blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
3
264
content_id
stringlengths
40
40
detected_licenses
sequencelengths
0
85
license_type
stringclasses
2 values
repo_name
stringlengths
5
140
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
905 values
visit_date
timestamp[us]date
2015-08-09 11:21:18
2023-09-06 10:45:07
revision_date
timestamp[us]date
1997-09-14 05:04:47
2023-09-17 19:19:19
committer_date
timestamp[us]date
1997-09-14 05:04:47
2023-09-06 06:22:19
github_id
int64
3.89k
681M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]date
2012-06-07 00:51:45
2023-09-14 21:58:39
gha_created_at
timestamp[us]date
2008-03-27 23:40:48
2023-08-21 23:17:38
gha_language
stringclasses
141 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
10.4M
extension
stringclasses
115 values
content
stringlengths
3
10.4M
authors
sequencelengths
1
1
author_id
stringlengths
0
158
81809000cae83583b3b0e35ffecbb1e853a326d1
3ad39884d8d726dcd0b8e0a31c46e46288e5224a
/Munny_Lamp/Munny_Lamp.ino
d78da7801aa43c39976e35ad113cab1568063d21
[ "MIT" ]
permissive
susanaoubina/Adafruit_Learning_System_Guides
a06177bd045e7085dd2987ca9022fa53c5fbce6a
63673725eba996ddbf977ecf59626b6e3ff3cebf
refs/heads/master
2020-04-04T17:44:57.861516
2018-11-04T00:13:11
2018-11-04T00:13:11
null
0
0
null
null
null
null
UTF-8
C++
false
false
6,990
ino
// MUNNY BLUEFRUIT LAMP // Feather M0 Bluefruit + Prop-Maker Wing and 3W RDB LED #include <string.h> #include <Arduino.h> #include <SPI.h> #include <Adafruit_LIS3DH.h> #include "Adafruit_BLE.h" #include "Adafruit_BluefruitLE_SPI.h" #include "Adafruit_BluefruitLE_UART.h" #if SOFTWARE_SERIAL_AVAILABLE #include <SoftwareSerial.h> #endif // pin definitions for using Prop-Maker FeatherWing //#define NEOPIXEL_PIN 5 //#define SWITCH_PIN 9 #define POWER_PIN 10 #define RED_LED 11 #define GREEN_LED 12 #define BLUE_LED 13 int red = 0; int green = 0; int blue = 0; #include "BluefruitConfig.h" Adafruit_LIS3DH lis = Adafruit_LIS3DH(); int tilt = 0; // for testing tilt of accelerometer /*========================================================================= APPLICATION SETTINGS     FACTORYRESET_ENABLE    Perform a factory reset when running this sketch         Enabling this will put your Bluefruit LE module in a 'known good' state and clear any config data set in previous sketches or projects, so     running this at least once is a good idea.         When deploying your project, however, you will want to disable factory reset by setting this value to 0.  If you are making changes to your     Bluefruit LE device via AT commands, and those changes aren't persisting across resets, this is the reason why.  Factory reset will erase the non-volatile memory where config data is stored, setting it back to factory default values.             Some sketches that require you to bond to a central device (HID mouse, keyboard, etc.) won't work at all with this feature enabled since the factory reset will clear all of the bonding data stored on the chip, meaning the central device won't be able to reconnect. PIN Which pin on the Arduino is connected to the NeoPixels? NUMPIXELS How many NeoPixels are attached to the Arduino? -----------------------------------------------------------------------*/ #define FACTORYRESET_ENABLE 0 /*=========================================================================*/ // Create the bluefruit object, either software serial...uncomment these lines Adafruit_BluefruitLE_SPI ble(BLUEFRUIT_SPI_CS, BLUEFRUIT_SPI_IRQ, BLUEFRUIT_SPI_RST); // A small helper void error(const __FlashStringHelper*err) { Serial.println(err); while (1); } // function prototypes over in packetparser.cpp uint8_t readPacket(Adafruit_BLE *ble, uint16_t timeout); float parsefloat(uint8_t *buffer); void printHex(const uint8_t * data, const uint32_t numBytes); // the packet buffer extern uint8_t packetbuffer[]; /**************************************************************************/ /*! @brief Sets up the HW an the BLE module (this function is called automatically on startup) */ /**************************************************************************/ void setup(void) { delay(500); pinMode(POWER_PIN, OUTPUT); digitalWrite(POWER_PIN, HIGH); pinMode(RED_LED, OUTPUT); pinMode(GREEN_LED, OUTPUT); pinMode(BLUE_LED, OUTPUT); analogWrite(RED_LED, 0); analogWrite(GREEN_LED, 0); analogWrite(BLUE_LED, 255); // startup color, waiting for BLE connection if (! lis.begin(0x18)) { // change this to 0x19 for alternative i2c address Serial.println("Couldnt start LIS3DH"); while (1); } Serial.begin(115200); Serial.println(F("Adafruit Bluefruit MUNNY LED Color Picker")); Serial.println(F("------------------------------------------------")); /* Initialise the module */ Serial.print(F("Initialising the Bluefruit LE module: ")); if ( !ble.begin(VERBOSE_MODE) ) { error(F("Couldn't find Bluefruit, make sure it's in CoMmanD mode & check wiring?")); } Serial.println( F("OK!") ); if ( FACTORYRESET_ENABLE ) { /* Perform a factory reset to make sure everything is in a known state */ Serial.println(F("Performing a factory reset: ")); if ( ! ble.factoryReset() ){ error(F("Couldn't factory reset")); } } /* Disable command echo from Bluefruit */ ble.echo(false); Serial.println("Requesting Bluefruit info:"); /* Print Bluefruit information */ ble.info(); Serial.println(F("Please use Adafruit Bluefruit LE app to connect in Controller mode")); Serial.println(F("Then activate/use the sensors, color picker, game controller, etc!")); Serial.println(); ble.verbose(false); // debug info is a little annoying after this point! /* Wait for connection */ while (! ble.isConnected()) { delay(500); } Serial.println(F("***********************")); // Set Bluefruit to DATA mode Serial.println( F("Switching to DATA mode!") ); ble.setMode(BLUEFRUIT_MODE_DATA); Serial.println(F("***********************")); } /**************************************************************************/ /*! @brief Constantly poll for new command or response data */ /**************************************************************************/ void loop(void) { digitalWrite(POWER_PIN, HIGH); /* Wait for new data to arrive */ uint8_t len = readPacket(&ble, BLE_READPACKET_TIMEOUT); if (len == 0) { accelerometer_check(); return; delay(10); } /* Got a packet! */ // printHex(packetbuffer, len); // Color if (packetbuffer[1] == 'C') { uint8_t red = packetbuffer[2]; uint8_t green = packetbuffer[3]; uint8_t blue = packetbuffer[4]; Serial.print ("RGB #"); if (red < 0x10) Serial.print("0"); Serial.print(red, HEX); if (green < 0x10) Serial.print("0"); Serial.print(green, HEX); if (blue < 0x10) Serial.print("0"); Serial.println(blue, HEX); analogWrite(RED_LED, red); analogWrite(GREEN_LED, green); analogWrite(BLUE_LED, blue); } } void accelerometer_check() { // Accelerometer sensors_event_t event; lis.getEvent(&event); Serial.print("\t\tX: "); Serial.print(event.acceleration.x); Serial.print(" \tY: "); Serial.print(event.acceleration.y); Serial.print(" \tZ: "); Serial.print(event.acceleration.z); Serial.println(" m/s^2 "); if (event.acceleration.y < 0) { tilt = 1; } else if (event.acceleration.y >= 0) { tilt = 0; } if (tilt==1) { analogWrite(RED_LED, random(0, 255)); analogWrite(GREEN_LED, random(0, 255)); analogWrite(BLUE_LED, random(0, 255)); Serial.println("TILTED"); delay(100); } }
a0e957e4049ebee59b1b0062bd1d956284d11106
a75d0418b2143d6f59635a8833bff49bc903df5e
/DofusMessages/ExchangeBidHouseInListAddedMessage.h
4fed2d3e435cd81fdb02ac97651f99de64a93a20
[]
no_license
Arkwell9112/dofus_bot
30b80850ba41b6a2b562705ec8aa1a6c87cfb8f8
fc1b805b70c0ed43cbc585322806ece89d057585
refs/heads/master
2023-01-16T01:08:06.710649
2020-11-23T20:53:00
2020-11-23T20:53:00
314,084,045
0
0
null
null
null
null
UTF-8
C++
false
false
755
h
#ifndef EXCHANGEBIDHOUSEINLISTADDEDMESSAGE_H #define EXCHANGEBIDHOUSEINLISTADDEDMESSAGE_H #include "../BotCoreAPI/BotCoreAPI.h" #include "../DofusTypes/ObjectEffect.h" #include <string> #include <vector> class ExchangeBidHouseInListAddedMessage : public DeserializeInterface { public: int itemUID = 0; unsigned int objectGID = 0; unsigned int objectType = 0; std::vector<ObjectEffect> effects; std::vector<double> prices; void deserialize(CustomDataInput *input); private: void _itemUIDFunc(CustomDataInput *input); void _objectGIDFunc(CustomDataInput *input); void _objectTypeFunc(CustomDataInput *input); void _effectsFunc(CustomDataInput *input); void _pricesFunc(CustomDataInput *input); }; #endif
b8cac37e7d0e9fc6f5222344e8457fb8ceedfcad
40af1e6cf7f9d02ff35a55b378f76a0de947582e
/SmartLamp/SmartLamp.ino
742173352274ce8d36f2240b20a1cc36a8c0e0fe
[]
no_license
Luiz-Zimmermann/PSE
85c89321f362091405d855cb3bd594f2821f9da6
2ac842bc786d762cb390ebfc3dbebc91b1aa32bf
refs/heads/master
2023-01-05T13:29:30.072565
2020-11-04T14:46:02
2020-11-04T14:46:02
310,030,754
0
0
null
null
null
null
UTF-8
C++
false
false
8,351
ino
#define BLYNK_PRINT Serial #include <BlynkSimpleEsp32.h> #include <WiFi.h> #include <WiFiClient.h> // Definição dos pinos a serem utilizados #define pinR 21 #define pinG 19 #define pinB 18 #define pinPIR 23 #define pinLDR 33 // Token fornecido pelo Blynk //Necessário para fazer a conexão entre o app e o esp32 char auth[] = "1Ls1DSHKl44ICfnxN_N-hdjlQvOnHbkH"; // Credenciais para usar o Wifi. // Usar "" para redes sem senha. char ssid[] = "TP-Link_3D4B"; char pass[] = "26071404"; // Configurações para poder usar o PWM const int freq = 5000; const int ledChannel1 = 0; const int ledChannel2 = 1; const int ledChannel3 = 2; const int resolution = 8; // Variáveis de controle int on_off = 0; //Variável controlada pelo aplicativo, liga/desliga int sensores_on_off = 1; //Variável que define se o funcionamento da lâmpada será de acordo com os sensores int sensor_change = 0; //Variável que indica se o sensor de presença mudou seu estado int movimento = 0; //Variável que indica se há presença ou não int luz_on_off = 0; //Variável que indica se há baixa luminosidade ou não int horario = 0; //Variável que indica se lâmpada está dentro do horário de funcionamento int horario_on_off = 0; //Variável que define se o funcionamento da lâmpada será de acordo com o horario int brilho = 255; //Variável que controla o brilho da lâmpada na cor branca int r = 255; //Variável que controla o valor do canal de cor vermelha int g = 255; //Variável que controla o valor do canal de cor verde int b = 255; //Variável que controla o valor do canal de cor azul // Timer utilizado para chamar periodicamente algumas funções BlynkTimer timer; // Relógio necessário para recuperar a hora do dia //WidgetRTC rtc; // Quando o Blynk se conectar ao servidor, executa esse trecho de código. BLYNK_CONNECTED() { // Synchronize time on connection //rtc.begin(); //Sincroniza todas as variáveis virtuais utilizadas no projeto. Blynk.syncVirtual(V0, V1, V2, V3, V4, V5); } // V0: colorpicker para controlar as cores do LED RGB BLYNK_WRITE(V0){ // Pega o valor de cada canal de cor e atribui as variaveis r,g,b r = param[0].asInt(); // Valor do canal vermelho g = param[1].asInt(); // Valor do canal verde b = param[2].asInt(); // Valor do canal azul Serial.println("trocou a cor"); // Se a lâmpada estiver ligada, atualiza a cor if(on_off == 1 or (luz_on_off and movimento and sensores_on_off) or (horario and horario_on_off)){ // Se o usuário voltar para a cor branca, //ela deverá acender com o valor de brilho previamente informado if(r == 255 and g == 255 and b == 255){ Blynk.syncVirtual(V4); }else{ ledcWrite(ledChannel1, r); ledcWrite(ledChannel2, g); ledcWrite(ledChannel3, b); Serial.println("Aplicou a cor"); } } } // V1: Botão liga/desliga a lâmpada BLYNK_WRITE(V1){ // Pega o valor do estado da lâmpada no aplicativo on_off = param.asInt(); // Se o comando enviado foi de ligar, então os canais de cores recebem os valores r,g,b que regem a cor do LED. if(on_off == 1 or (luz_on_off and movimento and sensores_on_off) or (horario and horario_on_off)){ ledcWrite(ledChannel1, r); ledcWrite(ledChannel2, g); ledcWrite(ledChannel3, b); // Atualiza o botão na tela do app //Blynk.virtualWrite(V1,1); // Se quando a lâmpada ligar, ela estiver na cor branca, ajusta o brilho. Blynk.syncVirtual(V4); // Se não a lâmpada é desligada, atribuindo o valor 0 nos canais }else{ ledcWrite(ledChannel1, 0); ledcWrite(ledChannel2, 0); ledcWrite(ledChannel3, 0); } } // V2: Input horário de funcionamento da lâmpada BLYNK_WRITE(V2){ horario = param.asInt(); // Se houve alteração no horario, chama a função BLYNK_WRITE(V1) //Blynk.syncVirtual(V1); } // V3: Botão liga/desliga horário BLYNK_WRITE(V3){ // Pega o valor que decide se o funcionamento irá depender do horário. horario_on_off = param.asInt(); Serial.print("Liga/desliga horario: "); Serial.println(horario_on_off); } // V4: Input brilho lâmpada BLYNK_WRITE(V4){ // Pega o valor do brilho brilho = param.asInt(); // Como escrito no aplicativo, o Slider "Brilho" // só controla o brilho da lâmpada se a mesma estiver com a cor branca, // pois o colorpicker RGB já possibilita mudar o brilho das cores, menos a cor branca. // Se todos os canais de cores estiverem no seu valor máximo (255), o LED ficará branco (na teoria). // Se os canais apresentarem o mesmo valor máximo, o valor dos canais irão depender do valor que virá do slider no aplicativo if(r == 255 and g == 255 and b == 255){ if(on_off == 1 or (luz_on_off and movimento and sensores_on_off) or (horario and horario_on_off)){ ledcWrite(ledChannel1, brilho); ledcWrite(ledChannel2, brilho); ledcWrite(ledChannel3, brilho); } } } // V5: Botão liga/desliga o funcionamento dos sensores BLYNK_WRITE(V5){ // Pega o valor que decide se o funcionamento irá depender dos sensores. sensores_on_off = param.asInt(); Serial.print("Sensores: "); Serial.println(sensores_on_off); // Se houve alteração na habilitação do horário, chama a função BLYNK_WRITE(V1) Blynk.syncVirtual(V1); } // Função de interrupção que é chamada quando há alteração de presença no ambiente. void IRAM_ATTR sensor_movimento(){ Serial.println("Presença: "); Serial.println(digitalRead(pinPIR)); if (movimento == 1){ movimento = 0; }else{ movimento = 1; } // Variável para informar que houve uma alteração sensor_change = 1; } // Função que verifica o nivel de luminosidade. // Threshold: valor inteiro 1000. // Limites do LDR: // *min: 0 // *max: 4095 void verifica_luz(){ Serial.print("Sensor LDR: "); // Lê o valor da porta pinLDR (35) // onde o sensor LDR está conectado. int luminosidade = analogRead(pinLDR); Serial.println(luminosidade); // Se o valor lido do LDR for menor que o limite "1000" // a lâmpada é acessa. if (luminosidade < 1000){ luz_on_off = 1; // Envia um comando para poder atualizar o elemento que controla esta variavel no app Blynk.virtualWrite(V1, on_off); Serial.println("Liga lâmpada"); }else{ luz_on_off = 0; // Envia um comando para poder atualizar o elemento que controla esta variavel no app Blynk.virtualWrite(V1, on_off); Serial.println("Desliga lâmpada"); } // Envia um comando ao Blynk para sincronizar os dados do app e do esp32. // no caso a variável a ser sincronizada é on_off, que é manipulada por um botão no app // e que decide se a lâmpada liga ou desliga. Blynk.syncVirtual(V1); } void setup() { // Console Serial.begin(115200); // Configura os canais que serão usados para controlar as portas com PWM. ledcSetup(ledChannel1, freq, resolution); ledcSetup(ledChannel2, freq, resolution); ledcSetup(ledChannel3, freq, resolution); // Vincula um canal a uma porta GPIO a ser controlada. ledcAttachPin(pinR, ledChannel1); ledcAttachPin(pinG, ledChannel2); ledcAttachPin(pinB, ledChannel3); // Definindo a porta em que o sensor PIR está como entrada. pinMode(pinPIR, INPUT_PULLUP); //Conecta o esp32 ao servidor do Blynk. Blynk.begin(auth, ssid, pass); Blynk.virtualWrite(V0, 255,255,255); Blynk.virtualWrite(V1, on_off); Blynk.virtualWrite(V2, horario); Blynk.virtualWrite(V3, horario_on_off); Blynk.virtualWrite(V4, brilho); Blynk.virtualWrite(V5, sensores_on_off); //Atribui uma função a interrupção causada pela mudança na porta pinPIR attachInterrupt(digitalPinToInterrupt(pinPIR), sensor_movimento, CHANGE); // Timer que chama a determinada função a cada 10 segundos. timer.setInterval(10000L, verifica_luz); } void loop() { // Processa comandos e gerencia a conexão com a nuvem Blynk.run(); // Executa os timers configurados previamente timer.run(); // Se houve alteração na presença, chama a função BLYNK_WRITE(V1) if (sensor_change){ sensor_change = 0; Blynk.syncVirtual(V1); } }
3ff4c0e718fbe9dd9acd8d6262555f19d35e7663
9ada6ca9bd5e669eb3e903f900bae306bf7fd75e
/case3/ddtFoam_Tutorial/0.004200000/T
afa0b232df6f9e65bbb3307b8b13e7681d027488
[]
no_license
ptroyen/DDT
a6c8747f3a924a7039b71c96ee7d4a1618ad4197
6e6ddc7937324b04b22fbfcf974f9c9ea24e48bf
refs/heads/master
2020-05-24T15:04:39.786689
2018-01-28T21:36:40
2018-01-28T21:36:40
null
0
0
null
null
null
null
UTF-8
C++
false
false
98,684
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.1.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; location "0.004200000"; object T; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 0 0 1 0 0 0]; internalField nonuniform List<scalar> 12384 ( 3021.19 3021.82 3034.35 3038.56 3053.76 3060.98 3080.07 3089.73 3092.55 3086.71 3074.21 3016.04 2855.76 2723.92 2572.69 2725.39 2796.23 2810.23 2809.42 2800.29 2798.19 2783.27 2795.74 2790.39 2800.55 2807.47 2813.73 2819.16 2819.58 2818.37 2812.92 2817.61 2819.96 2825.8 2832.98 2862.41 2857.41 2776.5 2690.33 2621.99 2547.05 2467.27 2486.78 2612.36 2924.67 2988.36 3022.83 3030.16 3032.12 3034.52 3035.54 3031.46 3024.65 3013.04 3004.35 2987.39 2981.18 2961.64 2953.95 2936.09 2921.22 2885.07 2856.04 2845.47 2845.12 2820.24 2891.01 3015.17 3099.95 3114.25 3120.96 3105.96 3006.47 2739.04 2932.68 2933.34 2927.39 2920.46 2913.25 2907.01 2888.53 2881.13 2881.09 2862.97 2867.82 2867.65 2859.73 2863.2 2860.9 2861.79 2862.95 2867.11 2875.74 2880.79 2877.95 2883.85 2859.25 2808.42 2754.28 2758.71 2777.05 2777.42 2777.89 2770 2666.16 2678.88 2685.53 2681.13 2681.06 2673.34 2671.5 2662.7 2671.75 2666.14 2672.25 2686.44 2676.2 2683.9 2683.83 2690.04 2682.04 2682.41 2673.62 2682.43 2680.6 2679.89 2694.82 2704.16 2735.53 2702.86 2603.07 2563.52 2562.74 2565.53 2608.87 2890.36 2891.9 2892.13 2900.51 2896.32 2882.13 2861.64 2845.78 2835.7 2835.25 2821.88 2821.92 2809.04 2804.13 2806.55 2788.14 2793.98 2786.87 2780.92 2786.91 2783.88 2792.2 2794.17 2799.47 2800.65 2810.97 2812.81 2782.18 2554.19 2560.47 2565.31 2571.93 2580.11 2632.47 2642.15 2610.23 2602.53 2596.54 2600.48 2609.16 2613.09 2621.18 2633.61 2640.95 2651.82 2652.36 2658.62 2661.44 2654.55 2658.57 2660.38 2675.14 2682.51 2699.38 2710.89 2713.63 2706.93 2697 2323.31 2278.83 2312.27 2355.82 2507.22 2630.19 2508.81 2554.44 2579.01 2595.8 2598.08 2570.83 2536.38 2548.54 2526.99 2542.84 2549.73 2562.36 2575.92 2592.32 2613.56 2636.28 2662.26 2684.64 2709.64 2733.33 2739.94 2726.26 2695.78 2658.1 2653.55 2515.4 2514.8 2628.7 2866.53 2531.4 2465.93 2476.15 2439.77 2451.21 2442.92 2443.38 2470.31 2464.71 2486.38 2516.25 2517 2540.44 2560.62 2586.98 2611.18 2636.43 2655.99 2666.31 2649.01 2623.82 2611.94 2735.36 2881.23 2509.74 2550.56 2577.29 2836.36 2974.8 2922.68 2916.83 2923.26 2910.7 2921.87 2927.45 2927.85 2926.34 2922.65 2915.92 2907.05 2888.25 2870.93 2852.31 2833.26 2813.22 2791.26 2770.64 2768.68 2745.48 2742.73 2759.35 2774.01 2810.34 2835.88 2876.48 2953.63 2255.7 2988.65 2880.68 2852.97 2846.17 2842.57 2815.29 2809.93 2767.55 2760.96 2737.34 2728.54 2724.62 2717.68 2719.71 2714.63 2720.98 2721.63 2712 2719.71 2690.1 2702.39 2666.59 2690.83 2681.26 2708.78 2734.42 2765.12 2836.96 2927.52 2196.57 2903.08 2842.14 2821.42 2799.47 2796.67 2785.54 2779.71 2779.1 2781.55 2784.24 2785.74 2785.36 2782.44 2776.09 2764.65 2749.24 2738.32 2728.02 2722.76 2718.69 2720.47 2720.62 2732.47 2862.51 2689.72 2329.02 2250.69 2281.58 2379.4 2196.54 2261.51 2273.86 2262.48 2323 2440.62 2554.56 2632.55 2709.7 2791.4 2898.45 3000.54 2979.71 2929.82 2888.86 2880.53 2863.85 2881.04 2907.13 2932.47 2967.62 2980.58 3012.26 2998.75 2864.86 2667.19 2435.14 2385.01 2402.55 2509.85 3012.23 3015.47 3034.06 3040.65 3062.7 3081.21 3098.75 3112.03 3110.21 3115.17 3095.18 3070.19 2946.48 2735.21 2574.31 2786.1 2826.8 2812.73 2780.38 2750.69 2743.48 2731.34 2742.66 2743.5 2764.51 2777.47 2796.89 2806.44 2810.72 2814.11 2808.75 2814.67 2810.02 2817.91 2825.25 2847.37 2875.1 2851.35 2787.92 2695.46 2606.53 2523.56 2500.76 2559.74 2942.23 3029.17 2985.65 2977.7 2992.99 3014.06 3030.02 3040.76 3044.03 3040.95 3032.84 3025.35 3015.3 3005.65 2995.77 2977.91 2964.56 2928.07 2892.51 2852.28 2842.71 2824.66 2850.28 2865.63 2974.16 3082.11 3126.32 3127.95 3083.66 2790.31 2937.48 2924.91 2887.08 2866.26 2858.88 2856.32 2855.64 2851.11 2839.61 2840.07 2830.29 2814.32 2815.65 2806.06 2803.12 2802.33 2806.33 2820.54 2841.15 2858.66 2877.02 2880.76 2870.6 2853.12 2793.48 2790.33 2820.76 2831.16 2826.53 2813.37 2624.44 2595.55 2578.55 2577.35 2579.82 2590.58 2603.88 2617.17 2627.75 2637.81 2652.56 2659.5 2682.82 2688.75 2703.48 2713.27 2717.12 2710.15 2700.65 2701.1 2692.74 2703.34 2697.72 2704.78 2714.6 2734.46 2686.87 2655.8 2655.69 2642.69 2707.81 2884.73 2883.45 2902.11 2871.54 2831.72 2813.12 2808.52 2794.5 2760.24 2735.4 2716.91 2692.35 2677.55 2664.91 2644.85 2648.69 2631 2634.7 2639.93 2649.07 2668.72 2686.12 2715.04 2739.25 2770.87 2788.72 2813.05 2802.88 2744.67 2554.27 2570.42 2578.86 2625.21 2636.76 2619.49 2579.87 2583.03 2568.76 2578.42 2598.91 2595.78 2524.12 2469.6 2435.71 2425.53 2431.57 2435.49 2435.98 2429.7 2414.22 2409.03 2398.8 2417.83 2479 2577.87 2686.97 2715.13 2703.97 2443.68 2306.12 2382.79 2518.65 2671.31 2563.66 2532.07 2582.7 2619.21 2647.99 2639.98 2626.42 2574.45 2579.93 2561.35 2562.34 2557.68 2553.05 2552.11 2560 2586.32 2629.99 2699.56 2761.21 2790.25 2756.69 2769.2 2835.33 2815.13 2705.28 2652.88 2509.23 2778.7 2834.04 2584.32 2495.47 2453.28 2447.47 2432.65 2431.04 2438.98 2449.47 2473.14 2479.39 2498.27 2531.76 2535.13 2541.65 2550.06 2561.34 2584.41 2623.42 2690.22 2750.03 2782.43 2732.79 2622.92 2630.87 2825.87 2714.29 2532.71 2657.37 2999.66 2965.85 2960.38 2945.47 2929.96 2891.83 2874.57 2870.63 2879.31 2899.98 2929.1 2930.97 2907.72 2869.9 2831.91 2803.06 2783.11 2770.5 2764.82 2758.28 2756.74 2725.7 2729.58 2729.56 2737.37 2762.88 2789.5 2839.46 2933.98 2581.64 2965.2 2889.94 2919.2 2964.43 2979.48 2965.87 2916.81 2858.96 2798.75 2747.6 2716.45 2694.89 2688.56 2692.17 2710.25 2737.95 2758.21 2775.49 2786.7 2783.6 2772.95 2753.78 2735.12 2728.59 2729.62 2741.2 2768.67 2819.31 2914.66 2561.34 2940.61 2817.9 2791.99 2770.31 2756.58 2748.97 2755.48 2764.95 2779.71 2801.1 2823.68 2844.21 2863.44 2863.73 2851.64 2821.15 2774.38 2724.85 2687.77 2684.46 2674.87 2682.23 2687.75 2760.16 2921.82 2708.19 2414.34 2251.89 2297.78 2217.38 2271.82 2271.54 2324.29 2484.33 2707.3 2922.18 2964.86 2866.46 2742.56 2643.44 2598.76 2586.24 2578.4 2573.59 2563.98 2557.1 2544.86 2545.48 2553.84 2577.08 2625.99 2677.47 2764.52 2822.13 2941.55 3046.39 2639.63 2427.78 2441.19 3037.31 3051.41 3068.56 3069.45 3080.51 3084.66 3095.95 3106 3101.01 3105.03 3113.23 3093 3033.77 2770.8 2674.74 2818.7 2813.94 2767.69 2726.75 2711.75 2717.79 2728.9 2758.99 2780.23 2813.66 2839.37 2859.9 2878.1 2884.06 2882.03 2868.65 2854.03 2831.92 2824.61 2818.42 2830.17 2856.59 2874.31 2849.71 2780.17 2686.35 2585.22 2494.28 2574.76 2952.17 2976.62 2932.22 2937.74 2977.54 3018.18 3032.94 3021.31 3008.03 2994.71 2988.05 2977.89 2969.59 2960.95 2953.09 2944.83 2940.41 2913.48 2898.25 2853.24 2848.52 2824.8 2843.27 2837.02 2868.89 2968.92 3096.88 3131.49 3106.01 2844.07 2931.34 2855.27 2853.67 2869.37 2876.27 2875.43 2871.69 2874.18 2860.38 2853.69 2845.04 2841.76 2826.11 2819.43 2810.8 2794.96 2785.37 2786.66 2801.36 2831.31 2856.36 2874.71 2874.66 2858.04 2846.71 2817.59 2828.75 2842.55 2842.82 2822.48 2523.29 2523.87 2535.8 2551.74 2572.86 2593.24 2620.84 2630.3 2655.87 2670.13 2688.46 2705.67 2713.5 2723.14 2721.06 2725.36 2721.98 2730.23 2716.79 2721.56 2712.81 2711.86 2708.15 2701.42 2707.25 2719.28 2728.64 2694.8 2689.5 2666.72 2801.19 2872.1 2890.03 2855.27 2818.24 2814.54 2767.37 2716.45 2677.96 2641.88 2626.47 2593.76 2578.74 2559.95 2538.53 2535.96 2525.5 2518.56 2531.08 2533.3 2559.33 2574.3 2607.85 2633.16 2677.48 2714.93 2758.36 2792.03 2808.11 2794.98 2535.02 2571.61 2601.99 2647.2 2608.44 2585.27 2553.92 2556.81 2555.05 2545.11 2428.21 2383.24 2386.12 2426.16 2478.71 2521.31 2546.05 2557.74 2556.73 2540.8 2512.03 2467.12 2417.44 2392.43 2389.47 2440.15 2569.5 2728.7 2712.58 2522.93 2343.84 2504.09 2698.72 2601.79 2543.98 2562.43 2620.57 2652.23 2680.27 2672.73 2653.19 2602.37 2606.02 2605.24 2609.44 2605.53 2593.27 2573.65 2561.02 2558.32 2602.58 2706.29 2766.69 2662.4 2592.05 2582.74 2697.65 2858.65 2750 2652.16 2597.74 2957.05 2620.59 2510.98 2480.63 2444.07 2447.25 2415.43 2438.68 2440.85 2454.36 2488.36 2507.85 2528.94 2570.98 2596.43 2598.26 2585.79 2573.43 2561.1 2582.41 2654.72 2756.17 2824.8 2839.56 2714.5 2580.9 2655.66 2916.9 2549.63 2731.9 3019.06 2980.51 2989.34 2949.76 2943.44 2906.41 2874.46 2839.57 2824.3 2844.39 2917.6 2908.99 2837.82 2779.18 2757.99 2776.34 2821.28 2852.35 2800.61 2721.79 2686.14 2674.56 2742.74 2807.4 2780.25 2753.12 2758.59 2802.14 2905.11 2850.29 2934.24 2928.8 3018.74 3062.04 3045.97 3024.39 3014.59 2971.01 2878.12 2778.93 2718.08 2688.72 2690.38 2732.43 2779.25 2832.46 2870.34 2897.62 2903.93 2870.09 2837.11 2803.28 2845 2837.01 2825.53 2804.15 2794.29 2820.54 2896.58 2885.53 2868.54 2797.72 2773.28 2755.31 2758.7 2762.59 2779.53 2801.93 2832.02 2872.61 2922.77 2972.84 3007.65 3025.79 3032.14 3014.98 2973.43 2899.96 2805.05 2722.2 2673.03 2659.9 2650.55 2670.85 2744.99 2899.36 2747.46 2321.83 2232.8 2236.01 2279.4 2307.11 2476.04 2802.25 2944.42 2806.05 2683.49 2603.88 2572.46 2580.2 2605.83 2624.42 2633.05 2630.45 2622.18 2603.54 2583.24 2549.7 2528.13 2510.92 2545.42 2606.03 2740.27 2837.75 2856.52 2885.21 3047.78 2587.57 2380.81 3066.66 3053.82 3031.94 2997.32 3024.42 3037.17 3079.22 3087.16 3093.12 3082.29 3108.37 3103.11 3077.73 2820.14 2809.62 2817.22 2771.9 2717.72 2696.62 2702.19 2737.66 2783.02 2830.7 2868.1 2898.31 2936.5 2963.91 2986.04 2998.45 2995.1 2975.93 2948.76 2900.12 2860.93 2828.74 2829.53 2859 2888.48 2880.3 2815.72 2725.01 2625.08 2536.84 2545.82 2969.71 2941.54 2905.72 2922.75 2986.74 3019.53 2991.79 2949.26 2915.58 2902.45 2891.75 2885.86 2875.15 2865.74 2863.49 2866.29 2875.09 2874.63 2871.37 2844.67 2839.9 2828.15 2831.03 2824.94 2828.64 2883.56 3019.24 3122.55 3114.64 2882.63 2873.7 2841.58 2884.45 2886.76 2889.95 2877.72 2865.17 2847.62 2829.64 2815.7 2814.54 2809.41 2811.21 2820.99 2810.59 2802.54 2787.91 2779.3 2785.16 2806.36 2839.73 2867.76 2869.01 2863.07 2850.07 2848.07 2839.41 2852.36 2855.25 2834.21 2517.56 2550.1 2580.98 2600.8 2612.35 2616.61 2621.1 2623.43 2650.55 2676.71 2700.39 2699.61 2705.4 2705.02 2722.54 2720.19 2728.36 2729.81 2728.47 2726.54 2729.21 2723.78 2714.61 2708.24 2697.96 2707.3 2719.19 2713.94 2697.09 2674.39 2849.37 2869.43 2866.19 2818.76 2801.74 2739.03 2698.23 2663.05 2638.06 2626.81 2592.5 2575.28 2548.52 2525.9 2524.93 2523.14 2529.91 2556.1 2571.32 2601.24 2610.26 2633.98 2633.77 2650.51 2664.69 2697.62 2736.59 2771.73 2802.36 2802.29 2515.25 2574.45 2613.75 2625.78 2590.98 2557.12 2530.79 2548.13 2475.07 2405.35 2394.57 2455.42 2531.4 2576.65 2590.37 2604.21 2616.88 2610.23 2601.95 2586.11 2567.76 2533.71 2491.49 2452.17 2413.97 2431.71 2511.54 2705.24 2718.66 2532.41 2389.33 2632.37 2686.43 2561.58 2551.58 2595.43 2632.44 2655.31 2656.9 2629.29 2592.02 2550.22 2570.48 2576.2 2606.77 2632.86 2634.73 2615.39 2582.91 2567.93 2593.34 2718.35 2708.53 2580.22 2505.24 2527.55 2621.46 2843.68 2773.9 2651.3 2719.36 2793.83 2546.45 2497.33 2481 2442.66 2440.07 2414.26 2410.39 2419.1 2415.03 2442.46 2483.74 2516.66 2566.43 2624.42 2644.77 2640.38 2601.58 2576.34 2588.13 2651.17 2764.97 2853.58 2870.13 2813.5 2632.43 2569.09 2773.03 2628.34 2784.56 3025 2999.29 3005.09 2988.67 2989.53 2976.78 2967.77 2896.09 2818.96 2804.88 2910.23 2865.74 2765.94 2725.57 2774.12 2864.31 2745.9 2609.63 2542.59 2473.49 2452.35 2389.69 2399.65 2485.07 2742.3 2805.29 2746.64 2762.71 2874.08 2970.73 2926.48 2976.5 3072.98 3062.01 3030.37 2988.44 2951.5 2987.85 2924.47 2784.5 2711.4 2685.48 2722.03 2784.36 2836.09 2869.81 2897.08 2901.74 2835.87 2723.2 2627.65 2593.12 2560 2636.1 2768.17 2874.9 2856.97 2835.59 2892.57 2970.05 2831.06 2782.29 2771.45 2773.76 2783.45 2797.83 2804.23 2816.89 2838.65 2878.89 2937.69 2996.65 3037.98 3058.53 3060.9 3053.97 3040.51 3036.95 2977.11 2855.74 2746.88 2689.62 2660.8 2639.29 2629.43 2714.88 2912.7 2596.96 2167.44 2251.62 2291.71 2387.85 2735.56 2930.86 2747.26 2621.89 2572.46 2574.54 2605.18 2643.46 2673.08 2684.44 2686.68 2683.18 2674.1 2670.97 2656.42 2637.52 2591.17 2538.43 2504.22 2566.31 2722.93 2884.38 2981.31 2910.95 2955.3 2780.41 2343.91 3059.42 2981.21 2938.23 2926.75 2948.86 2957.63 3001.83 3039.95 3057.79 3056.25 3091.66 3107.33 3093.94 2871.17 2821.79 2767.54 2706.2 2675.94 2676.76 2702.81 2753.26 2805.78 2845.84 2884.94 2926.21 2966.27 3014.62 3030.77 3024.01 3023.13 3011.01 2987.95 2951.86 2895.29 2842.52 2826.14 2845.82 2883.68 2891.01 2846.32 2764.94 2670.06 2549.01 2557.94 2978.81 2928.11 2892.49 2897.96 2981.85 2998.87 2922.79 2854.69 2817.41 2796.12 2792.72 2793.7 2792.6 2796.66 2805.08 2816.19 2826.83 2832.78 2836.07 2824.98 2825.44 2811.74 2819.7 2808.16 2806.6 2834.99 2944.08 3105.69 3111.35 2897.53 2849.04 2885.8 2901.97 2902.4 2891.98 2860.85 2832.75 2799.06 2780.93 2751.64 2745.47 2750.9 2773.94 2793.16 2805.9 2799.3 2793.41 2782.03 2781.19 2798.17 2832.63 2861.69 2860.65 2866.93 2851.18 2849.47 2854.72 2858.17 2859.5 2842.15 2562.43 2643.55 2683.32 2691.56 2688.89 2655.87 2627.84 2606.8 2616.15 2658.66 2695.31 2688.6 2694.08 2706.74 2710.31 2729.02 2724.83 2736.3 2725.97 2733.99 2730.01 2730.89 2718.08 2707.95 2694.55 2692.76 2709.8 2727.17 2699.28 2670.88 2845.2 2855.6 2835.98 2804.91 2745.01 2711.43 2682.29 2666.57 2659.78 2626.05 2609.5 2578.32 2559.37 2566.1 2572.48 2603.49 2642.91 2674.17 2702.15 2710.58 2727.24 2711.97 2723.25 2712.42 2709.75 2713.8 2728.55 2762.13 2791.63 2803.84 2499.79 2577.62 2617.96 2601.23 2561.65 2524.93 2520.19 2502.56 2442.15 2446.69 2513.34 2541.46 2557.99 2570.86 2587.04 2602.9 2624.86 2610.83 2581.19 2567.48 2556.22 2538.69 2532.79 2515.92 2499.95 2488.88 2539.34 2701.17 2731.62 2536.49 2436.27 2727.5 2637.26 2552.56 2557.58 2606.48 2629.64 2616.93 2597.52 2568.53 2528.36 2508.43 2501.42 2517.43 2552.3 2608 2653.25 2653.21 2612.49 2570.55 2580.48 2712.66 2668.93 2526.15 2507.59 2536.64 2673.13 2870.01 2773.87 2647.52 2817.51 2700.43 2519.22 2493.95 2491.37 2444.32 2427.12 2389.71 2373.5 2362.39 2348.91 2377.12 2411.59 2464.6 2547.35 2614.66 2673.47 2668.29 2619.67 2591.15 2611.65 2718.33 2855.77 2939.56 2948.59 2900.34 2765.51 2590.05 2660.29 2783.87 2803.61 3020.96 3009.35 3025.44 3000.13 2983.43 2967.17 2969.56 2968.82 2851.68 2782.41 2879.9 2834.32 2723.77 2713.93 2840.17 2779 2629.53 2565.83 2525.78 2491.97 2441.6 2375.29 2312.6 2297.52 2459.27 2818.46 2751.28 2725.87 2838.16 2966.63 2915.75 3008.43 3075.25 3073.42 3053.62 3012.47 2942.32 2932.75 2930.37 2768.54 2699.09 2691.12 2758.08 2811.3 2838.87 2848.59 2864.81 2872.86 2855.69 2735.62 2610.22 2514.29 2490.83 2482.66 2555.72 2720.51 2900.69 2870.54 2889.13 2949.8 2813.55 2780.4 2786.72 2814.18 2835.4 2839.7 2836.2 2826.88 2830.86 2855.63 2908.62 2979.23 3026.12 3049.01 3054.2 2957.16 2916.17 2960.01 3023.84 2985.64 2852.83 2744.56 2676.89 2634.04 2578.81 2604.17 2766.82 2928.5 2213.42 2258.58 2313.55 2530.1 2974.27 2774.98 2618.96 2569.77 2573.6 2609.79 2656.77 2687.6 2707.53 2724.75 2732.44 2717.49 2691.39 2662.38 2655.87 2659.34 2655.06 2603.2 2532.66 2513.56 2670.34 2892.19 3033.83 2976.55 2947.89 2936.18 2349.66 3040.32 2928.04 2913.65 2921.89 2946.65 2941.93 2952.62 2969.11 3000.47 3020.35 3071.26 3105.68 3093.53 2919.8 2782.15 2708.19 2659.49 2653.34 2673.07 2708.31 2750.08 2781.05 2802.67 2826.81 2867.87 2930.77 2996.12 3033.62 3025.25 3017.71 3003.43 2967.33 2929.8 2880.96 2838.78 2832.25 2853.88 2889.46 2898.75 2852.01 2775.5 2687.81 2565.26 2532.02 2993.57 2910.17 2894.4 2900.38 2974.32 2976.22 2875.03 2786.99 2747.44 2739.75 2747.07 2758.47 2772.16 2779.32 2784.56 2786.49 2787.51 2788.01 2788.78 2787.99 2780.02 2781.81 2777.52 2787.38 2783.68 2804.38 2885.64 3075.33 3108.83 2903.73 2850.74 2892.64 2908.15 2908.33 2881.55 2838.58 2811.84 2768.14 2748.19 2724.78 2722.13 2721.7 2733.07 2756.71 2777.24 2787.51 2784.04 2789.14 2784.19 2804.62 2833.16 2856.91 2852.39 2858.88 2855.43 2849.03 2852.73 2861.21 2859.27 2849.56 2650.8 2723.08 2714.86 2713.22 2711.16 2719.63 2662.4 2605.67 2587.98 2636.91 2690.19 2685.82 2692.42 2705.66 2719.31 2715.82 2737.08 2720.07 2735.79 2726.28 2733.55 2721.84 2720.4 2704.76 2685.99 2677.1 2687.08 2712.41 2695.03 2669.86 2834.91 2852.59 2813.52 2766.29 2735.07 2712.43 2697.61 2691.3 2662.37 2649.98 2611.04 2598.55 2590.08 2603.97 2642.87 2694.41 2728.21 2749.56 2741.8 2749.57 2729.88 2751.8 2745.44 2746.93 2744.82 2731.55 2736.89 2755.03 2783.92 2801.12 2491.14 2587.4 2612.65 2587.59 2544.17 2504.63 2513.63 2492.91 2503.44 2506.1 2525.47 2525.57 2534.18 2543.22 2560.25 2585.58 2622.96 2619.78 2561.74 2548.32 2554.42 2577.22 2603.12 2644.81 2638.62 2589.05 2598.66 2735.79 2728.84 2511.38 2481.48 2707.09 2607.34 2542.63 2567.55 2603.52 2599.86 2579.38 2558.49 2532.69 2526.18 2487.57 2486.84 2485.13 2503.44 2556.55 2635.62 2680.18 2650.63 2579.63 2559.59 2707.6 2650.89 2532.5 2559.94 2657.89 2819.4 2865.91 2768.22 2652.7 2861.29 2644.29 2500.95 2481.98 2485.34 2452.3 2417.75 2370.02 2345.6 2315.94 2307.26 2342.42 2364.15 2432.73 2517.46 2619.16 2698.33 2693.4 2636.22 2611.75 2665.43 2839.52 2943.38 2754.1 2676.18 2714.93 2917 2712.94 2625.91 2926.17 2801.11 3006.55 3009.49 3022.1 2999.07 2963.28 2941.18 2939.74 2960.74 2903.41 2758.39 2836.45 2824.94 2690.3 2707.21 2866.91 2796.43 2687.26 2638.12 2628.42 2635.12 2580.66 2453.47 2303.01 2239.55 2333.21 2659.16 2763.56 2694.89 2800.34 2957 2905.48 3022.61 3074.34 3061.83 3045.8 3031.93 2942.27 2923.42 2912.42 2741.26 2685.38 2707.11 2781.67 2809.67 2821.87 2835.98 2849.98 2862.66 2851.64 2775.8 2659.59 2567.83 2490.98 2461.14 2507.18 2589.95 2806.19 2908.71 2910.53 2923.05 2801.41 2802.04 2833.3 2870.69 2897.29 2906.39 2893.96 2867.27 2839.66 2836.36 2890.27 2969.59 3008.83 3031.33 3040.44 2844.48 2773.97 2831.11 2943.73 3031.92 2941.03 2808.55 2713.19 2647.85 2589.82 2552.09 2653.07 2970.81 2257.77 2269.43 2351.74 2743.52 2874.28 2663.3 2577.32 2568.89 2601.85 2652.37 2696.75 2745.89 2801.65 2840.11 2848.1 2821.01 2759.77 2703.63 2658.58 2645.98 2652.32 2654.96 2583.22 2506.37 2624.14 2893.43 3038.32 2994.59 2962.77 2951.26 2344.44 3021.14 2903.73 2918.15 2947.87 2972.68 2967.25 2948.4 2958.54 2980.61 3028.08 3084.47 3104.17 3085.25 3000.83 2784.41 2724.84 2660.1 2657.22 2697.01 2743.07 2768.24 2776.92 2778.79 2772.86 2784.67 2845.83 2943.83 3016.03 3027.95 3006.12 2955.23 2912.46 2868.01 2841.31 2826.2 2829.93 2855.42 2896.82 2903.84 2865.96 2797.8 2724.19 2597.36 2551.56 2994.59 2860.82 2870.21 2892.71 2962.19 2961.02 2860.67 2772.55 2737.17 2733.4 2748 2774.85 2795.15 2807.73 2820.45 2826.49 2813.81 2788.18 2773.81 2760.38 2757.55 2750.61 2751.86 2758.73 2766.14 2778.21 2854.17 3050.6 3095.77 2887.71 2866.94 2899.04 2910.65 2907.5 2875.02 2841.19 2817.25 2780.79 2732.77 2714.48 2712.96 2717.96 2737.98 2754.47 2778.44 2770.88 2774.22 2781.82 2792.56 2815.77 2843.48 2841.15 2841.73 2851.47 2852.11 2848.43 2854.81 2856.03 2850.07 2841.98 2725.43 2709.29 2677.37 2678.51 2699.38 2710.99 2697.73 2598.14 2564.52 2612.17 2688.65 2678.77 2693.05 2702.23 2712.62 2703.63 2724.1 2713.36 2718.46 2728.63 2719.63 2717.78 2710.04 2698.58 2675.16 2671.02 2683.34 2708.64 2685.71 2660.4 2828.76 2815.49 2787.63 2757.19 2746.61 2735.17 2728.38 2703.44 2691.79 2655.92 2632.63 2599.28 2611.92 2638.88 2699.36 2731.87 2754.49 2740.55 2737.38 2705.33 2717.29 2700.66 2712.98 2737.16 2744.26 2747.75 2742.92 2755.35 2777.3 2792.79 2496.02 2589.35 2597.59 2566.55 2516.95 2496.43 2510.8 2499.6 2510.29 2492.23 2500.27 2505.44 2510.39 2522.77 2536.73 2555.94 2602.72 2639.52 2540.85 2539.78 2590.69 2652.05 2693.55 2706.76 2738.55 2698.32 2696.7 2762.28 2738.17 2439.16 2519.21 2691.61 2586.49 2543.15 2570.18 2596.79 2570.06 2548.86 2530.2 2539.17 2523.62 2497.6 2493.47 2484.65 2485.58 2514.73 2600.18 2690.27 2684.35 2593.3 2542.54 2703.02 2644.72 2561.02 2695.93 2863.84 2855.93 2803.99 2749.2 2652.55 2872.97 2610.38 2478.73 2465.19 2470.14 2452.28 2413.94 2359.29 2346.95 2305.38 2306.05 2333.17 2344.73 2417.48 2500.58 2637.57 2727.2 2728.68 2654.06 2640.02 2757.36 2945.91 2669.36 2527 2477.2 2465.4 2524.18 2907.89 2657.25 2888.11 2783.78 2981.86 2990.13 3012.19 3004.44 2986.79 2957.89 2909.25 2927.67 2941.25 2738.23 2768.71 2822.85 2657.66 2689.48 2854.41 2863.95 2741.77 2693.68 2749.72 2824.16 2792.41 2603.01 2327 2234.99 2318.15 2668.02 2715.55 2681.39 2803.57 2941.09 2890.15 3018.3 3067.68 3052.98 3028.42 3028.9 2954.05 2932.31 2863.4 2714.45 2679.23 2730.84 2785.92 2815.74 2834.47 2853.53 2870.64 2849.93 2801.07 2715.24 2663.23 2593.72 2537.59 2509.8 2513.23 2568.22 2724.7 2935.57 2907.72 2899.85 2810.52 2817.81 2873.89 2938.39 2981.67 2988.71 2959.39 2916.74 2869.38 2839.84 2859.75 2934.48 2971.78 2984.79 3041.69 2845.55 2721.05 2765.29 2886.4 3012.05 2981.8 2850.48 2747.19 2665.34 2591.26 2539.28 2600.45 2923.08 2320.09 2278.15 2436.12 2972.13 2767.06 2602.29 2568.28 2584.63 2630.77 2693.23 2767.13 2860.93 2951.59 3008.34 3012.95 2962.36 2888.46 2780.2 2684.31 2631.97 2638.13 2648.31 2619.93 2514.79 2581.6 2910.55 3034.38 3021.45 3028.23 2722.51 2350.03 3010.29 2895.84 2929.19 2974.35 3022.43 3033.06 3047.32 3061.12 3089.62 3097.98 3102.8 3077.97 3063.54 3026.8 2850.56 2757.34 2678.4 2684.74 2745.06 2805.18 2833.52 2834.04 2803.81 2765.03 2732.83 2751.56 2859.89 2981.21 3017.79 3010.02 2947.94 2887.78 2846.04 2826.14 2827.3 2844.92 2875.39 2911.99 2914.4 2872.09 2811.66 2745.63 2609.15 2532.69 2978.72 2787.87 2860.32 2889.01 2943.25 2966.08 2892.37 2826.91 2798.86 2812.08 2852.54 2897.36 2916.13 2920.82 2928.36 2931.43 2931.81 2924.81 2915.87 2896.4 2844.75 2806.68 2772.08 2762.24 2756.08 2766.41 2834.3 3052.22 3090.37 2901.44 2862.33 2891.43 2900.49 2894.94 2871.53 2848.47 2839.02 2800.57 2743.41 2719.85 2709.49 2730.49 2748.59 2763.2 2770.27 2771.36 2777.72 2792.5 2813.89 2821.9 2822.72 2825.29 2839.53 2855.13 2851.87 2853.22 2854.07 2816.06 2811.62 2829.48 2716.38 2681.59 2660.45 2670.06 2691.67 2718.28 2699.34 2586.74 2530.5 2589.46 2683.49 2676.96 2681.24 2694.47 2693.15 2690.76 2703.06 2695.31 2712.56 2699.31 2712.32 2701.16 2692.23 2666.79 2653.93 2653.81 2672.1 2697.46 2668.88 2654.91 2818.78 2808.91 2781.03 2769.88 2772.02 2771.43 2748.89 2741.52 2710.25 2683.68 2637.43 2617.87 2617.98 2664.09 2714.86 2746.83 2754.82 2730.74 2695.64 2695.57 2668.19 2678.77 2707.25 2729.95 2747.5 2752.01 2746.86 2758.84 2776.58 2787.27 2489.83 2592.55 2589.63 2549.19 2502.32 2489.99 2509.31 2497.82 2501.81 2492.28 2507.93 2506.79 2525.97 2535.44 2549.15 2557.2 2583.9 2639.09 2523.01 2519.22 2618.68 2684.51 2677.72 2691.86 2732.51 2766.56 2764.89 2751.98 2733.61 2356.11 2535.78 2667.6 2566.59 2540.74 2565.99 2582.22 2561.74 2534.9 2535.11 2523.46 2523.32 2500.72 2510.28 2497.39 2488.93 2501.76 2576.13 2688.64 2703.61 2613.24 2529.22 2686.78 2651.96 2628.97 2842.11 2806.07 2761.06 2739.05 2715.11 2674.31 2806.56 2606.66 2461.23 2446.19 2453.64 2440.89 2414.83 2371.22 2346.82 2334.8 2330.76 2345.02 2348.41 2406.23 2509.29 2657.92 2767.56 2766.12 2669.84 2668.97 2855.59 2786.54 2540.93 2467.89 2453.03 2445.28 2440.48 2609.88 2736.6 2854.8 2753.47 2952.83 2968.21 2999.78 3001.75 2975.79 2947.7 2902.51 2912 2954.54 2713.96 2727.05 2825.7 2621.67 2652.23 2832.2 2905.66 2761.74 2737.39 2880.49 2932.11 2910.51 2824.22 2526.96 2430.25 2540.58 2788.69 2669.92 2651.96 2792.79 2919.37 2895.44 3016.04 3070.41 3055.27 3023.99 3009.12 2952.44 2967.02 2817.94 2695.69 2677.57 2743.09 2792.76 2846.09 2886.99 2889.24 2823.61 2757.9 2684.73 2647.06 2605.82 2581.63 2580.59 2563.15 2570.09 2588.9 2711.72 2937.24 2943.01 2903.44 2802.83 2838.39 2934.25 3024.58 3057.27 3053.82 3031.56 2993.18 2923.08 2861.94 2841.58 2918.93 2974.09 2949.54 2960.13 3005.22 2778.2 2752.16 2864.94 3005.81 2980.14 2866.41 2760.88 2663.67 2577.24 2540.99 2598.16 2947.29 2449.43 2294.93 2542.49 2950.63 2684.91 2586.76 2573.52 2605.54 2670.56 2751.31 2854.93 2968.38 3060.93 3085.86 3071.81 3046.69 2974.56 2866.74 2738.56 2649.85 2621.12 2639.16 2630.32 2538.74 2545.36 2858.89 2996.34 3004.93 2934.66 2667.06 2777.24 3002.77 2882.42 2935.11 3000.55 3067.39 3093.08 3087.64 3089.7 3089.64 3096.08 3092.83 3083.37 3055.05 3042.67 2981 3004.02 2967.33 2814.1 2715.62 2730.87 2796.99 2861.13 2896.88 2893 2856.28 2786.7 2718.9 2684.57 2751.36 2901.14 2995.26 3003.35 2983.02 2925.26 2883.05 2861.63 2862.88 2881.2 2915.23 2937.33 2928.92 2881.49 2826.96 2751.87 2586.88 2506.49 2540.68 2689.79 2805.26 2628.16 2823.72 2886.43 2916.88 2969.13 2929.25 2900.52 2900.5 2898.17 2889.79 2880.81 2887.58 2909.09 2935.22 2949.91 2957.93 2952.63 2925.88 2917.93 2915.34 2901.68 2847.06 2797.24 2764.67 2762.18 2849.83 3068.96 3015.42 2912.27 2819.79 2814.69 2853.54 2868.12 2872.41 2876.83 2864.82 2849.7 2847.51 2830.53 2778.82 2720.55 2702.74 2712.19 2739.5 2755.61 2769.39 2773.13 2784.9 2794.32 2793.31 2794.17 2812.36 2830.13 2846.79 2854.71 2844.09 2787.37 2707.17 2674.73 2724.27 2791.94 2680.64 2680.93 2757.28 2683.76 2674.11 2687.84 2704.11 2725 2683.76 2550.97 2513.35 2561.33 2665.8 2667.81 2668.51 2666.42 2666.12 2670.91 2675.67 2671.85 2681.19 2682.02 2671.87 2668.29 2645.64 2642.39 2640.1 2659.07 2684.17 2678.3 2652.66 2661.17 2660.72 2762.21 2764.93 2768.45 2763.37 2776.43 2800.5 2783.11 2779.03 2761.92 2744.21 2698.85 2660.59 2624.11 2626.16 2671.19 2724.64 2755.51 2743.02 2727.84 2694.37 2693.08 2682.07 2690.69 2707.58 2738.24 2740.33 2752.5 2752.05 2761.99 2781.69 2785.4 2609.83 2525.03 2513.41 2601.81 2588.53 2545.81 2506.19 2508.74 2519.26 2517.93 2519.85 2537.86 2541.67 2559.3 2575.04 2586.3 2590.21 2590.5 2576.39 2631.15 2515.94 2472.15 2579.29 2667.37 2682.43 2700.06 2720.62 2738.83 2768.26 2757.63 2588.47 2320.89 2420 2491.26 2655.85 2639.94 2566.15 2551.02 2576.31 2591.73 2563.85 2537.03 2531.26 2519.33 2518.05 2499.73 2518.98 2508.33 2494.34 2502.58 2571.78 2692.1 2710.93 2623.92 2508.52 2669.27 2675.88 2697.7 2830.37 2719.84 2698.3 2703.68 2713.84 2721.45 2867.68 2652.74 2889.05 2560.9 2434.07 2432.29 2438.45 2426.81 2418.76 2377.23 2364.58 2346.46 2361.36 2363.02 2351.47 2408.05 2529.1 2702.41 2817.78 2790.84 2687.31 2699.87 2936.44 2671.43 2505.42 2472.38 2511.18 2529.34 2493.03 2494.07 2868.05 2857.23 2852.27 2665.93 2756 2916.81 2939.54 2983.22 2989.56 2992.91 2956.96 2894.3 2900.38 2948.79 2688.26 2689.47 2826.5 2595.94 2620.17 2807.39 2929.84 2771.82 2761.38 2930.59 2952.47 2931.64 2905.5 2865.47 2836.49 2806.59 2726.33 2691.04 2700.57 2777.35 2818.18 2914.23 2793.01 2845.52 3001.85 3067.07 3052.86 3012.1 3000.75 2936.09 2969.67 2776.47 2674.84 2682.54 2751.85 2808.86 2896.5 2929.59 2744.22 2668.42 2612.58 2587.28 2542.05 2548.04 2574.68 2580.42 2606.02 2614.36 2624.71 2722.62 2947.36 2964.07 3014.55 3044.79 2875.74 2803.84 2878.75 2997.72 3063.94 3078.21 3087.51 3085.59 3037.03 2965.75 2878.31 2823.78 2874.85 2957.2 2917.48 2869.82 2937.22 3019.3 2927.3 2966.32 3013.34 2933.98 2820.37 2707.16 2617.93 2574.79 2577.57 2647.13 2883.04 2857.4 2607.43 2346.09 2353.86 2754.38 2853.61 2637.81 2580.88 2591.58 2637.19 2704.76 2797.6 2912.66 3043.05 3105.83 3115.1 3095.89 3071.07 3010.98 2913.98 2775.97 2658.16 2624.37 2628.67 2622.43 2550.84 2513.63 2784.73 3006.83 2966.09 2993.15 2830.3 2629.87 2541.15 2530.03 2998.5 2876.22 2924.41 3003.55 3080.87 3087.9 3068.69 3071 3088.87 3060.59 3032.28 3063.78 3082 3054.06 3039.73 3043.33 2998.33 2829.57 2777.65 2799.26 2836.48 2888.06 2914.36 2918.04 2889.87 2815.91 2723.26 2654.52 2651.76 2763.39 2921.36 2985.51 2998.77 2979.12 2955.55 2937.67 2934.55 2947.44 2957.69 2955.33 2926.33 2878.57 2819.63 2762.84 2628.78 2534.36 2480.18 2447.19 2482.81 2503.8 2759.61 2885.81 2903.13 2954.38 2935.15 2903.78 2886.94 2862.86 2849.39 2844.75 2846.58 2868.17 2900.68 2941.04 2962.27 2965.4 2925.46 2884.65 2887.05 2909.54 2899.29 2839.65 2784.21 2779.54 2949.22 3050.27 2923.31 2827.69 2820.76 2821.19 2843.53 2844.69 2857.44 2863.9 2860.91 2847.2 2842.06 2850.22 2817.01 2747.92 2695.79 2694.08 2703.55 2720.42 2738.67 2740.56 2758.92 2762.79 2777.14 2796.55 2823.11 2835.24 2826.61 2778.58 2669.98 2585.63 2569.13 2602.85 2661.62 2729.25 2795.96 2800.37 2708.14 2683.17 2692.87 2707.54 2728.85 2744.88 2640.03 2539.69 2487.04 2525.07 2606.51 2662.8 2647.3 2642.38 2629.88 2628.84 2638.26 2630.68 2633.9 2632.37 2628.58 2618.6 2629.52 2631.36 2652.69 2673.32 2670.45 2640.83 2659.25 2660.85 2724.11 2763.2 2773.9 2765.37 2773.13 2804.43 2797.64 2796.84 2782.08 2776.59 2753.06 2726.23 2677.59 2639.01 2628.61 2671.04 2730.84 2752.03 2755.64 2723.16 2715.37 2702.43 2706.69 2704.66 2727.36 2732.91 2747.64 2755.59 2767.99 2784.64 2786.34 2742.79 2557.16 2523.64 2542.62 2611.48 2579.8 2536.89 2514.99 2526.81 2550.75 2559.24 2578.87 2595.28 2599.13 2630.73 2628.52 2645.76 2644.57 2625.96 2609.42 2609.34 2551.39 2421.07 2485.65 2619.75 2696.51 2706.9 2725.17 2752.9 2756.7 2697.72 2395.98 2342.59 2487.35 2641.05 2712.92 2628.76 2558.09 2543.03 2562.54 2587.75 2578.97 2555.8 2534.3 2532.62 2520.1 2511.11 2519.33 2515.74 2497.63 2508.44 2583.42 2687.48 2680.47 2610.2 2483.17 2648.85 2698.96 2737.16 2778.71 2666.63 2669.86 2688.99 2705.34 2730.19 2867.74 2722.36 2840.49 2699.94 2445.56 2408.99 2420.1 2422.74 2416.68 2388.4 2388.76 2375.9 2376.1 2386.38 2371.55 2430.05 2578.9 2772.1 2872.95 2802.02 2687.14 2728.36 2961.26 2625.89 2488.52 2499.3 2570.62 2625.8 2594.12 2555.19 2661.9 2895.67 2740.78 2663.76 2826.92 2904.19 2933.72 2968.35 2991.28 2972.54 2939.83 2892.97 2897.9 2945.95 2637.88 2683.22 2828.55 2565.91 2578.82 2773.97 2941.77 2776.41 2728.83 2882.64 2961.64 2949.3 2928.74 2903.46 2865.21 2835.11 2806.93 2802.96 2831.45 2877.51 2792.46 2895.47 2903.9 2909.33 3029.53 3072.09 3040.97 2980.88 3012.69 2930.8 2919.71 2749.65 2661.69 2678.67 2761.8 2833.91 2933.01 2841.69 2672.18 2606.3 2599.74 2569.23 2558.68 2567.95 2578.27 2613.06 2629.41 2650.12 2667.04 2803.07 2975.49 2998.66 3010.43 3055.2 2877.47 2821.09 2919.59 3029.65 3087.1 3107.89 3096.74 3081.04 3062.4 3004.71 2919.3 2833.6 2843.12 2967.3 2957.62 2842.53 2804.11 2850.59 2896.22 2892.82 2841.24 2763.85 2692.78 2665.08 2699.75 2817.17 2958.23 2867.75 2694.35 2525.39 2379.99 2334.56 2508.09 3012.42 2758.57 2618.97 2589.44 2605.88 2667.03 2733.19 2818.95 2944.39 3071.1 3109.17 3105.51 3074.12 3048.69 3000.23 2914.65 2787.1 2667.22 2621.35 2630.02 2608.69 2552.47 2482.36 2628.46 2960.4 2976.7 2833.92 2659.1 2556.7 2531.58 2523.85 3005.42 2862.33 2904.16 2975.18 3073.63 3085.42 3056.88 3054.63 3075.57 3070.44 2984.61 2938.03 3009.59 3067.73 3059.31 3039.64 2929.57 2833 2868.01 2881.31 2884.38 2893.09 2915.28 2922.38 2905.92 2851.57 2757.41 2654.94 2603.63 2628.09 2764.85 2896.26 2963.5 2984.36 2981.9 2974.48 2970.19 2965.4 2953.54 2922.98 2864.52 2793.93 2738.05 2696.29 2620.13 2554.25 2495.03 2442.77 2424.12 2482.33 2761.16 2890.11 2896.15 2928.1 2941.41 2898.03 2857.88 2834.1 2813.95 2805 2805.28 2817.8 2847.5 2898.72 2952.8 2971.32 2950.19 2902.26 2888.97 2903.39 2913.86 2854.41 2806.07 2860.13 3019.7 2970.84 2838.8 2801.1 2819.72 2817.04 2823.47 2824.14 2824.19 2837.45 2845.8 2837.11 2838.63 2836.63 2846.76 2800.91 2731.41 2693 2691.66 2702.92 2715.27 2725.99 2754.06 2764.29 2796.72 2815.91 2816.65 2794.43 2717.37 2617.18 2564.84 2560.6 2593.78 2647.76 2725.22 2835.62 2781.29 2733.41 2706.05 2692.17 2714.7 2731.36 2751.13 2730.42 2607.37 2510.47 2481.84 2478.46 2521.93 2565.56 2607.99 2613.54 2611.69 2604.41 2592.15 2605.41 2596.43 2605.24 2619.54 2625.78 2633.08 2639.08 2634.71 2633.22 2622.84 2645.87 2671.59 2733.15 2752.82 2765.28 2745.67 2746.42 2770 2794.79 2817.33 2810.04 2802.86 2774.73 2757.56 2734.16 2699.05 2654.99 2631.91 2661.83 2719.45 2758.42 2755.48 2744.26 2723.8 2721.96 2719.65 2728.77 2729.96 2746.76 2754.74 2767.17 2777.19 2769.2 2723.73 2626.72 2555.7 2561.84 2582.61 2625.5 2595.57 2556.23 2543.94 2568.91 2593.55 2601.36 2612.62 2617.27 2635.31 2632.32 2651.13 2662.56 2669.97 2676.65 2643.56 2611.06 2666.54 2410.98 2382.33 2407.75 2447.96 2488.51 2582.15 2653.8 2686.75 2524.15 2315.5 2335.79 2509.99 2704.16 2722.92 2632.67 2578.34 2563.65 2586.39 2601.27 2599.18 2578.77 2563.01 2539.78 2549.21 2533.75 2532.77 2509.86 2500.49 2524.92 2616.33 2710.17 2628.41 2594.14 2468.81 2640.46 2693.26 2762.36 2773.6 2647.2 2659.85 2662.22 2690.92 2720.51 2862.64 2670.07 2661.77 2910.97 2640.58 2440.23 2408.66 2419.77 2418.88 2400.58 2389.65 2385.96 2398.54 2370.02 2382.88 2479.04 2667.45 2849.56 2909.84 2794.24 2682.1 2776.39 2947.11 2621.5 2498.83 2507.96 2599.66 2703.34 2693.66 2621.42 2599.34 2699.22 2608.48 2686.42 2877.65 2906.93 2924.95 2960.15 2975.93 2968.75 2924.9 2881.48 2915.55 2877.11 2594 2702.01 2829.97 2543.75 2538.96 2726.51 2931.21 2799.28 2669.51 2704.23 2832.34 2900.77 2897.35 2857.75 2822.43 2798.21 2750.41 2709.43 2695.03 2697.29 2766.11 2941.31 2902.22 2944.79 3043.74 3065.4 3027.23 2969.97 3010.13 2962.87 2858.21 2719.59 2645.05 2667.04 2758.73 2861.5 2954.52 2791.91 2688.04 2618.78 2602.07 2600.19 2572.51 2573.38 2594.81 2617.05 2652.88 2694.06 2783.26 2918.09 2997.99 3029.72 3039.77 2998.16 2885.35 2853.91 2947.68 3049.13 3106.02 3106.27 3097.11 3081.54 3055.08 3008.27 2952.82 2861.2 2797.32 2962.12 2979.44 2888.47 2783.19 2755.71 2746.36 2734.55 2717.45 2720.81 2782.71 2921.09 2874.22 2588.22 2463.8 2423.16 2409.29 2403.39 2411.93 2530.96 2899.79 2880.79 2686.45 2614.34 2605.2 2625.78 2680.02 2753.39 2828.29 2921.81 3037.55 3082.85 3074.23 3057.98 3021.08 2974.07 2890.11 2770.23 2663.89 2626.93 2628.93 2594.47 2533.42 2486.08 2557.88 2825.54 2921.81 2730 2605.07 2583.02 2566.7 2524.03 3010.56 2853.58 2878.77 2927.17 3039.57 3085.98 3060.77 3047.04 3058.47 3083.04 3035.1 2956.47 2914.78 2978.26 3001.29 2947.32 2884.1 2928.12 2947.01 2949.89 2933.95 2914.26 2916.92 2916.1 2910.37 2883.02 2813.69 2700.95 2604.4 2559.67 2592.47 2703.82 2814.79 2883.64 2914.97 2919.11 2909.76 2882.75 2834.63 2766.22 2701.34 2654.2 2624.03 2601.07 2568.63 2530.14 2494.2 2467.19 2456.66 2559.35 2820.91 2890.6 2894.43 2903.46 2940.26 2909.85 2851.9 2816.8 2798.28 2790.54 2793.68 2802.27 2814.68 2848.02 2917.79 2965.35 2980.84 2961.2 2926.06 2924.55 2914.51 2883.85 2891.69 2992.49 3019.92 2920.42 2809.79 2792.93 2804.22 2815.66 2810.19 2802.71 2809.19 2825.79 2847.59 2841.42 2833.44 2833.88 2834.56 2842.56 2802.09 2742.43 2719.8 2724.48 2732.32 2746.4 2780.63 2790.46 2805.22 2808.33 2772.18 2697.41 2618.28 2586.66 2595.34 2656.12 2751.53 2838.41 2843.03 2797.64 2747.18 2726.89 2710.48 2703.45 2718.5 2741.48 2762.64 2734 2602.56 2531.17 2484.4 2472.8 2474.49 2464.09 2486.16 2495.05 2497.2 2514.2 2510.14 2531.51 2536.95 2532.37 2561.41 2552.57 2577.39 2576.71 2598.03 2610.82 2635.75 2683.54 2736.51 2748.78 2752.1 2740.05 2742.13 2754.8 2784.49 2820.31 2814.26 2820.49 2808.29 2779.27 2745.15 2736.81 2713.02 2669.97 2638.89 2644.8 2700.89 2746.66 2764.93 2753.06 2742.63 2737.3 2739.45 2738.27 2753.97 2756.21 2754.29 2751.39 2728.57 2678.96 2617.54 2572.62 2583.42 2610.82 2623.81 2625.47 2600.94 2579.68 2575.53 2582.81 2604.86 2619.58 2624 2624.46 2614.89 2621.57 2629.3 2638.01 2672.68 2692.88 2674 2644.27 2645.49 2486.68 2353.27 2301.43 2257.65 2235.29 2265.78 2320.99 2402.52 2368.92 2291.83 2361.78 2497.79 2644.58 2776.55 2696.4 2606.78 2568.35 2568.92 2597.66 2605.03 2601.7 2590.58 2576.28 2558.74 2553.09 2521.65 2503.48 2502.25 2553.04 2642.69 2679.31 2576.02 2567.82 2432.78 2587.7 2715.17 2739.02 2811.85 2677.63 2712.58 2708.9 2724.16 2798.25 2759.68 2557.6 2540.75 2634.57 2927.03 2569.29 2455.8 2421.43 2409.41 2402.42 2402.27 2385.92 2384.89 2405.09 2441.36 2589.5 2800.83 2938.96 2925.36 2743.06 2653.9 2780.31 2951.28 2692.58 2549.41 2504.78 2588.2 2736.05 2792.03 2766.87 2673.46 2660.8 2670.35 2794.85 2908.64 2912.41 2926.26 2950.71 2957.74 2930.55 2889.96 2880.2 2943.89 2737.78 2570.94 2759.33 2832.5 2527.69 2490.33 2654.72 2858.06 2889.07 2649.5 2560.6 2533.32 2529.75 2507.15 2491.77 2494.9 2520.97 2581.83 2634.1 2691.94 2787.61 2919.7 2934.25 2924.71 2976.9 3037.32 3029.62 2972.31 2992 2967.47 2958.57 2796.93 2701.79 2622.71 2645.63 2743.3 2861.95 2976.57 2814.96 2707.64 2688.32 2635.36 2624.24 2618.29 2629.21 2644.99 2692.75 2745.7 2822.97 2917.1 2990.79 3029.32 3043.81 3035.71 2966.03 2881.82 2871.99 2963.38 3064.11 3104.67 3105.88 3107.5 3083.28 3045.48 3001.73 2962.45 2887.79 2778.6 2930.84 2893.21 2978.41 2873.17 2782.47 2747.74 2742.96 2802.91 2922 2892.37 2623.3 2525.15 2513.43 2519.69 2525.77 2549.44 2623.11 2767.89 2996.12 2919.5 2752.1 2656.34 2623.47 2617.85 2647.76 2692.89 2747.07 2818.62 2883.61 2951.84 3003.99 3025.32 3000.97 2974.8 2931.25 2839.83 2730.49 2650.18 2629.59 2627.62 2572.26 2511.36 2477.5 2494.04 2644.12 2864.39 2869.62 2748.63 2711.42 2583.85 2522.23 3026.93 2852.33 2846.01 2867.92 2911.71 3038.16 3082.45 3067.74 3064.03 3076.86 3043.25 2985.33 2964.12 2959.99 2949.93 2950.91 2980.06 2984.37 2998.19 2998.91 2982.23 2962.17 2944.45 2929.17 2919.62 2898.43 2865.92 2785.61 2668.76 2569.49 2522.1 2531.58 2587.96 2640.3 2675.25 2686.88 2677.14 2654.72 2631.43 2626.34 2632.91 2656.97 2678.55 2694.38 2723.89 2662.64 2601.29 2572.95 2598.19 2743.69 2881.95 2888.53 2879.92 2897.31 2917.39 2922.7 2875.3 2827.11 2800.51 2791.64 2796.89 2805.15 2816.37 2822.01 2855.9 2946.41 2982.77 3000.09 2998.37 2984.43 2980.14 2982.99 3010.15 3018.35 2966.13 2907.29 2808.97 2773.87 2779.85 2781.72 2769.51 2756.95 2766.52 2804.76 2833.15 2841.47 2833.07 2828.95 2830.25 2832.15 2839.75 2829.49 2792.08 2778.15 2777.35 2791.13 2801.99 2803.42 2809.04 2789.52 2739.73 2684.98 2653.82 2660.57 2706.79 2783.14 2864.92 2855.84 2814.75 2783.71 2752.87 2734.13 2727.2 2715.62 2719.58 2738.02 2769.45 2759.53 2667.47 2571.46 2532.9 2500.97 2495.83 2477.58 2468 2461.66 2462.15 2470.14 2482.63 2510.36 2537.71 2537.97 2582.17 2584.3 2618.13 2630.56 2656.51 2674.59 2707.6 2742.69 2746.94 2734.97 2732.9 2734.51 2740.27 2757.73 2791.56 2814.95 2837.22 2834.98 2836.86 2801.51 2745.71 2719.96 2724.77 2688.69 2641.36 2635.26 2661.51 2719 2748.02 2768.69 2764.26 2761.67 2759.64 2768.35 2761.98 2754.12 2736.43 2703.62 2656.95 2611.89 2582.82 2584.9 2618.74 2653.46 2668.61 2658.23 2635.06 2619.49 2621.53 2626.44 2630.34 2632.43 2629.84 2615.27 2611.33 2611.56 2613.81 2636.98 2657.57 2683.7 2711.38 2678.35 2642.53 2676.44 2399.43 2313.81 2250.73 2199.23 2192.37 2218.15 2269.69 2309.41 2335.76 2414.79 2514.9 2589.84 2746.67 2777.79 2680.64 2612.1 2586.27 2590.21 2600.32 2596.46 2587.14 2573.34 2556.1 2525.6 2509.94 2502.73 2538.26 2613.62 2677.18 2587.37 2536.84 2520.33 2400.77 2579.99 2715.19 2710.18 2852.67 2744.21 2785.17 2842.68 2856.9 2907.59 2799.57 2624.53 2592.9 2602.1 2880.52 2779.88 2548.77 2464.26 2431.14 2411.02 2400.83 2413.09 2415.15 2458.99 2584.39 2762.26 2934.35 2972.6 2919.48 2698.01 2636.21 2794.17 2924.99 2884.87 2707.74 2546.25 2510.41 2654.68 2845.84 2883.38 2893.25 2870.9 2886.73 2918.43 2917.94 2911.35 2918.62 2926.07 2915.42 2884.15 2870.48 2920.94 2837.73 2597.03 2579.21 2868.87 2838.36 2535.29 2448.02 2561.23 2752.63 2926.79 2788.39 2576.82 2475.7 2431.51 2434.8 2480.57 2600.63 2757.08 2862.5 2904.88 2932.67 2933.58 2923.85 2919.91 2937.49 2971.42 2995.57 2978.06 2975.76 3008.24 2973.51 2848.9 2735.53 2664.77 2592.2 2601.97 2705.32 2837.91 2977.64 2885.98 2758.47 2747.19 2698.6 2700.99 2721.71 2728.38 2770.5 2822.76 2876.66 2931.86 2979.33 3004.73 3019.99 3039.49 2995.21 2940.37 2892.41 2899 2970.17 3039.87 3078.98 3088.99 3074.22 3039.15 3001.21 2979.83 2959.22 2897.88 2775.2 2869.81 2875.98 2818.64 2959.63 2952.1 2931.24 2952.28 2932.69 2708.85 2560.74 2532.13 2595.34 2742.26 2847.77 2914.55 2987.66 3000.91 2948.94 2864.33 2769.49 2686.99 2653.36 2642.8 2639.88 2664.67 2706.09 2744.83 2789.27 2842.85 2886.86 2916.3 2922.13 2929.37 2915.32 2862.58 2775.99 2692.45 2641.45 2638.46 2615.75 2535.52 2483.73 2476.98 2477.15 2521.49 2738.05 2893.36 2876.57 2794.27 2576.43 2518.34 3049.39 2849.4 2806.99 2827.39 2828.27 2840.23 2905.79 3004.71 3020.7 2986.1 2919.89 2890.16 2914.08 2963.19 2990.93 3020.07 3022.2 3035.84 3037.73 3037.06 3029.94 3018.55 2996.5 2979.04 2964.18 2918.55 2883.54 2851.85 2777.51 2669.71 2572.22 2515.3 2491.69 2500.8 2513.3 2532.77 2558.38 2597.4 2648.34 2705.32 2765.9 2812 2844.72 2870.5 2882.44 2864.04 2817.74 2802.16 2832.26 2886.05 2892.32 2879.32 2865.04 2886.42 2900.28 2915.44 2899.89 2861.47 2822.72 2803.86 2805.14 2809.69 2826.91 2831.09 2826.17 2866.74 2948.45 2986.62 3019.43 3031.07 3032.51 3031.9 3019.71 2992.52 2914.44 2882.87 2855.92 2786.39 2749.1 2748.36 2732.44 2728.79 2745.32 2789.07 2828.05 2843.52 2832.1 2825.19 2822.71 2825.07 2824.97 2833.44 2834.26 2826.46 2822.93 2821.06 2816.85 2826.64 2827.61 2812.64 2805.12 2802.38 2810.1 2824.61 2837.89 2854.13 2866.23 2873.21 2864.51 2833.91 2803.58 2778.42 2767.35 2748.36 2732.44 2731.28 2750.37 2774.67 2762.73 2719.69 2670.94 2658.8 2620.3 2625.56 2584.35 2610.4 2595.57 2621.21 2646.1 2666.78 2693.27 2690.78 2716.51 2713.02 2733.79 2732.24 2743.12 2740.17 2744.15 2741.41 2734.3 2723.12 2726.18 2734.03 2746.17 2764.12 2783.85 2807.6 2819.77 2826.66 2817.58 2786.51 2733 2707.6 2730.07 2700.59 2660.26 2628.97 2633.8 2660.12 2702.13 2733.25 2751.8 2763.75 2767.08 2763.26 2756.73 2735.63 2702.16 2654.89 2616.99 2592.54 2591.25 2612.26 2648.77 2679.2 2689.56 2682.4 2673.97 2660.87 2652.9 2650.31 2649.57 2645.87 2634.33 2628.07 2622.89 2615.55 2633.55 2644.95 2655.13 2689.09 2713.88 2707.95 2684.21 2667.28 2591.5 2422.4 2336.65 2307.31 2322.51 2353.56 2379.49 2392.17 2434.18 2499.35 2533.61 2565.4 2652.79 2810.94 2784.91 2696.73 2638.73 2614.24 2598.95 2591.67 2571.6 2563.54 2531.69 2534.12 2520.27 2560.2 2622.49 2677.14 2583.26 2515.94 2532.1 2464.45 2380.42 2520 2721.58 2698.03 2852.71 2819.6 2783.32 2895.74 2900.35 2965.06 2960.85 2918.16 2748.13 2739.41 2840.05 2970.42 2787.5 2634.92 2558.08 2521.18 2510.09 2525.31 2595.67 2703.95 2850.83 2957.98 2963.61 2949.33 2839.95 2612.08 2587.6 2687.37 2760.26 2787 2868.32 2706.47 2530.21 2511.43 2674.3 2877.28 2885.9 2877.48 2886.47 2894.31 2896.3 2898.18 2897.82 2890.09 2876.56 2878.13 2919.48 2832.21 2615.73 2561.63 2734.55 2936.68 2839.19 2582.89 2427.35 2462.36 2614.62 2778.15 2914.48 2871.35 2695.94 2583.23 2542.75 2575.3 2693.96 2846.66 2935.51 2931.4 2904.54 2906.27 2917.23 2933.46 2964.6 2973.78 2976.98 2996.78 3017.61 2982.12 2864.48 2715.41 2644.4 2589.26 2537.49 2541.15 2627.38 2772.92 2935.29 2986.28 2853.93 2795.5 2747.81 2763.52 2743.98 2818.27 2836.59 2871.35 2909.36 2942.06 2973.39 3013.86 3021.9 2991.87 2958.92 2934.3 2914.37 2920.08 2960.86 2998.96 3022.07 3023.73 3011.58 2990.97 2971.02 2959.68 2950.11 2896.1 2772.91 2791.77 2979.46 2760.09 2771.42 2839.29 2844.42 2761.3 2644.69 2563.47 2542.38 2624.45 2818.23 3000.19 2988.04 2942.44 2894.91 2844.11 2791.26 2740.65 2695.33 2666.19 2656.83 2654.18 2661.78 2681.02 2709.14 2745.16 2775.03 2803.24 2836.97 2856.33 2873.17 2864.56 2830 2771.88 2707.58 2659.82 2645.85 2645.97 2582.31 2491.72 2471.86 2476.62 2471.87 2477.79 2578.47 2708.99 2805.62 2719.66 2560.41 2514.84 3063.45 2897.69 2776.11 2767.82 2777.37 2778.95 2766.08 2757.75 2749.8 2743.75 2728.82 2731.66 2746.05 2791.42 2840.05 2877.85 2880.9 2870.09 2852.82 2839.39 2877.08 2980.36 3039.67 3030.97 3008.96 2983.26 2885.55 2863.93 2845.32 2797.16 2723.85 2652.04 2589.33 2571.62 2571.43 2594.63 2635.32 2692.66 2753.31 2802.88 2830.63 2846.6 2856.56 2862.65 2865.47 2870.55 2873.59 2875.85 2881.64 2882.51 2872.62 2855.9 2853.34 2882.29 2891.96 2898.53 2898.27 2886.76 2865.05 2842.62 2827.21 2825.76 2831.5 2843.64 2834.15 2822.05 2860.38 2932.89 2958.12 2976.09 2984.97 2976.18 2952.88 2906.11 2864.2 2870.24 2881.21 2827.78 2777.65 2747.24 2733.75 2729.03 2751.9 2784.17 2819.1 2832.56 2833.17 2822.24 2817.37 2816.36 2817.84 2815.57 2804.43 2801.15 2800.56 2798.41 2808 2814.18 2814.4 2816.7 2812.63 2807.21 2795.33 2783.25 2768.58 2761.29 2767.94 2791.34 2822.71 2836.78 2854.2 2837.48 2828.2 2816.12 2789.15 2738.78 2733.34 2748.06 2762.05 2763.73 2764.89 2754.59 2729.27 2713.16 2658.3 2665.16 2641.1 2641.24 2661.37 2658.86 2680.32 2679.7 2700.73 2701.7 2720.66 2722.52 2733.7 2733.96 2733.83 2730.1 2727.87 2727.74 2734.7 2744 2753.96 2766.76 2783.07 2797.35 2808.58 2807.42 2803.77 2775.83 2722.88 2700.64 2731.36 2722.11 2678.76 2640.96 2619.69 2620.99 2625.66 2645.69 2661.96 2677.6 2684.8 2678.4 2671.16 2641.26 2620.75 2600.39 2596.69 2606.89 2631.86 2655 2677.71 2698.76 2707.56 2702.08 2700.21 2697.12 2689.55 2682.77 2678.5 2669.23 2662.83 2651.63 2644.46 2641.72 2653.59 2649.75 2672.46 2689.68 2706.53 2736.08 2723.67 2681.58 2699.74 2618.3 2516.49 2507.79 2516.18 2527.39 2524.63 2520.18 2529.72 2543.98 2539.71 2534.4 2560.91 2628.66 2767.25 2828.32 2770.13 2709.9 2672.87 2649.62 2625.53 2617.35 2592.97 2626.25 2634.08 2690.41 2664.12 2577.1 2474.49 2479.87 2524.93 2418.89 2353.46 2461.33 2712.67 2668.53 2772.62 2866.61 2798.27 2857.82 2865.06 2929.1 2998.37 2886.23 2820.67 2756.33 2735.85 2793.09 2895.32 2991.67 2959.89 2906.2 2889.61 2915.14 2945.25 2918.7 2891.99 2888.59 2909.14 2936.92 2817.65 2567.41 2519.12 2566.09 2596.12 2602.33 2674.68 2816.3 2723.93 2548.24 2494.44 2535.35 2709.27 2881.11 2925.53 2936.69 2937.93 2936.02 2934.23 2935.33 2938.68 2832.07 2651.57 2561.93 2593.76 2763 2920.28 2849.09 2819.33 2692.74 2462.11 2389.79 2469.53 2608.21 2726.55 2822.42 2899.15 2940.71 2881.67 2826.53 2812.07 2832.33 2892.25 2946.63 2970.7 2978.2 2992.65 3010.51 3019.9 3021.35 3022.95 3003.46 2969.02 2816.24 2654.74 2554.94 2497.34 2466.15 2452.86 2462.95 2521.13 2650.5 2855.44 2995.63 2976.87 2904.59 2837.41 2839.56 2829.09 2877.61 2889.02 2937.46 2972.36 2989.22 2995.68 2967.72 2947.68 2936.23 2937.75 2942.1 2943.65 2941.37 2949.93 2957.15 2958.64 2954.35 2942.69 2928.2 2932.16 2937.15 2938.74 2881.21 2754.06 2714.29 2922.4 2834.95 2736.07 2785.44 2841.04 2845.08 2820.26 2792.72 2811.95 2903.44 2994.17 2965.07 2910.9 2859.79 2813.31 2773.22 2735.86 2705.37 2681.2 2664.92 2657.99 2653.29 2654.26 2663.41 2673.91 2694.78 2717.69 2733.16 2744.17 2755.18 2749.92 2736.46 2713.35 2688.39 2666.96 2656.51 2661.04 2631.33 2508.59 2466.67 2469.69 2467.86 2467.86 2465.3 2481.52 2514.5 2584.48 2551.17 2507.27 2512.01 3072.21 2943.36 2795.75 2742.5 2723.06 2715.6 2709.68 2702.83 2690.85 2678.37 2670.21 2656.7 2657.6 2650.92 2656.3 2657.48 2648.21 2648.53 2641.61 2649.52 2662.06 2713.51 2846.83 3052.81 3034.96 3021.37 2930.32 2833.36 2844.67 2854.87 2832.25 2805.88 2781.63 2766.08 2760.14 2762.14 2773.56 2789.47 2799.97 2811.32 2813.98 2820.26 2821.16 2823.63 2822.37 2824.64 2828.94 2833.2 2836.8 2836.55 2836.01 2832.74 2851.82 2894.1 2886.33 2867.76 2876.39 2876.51 2875.29 2863.93 2858.78 2848.56 2850.73 2848.15 2841.09 2831.38 2815.27 2829.05 2856.39 2889.71 2908.69 2913.6 2905.9 2895.33 2887.83 2870.51 2851.07 2835.25 2814.4 2802.96 2793.45 2779.19 2785.64 2798.19 2814.55 2831.62 2821.21 2820.48 2812.82 2808.61 2800.06 2797.56 2803.4 2787.17 2790.35 2785.88 2781.39 2784.75 2787.44 2785.38 2782.42 2776.93 2769.4 2754.99 2739.03 2724.45 2716.17 2714.86 2718.5 2725.59 2735.36 2744.02 2769.32 2830.65 2860.19 2763.32 2724.58 2730.67 2727.28 2725.81 2716.32 2703.28 2677.48 2661.05 2610.19 2629.16 2608.7 2605.14 2639.32 2628.75 2665.37 2655.32 2690.58 2680 2713.92 2708.24 2730.2 2728.08 2739.4 2743.35 2749.27 2755.42 2760.96 2765.53 2770.34 2774.72 2779.9 2784.38 2783.48 2781.2 2768.5 2747.6 2708.5 2684.53 2721.49 2742.85 2698.35 2658.22 2624.46 2604.79 2588.82 2592.13 2581.75 2588.54 2587.45 2586.48 2585.12 2589.18 2596.1 2607.57 2624.3 2644.92 2661.96 2676.46 2688.09 2695.92 2699.25 2695.28 2691.89 2689.33 2686.86 2684.48 2679.84 2677.27 2672.11 2666.55 2662.26 2659.72 2653.14 2671.28 2675.9 2685.96 2717.64 2736.26 2758.96 2731.76 2694.13 2697.12 2637.99 2614.84 2607.08 2596.2 2584.15 2581.43 2575.58 2563.66 2542.79 2532.19 2514.36 2524.76 2543.57 2592.63 2658.42 2729.71 2763.24 2767.48 2754.05 2736.47 2668.24 2662.13 2570.42 2566.14 2494.98 2479.52 2434.51 2492.6 2502.33 2403.5 2344.39 2394.19 2647.9 2636.13 2618.78 2735.03 2817.69 2898.52 2860.02 2786.05 2793.04 2714.38 2734.07 2708.95 2712.64 2686.82 2692.71 2704.72 2721.02 2723.72 2730.04 2727.56 2730.28 2757.62 2789.19 2836.21 2874.89 2915.48 2773.97 2524.71 2444.76 2461.16 2493.7 2489.65 2534.28 2655.87 2783.62 2853.49 2790.28 2715.5 2698.12 2707.25 2744.98 2783.48 2816.06 2829.71 2828.91 2794.73 2751.88 2744.62 2770.13 2837.29 2907.01 2867.06 2803.88 2776.06 2781.03 2768.23 2599.59 2376.2 2359.86 2462.77 2569.53 2634.51 2676.32 2707.13 2730.04 2760.11 2770.37 2788.89 2805.61 2810.33 2850.62 2868.55 2892.9 2901.22 2891.12 2860.96 2808.67 2718.02 2605.18 2506.64 2434.28 2394.88 2373.18 2368.06 2373.75 2392.07 2421.01 2484.44 2725.36 2969.83 2973.55 2925.26 2883.84 2864.99 2803.32 2873.08 2841.74 2866.12 2883.24 2895.12 2908.42 2911.74 2917.09 2926.89 2946.36 2968.73 2980.91 2975.75 2965.41 2951.5 2937.79 2923.23 2917.48 2917.24 2925.18 2938.14 2935.46 2849.05 2717 2658.48 2724.37 2996.46 2760.43 2815.02 2929.12 2976.75 2981.18 2981.98 2977.31 2969.51 2954.67 2927.5 2902.86 2879.58 2856.69 2837.61 2820.48 2802.14 2782.27 2759.25 2737.45 2719.04 2703.95 2692.62 2686.28 2682.11 2681.72 2674.51 2679.39 2675.5 2677.76 2673.06 2671.91 2667.03 2663.92 2665.33 2670.26 2568.83 2464.99 2459.24 2466.6 2462.59 2471.22 2467.96 2476.59 2476.49 2483.25 2486.61 2491.37 2510.83 3013.29 3023.06 3021.34 3038.28 3047.44 3066.81 3074.54 3088.23 3096.51 3088.76 3075.98 3030.33 2788.46 2690.18 2567.18 2728.43 2794.01 2812.21 2809.03 2802.06 2787.99 2795.89 2783.58 2796.71 2798.17 2808.14 2814.91 2817.59 2818.93 2815.84 2819 2814.54 2820.56 2825.51 2835.12 2862.5 2861.88 2788.18 2691.76 2613.72 2527.43 2486.05 2505.13 2575.06 2923.26 2992.51 3024.3 3030.17 3031.84 3034.7 3035.58 3031.46 3023.84 3014.96 3001.06 2992.91 2973.91 2964.73 2947.14 2940.32 2918.5 2890.21 2852.77 2850.28 2832.19 2841.89 2871.58 3026.74 3095.86 3114.82 3121.05 3108.95 2999.52 2737.68 2937.38 2935.01 2930.65 2919.95 2914.14 2903.21 2893.85 2883.92 2870.25 2875.42 2867.83 2859.62 2864.82 2861.49 2861.28 2859.98 2862.25 2868.66 2876.87 2880.9 2878.55 2883.59 2859.58 2809.98 2753.56 2758.64 2770.95 2781.03 2777.95 2774.73 2665.43 2677.99 2684.8 2684.45 2675.97 2676.15 2669.44 2670.75 2658.98 2669.16 2675.45 2670.19 2687.55 2684.65 2687.92 2681.26 2685.68 2677.25 2681.11 2674.56 2682.6 2688.69 2684.91 2710.14 2734.39 2704.11 2603.36 2564.77 2563.27 2564.6 2599.11 2894.56 2891.1 2892.04 2898.73 2904.77 2875.9 2859.22 2848.93 2841.26 2827.95 2828.75 2814.09 2814.53 2807.97 2795.44 2802.97 2785.99 2784.66 2786.32 2782.62 2789.34 2789.38 2795.27 2796.81 2803.79 2804.57 2819.65 2775.88 2559.24 2561.21 2564.4 2576.59 2575.2 2639.86 2634.5 2615.24 2599.2 2598.53 2602.41 2605.03 2614.92 2623.45 2630.54 2644.02 2649.81 2653.68 2655.94 2662.74 2659.54 2655.45 2665.29 2665.91 2684.47 2701.97 2709.02 2717.72 2700.62 2700.62 2303.02 2282.08 2312.96 2353.66 2479.68 2632.29 2532.44 2541.73 2585.22 2597.65 2586.34 2566.55 2557.08 2523.93 2541.89 2537.05 2550.62 2562.22 2576.12 2592.49 2613.21 2636.72 2659.51 2684.68 2709.2 2734.98 2737.89 2726.18 2696.17 2659.85 2653.2 2513.07 2507.97 2648.21 2864.25 2511.81 2494.27 2453.62 2461.23 2437.07 2450.5 2456.24 2446.97 2484.72 2494.43 2496.19 2528 2539.6 2562.08 2585.31 2611.54 2635.66 2657.09 2666.07 2649.99 2618.1 2625.67 2735.74 2819.86 2480.07 2558.24 2565.87 2759.95 2974.67 2928.83 2928.5 2907.13 2922.84 2922.34 2927.71 2927.4 2926.83 2922.59 2915.83 2907.29 2887.97 2871.43 2851.86 2833.27 2810.57 2794.5 2780.02 2747.84 2750.54 2748.8 2753.46 2782.27 2801.85 2837.22 2878.58 2952.17 2260.52 2984.58 2881.3 2853.94 2850.48 2836.55 2825.01 2792.43 2785.28 2749.17 2742.52 2730.75 2721.54 2720.75 2714.58 2720.15 2719.19 2718.23 2721.93 2702.8 2711.77 2676.7 2695.24 2666.91 2695.91 2709.26 2731.56 2767.88 2835.65 2928.78 2199.66 2822.02 2857.37 2812.2 2807.99 2791.4 2785.68 2780.49 2779.23 2781.48 2783.93 2786.05 2785.44 2782.34 2775.57 2764 2751.9 2737.44 2727.48 2719.95 2722.78 2722.58 2717.56 2746.03 2857.19 2735.49 2326.93 2280.61 2330.83 2384.71 2204.94 2277.15 2267.72 2276.43 2343.96 2440.43 2533.51 2631.22 2718.61 2814.9 2913.39 3002.65 2981.02 2930.59 2906.57 2877.8 2889.24 2894.63 2912.86 2941.52 2960.77 2998.7 3002.53 2998.39 2832.04 2567.95 2441.27 2369.96 2442 2508.16 3008.92 3021.91 3026.77 3048.49 3060.58 3077.74 3102.72 3110.79 3112.26 3113.33 3097.18 3067.45 2915.04 2708.82 2568.58 2788.29 2827.96 2811.7 2779.75 2756.88 2734.91 2739.49 2733.72 2750.23 2758.24 2781.28 2794.51 2806.92 2812.64 2810.82 2813.89 2807.54 2814.21 2815.47 2823.39 2844.03 2865.6 2848.78 2783.67 2701.18 2615.1 2516.09 2475.58 2598.05 2943.16 3021.55 2985.27 2979.03 2993.1 3013.48 3030.3 3040.5 3044.44 3040.23 3033.91 3024.09 3016.42 3006.46 2992.03 2983.53 2960.03 2932.58 2889.8 2861.21 2827.57 2840.97 2834.9 2881.04 2963.56 3087.46 3123.02 3131.01 3080.71 2800.27 2933.82 2922.28 2882.05 2866.8 2859.55 2856.6 2852.91 2849.07 2848.28 2831.54 2823.14 2824.85 2811.13 2808.55 2803.89 2801.77 2806.26 2818.47 2840.51 2858.94 2876.86 2880.68 2870.86 2853.15 2794.59 2790.82 2817.6 2831.9 2827.48 2815.45 2630.04 2598.99 2580.55 2576.81 2581.09 2590.2 2603.72 2616.67 2627.93 2639.16 2648.64 2668.28 2676.49 2693.07 2701.83 2716.64 2715.38 2708.99 2703.94 2695.08 2702.32 2695.44 2702.11 2699.69 2717.25 2733.24 2690.51 2650.63 2658.55 2640.31 2705.08 2882.63 2883.19 2906.26 2875.59 2828.6 2816.11 2814.75 2777.41 2770.27 2736.5 2710.27 2697.74 2677.3 2659.18 2656.08 2634.63 2640.42 2634.54 2638.6 2651.64 2665.16 2689.65 2712.78 2742.63 2765.61 2793.26 2811.85 2804.35 2743.57 2554.86 2569 2579.69 2622.07 2649.13 2605.78 2592.62 2571.84 2575.55 2580.18 2596.36 2596.55 2532.15 2463.39 2437.13 2426.08 2431.4 2436.35 2434.83 2427.94 2419.34 2403.56 2406.47 2419.51 2478.01 2574.46 2686.47 2719.99 2703.79 2446.28 2309.05 2387.97 2515.43 2667.21 2562.9 2539.66 2581.02 2625.01 2643.09 2647.68 2608.74 2599.44 2558.11 2567.24 2560.27 2557.93 2553.35 2551.96 2560 2584.75 2633.82 2699.45 2766.09 2784.18 2758.75 2765.95 2835.82 2814.06 2705.02 2652.36 2521.88 2744.54 2845.76 2593.71 2485.96 2462.63 2433.7 2434.72 2436.26 2439.17 2449.21 2455.86 2490.67 2513.76 2515.94 2536.4 2545.13 2550.44 2560.8 2582.44 2626.05 2689.46 2751.51 2784.84 2726.79 2628 2644.35 2828.03 2681.87 2539.58 2643.6 2988.29 2970.23 2954.6 2957.98 2917.91 2885.97 2874.14 2873.22 2879.05 2900.02 2928.82 2930.71 2907.79 2869.96 2832.33 2803.73 2779.46 2770.2 2768.69 2763.98 2741.69 2741.47 2718.76 2725.38 2741.49 2759.71 2792.01 2839.46 2933.3 2578.24 2968.58 2890.61 2918.18 2966.69 2983.27 2962.39 2923.08 2858.21 2796.86 2748.42 2712.64 2695.85 2685.88 2691.22 2713.5 2734.31 2760.06 2777.35 2783.8 2784.27 2772.56 2755.76 2735.76 2725.01 2729.13 2741.71 2766.15 2820.36 2914.56 2560.81 2938.29 2825.51 2789.85 2770.72 2755.07 2750.81 2753.67 2766.09 2779.2 2800.98 2824.63 2845.4 2856.98 2868.33 2854.2 2820.08 2770.1 2724.89 2698.2 2673.85 2679.75 2676.14 2686.09 2757.01 2925.31 2661.08 2365.21 2252.3 2310.32 2239.6 2279.67 2270.93 2337.82 2494.2 2700.79 2921.45 2964.25 2861.33 2743.41 2643.8 2597.25 2584.34 2578.61 2574.77 2566 2552.67 2549.53 2542.3 2552.19 2576.4 2620.82 2697.79 2755.24 2839.31 2911.13 3045.83 2565.71 2373.66 2456.78 3031.94 3054.72 3062.45 3074.44 3075.03 3085.78 3097.91 3105.95 3101.42 3102.58 3114.81 3092.34 3019.11 2748.13 2673.75 2818.28 2811.95 2767.42 2727.88 2712.78 2713.17 2735.39 2753.1 2786.85 2809.71 2839.47 2862.5 2875.47 2885.31 2882.4 2869.56 2849.23 2837.44 2820.82 2820.14 2835.69 2867.77 2879.51 2850.4 2769.34 2675.44 2571.15 2512.26 2554.85 2958.58 2979.47 2924.4 2936.86 2979.36 3018.76 3031.74 3023.33 3006.34 2996.71 2985.8 2979.78 2970.26 2961.98 2954.25 2947.27 2934.54 2923.31 2886.89 2864.21 2831.97 2842.56 2828.81 2840.93 2868.93 2970.83 3094.37 3132.44 3107.78 2855.48 2934.81 2857.54 2857.63 2866.55 2877.8 2875.62 2874.8 2863.96 2865.79 2855.97 2845.22 2829.83 2826.81 2818.28 2809.39 2795.27 2785.36 2787.75 2800.1 2830.82 2857.02 2875.32 2873.61 2858.49 2848.47 2817.51 2826.45 2843.84 2840.76 2822.81 2523.36 2523.81 2534.58 2553.37 2571.58 2595.83 2613.38 2640.31 2648.91 2672.75 2689.1 2700.29 2720.15 2717.96 2724.91 2723.13 2729.88 2719.63 2726.4 2713.99 2717.47 2713.03 2707.62 2704.55 2704.72 2720.13 2727.57 2697.47 2689 2669.65 2818.42 2875.51 2888.87 2854.35 2813.73 2817.18 2769.8 2712.62 2672.83 2651.49 2617.51 2604.15 2574.25 2555.26 2547.97 2528.45 2524.56 2526.94 2521.87 2541.9 2550.98 2580.68 2598.78 2636.63 2670.3 2719.65 2756.68 2791.28 2807.82 2795.69 2535.15 2571.79 2605.49 2636.99 2623.85 2573.24 2564.9 2542.1 2569.63 2531.52 2439.17 2376.36 2386.57 2428.58 2478.32 2520.08 2546.72 2558.2 2555.99 2542.43 2510.81 2468.91 2421.58 2386.5 2391.74 2440.27 2562.6 2723.56 2712.44 2506.65 2349.11 2501.16 2698.72 2601.22 2541.29 2569.8 2616.61 2658.09 2675.08 2677.95 2644.16 2625.42 2595.4 2603.78 2608.24 2605.95 2593.14 2573.69 2561.21 2559.76 2601.69 2701.62 2762.4 2668.65 2584.29 2588.69 2687.06 2860.1 2752.41 2652.53 2578.06 2984.24 2628.15 2512.2 2483.45 2456.21 2412.44 2439.57 2428.15 2448.79 2466.84 2471.42 2503.59 2546.82 2566.94 2588.26 2600.32 2590.47 2567.47 2564.45 2582.62 2653.15 2752.46 2827.38 2839.34 2718.62 2591.08 2638.72 2923.05 2548.23 2721.12 3017.06 2984.43 2979.36 2962.47 2929.8 2911.96 2877.82 2834.41 2826.78 2845.66 2916.49 2908.21 2838.48 2778.14 2759.27 2776.84 2822.49 2851.39 2801.63 2726.62 2674.3 2684.63 2739.86 2808.76 2780.1 2753.94 2759.66 2802.61 2903.72 2850.65 2936.58 2929.09 3019.05 3059.13 3044.69 3026.67 3011.44 2972.27 2877 2780.7 2715.51 2690.11 2692.89 2728.54 2786.33 2827.81 2872.08 2899.1 2901.59 2877.8 2823.42 2823.04 2825.42 2843.8 2820.43 2804.04 2795.88 2818.38 2898.7 2884.81 2871.94 2795.68 2770.31 2760.99 2754.23 2764.36 2779.35 2801.74 2832.54 2872.68 2921.69 2970.19 3008.67 3030.63 3026.84 3013.96 2977.57 2899.72 2801.09 2719.4 2677.08 2666.98 2663.08 2676.36 2753.37 2900.63 2754.51 2321.88 2200.19 2255.61 2280.09 2310.19 2489.87 2801.61 2943.89 2805.81 2680.37 2600.04 2575.14 2581.57 2605.29 2622.34 2633.34 2632.06 2622.06 2609.58 2582.17 2554.33 2523.78 2520.46 2536.79 2636.15 2733.78 2833.09 2862.51 2929.13 2987.34 2467.64 2390.45 3063.18 3060.29 3020.92 3014.65 3004.95 3051.54 3071.67 3091.05 3091.23 3082.16 3108.08 3102.12 3073.11 2797.44 2807.72 2816.88 2773.28 2720.36 2696.02 2701.63 2738.33 2785.83 2826.09 2867.96 2903.29 2932.6 2964.37 2988.67 2996.17 2995.35 2977.43 2946.49 2905.84 2855.92 2827.06 2827.07 2848.56 2882.24 2877.85 2823.76 2733.71 2631.16 2515.44 2564.98 2968.7 2938.21 2908.93 2915.7 2982.73 3020.17 2992.78 2946.33 2917.78 2900.15 2894.92 2884.63 2874.17 2863.43 2861.45 2867.16 2873.49 2877.88 2864.79 2852.38 2832.26 2834.1 2827.2 2828.15 2826.75 2883.28 3017.71 3123.34 3112.41 2888.53 2873.27 2844.3 2883.39 2889.35 2886.98 2880.58 2866.11 2845.71 2828.19 2815.7 2805.64 2817.56 2821.52 2825.43 2813.37 2802.29 2792.02 2780.12 2784.76 2805.66 2839.21 2867.94 2867.88 2862.16 2850.44 2847.11 2839.37 2851.94 2856.91 2831.93 2520.53 2548.93 2580.15 2601.67 2610.74 2615.32 2619.85 2630.69 2643.81 2679.85 2698.3 2700.55 2699.45 2713.61 2715.39 2727.21 2725.9 2727.25 2729.15 2729.94 2725.41 2723.59 2716.29 2705.78 2700.24 2704.38 2722.64 2716.04 2697.13 2672.59 2837.61 2866.76 2870.07 2815.83 2804.68 2743.63 2690.2 2664.68 2646.36 2615.5 2603.02 2567.66 2546.4 2534.73 2517.86 2522.19 2538.13 2548.44 2578.25 2593.42 2618.85 2622.17 2644.61 2649.59 2673.89 2697.49 2733.07 2773.46 2802.44 2802.55 2515.16 2573.02 2617.5 2622.66 2590.31 2555.42 2534.9 2539.12 2485.82 2395.18 2403.34 2453.3 2529.62 2577.06 2589.61 2604.09 2615.73 2610.75 2600.79 2586.56 2566.72 2534.33 2491.67 2445.08 2421.89 2429.32 2514.65 2703.96 2722.19 2543.99 2393.08 2628.69 2681.38 2566.99 2545.66 2592.1 2639.01 2655.45 2652.32 2631.71 2589.66 2573.29 2547.24 2579.49 2608.51 2631.99 2634.89 2615.5 2583.6 2567.08 2593.33 2714.53 2714.24 2570.83 2519.25 2523.56 2629.34 2845.44 2772.86 2650.68 2703.61 2807.16 2551.54 2495.38 2484.91 2458 2411.41 2419.32 2416.55 2411.92 2429.53 2439.64 2466.2 2523.57 2577.56 2615.12 2649.03 2636.65 2604.52 2575.91 2585.78 2651.82 2767.01 2852.05 2869.91 2818.15 2629.89 2561.67 2777.11 2605.24 2773.49 3024.04 3002.47 3001.62 2996.34 2984.92 2978.64 2969.1 2898.65 2819.42 2808.44 2911.38 2866.52 2763.9 2726.89 2773.4 2864.46 2746.6 2615.64 2532.77 2493.36 2424.39 2411.2 2386.58 2504.3 2721.81 2807.35 2749.95 2765.52 2870.65 2964.67 2924.28 2975.58 3071.69 3066.81 3033.12 2988.09 2955.29 2981.87 2923.6 2787.41 2709.72 2687.96 2722.61 2784.77 2834.71 2870.59 2893.06 2899.63 2837.88 2721.42 2635.37 2567.23 2582.2 2629.94 2755.2 2877.13 2853.87 2837.84 2889.72 2969.99 2830.8 2784.84 2771.11 2772.4 2786.79 2796.25 2807.01 2817.16 2836.97 2875.45 2935.01 2997.88 3039.95 3056.47 3058.45 3055.9 3047.1 3030.43 2979.07 2860.05 2744.77 2680.47 2653.08 2632.26 2624.46 2711.89 2954.92 2511.41 2196.35 2264.25 2287.56 2402.97 2748.16 2929.45 2746.24 2622.99 2571.67 2576.17 2602.57 2640.52 2674.34 2689.1 2689.86 2682.21 2673.85 2662.13 2657.34 2636.91 2596.08 2537.08 2519.48 2571.37 2725.17 2937.88 2970.98 2924.09 3013.89 2724.03 2355.13 3055.46 2988.31 2927.5 2936.75 2940.87 2967.03 2992.21 3042.74 3056.93 3055.56 3094.65 3106.61 3094.43 2849.47 2820.96 2762.05 2703.74 2673.5 2675.55 2703.68 2753.65 2803.32 2848.01 2883.63 2924.41 2970.78 3010.77 3030.92 3028.66 3016.82 3011.78 2993.22 2951.62 2893.23 2841.78 2830.61 2854.21 2888.85 2891.97 2838.62 2755.41 2659.29 2550.52 2537.49 2983.83 2930.04 2900.78 2912.28 2984.72 2997.29 2925.63 2857.93 2813.2 2798.92 2792.8 2791.89 2792.44 2797.27 2805.88 2816.28 2827.05 2834.95 2832.24 2830.79 2816.21 2823.25 2808.71 2814.52 2807.25 2835.88 2941.89 3103.14 3112.88 2902.93 2844.96 2878.47 2901.65 2900.6 2893.45 2860.7 2831.2 2802.97 2774.31 2763.65 2750.85 2752.15 2761.23 2785.31 2800.5 2797.95 2788.78 2784.19 2782.21 2801.08 2831.5 2860.54 2859.77 2866.46 2854.29 2849.13 2852.43 2859.66 2859.77 2844.85 2562.08 2639.48 2684.44 2694.99 2682.36 2659.19 2627.1 2609.11 2616.04 2658.83 2693.71 2691.33 2694.61 2700.49 2720.37 2721.53 2733.59 2725.19 2735.03 2730.63 2735.6 2725.5 2719.82 2708.12 2692.24 2693.57 2701.74 2722.82 2698.34 2673.25 2847.48 2866.18 2832.49 2803.44 2747.08 2702.08 2686.21 2674.38 2647.98 2636.39 2600.99 2581.55 2567.35 2556.11 2577.34 2605.67 2641.2 2676.63 2697.95 2718.17 2712.31 2732.65 2719.23 2717.3 2705.01 2710.52 2733.78 2760.37 2791.48 2803.09 2502.21 2579.39 2620.38 2602.2 2562.05 2524.96 2524.23 2503.95 2441.28 2451.46 2505.92 2545.92 2556.2 2572.24 2586.69 2606.32 2623.82 2610.78 2582.01 2567.05 2555.44 2543.39 2524.87 2523.09 2501.51 2486.6 2535.47 2711.54 2722.83 2537.52 2436.49 2711.57 2645.08 2547.09 2560.61 2607.5 2625.36 2621.01 2596 2564.85 2538.41 2503.53 2497.42 2512.1 2555.29 2608.23 2651.91 2653.57 2612.73 2570.52 2578.27 2716.22 2667.08 2535.84 2499.68 2538.51 2666.47 2868.49 2775.73 2651.77 2804.77 2707.17 2525.24 2490.57 2480.34 2466.79 2409.53 2396.91 2374.04 2357.83 2362.41 2367.4 2409.66 2471.46 2539.82 2626.73 2664.78 2667.56 2621.78 2589.48 2611.56 2718.3 2855.03 2940.43 2947.92 2903.61 2763.85 2594.64 2661.59 2764.95 2800.53 3021.02 3012.62 3018.72 3008.15 2970.56 2960.89 2969.16 2968.92 2852.16 2777.34 2883.08 2837.35 2725.87 2712.82 2838.26 2777.11 2631.58 2563.25 2527.54 2489.54 2445.6 2373.18 2313.9 2312.17 2465.65 2803.43 2756.08 2729.94 2838.77 2968.41 2915.27 3007.77 3076.26 3069.26 3053.86 3015.93 2937.45 2938.49 2932.82 2768.6 2698.01 2689.26 2757.35 2810.12 2836.54 2854.47 2865.24 2879.43 2853.68 2737.6 2608.28 2528.87 2473.68 2490.08 2558.34 2715.07 2904.13 2869.42 2898.77 2947.53 2810.35 2788.25 2792.8 2809.24 2830.84 2839.66 2832.59 2826.64 2828.75 2857.1 2917.88 2986.06 3025.92 3048.84 3058.27 2958.97 2914.17 2959.69 3027.31 2986.3 2857.17 2747.03 2682.49 2636.38 2590.47 2609.51 2794.96 2790.78 2188.07 2276.29 2311.14 2548.1 2976.33 2770.61 2622.4 2568.89 2575.47 2606.24 2652.31 2690.62 2712.36 2722.26 2724.79 2712.54 2688.95 2673.8 2663.13 2661.8 2651.73 2611.96 2527.13 2526.36 2680.34 2942.85 3017.09 2965.08 2960.06 2901.35 2344.22 3038.18 2934 2904.15 2930.31 2937.87 2946.95 2943.31 2977.25 2997.78 3022.72 3071.99 3107.31 3095.21 2913.87 2790.11 2716.62 2662 2652.67 2674.31 2708.95 2749.52 2780.99 2803.84 2828.13 2865.42 2928.61 3001.26 3026.92 3028.42 3021.33 2994.59 2970.31 2930.35 2880.29 2839.56 2826.87 2848.78 2888.23 2897.41 2857.11 2783.54 2699.01 2573.2 2554.33 2992.11 2899.64 2883.61 2892.59 2976.24 2973.34 2870.85 2786.38 2750.39 2738.24 2745.24 2759.21 2771.44 2779.77 2783.69 2786.7 2787.2 2788.88 2789.2 2787.55 2783.77 2776.79 2783.06 2782.63 2785.69 2802.18 2889.36 3074.07 3105.89 2902.09 2860.03 2899.37 2909.81 2909.25 2879.62 2842.58 2806.14 2776.56 2741.41 2726.72 2709.63 2716.13 2737.97 2759.5 2786.84 2785.55 2783.65 2779.6 2788.6 2807.04 2831.24 2856.94 2852.79 2858.72 2855.36 2848.64 2854.59 2858.33 2858.76 2848.88 2653.94 2724.96 2714.94 2710.49 2714.41 2716.55 2664.43 2601.75 2589.32 2636.14 2692.09 2683.05 2696.32 2704.97 2710.35 2729.69 2716.74 2737.37 2724.52 2734.82 2726.82 2727.54 2715.58 2708.1 2688.22 2682.68 2696.42 2716.27 2695.98 2664.77 2843.97 2838.17 2808.77 2770.14 2729.22 2716.77 2703.63 2680.05 2674.04 2639.78 2621.46 2589.89 2587.71 2608.2 2646.6 2690.45 2730.09 2741.15 2753.99 2738.44 2750.9 2728.15 2737.44 2743.18 2736.7 2735.1 2737.52 2756.67 2783.46 2801.12 2493.39 2585.05 2611.25 2587.21 2537.9 2508.36 2505.49 2505.72 2492.39 2520.1 2515.1 2527.52 2534.71 2544.68 2557.36 2584.85 2623.99 2618.21 2561.43 2547.78 2559.64 2572.63 2611.09 2639.93 2636.05 2586.73 2603.36 2729.23 2736.76 2508.33 2468.52 2722.08 2608.03 2546.86 2565.97 2607.29 2597.54 2573.23 2553.94 2544.76 2508.66 2503.16 2480.07 2482.29 2502.93 2557.19 2635.04 2679.34 2649.24 2578.36 2562.45 2710.48 2646.39 2521.48 2563.07 2667.5 2823.51 2867 2759.67 2651.42 2859.51 2648.33 2503.21 2481.93 2475.73 2458.72 2413.91 2379.55 2334.23 2319.86 2323.08 2325.02 2378.89 2428.11 2514.17 2622.73 2695.25 2697.22 2635.26 2611.94 2666.72 2840.9 2942.87 2753.86 2677.71 2717.08 2917.58 2722.52 2635.48 2930.83 2796.8 3008.04 3006.5 3021.05 2999.02 2975.55 2956.02 2936.56 2955.41 2900.81 2761.08 2824.67 2824.61 2689.01 2709.93 2866.42 2797.74 2685.07 2637.92 2631.76 2627.38 2592.21 2447.9 2295.61 2251.21 2329.9 2679.22 2747.75 2698.71 2816.83 2959.37 2906.39 3022.53 3073.17 3060.2 3040.19 3027.1 2948.37 2920 2907.19 2740.64 2687.07 2708.97 2779.61 2809.71 2822.9 2835.21 2848.02 2855.03 2853.68 2766.2 2670.99 2556.87 2488.58 2478 2490.13 2593.28 2799.26 2908.3 2894.02 2925.58 2809.02 2789.56 2820.3 2872.23 2904 2905.67 2887.33 2861.14 2842.31 2844.73 2884.62 2956.49 3000.64 3029.82 3040.6 2837.58 2771.18 2837.54 2947.43 3032.47 2937.61 2810.07 2712.38 2644.45 2584.06 2556.6 2700.9 3005.47 2257.51 2280.76 2360.13 2756.04 2865.88 2664.01 2575.91 2568.69 2594.78 2652.87 2707.96 2751.47 2794.06 2838.22 2852.41 2821.12 2767.43 2694.94 2648.81 2639.93 2654.38 2649.45 2578.57 2504.63 2638.41 2938.62 3029.56 2997.45 2951.23 2891.58 2347.61 3022.4 2909.95 2911.72 2954.19 2969.41 2967.6 2952.28 2955.21 2990.06 3022.86 3085.54 3098.8 3077.73 2991.33 2771.43 2711.2 2654.55 2659.4 2696.92 2739.82 2768.89 2778.65 2776.31 2776.03 2784.85 2841.76 2944.15 3022.49 3020.18 3007.92 2963.98 2902.91 2875.78 2843.83 2824.78 2833.84 2857.92 2897.31 2905 2863.53 2793.58 2716.37 2590.5 2536.01 2995.78 2872.27 2879.57 2892.64 2962.04 2966.81 2861.21 2774.03 2740.53 2731.69 2748.9 2773.48 2793.12 2811.22 2821.92 2822.12 2815.03 2789.7 2770.29 2765.88 2753.73 2750.18 2752.73 2760 2764.78 2780.68 2850.98 3055.15 3098.46 2897.69 2849.88 2890.45 2905.61 2904.56 2875.6 2845.37 2818.66 2770.29 2738.94 2720.43 2708.84 2723.93 2734.35 2756.88 2772.94 2776.47 2775.52 2780 2794.88 2815.52 2842.8 2841.17 2841.89 2851.17 2852.35 2847.95 2853.49 2856.58 2851.38 2843.99 2728.3 2704.05 2677.75 2679.98 2690.94 2719.13 2692.49 2602.89 2560.26 2620.27 2685.34 2681.36 2692.68 2705.14 2706.29 2720.78 2705.88 2720.85 2723.96 2720 2722.77 2716.15 2713.44 2693.48 2672.56 2663 2674.97 2703.08 2684.92 2666.25 2825.5 2831.82 2803.15 2754.31 2749.08 2740.71 2718.85 2712.72 2683.57 2663.65 2622.19 2610.65 2606.28 2645.34 2686.2 2740.11 2748.65 2752 2722.14 2722.6 2693.46 2712.37 2723.66 2737.8 2753.67 2745.49 2743.71 2754.32 2778.17 2792.52 2491.58 2590.7 2601.6 2565.06 2518.76 2493.91 2503.14 2513.09 2498.37 2501.8 2496.99 2503.1 2513.28 2522.6 2533.95 2560.33 2600.56 2640.93 2542.3 2537.48 2591.98 2658.63 2687.04 2712.17 2735.83 2705.05 2688.97 2756.28 2731.96 2449.86 2530.83 2678.67 2576.38 2540.37 2566.82 2592.65 2576.4 2550.02 2543.74 2524.82 2519.08 2512.81 2491.08 2483.56 2484.53 2517.29 2600.95 2692.73 2684.97 2594.79 2546.24 2696.23 2648.89 2566.31 2695.3 2853.98 2861.85 2810.73 2737.16 2664.97 2867.22 2612.87 2478.55 2464.9 2466.16 2451.41 2416.85 2381.04 2317.68 2317.47 2317.96 2319.36 2365.21 2406.4 2505.24 2630.42 2730.84 2728.89 2653.71 2637.21 2755.09 2947.1 2669.23 2525.85 2478.23 2468.26 2528.6 2906.87 2663.34 2882.95 2780.75 2980.89 2992.06 3013.18 3001.52 2972.32 2934.55 2927.27 2921.9 2939.99 2743.02 2777.53 2822.31 2653.56 2686.07 2855.4 2864.07 2743.31 2691.38 2751.57 2820.58 2794.78 2596.57 2337.79 2238.63 2307.89 2663.26 2730.61 2656.55 2773.42 2941.96 2895.28 3023.07 3067.92 3054.43 3033.13 3034.46 2951.81 2933.86 2868.72 2713.86 2678.34 2729.12 2790.4 2805.47 2839.56 2867.05 2872.9 2868.87 2809.39 2741.75 2655.64 2595.66 2542.73 2513.59 2517.41 2571.51 2734.4 2931.21 2924.02 2908.66 2794.84 2815.43 2882.29 2951.29 2980.49 2988.4 2973.44 2931.9 2872.37 2839.23 2864.11 2945.27 2988.68 2989.57 3035.3 2846.21 2727.98 2763.11 2876.53 3009.95 2978.9 2855.58 2743.37 2665.75 2590.38 2539.86 2626.1 2946.8 2354.46 2291.53 2437.96 2976.16 2762.35 2604.85 2565.8 2580.58 2637.48 2703.14 2768.77 2850.42 2945.47 3001.91 3001.9 2965.94 2882.72 2783.83 2688.13 2640.68 2632.34 2653.18 2618.54 2520.24 2590.6 2898.71 3022.01 3023.41 2990.22 2787.41 2335.85 3007.52 2893.49 2927.14 2982.27 3016.31 3039.38 3040.96 3067.52 3085.81 3099 3104.13 3085.84 3070.06 3028.29 2867.17 2766.55 2678.98 2685.93 2745.06 2804.97 2835.92 2831.47 2805.01 2762.08 2735.99 2754.77 2855.91 2982.32 3023.9 2999.65 2958.65 2881.39 2847.14 2828.07 2827.53 2843.15 2873.21 2911.92 2913.13 2873.2 2811.27 2746.19 2612.68 2538.72 2975.57 2783.92 2856.94 2891.2 2940.79 2963.45 2891.11 2827.34 2799.37 2810.6 2851.58 2898.78 2916.14 2921.01 2927.88 2931.73 2932.13 2924.89 2918.83 2895.43 2851.38 2801.07 2775.41 2762.05 2758.04 2763.1 2834.44 3047.79 3084.15 2890.09 2861.5 2891.41 2897.8 2897.5 2872.62 2848.65 2838.53 2801.32 2747.49 2711.54 2712.99 2725.86 2752.7 2762.26 2767.69 2769.31 2776.93 2791.84 2813.96 2822.43 2822.52 2825.29 2839.78 2855.41 2851.99 2853.22 2852.93 2817.28 2812.99 2828.96 2716.43 2688.42 2658.76 2673.13 2689.32 2718.89 2706.68 2580.17 2534.28 2592.48 2683.75 2674.63 2686.89 2688.2 2695.18 2700.41 2693.47 2707.88 2697.35 2713.86 2701.52 2706.98 2688.34 2672.08 2653.92 2663.09 2679 2703.01 2671.41 2656.92 2798.68 2798.27 2767.89 2763.58 2775.17 2760.63 2756.64 2736.61 2717.46 2673.42 2647.16 2610.4 2622.83 2662.81 2718.81 2750.64 2745.94 2727.53 2712.91 2677.97 2688.16 2684.4 2699.27 2730.95 2750.83 2748.02 2749.42 2757.56 2777.08 2789.3 2499.66 2596.92 2590.41 2555.38 2503.86 2497.13 2499.63 2509.17 2491.68 2501.12 2497.33 2515.52 2519.72 2536.01 2550.65 2558.28 2577.71 2642.5 2521.2 2517.03 2615.49 2674.76 2682.52 2696.05 2732.93 2754.83 2773.43 2763.52 2733.27 2350.18 2548.84 2668.74 2575.25 2545.28 2571.73 2587.34 2560.19 2543.33 2523.33 2528.93 2514.36 2518.05 2500.08 2497.61 2488.94 2500.78 2576.44 2690.76 2702.99 2611.86 2524.98 2684.4 2659.88 2617.96 2845.04 2802.11 2762.23 2740 2721.75 2662.57 2813.59 2609.07 2463.23 2448.49 2450 2444.32 2414.94 2378.08 2339.43 2326.64 2333.65 2331.48 2363.2 2406.11 2500.91 2659.23 2772.36 2762.23 2674.65 2669.11 2857.86 2783.76 2540.66 2466.09 2450.63 2446.91 2436.1 2604.43 2740.14 2858.01 2746.8 2952.77 2965.49 2998.57 2999.73 2995.18 2954.61 2908.64 2900.12 2950.41 2718.94 2721.33 2823.99 2625.46 2656.81 2831.51 2906.01 2760.42 2738.78 2877.92 2934.1 2917.36 2808.5 2555.1 2403.27 2543.8 2785.94 2678.29 2679.55 2791.51 2880.89 2865.31 3004.31 3065.18 3052.41 3023.55 3013.48 2948.25 2964.69 2816.77 2692.67 2677.76 2744.6 2798.68 2832.34 2889.75 2906.25 2809.87 2732.23 2674.04 2606.82 2600.14 2586.82 2568.68 2579.86 2564.11 2589.92 2701.93 2945.33 2932.18 2887.03 2804 2852.22 2939.5 3006.08 3043.03 3062.51 3038.73 2987.64 2915.65 2844.83 2834.33 2906.16 2953.18 2936.63 2967.06 3013.22 2774.13 2745.62 2866.52 3006.39 2983.47 2872.22 2762.65 2666.35 2580.15 2542.04 2604.31 2936.78 2446.64 2304.32 2549.48 2947.79 2686.32 2582.47 2575 2610.1 2673.65 2744.03 2841.59 2973.45 3078.6 3105.7 3092.2 3051.69 2982.07 2870.2 2738.69 2643.09 2627.98 2635.96 2629.96 2544.66 2544.29 2875.27 3021.52 3005.95 2945.06 2736.28 2697.46 3001.14 2887.04 2932.8 3002.29 3067.65 3091.84 3089.02 3087.93 3093.41 3092.63 3093.25 3069.84 3042.58 3033.26 3001.26 3006.61 2965.94 2811.67 2715.46 2730.98 2795 2864.51 2894.74 2894.32 2855.19 2785.53 2715.93 2687.94 2751.73 2894.95 2997.78 3008.91 2978.15 2931.82 2882.01 2862.78 2863.35 2883.41 2915.2 2938.87 2926.56 2883.2 2826.92 2753.87 2590.91 2507.04 2540.54 2692.5 2808.21 2626.94 2824.95 2887.17 2921.31 2964.55 2931.43 2900.05 2900.46 2898.08 2890.15 2880.2 2888.9 2908.11 2935.16 2950.02 2956.04 2953.35 2925.18 2916.1 2911.25 2904.58 2847.2 2795.14 2766.09 2763.69 2853.26 3069.64 3024.41 2922.62 2818.16 2820.89 2840.22 2862.25 2873.62 2881.15 2869.79 2844.33 2846.49 2837.9 2770.78 2722.07 2702.58 2716.96 2734.22 2757.83 2765.48 2778.57 2783.51 2789.09 2792.9 2799.46 2808.74 2829.09 2847.75 2854.09 2844.27 2790.54 2705.98 2676.07 2726.53 2791.95 2674.43 2674.69 2756.72 2684.22 2674.98 2684.71 2706.29 2731.56 2677.27 2559.29 2506.49 2569.41 2659.95 2672.61 2665.6 2668.98 2667.73 2667.12 2669.2 2679.87 2677.03 2678.54 2680.38 2660.78 2651.7 2635.47 2645.2 2652.71 2677.66 2674.88 2660 2652.79 2679.07 2739.75 2786 2779.97 2769.89 2791.74 2789.73 2793.19 2774.02 2765.58 2738.11 2706.62 2657.49 2625.04 2625.76 2671.91 2727.02 2749.43 2749.45 2717.11 2705.32 2679.17 2684.24 2692.15 2712.6 2727.46 2752.14 2746.52 2752.77 2768.06 2781.77 2784.01 2611.81 2512.5 2508.38 2605.64 2584.13 2539.16 2499.89 2500.92 2515.17 2517.64 2524.33 2528.08 2548.62 2559.32 2575.91 2586.15 2592.02 2586.73 2582.11 2629.43 2516.19 2473.26 2590.13 2685.41 2681.65 2683.88 2707.59 2753.04 2756.55 2749.89 2591.16 2320.83 2412.39 2496.96 2631.42 2642.63 2560.52 2541.76 2565.91 2578.29 2560.07 2543.9 2524.84 2525.28 2508.08 2513.57 2506.48 2507.6 2494.63 2499.27 2570.39 2685.05 2709.09 2617.62 2508.85 2670.66 2672.56 2689.99 2830.72 2721.29 2702.39 2708.72 2703.32 2731.5 2860.2 2609.8 2877.34 2562.29 2430.39 2425.65 2433.06 2435.99 2406.37 2390.48 2359.86 2363.25 2354.84 2354.23 2371.16 2411.45 2525.1 2701.93 2819.88 2791.12 2685.63 2699.85 2933.38 2675.04 2504.9 2471.97 2513.57 2527.35 2499.72 2502.78 2868.94 2830.78 2877.24 2657.14 2763.8 2915.06 2944.99 2983.92 2995.95 2975.75 2946.59 2899.98 2894.82 2951.92 2683.92 2691.53 2828.81 2592.76 2617.43 2807.16 2930.14 2772.56 2761.55 2931.67 2949.31 2929.17 2905.75 2867.21 2833.87 2804.88 2733.46 2672.94 2689.89 2771.25 2766.87 2857.26 2870.79 2876.28 3014.8 3069.91 3056.44 3014.57 3006.47 2932.64 2964.33 2776.75 2679.1 2676.84 2754.02 2820.02 2881.51 2909.8 2785.07 2670.08 2629.33 2571.39 2580.97 2564.03 2561.51 2592.16 2610.44 2616.99 2618.45 2724.19 2943.58 2964.06 3011.21 3048.18 2882.77 2808.45 2877.81 2981.56 3072.24 3097.37 3083.65 3058.44 3033.42 2972.35 2887.23 2831.51 2885.81 2967.79 2933.28 2874.53 2929.48 3018.54 2931.17 2960.68 3010.23 2930.07 2816.39 2705.65 2613.64 2574.52 2577.32 2651.51 2865.14 2877.17 2610.53 2347.91 2358.02 2748.63 2847.73 2637.5 2584.53 2586.38 2637.46 2709.87 2793.05 2918.8 3042.64 3103.1 3100.04 3084.91 3053.98 3009.44 2909.39 2775.83 2663.04 2618.01 2633.57 2620.01 2558.26 2510.21 2763.43 3003.23 2979.02 2985.28 2911.14 2627.47 2538.41 2530.47 3002.78 2873.87 2922.31 3003.85 3075.85 3090.85 3067.83 3074 3085.64 3059.19 3023.38 3071.61 3075.07 3065.94 3037.55 3042.26 3003.18 2828.14 2777.56 2799.68 2837.64 2886.58 2915.24 2919.05 2887.25 2818.15 2721.69 2650.9 2655.32 2771.07 2911.17 2994.15 2992.18 2979.11 2955.55 2934.9 2933.54 2946.7 2958.46 2953.26 2927.98 2875.34 2820.88 2761.92 2628.22 2530 2479.08 2445.82 2485.59 2507.99 2753 2890.82 2902.05 2950.89 2937.68 2902.95 2886.05 2863.65 2849.4 2842.81 2848.67 2867.26 2900.42 2941.18 2962.41 2965.4 2927.12 2887.34 2891.02 2902.87 2904 2836.67 2782.87 2779.94 2945.62 3043.48 2915.44 2825.2 2820.27 2834.12 2843.38 2846.72 2845.27 2856.05 2850.57 2847.3 2845.69 2845.63 2824.93 2742.58 2699.96 2691.79 2705.88 2718.5 2734.34 2751.37 2748.98 2763.9 2779.01 2799.8 2820.74 2834.5 2826.28 2778.08 2672 2587.39 2567.64 2604.23 2661.97 2730.46 2792.15 2805.98 2702.41 2683.18 2689.43 2709.93 2730.46 2737.61 2640.82 2522.55 2495.21 2517.33 2607.07 2660.54 2653.85 2635.53 2637.51 2636.79 2627.83 2637.47 2633.59 2631.86 2625.08 2628.39 2621.01 2638.19 2648.53 2676.75 2669.11 2644.21 2656.54 2668.36 2716.62 2769.71 2761.12 2754.27 2766.53 2789.18 2812.01 2796.24 2789.76 2770.12 2757.18 2722.96 2679.71 2636.26 2630.9 2669.87 2727.1 2761.13 2744.83 2733.79 2706.07 2701.61 2697.82 2714.67 2720.61 2737.35 2743.59 2755.75 2770.41 2784.21 2786.01 2740.88 2557.82 2530.9 2541.47 2613.78 2589.31 2545.86 2517.7 2534.83 2549.88 2567.04 2572.94 2586.17 2613.21 2612.22 2639.47 2640.07 2642.51 2630.78 2604.24 2619.23 2568.79 2419.73 2479.58 2603.43 2693.07 2724.21 2741.91 2746.87 2756.54 2706.84 2391.96 2342.9 2493.62 2650.08 2722.07 2625.04 2568.8 2556.17 2580.75 2598.09 2575.31 2550.14 2543.1 2523.93 2516.27 2520.94 2523.26 2510.91 2497.6 2511.08 2585.17 2701.85 2680.05 2618.11 2493.72 2655.42 2688.39 2754.51 2777.32 2672.43 2667.51 2694.49 2701.49 2724.23 2869.11 2710.04 2835.14 2694.31 2452.12 2419.19 2422.55 2427.63 2411.02 2399.37 2369.14 2375.76 2382.38 2362.98 2369.75 2427.45 2582.6 2766.07 2872.02 2803.66 2691.12 2736.18 2965.42 2623.22 2491.05 2498.52 2573.89 2622.07 2592.45 2545.68 2653.28 2905.46 2732.27 2658.68 2823.23 2904.75 2923.22 2975.27 2977.18 2981.91 2946.49 2891.51 2896.95 2943.17 2638.65 2680.69 2829.94 2567.95 2581.77 2774.89 2940.86 2776.86 2728.68 2880.06 2965.36 2945.27 2932.75 2897.98 2866.9 2828.44 2814.22 2807.22 2830.07 2890.77 2780.12 2938.97 2881.9 2892.04 3019.41 3072.69 3051.09 2990.38 3008.27 2929.65 2921.29 2743.48 2659.45 2679.54 2754.21 2842.11 2936.93 2806.47 2690.05 2633.59 2572.62 2554.96 2551.8 2543.59 2576.46 2604.39 2637.64 2635.37 2677.51 2799.78 2976.61 2998.01 3015.29 3050.74 2882.94 2829.97 2911.32 3032.2 3095.35 3093.27 3091.36 3085.95 3047.66 2998.89 2926.04 2832.5 2839.12 2965.72 2948.35 2831.48 2809.17 2850.96 2895.8 2891.71 2845.5 2764.84 2692.55 2666.01 2701.31 2817.71 2959.11 2908.38 2712.58 2549.63 2377.46 2341.69 2493.65 3013.28 2756.34 2617.86 2591.71 2609.84 2659.46 2733.28 2827.24 2942.94 3064.46 3118.18 3105.23 3080.56 3047.88 3005.78 2915.64 2784.62 2668.44 2622.29 2627.68 2610.21 2552.04 2490.95 2624.47 2935.35 2969.86 2802.66 2666.34 2569.13 2540.36 2521.47 3001.51 2863.26 2903.53 2980.69 3074.88 3084.78 3057.66 3052.74 3080.11 3073.3 2986.72 2938.76 3014.86 3066.77 3064.61 3042.37 2925.31 2836.16 2866.46 2882.79 2880.86 2897.12 2913.16 2921.57 2906.51 2853.02 2757.91 2654.54 2595.55 2640.47 2758.7 2894.25 2967.96 2982.36 2983.54 2976.55 2971.05 2965.89 2952.62 2922.6 2863.69 2798.81 2740.3 2695.77 2614.93 2551.24 2494.62 2445.05 2420.92 2485.14 2760.99 2891.39 2894.91 2928.48 2941.84 2897.81 2858.35 2832.54 2816 2803.57 2804.98 2818.63 2847.48 2898.51 2953.1 2969.3 2954.77 2901.29 2885.66 2905 2910.57 2858.44 2800.58 2862.26 3025.07 2982.52 2842.24 2807.2 2817 2828.74 2836.02 2830.87 2836.43 2842.46 2855.08 2843.71 2835.74 2838.21 2845.49 2805.23 2725.52 2693.51 2692.43 2703.12 2714.04 2732.93 2739.99 2774.72 2798.06 2813.26 2816.53 2795.17 2717.16 2617.63 2564.99 2559.62 2594.02 2650.25 2729.66 2837.43 2772.1 2738.88 2697.79 2703.09 2703.44 2732.04 2758.2 2735.61 2607.33 2526.8 2477.83 2481.57 2517.71 2574.02 2600.52 2614.9 2611.09 2598.27 2604.34 2590.89 2606.51 2608.62 2611.02 2629.76 2632.11 2636.21 2639.94 2627.66 2624.11 2644.14 2676.67 2725.62 2763.51 2753.47 2753.71 2756.28 2779.85 2812.47 2802.56 2803.23 2792.77 2778.78 2751.72 2738.83 2696.06 2654.16 2634.68 2660.17 2722.94 2754.2 2759.12 2736.51 2729.05 2718.96 2723.42 2723.23 2739.86 2742.66 2759.69 2770.94 2776.34 2765.66 2721.69 2622.42 2553.28 2560.14 2582.55 2616.38 2581.64 2549.19 2540.29 2557.39 2576.25 2599.19 2611.83 2623.53 2623.05 2645.28 2646.26 2659.46 2676.29 2674.82 2636.29 2616.85 2647.8 2411.67 2379.42 2416.17 2445.93 2498.48 2566.49 2680.85 2680.95 2530.3 2312.56 2336.77 2497.5 2700.71 2730.89 2640.47 2568.49 2550.38 2563.09 2598.43 2598.46 2579.3 2557.71 2555.45 2530.69 2545 2529.31 2513.79 2494.54 2522.48 2605.47 2691.46 2630.49 2596.69 2455.79 2618.94 2717.25 2752.76 2767.09 2667.49 2637.05 2681.28 2688.55 2708.86 2862.29 2676.13 2649.01 2922.7 2628.12 2442.14 2425.66 2417.21 2411.44 2407.38 2399 2393.78 2382.37 2392.76 2398.12 2480.39 2670.23 2856.17 2909.53 2788.99 2674.57 2757.75 2950.71 2625.17 2497.93 2507.04 2598.95 2701.58 2696.76 2623.8 2597.55 2691.55 2610.34 2685.85 2875.12 2904.2 2922.5 2965.15 2974.36 2964.53 2916.82 2891.83 2913.58 2875.82 2594.46 2697.84 2829.88 2542.93 2536.18 2725.06 2931.65 2798.75 2666.62 2704.24 2834.17 2898.64 2891.48 2866.63 2825.31 2781.62 2756.79 2715.01 2671.09 2692.19 2780.14 2953.35 2895.37 2935.21 3037.91 3061 3019.22 2955.63 3002.93 2957.08 2859.5 2725.86 2644.37 2671.19 2758.32 2853.27 2964.67 2792.85 2665.84 2644.13 2610.89 2564.22 2572.81 2574.28 2591.31 2620.55 2646.59 2696.67 2780.09 2919.95 2998.34 3029.37 3046.93 3011.48 2872.65 2838.58 2948.1 3061.11 3100.82 3107.73 3101.89 3088.36 3052.73 3012.76 2957.55 2852.76 2804.48 2963.75 2975.46 2893.72 2782.6 2752.38 2748.3 2731.03 2719.04 2720.87 2783.29 2923.27 2873.14 2594.25 2473.14 2427.63 2409.97 2400.18 2413.72 2524.12 2891.98 2881.73 2688.9 2615.6 2599.51 2628.98 2685.11 2743.98 2826.12 2934.62 3025.62 3085.77 3095.07 3058.5 3017.32 2975.05 2885.89 2765.08 2663.25 2624.54 2628.62 2594.65 2533.52 2481.54 2516.33 2775.87 2932.41 2780.32 2624.81 2589.32 2583.57 2524.97 3013.01 2853.95 2876.95 2925.12 3035.5 3087.11 3060.09 3047.75 3054.45 3083.01 3041.25 2952.39 2918.94 2977.55 2999.07 2946.57 2885.44 2925.8 2948.12 2946.74 2934.63 2917.81 2911.28 2918.92 2911.11 2881.55 2814.32 2704.28 2598.26 2556.58 2602.8 2702.26 2812.52 2884.8 2912.1 2918.36 2908.1 2883.92 2833.18 2768.71 2700.56 2653.88 2621.16 2598.42 2570.6 2533.98 2495.81 2465.29 2457.83 2560.32 2819.82 2890.7 2892.82 2905.01 2939.2 2909.86 2852.37 2815.09 2798.72 2790.87 2792.7 2803.13 2814.4 2846.53 2917.08 2968.75 2979.15 2961.13 2926.48 2921.18 2917.42 2879.09 2894.21 2987.05 3010.59 2915.22 2804.76 2789.2 2810.68 2806.28 2805.13 2790.36 2801.11 2820.87 2843.27 2837.17 2833.74 2834.2 2834.53 2843.66 2804.26 2744.35 2719.46 2721.74 2734.33 2752.91 2766.85 2798.25 2809.74 2801.84 2773.57 2698.76 2617.45 2585.31 2595.87 2656.45 2753.68 2840.79 2840.09 2798.07 2745.15 2726.44 2709.32 2707.07 2713.52 2742.38 2766.87 2724.16 2610.12 2518.74 2485.85 2468.43 2465.66 2483.11 2476.74 2492.85 2506.31 2506.92 2526.78 2519.4 2530.46 2552.21 2541.04 2568.86 2565.29 2585.96 2590.68 2613.41 2638.26 2681.71 2735.41 2752.82 2742.79 2748.1 2736.56 2748.94 2779.27 2804.3 2830.42 2829.07 2823.78 2789.1 2752.14 2731.7 2713.96 2672.68 2633.78 2648.73 2696.43 2749.22 2762.51 2759.6 2748.41 2743.57 2739.97 2747.58 2746.28 2755.03 2760.41 2749.26 2727.68 2683.13 2621.81 2580.11 2588.56 2608.4 2630.56 2640.97 2609.98 2578.63 2579.98 2603.5 2613.37 2622.01 2623.87 2621.35 2623.76 2614.51 2622.83 2646.41 2668.01 2686.9 2685.63 2636.57 2656.45 2482.25 2345.18 2307.99 2254.55 2234.25 2254.13 2331.04 2385.02 2368.16 2303.05 2355.71 2499 2642.09 2774.59 2691.11 2607.15 2575.25 2582.55 2598.34 2609.36 2602.45 2587.21 2573 2567.46 2542.6 2526.27 2502.43 2505.19 2557.81 2653.24 2681.31 2571.6 2563.58 2432.25 2617.02 2705.89 2739.1 2797.64 2708.22 2675.63 2724.23 2742.12 2779.3 2766.96 2573.39 2539.41 2610.46 2923.11 2584.5 2445.54 2417.29 2410.15 2400.42 2388.05 2397.5 2394.04 2384.06 2442.64 2582.27 2789.41 2938.06 2929.46 2759.47 2660.01 2809.29 2944.04 2691.7 2550.94 2510.18 2573.78 2726.67 2811.13 2761.74 2680.13 2655.06 2669.94 2793.73 2909.57 2913.5 2925.99 2953.57 2956.92 2933.82 2887.01 2885.12 2947.86 2733.34 2571.83 2759.23 2831.9 2528.16 2491.67 2655.05 2858.4 2886.92 2651.08 2558 2532.08 2525.12 2507.73 2492.95 2496.46 2527.87 2568.7 2631.66 2696.75 2789.78 2937.88 2938.16 2924.71 2974.54 3036.22 3030.74 2972.2 2996.43 2971.46 2960.12 2796.31 2699.88 2624.63 2643.39 2746.25 2860.73 2975.76 2825.27 2704.03 2672.57 2666.81 2625.38 2625.85 2622.43 2652.14 2684.44 2746.49 2824.92 2916.8 2990.72 3029.23 3044.33 3035.69 2963.5 2885.22 2876.35 2968.02 3055.79 3106.04 3109.66 3095.02 3077.76 3031.18 2998.73 2964.67 2884.59 2779.35 2930.55 2883.68 2979.82 2874.9 2780.42 2745.87 2744.76 2801.08 2921.89 2896.6 2626.36 2522.36 2507.36 2512.89 2521.01 2547.6 2623.16 2762.79 2996.89 2920.11 2752.01 2653.93 2626.34 2619.5 2642.72 2696.45 2753.21 2807.21 2886.02 2961.13 3000.98 2996.57 2994.51 2974.63 2930.62 2840.75 2734.9 2649.68 2632.05 2628.57 2571.35 2507.44 2482.14 2481.63 2626.23 2864.5 2858.94 2743.34 2699.38 2611.13 2521.73 3027.5 2845.89 2845.55 2869.04 2916.98 3033.2 3082 3065.42 3065.97 3077.3 3043.34 2980.07 2971.79 2956.14 2950.25 2954.34 2975.18 2987.72 2995.15 2998.26 2988.43 2957.81 2943.66 2931.94 2917.23 2899.27 2864.56 2788.12 2670.45 2561.39 2522.86 2540.85 2584.77 2639.76 2675.91 2688.43 2678.2 2653.17 2633.82 2625.43 2632.79 2655.45 2677.92 2695.84 2726.96 2662.65 2599.08 2573.38 2597.48 2743.04 2881.83 2888.26 2880.42 2896.78 2918.04 2921.86 2876.08 2826.55 2801.94 2793 2793.12 2807.36 2816.62 2818.96 2859.2 2941.6 2983.12 3000.74 2996.3 2984.14 2979.46 2984.26 3009.68 3024.53 2974.58 2909.46 2809.86 2778.01 2777.82 2778.47 2771.91 2756.8 2775.77 2806.75 2835.17 2840.4 2833.15 2829.22 2830.33 2832 2839.11 2827.47 2794.16 2775.5 2780.96 2784.15 2796.91 2814.34 2805.88 2787.58 2740.68 2684.97 2654.29 2661.32 2707.56 2784.02 2864.77 2854.72 2816.04 2780.41 2751.28 2737.59 2721.99 2717.29 2716.28 2738.71 2767.39 2766.97 2657.58 2584.65 2526.55 2507.76 2490.91 2487.69 2461.02 2462.5 2466.78 2468.02 2493.24 2505.34 2522.26 2562.59 2560.23 2600.48 2607.76 2635.91 2650.67 2678.29 2708.12 2742.4 2745.59 2738.9 2727.84 2733.23 2744.69 2761.5 2786.45 2820.99 2824.19 2829.59 2821.24 2786.95 2739.76 2724.22 2725.14 2685.57 2645.45 2632.59 2664.09 2713.95 2758.12 2760.34 2762.77 2760.85 2763.4 2760.3 2763.14 2756.93 2735.11 2702.45 2658.7 2609.74 2580.99 2584.13 2620.21 2651.14 2657.1 2648.49 2638.59 2620.87 2609.78 2613.24 2626.18 2631.25 2625.13 2620.65 2606.62 2607.17 2625.6 2632.64 2652.75 2694.78 2703.71 2675.03 2645.34 2664.7 2410.33 2315.42 2245.74 2200.55 2189.39 2218.32 2271.21 2310.73 2332.13 2422.47 2513.45 2591.97 2740.46 2778.45 2677.38 2611.35 2584.48 2590.61 2595.97 2598.6 2589.79 2573.55 2550.36 2532.65 2505.84 2504.39 2537.25 2611.91 2677.06 2591.63 2534.76 2519.4 2406.01 2558.42 2713.25 2723.07 2833.82 2761.18 2779.76 2837.64 2877.28 2890.04 2821.43 2654.63 2545.78 2634.9 2866.45 2766.98 2552.6 2469.94 2437.19 2414.05 2403.08 2395.48 2422.76 2472.47 2579.49 2767.43 2932.07 2966.65 2906.13 2677.75 2630.76 2767.81 2914.85 2882.92 2708.18 2542.93 2519.1 2656.67 2841.71 2887.18 2894.39 2867.44 2886.05 2918.77 2917.7 2911.19 2918.13 2925.63 2916.16 2883.95 2869.16 2913.91 2840.83 2599.24 2576.24 2867.84 2836.77 2535.57 2448.07 2563.36 2751.29 2927.41 2790.16 2576.65 2473.81 2431.44 2435.09 2480.01 2598.19 2760.63 2864.27 2913.83 2924.04 2938.01 2920.23 2922.09 2938.26 2972.73 2997.09 2979.93 2978.07 3009.83 2975.32 2849.24 2735.1 2665.55 2591.33 2602.75 2704.64 2839.46 2975.43 2884.89 2760.7 2725.5 2721.9 2701.9 2706.66 2745.91 2772.16 2817.67 2878.46 2932.44 2977.98 3004.97 3019.86 3039.23 2995.61 2939.18 2890.96 2897.94 2969.17 3040.14 3082.01 3091.06 3081.83 3050.11 3014.97 2984.51 2958.12 2900.89 2774.85 2871.71 2882.68 2813.03 2961.46 2954.91 2929.43 2950.57 2934.06 2707.83 2559.8 2533.32 2598.09 2742.39 2849.45 2918.99 2986.18 2999.8 2949.14 2864.74 2769.62 2687.26 2653.18 2640.27 2642.08 2666.15 2701.37 2748.24 2794.76 2834.37 2877.81 2913.43 2937.24 2937.13 2916.53 2861.99 2775.56 2690.41 2640.79 2637.63 2620.87 2533.99 2487.56 2476.76 2473.57 2519.77 2683.14 2846.66 2869.83 2807.73 2615.03 2520.06 3048.21 2863.84 2806.67 2821.84 2829.4 2834.55 2913.17 2994.56 3020.35 2986.44 2921.27 2888.6 2917.97 2959.86 2995.76 3015.58 3026.33 3033.64 3039.2 3036.13 3031 3015.76 2999.21 2976.64 2965.11 2918.32 2883.42 2850.55 2781.1 2669.31 2566 2513.46 2500.24 2495.82 2514.32 2532.66 2558.17 2595.24 2649.24 2706.14 2761.82 2814.06 2845.89 2870.86 2882.4 2861.64 2818.85 2803.44 2831.98 2885.69 2892.5 2879.29 2865.34 2885.84 2900.07 2916.11 2898.77 2859.87 2821.87 2806.96 2802.16 2813.18 2823.19 2833.97 2822.32 2865.84 2948.8 2985.96 3020.32 3030.73 3032.55 3032.52 3021.97 2988.11 2907.33 2880.07 2857.42 2780.11 2757.7 2739.23 2733.91 2728.28 2744.77 2789.72 2827.79 2845.79 2831.95 2825.1 2822.76 2824.71 2825.99 2836.52 2831.12 2829.5 2820.64 2816.52 2825.14 2821.25 2825.61 2816.22 2803.93 2802.17 2809.63 2823.84 2836.37 2853.3 2866.8 2874.86 2863.13 2834.67 2801.29 2782.85 2763.38 2753.65 2731.46 2727.25 2752.46 2770.77 2771.34 2711.51 2681.85 2642.41 2640.95 2602.6 2614.62 2583.28 2617.13 2629.09 2644.77 2670.63 2683.25 2706.8 2702.27 2725.74 2722.91 2739.34 2737.47 2743.88 2740.83 2743.93 2732.21 2725.13 2724.65 2734.01 2747.76 2762.27 2789.58 2812.56 2827.18 2828.27 2831.31 2796.17 2735.5 2709.95 2731.42 2704.58 2655.48 2631.84 2630.13 2663.28 2699.53 2732.82 2754.59 2761.85 2764.94 2766.49 2756.39 2735.97 2698.74 2658.82 2614.9 2592.56 2592.59 2611.68 2647.61 2682.2 2693.11 2680.69 2672.45 2668.51 2661.32 2653.1 2650.66 2644.41 2638.44 2624.84 2617.38 2625.98 2624.4 2640.3 2665.48 2680.04 2707.62 2719.06 2672.44 2677.5 2600.17 2409.5 2344.4 2308.45 2319.05 2356.39 2376.87 2393.9 2429.87 2496.59 2538.39 2565.15 2658.92 2811.64 2784.86 2699.28 2639.18 2614.12 2602.58 2585.05 2578.7 2553.53 2546.03 2515.75 2532.68 2559.28 2621.25 2667.34 2605.27 2497.41 2538.33 2461.19 2372.82 2527.19 2727.16 2688.48 2870.67 2783.83 2830.98 2847.83 2938.51 2928.99 2983.52 2896.97 2769.42 2726.84 2829.14 2977.58 2789.25 2634.04 2555.03 2519.14 2512 2536.95 2577.75 2696.16 2849.05 2956.75 2966.66 2951.87 2869.36 2631.76 2593.93 2702.9 2769.88 2795.81 2864.17 2706.99 2533.87 2512.03 2669.39 2873.51 2886.55 2878.83 2886.51 2894.79 2896.12 2897.77 2897.62 2889.74 2876.27 2879.28 2922.91 2830.67 2618.33 2557.45 2733.68 2935.51 2835.41 2586.04 2425.12 2461.96 2615.62 2777.99 2913.23 2870.4 2692.5 2582.09 2546.01 2573.75 2696.11 2835.54 2947.43 2935.52 2915.35 2901.22 2918.26 2934.3 2963.61 2973.34 2978.15 2996.72 3016.21 2985.02 2866.92 2714.78 2645.98 2589.08 2539.49 2539.75 2627.06 2773.07 2936.43 2983.14 2855.48 2794.77 2773.48 2735.28 2784.9 2776.45 2850.53 2874.72 2908.74 2941.78 2972.24 3014.96 3021.25 2993.06 2957.97 2934.36 2913.86 2920.01 2961.44 2999.32 3021.55 3026.68 3010.12 2979.27 2964.73 2955.99 2948.75 2896.39 2772.49 2791.19 2977.69 2763.65 2768.35 2839.83 2845.25 2762.81 2646.99 2560.92 2545.87 2622.99 2815.01 2997.36 2985.67 2940.79 2894.57 2844.74 2792.63 2740.99 2695.27 2666.05 2657.71 2654.6 2660.18 2682.03 2711.72 2740.45 2776.74 2809.82 2832.45 2856.87 2865.08 2861.57 2828.69 2772.48 2707.67 2660.92 2645.8 2646.53 2582.41 2490.17 2475.21 2477.9 2472.77 2476.59 2529.73 2697.19 2759.36 2720.3 2548.91 2514.41 3065.22 2892.69 2775.37 2763.48 2780.3 2779.24 2764.23 2755.95 2752.62 2739.11 2733.38 2729.66 2746.72 2789.9 2841.73 2870.8 2886.35 2871.62 2850.88 2843.3 2879.27 2980.58 3040.78 3026.64 3010.37 2983.12 2885.87 2862.26 2847.46 2799.39 2721.67 2641.37 2599.87 2571.74 2573.47 2595.12 2636.07 2692.09 2753.3 2802.81 2831.73 2847.51 2856.86 2862.93 2863.76 2871.42 2874.01 2875.34 2881.38 2882.66 2872.62 2854.84 2853.96 2881.49 2893.8 2897.89 2899.17 2887.49 2864.74 2843.25 2826.74 2824.9 2836.2 2837.11 2840.07 2823.08 2861.11 2927.87 2958.84 2976.12 2984.7 2975.36 2950.73 2912.19 2872.05 2872.97 2878.72 2830.91 2777.77 2748.56 2727.86 2733.41 2748.98 2782.58 2819.19 2832.79 2833.07 2822.47 2817.1 2816.39 2816.76 2813.91 2806.89 2803.19 2805.05 2807.16 2804.94 2808.28 2818.83 2815.21 2812.51 2807.08 2795.64 2783.51 2771.34 2762.27 2769.31 2792.57 2815.32 2843.96 2846.27 2846.84 2819.9 2820.2 2786.47 2741.53 2730.42 2751.32 2757.88 2766.03 2764.58 2752.76 2736.59 2691.79 2687.11 2644.23 2652.93 2656.2 2649.8 2670.41 2669.27 2690.33 2690.7 2711.3 2712.24 2728.37 2730.74 2735.34 2733.52 2730.87 2726.7 2728.47 2734.39 2744.36 2753.7 2767.14 2780.11 2795.81 2805.31 2809.35 2796.47 2771.3 2723.07 2694.22 2731.31 2718.37 2680.34 2638.45 2624.13 2615.57 2630.88 2643.02 2661.43 2676.84 2684.79 2683.6 2661.93 2648.04 2618.3 2602.65 2594.66 2609.29 2631.45 2655.98 2677.8 2697.91 2708.4 2703.75 2696.56 2689.73 2687.18 2683.61 2677 2671.9 2660.84 2653.95 2648.59 2645.91 2640.34 2662.85 2669.16 2688.02 2715.72 2733.03 2721.87 2692.37 2689.72 2615.23 2520.49 2501.38 2517.52 2528.2 2524.32 2520.78 2531.97 2540.29 2537.07 2535.43 2557.31 2633.62 2771.51 2827.03 2764.77 2711.26 2676.42 2647.86 2628.63 2604.01 2614.33 2602.27 2654.14 2673.22 2681.31 2555.47 2495.13 2468.04 2543.56 2410.64 2358.45 2458.06 2715.59 2645.5 2789.34 2840.64 2836.73 2819.37 2895.86 2944.6 2970.12 2923.98 2795.05 2751.5 2750.68 2785.58 2893.41 2989.61 2960.18 2905.22 2890.35 2913.18 2953.72 2932.07 2884.58 2898.46 2908.72 2945.86 2773.85 2556.44 2516.78 2565.42 2582.93 2603.78 2678.89 2815.31 2720.08 2542.12 2498.72 2536.78 2710.82 2878.21 2925.8 2936.82 2937.94 2936.21 2934.27 2935.25 2939 2830.01 2649.62 2556.15 2598.25 2763.6 2921.49 2850.49 2813.89 2696.51 2461.62 2391.03 2469.95 2606.98 2727.25 2824.41 2899.52 2938.45 2888.02 2826.89 2809.85 2840.84 2880.43 2939.99 2963.74 2977.27 2997.84 3008.34 3019.92 3020.71 3022.71 3004.05 2970.76 2815.39 2653.24 2555.17 2495.34 2466.4 2452 2462.54 2521.48 2651.33 2856.17 2992.74 2974.48 2910.24 2864.04 2822.21 2839.42 2837.66 2917.78 2937.62 2971.55 2990.06 2994.46 2968.19 2948.11 2935.99 2937.67 2942.18 2943.9 2941.02 2949.78 2957.67 2958.57 2951.51 2944.46 2936.63 2932.08 2939.21 2939.6 2880.78 2754.03 2712.48 2924.55 2842.37 2731.59 2789.18 2839.13 2843.94 2821.12 2794.34 2811.83 2905.78 2996.95 2966.5 2912.95 2860.68 2815.05 2773.57 2736.43 2705.5 2681.27 2665.35 2657.1 2653.95 2655.04 2659.47 2678.4 2696.29 2712.29 2731.69 2748.62 2757.23 2752.08 2736.92 2714.63 2688.16 2666.65 2655.94 2661.28 2633.95 2514.15 2466.07 2470.05 2471.91 2467.75 2470.41 2478.7 2535.37 2556.28 2539.5 2500.12 2512.51 3066.99 2948.98 2799.08 2743.78 2723.27 2715.1 2709.52 2701.51 2692.19 2679.71 2665.22 2663.11 2650.02 2656.16 2655.12 2653.62 2654.15 2644.19 2646.74 2645.74 2665.98 2710.37 2850.98 3050.06 3034.96 3021.42 2929.68 2832.91 2846.57 2852.1 2834.01 2804.94 2783.68 2765.63 2759.04 2763.9 2773.37 2788.13 2801.97 2808.99 2817.64 2818.19 2820.86 2822.24 2823.45 2825.08 2828.22 2832.86 2836.91 2836.48 2836.05 2833.4 2850.55 2894.28 2887.08 2868.23 2873.02 2879.68 2872.38 2866.72 2853.05 2855.14 2846.23 2843.83 2846.8 2829.09 2817.48 2827.11 2857.18 2888.51 2909.01 2913.52 2905.07 2895.47 2884.35 2869.11 2853.65 2834.04 2819.44 2799.53 2783.84 2788.03 2785.88 2794.54 2812.68 2831.46 2821.09 2820.45 2812.95 2809.14 2801.55 2802.52 2795.38 2800.6 2782.7 2782.42 2787.01 2785.54 2784.89 2786.13 2782.41 2776.97 2769.5 2755.24 2738.39 2726.04 2715.98 2714.16 2718.37 2726.09 2734.9 2741.74 2769.83 2832.22 2859.91 2761.06 2727.59 2725.44 2733.34 2722.27 2718.12 2701.14 2682.71 2641.23 2643.28 2605.03 2617.73 2627.04 2617.49 2652.46 2642.41 2678.06 2667.47 2702.96 2694.1 2722.81 2720.21 2735.43 2736 2743.84 2749.41 2755.34 2761 2765.53 2770.59 2774.83 2780.73 2783.46 2784.68 2779.39 2771.18 2750.22 2710.93 2691.54 2721.81 2744.4 2695.29 2659.39 2623.61 2602.72 2595.93 2582.58 2590.36 2583.27 2586.23 2587.32 2587.76 2588.1 2593.95 2608.16 2625.91 2643.03 2661.85 2676.88 2687.63 2696.02 2698.54 2696.74 2694.49 2690.69 2687.35 2683.43 2681.35 2676.36 2671.75 2666.22 2659.34 2656.84 2665.55 2656.56 2675.92 2698.89 2701.75 2735.87 2766.42 2718.68 2699.41 2703.77 2635.02 2616.26 2607.22 2595.61 2584.76 2581.93 2574.61 2564.32 2546.83 2521.08 2525.21 2522.18 2543.11 2594.94 2665.07 2726.4 2763.93 2767.77 2754.73 2720.1 2707.73 2616.47 2612.94 2534.08 2521.9 2454.23 2454.55 2471.04 2519.98 2389.78 2352.88 2388.96 2652.69 2616.54 2633.67 2715.34 2858.96 2844.39 2872.13 2848.57 2708.13 2747.55 2718.53 2733 2698.46 2692.9 2691.26 2706.87 2718.1 2727.14 2724.21 2730.45 2735.31 2749.21 2792.14 2836.27 2877.62 2920.38 2811.31 2521.49 2458.65 2467.21 2479.19 2497.55 2535.55 2627.7 2760.35 2851.67 2786.98 2727.14 2691.96 2708.44 2744.19 2782.6 2815.38 2829.45 2829.2 2794.55 2752.65 2743.49 2774.69 2835.98 2905.74 2868.03 2801.94 2776.42 2781.43 2768.59 2600 2377.81 2360.66 2464.86 2569.51 2635.07 2675.9 2706.14 2733.54 2752.2 2777.47 2793.24 2809.41 2834.8 2836.01 2872.05 2892.73 2902.12 2891.17 2860.95 2807.92 2718.68 2604.69 2506.43 2435.59 2392.86 2374.83 2366.84 2374.4 2391.54 2420.61 2484.42 2725.67 2958.89 2980.8 2932.88 2877.07 2830.17 2868.49 2800.79 2863.6 2870.16 2881.1 2896.84 2905.42 2913.67 2916.97 2926.77 2946.32 2968.89 2981.01 2976.06 2965.15 2951.48 2937.28 2925.77 2913.96 2911.47 2925.56 2938.44 2936.98 2848.66 2717.78 2656.88 2731.74 2989.33 2759.61 2819.7 2923.1 2982.47 2978.6 2982.53 2977.8 2966.87 2951.26 2927.35 2901.05 2877.39 2856.46 2837.85 2819.78 2802.85 2782.57 2759.1 2736.74 2718.36 2704.12 2694.69 2685.14 2681.66 2677.23 2681.48 2672.63 2677.71 2674.27 2676.14 2671.35 2666.11 2663.96 2665.76 2669.36 2577.6 2464.18 2462.95 2461.97 2468.53 2464.6 2474 2471.4 2478.46 2480.79 2484.48 2491.02 2511.49 ) ; boundaryField { wand { type zeroGradient; } frontAndBack { type empty; } } // ************************************************************************* //
af2209a92b45687acd3db5cec8031ea51da6cd16
5a4ea6e31c5388f81391d0d2500625c050d2187d
/DungeonLib/src/cresco.ai.dungeonlib.data/mapping/hashmap.h
c8e7c45bad03e21300a4f2cf2f1ac05d89cbbd6c
[ "Apache-2.0" ]
permissive
mysterymagination/DungeonLib
0ad72136f552165fe33d7c110c48e30c13aebd4a
42e2ae3a7514bd0cbcbf100640c9f62d48a3a37b
refs/heads/master
2021-05-27T20:24:13.156837
2013-08-17T20:15:21
2013-08-17T20:15:21
null
0
0
null
null
null
null
UTF-8
C++
false
false
26,128
h
#ifndef _HASHMAP_H_ #define _HASHMAP_H_ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <iostream> #include <vector.h> /* One way, based on the C hashmap meant to use character string keys //Beginning of Hashmap class definition //All-righty-roo, this hashmap is going to take advantage of some c++ features //mostly class and function/class templates and avoid the void pointer casting stuff from the ansi C version //Don't seem to need this guy... might want to test with templated structs and see if it is needed there, or if templateThing<a_type> is a suffciently real class object or struct object //class Hashmap_Base{ //private: //public: //virtual Hashmap_Base(); //can't have virtual constructors //virtual ~Hashmap_Base(); //virtual std::vector<char>* getKeys(); //virtual std::vector<char>* getValues(); //}; template <class Key, class Value> //template <class Value> class Hashmap{//:Hashmap_Base{ private: //N.B. In order to facilitate associative grouping, we probably don't want any kind of //standard linear containers here //naive associativity is not too difficult-- just write a hashing function which //determines the flat address to be used for the value (based on the key) and malloc space for the value //at that location (see the ANSI C implementation) //Spatial-respective hashing would instead generate a unique hash code based on the key //and use this value in an offset algorithm from some given location so as to obey spatial locality //rules. Best case would be for all the value spaces to be knit tightly enough that //all of a given hashmap's look-up locations could be in RAM at the same time following the first //reference to the hashmap object Key keys[1]; Value values[1]; int mappedElementCount; typedef struct { void* myObject; //this was const before-- is that necessary? Seems like we need it mutable... char* myType; }abstractObject; //w00t, a 2-way traversable circular linked list in C FTW!! typedef struct _list_t_{ abstractObject* key_ptr; abstractObject* value_ptr; //could just be void* but hey let's vagazzle this bitch! struct _list_t_* pNext; struct _list_t_* pPrevious; struct _list_t_* pLinkedListHead; //set only when the list is first created as the address of the oject currently being added struct _list_t_* pLinkedListTail; //set anew each time a new object is added to the end of the list to the address of the new object }linkedList; linkedList** table; //how do you free the memory from a vector...? //since it is a container class it should provide a function to dealloc memory from its stored elements... //answer is std::vector::clear() BUT bear in mind that if your vector contains pointers, you must iterate over each such //pointer and free it BEFORE clearing the vector. Elsewise you end up with memory leaks as the objects pointed to by the pointers //in the vector will not be deallocated (clear attempts to call the destructor of each object in the vector, but even typed pointers will not automatically dereference and call the associated object's destructor), //and after the vector is cleared hooks to them will be (potentially) lost. Clearing a vector of pointers will essentially empty your vector //but will also remove the address hooks to objects allocated in memory without deallocating that memory, leading to massive memory leaks. //Also, you don't have to call clear() explicitly; this'll be done automatically by the vector's destructor //so you only need to make sure it gets destroyed via free if malloc'd or delete if new'd or allow to go //out of scope if directly constructed implicitly or explicitly ///std::vector<Key> keys; ///std::vector<Value> values; public: explicit Hashmap();//(Key,Value); virtual ~Hashmap(); //Did I implement this here for a reason...? Moving to class implementation below //void myPair(Key first, Value second){ //keys[0]=first; values[0]=second; //} virtual void test(); virtual int hash(Key*); void myPair(Key,Value); int* getSize(); virtual void putKVPair(Key*,Value*); virtual Value* get(Key*); void clearMap(); void init_LinkedList(linkedList*); //When we use these methods, we'll want a linear vector of keys and values to iterate over, so vector is good here std::vector<Key>* getKeys(); std::vector<Value>* getValues(); }; //end hashmap class definition //Hashmap class implementation template<class Key,class Value> Hashmap<Key,Value>::Hashmap(){ mappedElementCount = 0; } template<class Key,class Value> Hashmap<Key,Value>::~Hashmap(){ printf("\nDestroying the base Hashmap object!\n"); } template<class Key,class Value> void Hashmap<Key,Value>::test(){ printf("The size of our Key is %i and the size of our Value is %i\n",sizeof(Key),sizeof(Value)); } template<class Key, class Value> void Hashmap<Key,Value>::myPair(Key k, Value v){ keys[0] = k; values[0] = v; } template<class Key,class Value> int Hashmap<Key,Value>::hash(Key* k_ptr){ //TODO: figure out how the original C version below was supposed to work //starting at 0 and adding char val + 31*currentHashVal for each new linked list //in the table, and then edit our algorithm here appropriately unsigned int hashval; void* hash_ptr; // we start our hash out at 0 //hashval = k_ptr;//0; //Store the address of our Key object //We can operate on this address with normal //arithmetic later (I think) to achieve //X byte offsets etc. hash_ptr = k_ptr; //If our Key is of type std::string... //if() //TODO: yeah, type checking is not the OOP way... //instead we should probably have another class //that inherits from Hashmap and which has a set //std::string key type, but a templated value //When we know our keys will be strings, we would //use that class instead of Hashmap. To support this polymorphism, //we've made Hashmap's destructor virtual. Note that this is //all for the sake of hashing over the Key value by charracters... //a more generic hashing method would eliminate the need for a derived //class //for each character, we multiply the old hash by 31 and add the current //character. Remember that shifting a number left is equivalent to //multiplying it by 2 raised to the number of places shifted. So we //are in effect multiplying hashval by 32 and then subtracting hashval. //Why do we do this? Because shifting and subtraction are much more //efficient operations than multiplication. //for(int i=0;i<str.length();i++) { //Since we don't know our Key's type here, //we'll just make the new hashval the current + 4 bytes hashval = hashval+4; //str[i] + ((hashval << 5) - hashval); //} //we then return the hash value mod the hashmap size so that it will //fit into the necessary range return hashval % mappedElementCount; } template<class Key,class Value> std::vector<Key>* Hashmap<Key,Value>::getKeys(){ //TODO: prepare a vector initialized with all Key objects and return it here return keys; } template<class Key,class Value> std::vector<Value>* Hashmap<Key,Value>::getValues(){ //TODO: prepare a vector initialized with all Value objects and return it here return values; } template<class Key,class Value> int* Hashmap<Key,Value>::getSize(){ return &mappedElementCount; } template<class Key,class Value> void Hashmap<Key,Value>::putKVPair(Key* k, Value* v){ //TODO: implement hashing of the key object k to determine //the address of the value object v //first step, generate a hash from our key int tempHash = hash(k); //TODO: store Value at an address given by or influenced by tempHash //If all was successfully completed, increment the mapped records counter mappedElementCount++; } template<class Key, class Value> Value* Hashmap<Key,Value>::get(Key* k_ptr){ linkedList *list; init_LinkedList(list); unsigned int hashval = hash(k_ptr); //Go to the correct list based on the hash value and see if str is //in the list. If it is, return return a pointer to the abstractObject member of the list. //If it isn't, the item isn't in the table, so return NULL. // for(list = this->table[hashval]; list != NULL; list = list->pNext) { // if (strcmp(strKey, list->str) == 0) return list->value; //TODO: need to come up with a way to grep over the map given an //abstractObject for the general case here... // } return NULL; } template<class Key,class Value> void Hashmap<Key,Value>::clearMap(){ //TODO: implement a cascading chain of deallocation of stored objects within the hashmap //MAYBE-- only if we create new objects rather than just mapping reference associations, //which is really the goal here... In the latter preferred case, just //empty the Hashmap here } template <class Value> class Stringmap:public Hashmap<std::string,Value>{ private: Value values[1]; typedef struct { void* myObject; //this was const before-- is that necessary? Seems like we need it mutable... char* myType; }abstractObject; //w00t, a 2-way traversable circular linked list in C FTW!! typedef struct _list_t_{ std::string* str_ptr; abstractObject* value_ptr; //could just be void* but hey let's vagazzle this bitch! struct _list_t_* pNext; struct _list_t_* pPrevious; struct _list_t_* pLinkedListHead; //set only when the list is first created as the address of the oject currently being added struct _list_t_* pLinkedListTail; //set anew each time a new object is added to the end of the list to the address of the new object }linkedList; linkedList** table; // pointer to the table elements array -- What we have is a pointer to a pointer to a linked list; thus list_t **table. Used because we don't know the size of the hashtable to begin with.... public: //Con/de 'structors explicit Stringmap(); ~Stringmap(); //Here we know our Key will be of type std::string //so we can generate our hash sig the way we planned //before int hash(std::string*); void initLinkedList(linkedList*); //override test from base class void test(); int putKVPair(std::string*,Value*); Value* get(std::string*); linkedList* lookupString(std::string*); }; template<class Value> Stringmap<Value>::Stringmap():Hashmap<std::string,Value>(){ } template<class Value> Stringmap<Value>::~Stringmap(){ printf("\nDestroying the derived stringmap object!\n"); } template<class Value> void Stringmap<Value>::test(){ printf("The size of our Value is %i\n",sizeof(Value)); } template<class Value> int Stringmap<Value>::hash(std::string* str_ptr){ unsigned int hashval; // we start our hash out at 0 hashval = 0; //If our Key is of type std::string... //if() //TODO: yeah, type checking is not the OOP way... //instead we should probably have another class //that inherits from Hashmap and which has a set //std::string key type, but a templated value //When we know our keys will be strings, we would //use that class instead of Hashmap. To support this polymorphism, //we've made Hashmap's destructor virtual. Note that this is //all for the sake of hashing over the Key value by charracters... //a more generic hashing method would eliminate the need for a derived //class // for each character, we multiply the old hash by 31 and add the current // character. Remember that shifting a number left is equivalent to // multiplying it by 2 raised to the number of places shifted. So we // are in effect multiplying hashval by 32 and then subtracting hashval. // Why do we do this? Because shifting and subtraction are much more // efficient operations than multiplication. for(int i=0;i<str_ptr->length();i++) { hashval = (*(str_ptr))[i] + ((hashval << 5) - hashval); } // we then return the hash value mod the hashmap size so that it will //fit into the necessary range return hashval % (*(Hashmap<std::string,Value>::getSize())); } template<class Value> void Stringmap<Value>::initLinkedList(linkedList* ll){ ll->pLinkedListHead = NULL; ll->pLinkedListTail = NULL; ll->pNext = NULL; ll->pPrevious = NULL; ll->str_ptr = NULL; ll->value_ptr = NULL; } template<class Value> int Stringmap<Value>::putKVPair(std::string* str_ptr, Value* v){ //TODO: implement hashing of the Key std::string to determine //the address of the value object v linkedList* new_list; initLinkedList(new_list); linkedList* current_list; initLinkedList(current_list); //first step, generate a hash from our string key int tempHash = hash(str_ptr); //TODO: store Value at an address given by or influenced by tempHash //or at a spot in the hashtable given or influenced by tempHash // Attempt to allocate memory for list if ((new_list = (linkedList*)malloc(sizeof(linkedList))) == NULL) return 1; // Does item already exist? current_list = lookupString(str_ptr);//lookup_string(hashMap, str); if (current_list != NULL){ //collision case // item already exists, either don't insert it again or add it to the linked list as a handled collision element. //handle new assignment of listTail, don't alter listHead here return 2; //the "don'insert it again" method... } else{ //usual case // Else, Insert into list //at this point, we are definitly adding the first member of the list so set it as both //list head and list tail... new_list->str_ptr = strdup(str_ptr->c_str());//performs malloc of strlen(s) + 1 bytes for you new_list->value_ptr = myVal; //set value member to the address of the object passed in as myVal new_list->pNext = this->table[hashval]; new_list->pPrevious = this->table[hashval]; new_list->pLinkedListHead = this->table[hashval]; new_list->pLinkedListTail = this->table[hashval]; this->table[hashval] = new_list; } return 0; //success condition //If all was successfully completed, increment the mapped records counter mappedElementCount++; } template<class Value> Value* Stringmap<Value>::get(std::string* str_ptr){ linkedList *list; init_LinkedList(list); unsigned int hashval = hash(k_ptr); // Go to the correct list based on the hash value and see if str is // in the list. If it is, return return a pointer to the abstractObject member of the list. //If it isn't, the item isn't in the table, so return NULL. for(list = this->table[hashval]; list != NULL; list = list->pNext) { if (strcmp(str_ptr, list->str_ptr) == 0) return list->value_ptr; } return NULL; } */ /* * A simple hashmap in cpp example * Very simple yet complete Hash Map implementation in C++ * * Relies upon int values for mapping, but any given data structure * could be hashed into an int which would allow this impl to be used * practically out of the box. Since the hashval is only used as a hint * at where the Value object will be located, the hash function doesn't * need to be very complicated. For a StringMap for instance, you might * generate a hashval by adding together each character of the string * and then modding the resultant sum by the TABLE_SIZE to ensure it will * fit in the underlying table of HashNode objects */ // // Configurable table size constant const int TABLE_SIZE = 128; const int ERROR = -1; /*canned hashnode class for hashtable // Hash node class class HashNode { public: //Constructor for HashNode with an init list for its members, _key, _value, and _next HashNode(int key, int value) : _key(key), _value(value), _next(0) { } //Accessors for the current working _key and _value values int getCurrentKey() { return _key; } int getCurrentValue() { return _value; } //Pointer to the next hashnode in the linked list HashNode* next() { return _next; } //Set the current _value value void set_value(int value) { _value = value; } //Set the _next value void set_next(HashNode* next) { _next = next; } private: // Key-value pair int _key; int _value; //pointer to the next hashnode. Prev is tracked in terms of next //(e.g. prev = current;current = next) when needed HashNode* _next; }; */ // Hash map class template <class key_data, class value_data> class HashMap { public: HashMap(); HashMap(const HashMap&); virtual ~HashMap(); HashMap& operator=(const HashMap&); template <class c> int keyGen(c); int keyGen(std::string); int HashFunc(int); value_data* get(key_data); void put(key_data,value_data); void remove(key_data); private: // Hash node class class HashNode { public: //Constructor for HashNode with an init list for its members, _key, _value, and _next HashNode(int key, value_data value) : _key(key), _value(value), _next(0) { } //Accessors for the current working _key and _value values int getCurrentKey() { return _key; } value_data* getCurrentValue() { return &_value; } //Pointer to the next hashnode in the linked list HashNode* next() { return _next; } //Set the current _value value void set_value(value_data value) { _value = value; } //Set the _next value void set_next(HashNode* next) { _next = next; } private: // Key-value pair int _key; value_data _value; //pointer to the next hashnode. Prev is tracked in terms of next //(e.g. prev = current;current = next) when needed HashNode* _next; }; //End class HashNode declaration/definition // Hash table HashNode** _table; }; //End class HashMap declaration template <class key_data,class value_data> HashMap<key_data,value_data>::HashMap() { //Sets _table to be an array of TABLE_SIZE pointers to hashnodes _table = new HashNode*[TABLE_SIZE]; //init all the hashnode pointers in _table to NULL (given as immediate zero here) for (int i = 0; i < TABLE_SIZE; ++i){ _table[i] = 0; } } template <class key_data,class value_data> HashMap<key_data,value_data>::~HashMap() { //Delete the entire _table for (int i = 0; i < TABLE_SIZE; ++i) { HashNode* entry = _table[i]; while (entry != 0) { HashNode* prev = entry; entry = entry->next(); //should be zero at the tail of the list delete prev; } } } //copy-constructor //TODO: make sure that reference members are //reallocated for object pointed to by this template <class key_data,class value_data> HashMap<key_data,value_data>::HashMap(const HashMap<key_data,value_data>& other) { std::cout << "cc called for HashMap!" << std::endl; //first check for self reference if(this != other){ //Sets _table to be an array of TABLE_SIZE pointers to hashnodes _table = new HashNode*[TABLE_SIZE]; //init all the hashnode pointers in _table to other's values for (int i = 0; i < TABLE_SIZE; ++i){ _table[i] = other._table[i]; } } } //overload operator= template <class key_data, class value_data> HashMap<key_data,value_data>& HashMap<key_data,value_data>::operator= (const HashMap<key_data,value_data>& copy){ HashMap<key_data,value_data>* newMap = new HashMap<key_data,value_data>(); //Sets _table to be an array of TABLE_SIZE pointers to hashnodes newMap->_table = new HashNode*[TABLE_SIZE]; //init all the hashnode pointers in _table to NULL (given as immediate zero here) for (int i = 0; i < TABLE_SIZE; ++i){ newMap->_table[i] = 0; } //evidently initialization of object references REQUIRES //an actual object, as opposed to the address of an object, //which is what the ref becomes anyway... return *newMap; } //arbitrary data integer key generation template <class key_data, class value_data> template <class c> int HashMap<key_data,value_data>::keyGen(c dat){ /* //Casts the memory address where the arbitrary data //object is stored to an int (platform specific as to //whether the int will hold the whole pointer) //and then returns this int value. We only need //an algorithm that will generate a deterministic //key for a given object throughout a given app run, //so this is fine for arbitrary data unless that data //is moved int* i_ptr = reinterpret_cast<int*>(&dat); return *i_ptr; */ //Potentially a much better solution: //use sizeof data to get an int value based //on the object independent of its location in memory return sizeof dat; } //known data type std::string key generation template <class key_data,class value_data> int HashMap<key_data,value_data>::keyGen(std::string s){ int total = 0; for(int i=0;i<s.length();i++){ total+=s[i]; } return total; } /* //NOTE: Yes, this is the problem: //error: enclosing class templates are not explicitly specialized //You cannot specialize a member without also specializing the class. //What you can do is put the code from function in a separate class //and specialize that, much like basic_string depends on a separate //char_traits class. Then then non-specialized function can call a //helper in the traits class. template <class key_data, class value_data> template<> int HashMap<key_data,value_data>::keyGen<std::string>(std::string s){ int total = 0; for(int i=0;i<s.length();i++){ total+=s[i]; } return total; } //template <class key_data,class value_data> template int HashMap<key_data,value_data>::keyGen<std::string>(std::string); */ // Should be optimized according to specific needs //NOTE: HashFunc, as a header implemented function, seems //to need to be a member of a single compilation unit, such as //a class or possibly a struct; if simply left as a C-style //orphaned function, ld will throw duplicate symbol error //even with include guards... template <class key_data,class value_data> int HashMap<key_data,value_data>::HashFunc(int key) { return key % TABLE_SIZE; } /** * Attempts to retrieve a pointer to the value_data object * associated with the given key_data object. If it cannot * find an associated value_data object, it returns NULL * so check for success condition via hashmap.get(...) != NULL... */ template <class key_data,class value_data> value_data* HashMap<key_data,value_data>::get(key_data dk) { int key = keyGen(dk); int hash_val = HashFunc(key); HashNode* entry = _table[hash_val]; while (entry != 0) { if (entry->getCurrentKey() == key) { return entry->getCurrentValue(); } entry = entry->next(); } printf("Your get of int key %i resulted in no hits. The returned Value is NULL!\n",key); //value_data dat; return NULL; } template <class key_data,class value_data> void HashMap<key_data,value_data>::put(key_data dk, value_data dv){ //generate an int value from our arbitrary Key data type int key = this->keyGen(dk); //generate a hash_val based on the integer key int hash_val = HashFunc(key); //init our hashnode pointer prev to NULL HashNode* prev = 0; //init our hashnode pointer entry to the most correct linked list //record in our _table array HashNode* entry = _table[hash_val]; //Now search for the key in the linked list of hashnodes //break if the linked list is NULL (entry==0) or if the //key is already in the linked list (this algorithm does NOT //allow repeat Keys in the hashmap) or if the tail of the linked //list has been reached and thus it is time to place our novel //key and its associated arbitrary value data in a new HashNode while (entry != 0 && entry->getCurrentKey() != key) { prev = entry; entry = entry->next(); } //If we are at the ll tail, append a new HashNode //of int Key and arbitrary data Value if (entry == 0) { entry = new HashNode(key, dv); //if we are adding the head of the ll now //set prev to be entry also if (prev == 0) { _table[hash_val] = entry; } else { //otherwise, set prev's next value to point to the //HashNode we just added prev->set_next(entry); } } else { //If we didn't need to add a new HashNode (e.g. the key //already was in the ll) then just replace the exisiting //Key's associated Value with the one specified in this //function call entry->set_value(dv); } } /* void Put(int key, int value) { int hash_val = HashFunc(key); HashNode* prev = 0; HashNode* entry = _table[hash_val]; while (entry != 0 && entry->key() != key) { prev = entry; entry = entry->next(); } if (entry == 0) { entry = new HashNode(key, value); if (prev == 0) { _table[hash_val] = entry; } else { prev->set_next(entry); } } else { entry->set_value(value); } } */ template <class key_data, class value_data> void HashMap<key_data,value_data>::remove(key_data dat){ //removes the K,V pair given by the key_data arg int key = keyGen(dat); int hash_val = HashFunc(key); HashNode* entry = _table[hash_val]; HashNode* prev = 0; //Traverse the ll, looking for either key or the tail while (entry != 0) { if (entry->getCurrentKey() == key) { break; } prev = entry; entry = entry->next(); } if (entry == 0){ //key was not present in the hashnode return; } else { if (prev == 0) { //if key is at the head, move the head to next _table[hash_val] = entry->next(); } else { //otherwise set prev's next to be entry's next prev->set_next(entry->next()); } //delete entry delete entry; } } /* private: // Hash table HashNode** _table; }; */ #endif /*_HASHMAP_H_*/
9406d2a9895c190c28115236f5639da8932507e1
d758eb35c46ae6493f06c3c7eb1c7e90b62be425
/app/src/main/cpp/DNFFmpeg.h
a865a9cadeedf14b5fa71bed8c4f0bdd417722f2
[]
no_license
PineJuneYang/ffmpeg
55d92c33eb851a2ba8ddee467c11939f1e7dac51
c226ccc450d4236f17b68e34831ae7a023099cbd
refs/heads/master
2023-03-31T21:46:19.777883
2021-04-04T15:04:29
2021-04-04T15:04:29
354,517,973
0
0
null
null
null
null
UTF-8
C++
false
false
889
h
// // Created by dell on 2021/1/28. // #ifndef FFMPEG_DNFFMPEG_H #define FFMPEG_DNFFMPEG_H #include "JavaCallHelper.h" #include "AudioChannel.h" #include "VideoChannel.h" extern "C" { #include <libavformat/avformat.h> } typedef void (*RenderFrameCallback)(uint8_t *,int , int, int); class DNFFmpeg { public: DNFFmpeg(JavaCallHelper *javaCallHelper, const char *dataResource); ~DNFFmpeg(); void prepare(); void _prepare(); void start(); void _preparePlay(); void setRenderFrameCallback(RenderFrameCallback renderFrameCallback); private: char *dataResource; pthread_t pid; pthread_t pidStart; AVFormatContext *avFormatContext; JavaCallHelper *javaCallHelper; AudioChannel *audioChannel = NULL; VideoChannel *videoChannel = NULL; bool isPlaying; RenderFrameCallback callback; }; #endif //FFMPEG_DNFFMPEG_H
870a1d3056beb7f619a19ddd80949ec20610d458
6a84a3e15f4d98db106293fa259ad1202068c30c
/jni/Library_MMDAgent/src/include/Option.h
c16d94575aed1421df1d610f24127e3a87180b9a
[ "BSD-3-Clause" ]
permissive
kaitoh/MMDAgent
87768b3e323aaa4efe292c1580dd3421cc323ab0
1512f2de77b41c85850e365fda2f25c139ee1332
refs/heads/master
2021-01-17T23:26:23.554094
2014-05-23T10:09:18
2014-05-23T10:09:18
20,095,325
1
2
null
null
null
null
UTF-8
C++
false
false
17,381
h
/* ----------------------------------------------------------------- */ /* The Toolkit for Building Voice Interaction Systems */ /* "MMDAgent" developed by MMDAgent Project Team */ /* http://www.mmdagent.jp/ */ /* ----------------------------------------------------------------- */ /* */ /* Copyright (c) 2009-2013 Nagoya Institute of Technology */ /* Department of Computer Science */ /* */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or */ /* without modification, are permitted provided that the following */ /* conditions are met: */ /* */ /* - Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* - Redistributions in binary form must reproduce the above */ /* copyright notice, this list of conditions and the following */ /* disclaimer in the documentation and/or other materials provided */ /* with the distribution. */ /* - Neither the name of the MMDAgent project team nor the names of */ /* its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */ /* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */ /* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ /* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */ /* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS */ /* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, */ /* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED */ /* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */ /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, */ /* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY */ /* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */ /* POSSIBILITY OF SUCH DAMAGE. */ /* ----------------------------------------------------------------- */ /* definitions */ #define OPTION_MAXBUFLEN 2048 #define OPTION_USECARTOONRENDERING_STR "use_cartoon_rendering" #define OPTION_USECARTOONRENDERING_DEF true #define OPTION_USEMMDLIKECARTOON_STR "use_mmd_like_cartoon" #define OPTION_USEMMDLIKECARTOON_DEF true #define OPTION_CARTOONEDGEWIDTH_STR "cartoon_edge_width" #define OPTION_CARTOONEDGEWIDTH_DEF 0.7f #define OPTION_CARTOONEDGEWIDTH_MAX 1000.0f #define OPTION_CARTOONEDGEWIDTH_MIN 0.001f #define OPTION_CARTOONEDGESTEP_STR "cartoon_edge_step" #define OPTION_CARTOONEDGESTEP_DEF 1.2f #define OPTION_CARTOONEDGESTEP_MAX 10.0f #define OPTION_CARTOONEDGESTEP_MIN 1.0f #define OPTION_CARTOONEDGESELECTEDCOLOR_STR "cartoon_edge_selected_color" #define OPTION_CARTOONEDGESELECTEDCOLORR_DEF 1.0f #define OPTION_CARTOONEDGESELECTEDCOLORG_DEF 0.0f #define OPTION_CARTOONEDGESELECTEDCOLORB_DEF 0.0f #define OPTION_CARTOONEDGESELECTEDCOLORA_DEF 1.0f #define OPTION_CARTOONEDGESELECTEDCOLOR_MAX 1.0f #define OPTION_CARTOONEDGESELECTEDCOLOR_MIN 0.0f #define OPTION_CAMERAROTATION_STR "camera_rotation" #define OPTION_CAMERAROTATIONX_DEF 0.0f #define OPTION_CAMERAROTATIONY_DEF 0.0f #define OPTION_CAMERAROTATIONZ_DEF 0.0f #define OPTION_CAMERAROTATION_MAX 1000.0f #define OPTION_CAMERAROTATION_MIN 0.001f #define OPTION_CAMERATRANSITION_STR "camera_transition" #define OPTION_CAMERATRANSITIONX_DEF 0.0f #define OPTION_CAMERATRANSITIONY_DEF 13.0f #define OPTION_CAMERATRANSITIONZ_DEF 0.0f #define OPTION_CAMERATRANSITION_MAX 10000.0f #define OPTION_CAMERATRANSITION_MIN -10000.0f #define OPTION_CAMERADISTANCE_STR "camera_distance" #define OPTION_CAMERADISTANCE_DEF 100.0f #define OPTION_CAMERADISTANCE_MAX 100000.0f #define OPTION_CAMERADISTANCE_MIN 0.0f #define OPTION_CAMERAFOVY_STR "camera_fovy" #define OPTION_CAMERAFOVY_DEF 16.0f #define OPTION_CAMERAFOVY_MAX 180.0f #define OPTION_CAMERAFOVY_MIN 0.0f #define OPTION_STAGESIZE_STR "stage_size" #define OPTION_STAGESIZEW_DEF 25.0f #define OPTION_STAGESIZED_DEF 25.0f #define OPTION_STAGESIZEH_DEF 40.0f #define OPTION_STAGESIZE_MAX 1000.0f #define OPTION_STAGESIZE_MIN 0.001f #define OPTION_SHOWFPS_STR "show_fps" #define OPTION_SHOWFPS_DEF true #define OPTION_FPSPOSITION_STR "fps_position" #define OPTION_FPSPOSITIONX_DEF -2.5f #define OPTION_FPSPOSITIONY_DEF 22.0f #define OPTION_FPSPOSITIONZ_DEF 3.0f #define OPTION_WINDOWSIZE_STR "window_size" #define OPTION_WINDOWSIZEW_DEF 600 #define OPTION_WINDOWSIZEH_DEF 600 #define OPTION_WINDOWSIZE_MAX 4096 #define OPTION_WINDOWSIZE_MIN 1 #define OPTION_FULLSCREEN_STR "full_screen" #define OPTION_FULLSCREEN_DEF false #define OPTION_LOGSIZE_STR "log_size" #define OPTION_LOGSIZEW_DEF 80 #define OPTION_LOGSIZEH_DEF 30 #define OPTION_LOGSIZE_MAX 4096 #define OPTION_LOGSIZE_MIN 1 #define OPTION_LOGPOSITION_STR "log_position" #define OPTION_LOGPOSITIONX_DEF -17.5f #define OPTION_LOGPOSITIONY_DEF 3.0f #define OPTION_LOGPOSITIONZ_DEF -15.0f #define OPTION_LOGSCALE_STR "log_scale" #define OPTION_LOGSCALE_DEF 1.0f #define OPTION_LOGSCALE_MAX 1000.0f #define OPTION_LOGSCALE_MIN 0.001f #define OPTION_LIGHTDIRECTION_STR "light_direction" #define OPTION_LIGHTDIRECTIONX_DEF 0.5f #define OPTION_LIGHTDIRECTIONY_DEF 1.0f #define OPTION_LIGHTDIRECTIONZ_DEF 0.5f #define OPTION_LIGHTDIRECTIONI_DEF 0.0f #define OPTION_LIGHTINTENSITY_STR "light_intensity" #define OPTION_LIGHTINTENSITY_DEF 0.6f #define OPTION_LIGHTINTENSITY_MAX 1.0f #define OPTION_LIGHTINTENSITY_MIN 0.0f #define OPTION_LIGHTCOLOR_STR "light_color" #define OPTION_LIGHTCOLORR_DEF 1.0f #define OPTION_LIGHTCOLORG_DEF 1.0f #define OPTION_LIGHTCOLORB_DEF 1.0f #define OPTION_LIGHTCOLOR_MAX 1.0f #define OPTION_LIGHTCOLOR_MIN 0.0f #define OPTION_CAMPUSCOLOR_STR "campus_color" #define OPTION_CAMPUSCOLORR_DEF 0.0f #define OPTION_CAMPUSCOLORG_DEF 0.0f #define OPTION_CAMPUSCOLORB_DEF 0.2f #define OPTION_CAMPUSCOLOR_MAX 1.0f #define OPTION_CAMPUSCOLOR_MIN 0.0f #define OPTION_MAXMULTISAMPLING_STR "max_multi_sampling" #define OPTION_MAXMULTISAMPLING_DEF 4 #define OPTION_MAXMULTISAMPLING_MAX 32 #define OPTION_MAXMULTISAMPLING_MIN 0 #define OPTION_MOTIONADJUSTTIME_STR "motion_adjust_time" #define OPTION_MOTIONADJUSTTIME_DEF 0.0f #define OPTION_MOTIONADJUSTTIME_MAX 10.0f #define OPTION_MOTIONADJUSTTIME_MIN -10.0f #define OPTION_LIPSYNCPRIORITY_STR "lipsync_priority" #define OPTION_LIPSYNCPRIORITY_DEF 100.0f #define OPTION_LIPSYNCPRIORITY_MAX 1000.0f #define OPTION_LIPSYNCPRIORITY_MIN -1000.0f #define OPTION_BULLETFPS_STR "bullet_fps" #define OPTION_BULLETFPS_DEF 120 #define OPTION_BULLETFPS_MAX 120 #define OPTION_BULLETFPS_MIN 1 #define OPTION_GRAVITYFACTOR_STR "gravity_factor" #define OPTION_GRAVITYFACTOR_DEF 2.0f #define OPTION_GRAVITYFACTOR_MAX 1024.0f #define OPTION_GRAVITYFACTOR_MIN 0.0f #define OPTION_ROTATESTEP_STR "rotate_step" #define OPTION_ROTATESTEP_DEF 4.5f #define OPTION_ROTATESTEP_MAX 180.0f #define OPTION_ROTATESTEP_MIN 0.001f #define OPTION_TRANSLATESTEP_STR "translate_step" #define OPTION_TRANSLATESTEP_DEF 0.5f #define OPTION_TRANSLATESTEP_MAX 1000.0f #define OPTION_TRANSLATESTEP_MIN 0.001f #define OPTION_DISTANCESTEP_STR "distance_step" #define OPTION_DISTANCESTEP_DEF 4.0f #define OPTION_DISTANCESTEP_MAX 1000.0f #define OPTION_DISTANCESTEP_MIN 0.001f #define OPTION_FOVYSTEP_STR "fovy_step" #define OPTION_FOVYSTEP_DEF 1.0f #define OPTION_FOVYSTEP_MAX 1000.0f #define OPTION_FOVYSTEP_MIN 0.001f #define OPTION_USESHADOWMAPPING_STR "use_shadow_mapping" #define OPTION_USESHADOWMAPPING_DEF false #define OPTION_SHADOWMAPPINGTEXTURESIZE_STR "shadow_mapping_texture_size" #define OPTION_SHADOWMAPPINGTEXTURESIZE_DEF 1024 #define OPTION_SHADOWMAPPINGTEXTURESIZE_MAX 8192 #define OPTION_SHADOWMAPPINGTEXTURESIZE_MIN 1 #define OPTION_SHADOWMAPPINGSELFDENSITY_STR "shadow_mapping_self_density" #define OPTION_SHADOWMAPPINGSELFDENSITY_DEF 1.0f #define OPTION_SHADOWMAPPINGSELFDENSITY_MAX 1.0f #define OPTION_SHADOWMAPPINGSELFDENSITY_MIN 0.0f #define OPTION_SHADOWMAPPINGFLOORDENSITY_STR "shadow_mapping_floor_density" #define OPTION_SHADOWMAPPINGFLOORDENSITY_DEF 0.5f #define OPTION_SHADOWMAPPINGFLOORDENSITY_MAX 1.0f #define OPTION_SHADOWMAPPINGFLOORDENSITY_MIN 0.0f #define OPTION_SHADOWMAPPINGLIGHTFIRST_STR "shadow_mapping_light_first" #define OPTION_SHADOWMAPPINGLIGHTFIRST_DEF true #define OPTION_DISPLAYCOMMENTTIME_STR "display_comment_time" #define OPTION_DISPLAYCOMMENTTIME_DEF 5.0f #define OPTION_DISPLAYCOMMENTTIME_MAX 30.0f #define OPTION_DISPLAYCOMMENTTIME_MIN 0.0f #define OPTION_MAXNUMMODEL_STR "max_num_model" #define OPTION_MAXNUMMODEL_DEF 10 #define OPTION_MAXNUMMODEL_MAX 1024 #define OPTION_MAXNUMMODEL_MIN 1 /* Option: user options */ class Option { private: /* cartoon rendering */ bool m_useCartoonRendering; bool m_useMMDLikeCartoon; float m_cartoonEdgeWidth; float m_cartoonEdgeStep; float m_cartoonEdgeSelectedColor[4]; /* camera viewpoint parameters */ float m_cameraRotation[3]; float m_cameraTransition[3]; float m_cameraDistance; float m_cameraFovy; /* stage */ float m_stageSize[3]; /* fps */ bool m_showFps; float m_fpsPosition[3]; /* window */ int m_windowSize[2]; bool m_fullScreen; /* log */ int m_logSize[2]; float m_logPosition[3]; float m_logScale; /* light */ float m_lightDirection[4]; float m_lightIntensity; float m_lightColor[3]; /* campus */ float m_campusColor[3]; /* OpenGL */ int m_maxMultiSampling; /* motion */ float m_motionAdjustTime; float m_lipsyncPriority; /* bullet physics */ int m_bulletFps; /* gravity scale */ float m_gravityFactor; /* move */ float m_rotateStep; float m_translateStep; float m_distanceStep; float m_fovyStep; /* shadow mapping */ bool m_useShadowMapping; int m_shadowMapTextureSize; float m_shadowMapSelfDensity; float m_shadowMapFloorDensity; bool m_shadowMapLightFirst; /* comment */ float m_displayCommentTime; /* model */ int m_maxNumModel; /* initialize: initialize options */ void initialize(); public: /* Option: constructor */ Option(); /* load: load options */ bool load(const char *file); /* getUseCartoonRendering: get cartoon rendering flag */ bool getUseCartoonRendering(); /* setUseCartoonRendering: set cartoon rendering flag */ void setUseCartoonRendering(bool b); /* getUseMMDLikeCartoon: get MikuMikuDance like cartoon flag */ bool getUseMMDLikeCartoon(); /* setUseMMDLikeCartoon: set MikuMikuDance like cartoon flag */ void setUseMMDLikeCartoon(bool b); /* getCartoonEdgeWidth: get edge width for catoon */ float getCartoonEdgeWidth(); /* setCartoonEdgeWidth: set edge width for catoon */ void setCartoonEdgeWidth(float f); /* getCartoonEdgeStep: get cartoon edge step */ float getCartoonEdgeStep(); /* setCartoonEdgeStep: set cartoon edge step */ void setCartoonEdgeStep(float f); /* getCartoonEdgeSelectedColor: get cartoon edge seleceted color */ float *getCartoonEdgeSelectedColor(); /* setCartoonEdgeSelectedColor: set cartoon edge seleceted color */ void setCartoonEdgeSelectedColor(const float *f); /* getCameraRotation: get camera rotation */ float *getCameraRotation(); /* setCameraRotation: set camera rotation */ void setCameraRotation(const float *f); /* getCameraTransition: get camera transition */ float *getCameraTransition(); /* setCameraTransition: set camera transition */ void setCameraTransition(const float *f); /* getCameraDistance: get camera distance */ float getCameraDistance(); /* setCameraDistance: set camera distance */ void setCameraDistance(float f); /* getCameraFovy: get camera fovy */ float getCameraFovy(); /* setCameraFovy: set camera fovy */ void setCameraFovy(float f); /* getStageSize: get stage size */ float *getStageSize(); /* setStageSize: set stage size */ void setStageSize(const float *f); /* getShowFps: get fps flag */ bool getShowFps(); /* setShowFps: set fps flag */ void setShowFps(bool b); /* getFpsPosition: get fps position */ float *getFpsPosition(); /* setFpsPosition: set fps position */ void setFpsPosition(const float *f); /* getWindowSize: get window size */ int *getWindowSize(); /* setWindowSize: set window size */ void setWindowSize(const int *i); /* getFullScreen: get full screen flag */ bool getFullScreen(); /* setFullScreen: set full screen flag */ void setFullScreen(bool b); /* getLogSize: get log window size */ int* getLogSize(); /* setLogSize: set log window size */ void setLogSize(const int *i); /* getLogPosition: get log window position */ float *getLogPosition(); /* setLogPosition: set log window position */ void setLogPosition(const float *f); /* getLogScale: get log window scale */ float getLogScale(); /* setLogScale: set log window scale */ void setLogScale(float f); /* getLogDirection: get light direction */ float *getLightDirection(); /* setLogDirection: set light direction */ void setLightDirection(const float *f); /* getLogIntensity: get light intensity */ float getLightIntensity(); /* setLogIntensity: set light intensity */ void setLightIntensity(float f); /* getLightColor: get light color */ float *getLightColor(); /* setLightColor: set light color */ void setLightColor(const float *f); /* getCampusColor: get campus color */ float *getCampusColor(); /* setCampusColor: set campus color */ void setCampusColor(const float *f); /* getMaxMultiSampling: get max number of multi sampling */ int getMaxMultiSampling(); /* setMaxMultiSampling: set max number of multi sampling */ void setMaxMultiSampling(int i); /* getMotionAdjustTime: get motion adjust time in sec */ float getMotionAdjustTime(); /* setMotionAdjustTime: set motion adjust time in sec */ void setMotionAdjustTime(float f); /* getLipsyncPriority: get lipsync motion priority */ float getLipsyncPriority(); /* setLipsyncPriority: set lipsync motion priority */ void setLipsyncPriority(float f); /* getBulletFps: get bullet fps */ int getBulletFps(); /* setBulletFps: set bullet fps */ void setBulletFps(int i); /* setGravityFactor: set gravity factor */ void setGravityFactor(float f); /* getGravityFactor: get gravity factor */ float getGravityFactor(); /* getRotateStep: get rotate step */ float getRotateStep(); /* setRotateStep: set rotate step */ void setRotateStep(float f); /* getTranslateStep: get translate step */ float getTranslateStep(); /* setTranslateStep: set translate step */ void setTranslateStep(float f); /* getDistanceStep: get distance step */ float getDistanceStep(); /* setDistanceStep: set distance step */ void setDistanceStep(float f); /* getFovyStep: get fovy step */ float getFovyStep(); /* setFovyStep: set fovy step */ void setFovyStep(float f); /* getUseShadowMapping: get shadow mapping flag */ bool getUseShadowMapping(); /* setUseShadowMapping: set shadow mapping flag */ void setUseShadowMapping(bool b); /* getShadowMappingTextureSize: get texture size of shadow mapping */ int getShadowMappingTextureSize(); /* setShadowMappingTextureSize: set texture size of shadow mapping */ void setShadowMappingTextureSize(int i); /* getShadowMappingSelfDensity: get self density of shadow mapping */ float getShadowMappingSelfDensity(); /* setShadowMappingSelfDensity: set self density of shadow mapping */ void setShadowMappingSelfDensity(float f); /* getShadowMappingFloorDensity: get floor density of shadow mapping */ float getShadowMappingFloorDensity(); /* setShadowMappingFloorDensity: set floor density of shadow mapping */ void setShadowMappingFloorDensity(float f); /* getShadowMappingLightFirst: get first light flag */ bool getShadowMappingLightFirst(); /* setShadowMappingLightFirst: set first light flag */ void setShadowMappingLightFirst(bool b); /* getDisplayCommentTime: get display comment time in sec */ float getDisplayCommentTime(); /* setDisplayCommentTime: set display comment time in sec */ void setDisplayCommentTime(float f); /* getMaxNumModel: get maximum number of models */ int getMaxNumModel(); /* setMaxNumModel: set maximum number of models */ void setMaxNumModel(int i); };
18803bd7d332ec3fcc95ba24134b0dc980133b4e
66c148b4282ebc4b8fa85049eb062028170ebdb3
/GlobalProject/Week10Wordprocessing/localHeaders/Text.h
55e44d68d1501989fde8a634f6532a85179eb1e4
[]
no_license
KonstantinovD/Basics-of-CPP-BSU-2017
5de3749e364d371097a60d57116dc71c25fd51ee
6c5b413bf5c01b7fe2a90f953b529245f3e966b1
refs/heads/master
2021-09-08T06:28:58.654521
2018-03-07T22:08:02
2018-03-07T22:08:02
106,162,710
0
0
null
null
null
null
UTF-8
C++
false
false
479
h
#pragma once #include <list> #include "Sentence.h" class Text: public Sentence{ private: std::list<std::pair<int, int>> sentBegins; public: Text() : Sentence(){} //takes C-string Text(char*); Text(char*, int); Text(char); Text(const Text&); ~Text(){} void push_back(const Sentence&); void sortWords(); private: bool isEndOfSentence(int index); void updateSentBegins(); public: int findSentWithCommonWords(); };
958a1787bd175a644f073e5b48faa3f42f4f12ef
b123be12ec02f51c8456abeee75a254a75b0918b
/POJ_accepted/2115.cpp
81199136dee16848662b02f3c541b4e0c4ea43db
[]
no_license
oct-month/OJ-problems
4e91916de718745d0ff7c0ecdb476e4673515f18
f40b8998ae1ea05fb6c3a9d2bf20005f858e6c31
refs/heads/master
2022-11-29T00:33:54.553227
2020-08-09T15:07:43
2020-08-09T15:07:43
280,439,178
0
0
null
null
null
null
UTF-8
C++
false
false
661
cpp
#include<iostream> #include<cstdio> using namespace std; typedef long long LL; LL ex_gcd(LL a,LL b,LL &x,LL &y) { if(b==0) { x=1; y=0; return a; } LL md=ex_gcd(b,a%b,x,y); LL temp=x; x=y,y=temp-a/b*y; return md; } int main() { LL A,B,C,k,x,y; while(~scanf("%lld %lld %lld %lld",&A,&B,&C,&k)&&A+B+C+k) { LL a=C,b=1LL<<k,c=B-A; LL gcd=ex_gcd(a,b,x,y); if(c%gcd) { printf("FOREVER\n"); continue; } a/=gcd,c/=gcd,b/=gcd; x*=c; x=(x%b+b)%b; printf("%lld\n",x); } return 0; } //https://blog.csdn.net/qq_22902423/article/details/50569835
48e3cbdc5b6e6eeb4379329feba72fd98b318c46
a9c561ab1de476e0ed110c7290dc9f3386ae4e3f
/Tutorials/GPU/CNS/Source/hydro/CNS_hydro_K.H
f2e70c28ce7fda2769f0414cd43fba333d9f486b
[ "BSD-2-Clause" ]
permissive
JBlaschke/amrex-backup
0c2277157b63c9a10c0983a5b9740d2fd6107ea0
8fd7fa13765fc662e7c2cfc82a4af15212acbfe8
refs/heads/master
2022-04-18T16:13:12.877094
2020-04-19T16:07:46
2020-04-19T16:07:46
null
0
0
null
null
null
null
UTF-8
C++
false
false
14,630
h
#ifndef CNS_HYDRO_K_H_ #define CNS_HYDRO_K_H_ #include "CNS_index_macros.H" #include "CNS_parm.H" #include <AMReX_FArrayBox.H> #include <cmath> AMREX_GPU_DEVICE inline void cns_ctoprim (int i, int j, int k, amrex::Array4<amrex::Real const> const& u, amrex::Array4<amrex::Real> const& q, Parm const& parm) noexcept { amrex::Real rho = amrex::max(u(i,j,k,URHO),parm.smallr); amrex::Real rhoinv = 1.0/rho; amrex::Real ux = u(i,j,k,UMX)*rhoinv; amrex::Real uy = u(i,j,k,UMY)*rhoinv; amrex::Real uz = u(i,j,k,UMZ)*rhoinv; amrex::Real kineng = 0.5*rho*(ux*ux+uy*uy+uz*uz); amrex::Real ei = u(i,j,k,UEDEN) - kineng; if (ei <= 0.0) ei = u(i,j,k,UEINT); amrex::Real p = amrex::max((parm.eos_gamma-1.0)*ei,parm.smallp); ei *= rhoinv; q(i,j,k,QRHO) = rho; q(i,j,k,QU) = ux; q(i,j,k,QV) = uy; q(i,j,k,QW) = uz; q(i,j,k,QEINT) = ei; q(i,j,k,QPRES) = p; q(i,j,k,QCS) = std::sqrt(parm.eos_gamma*p*rhoinv); q(i,j,k,QTEMP) = 0.0; } AMREX_GPU_DEVICE inline void cns_flux_to_dudt (int i, int j, int k, int n, amrex::Array4<amrex::Real> const& dudt, amrex::Array4<amrex::Real const> const& fx, amrex::Array4<amrex::Real const> const& fy, amrex::Array4<amrex::Real const> const& fz, amrex::GpuArray<amrex::Real,AMREX_SPACEDIM> const& dxinv) noexcept { dudt(i,j,k,n) = dxinv[0] * (fx(i,j,k,n) - fx(i+1,j,k,n)) + dxinv[1] * (fy(i,j,k,n) - fy(i,j+1,k,n)) + dxinv[2] * (fz(i,j,k,n) - fz(i,j,k+1,n)); } namespace { AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real limiter (amrex::Real dlft, amrex::Real drgt) noexcept { amrex::Real dcen = 0.5*(dlft+drgt); amrex::Real dsgn = amrex::Math::copysign(1.0, dcen); amrex::Real slop = 2.0 * amrex::min(amrex::Math::abs(dlft),amrex::Math::abs(drgt)); amrex::Real dlim = (dlft*drgt >= 0.0) ? slop : 0.0; return dsgn * amrex::min(dlim,amrex::Math::abs(dcen)); } } AMREX_GPU_DEVICE inline void cns_slope_x (int i, int j, int k, amrex::Array4<amrex::Real> const& dq, amrex::Array4<amrex::Real const> const& q) noexcept { amrex::Real dlft = 0.5*(q(i,j,k,QPRES)-q(i-1,j,k,QPRES))/q(i,j,k,QCS) - 0.5*q(i,j,k,QRHO)*(q(i,j,k,QU) - q(i-1,j,k,QU)); amrex::Real drgt = 0.5*(q(i+1,j,k,QPRES)-q(i,j,k,QPRES))/q(i,j,k,QCS) - 0.5*q(i,j,k,QRHO)*(q(i+1,j,k,QU) - q(i,j,k,QU)); amrex::Real d0 = limiter(dlft, drgt); amrex::Real cs2 = q(i,j,k,QCS)*q(i,j,k,QCS); dlft = (q(i,j,k,QRHO)-q(i-1,j,k,QRHO)) - (q(i,j,k,QPRES) - q(i-1,j,k,QPRES))/cs2; drgt = (q(i+1,j,k,QRHO)-q(i,j,k,QRHO)) - (q(i+1,j,k,QPRES) - q(i,j,k,QPRES))/cs2; amrex::Real d1 = limiter(dlft, drgt); dlft = 0.5*(q(i,j,k,QPRES)-q(i-1,j,k,QPRES))/q(i,j,k,QCS) + 0.5*q(i,j,k,QRHO)*(q(i,j,k,QU) - q(i-1,j,k,QU)); drgt = 0.5*(q(i+1,j,k,QPRES)-q(i,j,k,QPRES))/q(i,j,k,QCS) + 0.5*q(i,j,k,QRHO)*(q(i+1,j,k,QU) - q(i,j,k,QU)); amrex::Real d2 = limiter(dlft, drgt); dlft = q(i,j,k,QV) - q(i-1,j,k,QV); drgt = q(i+1,j,k,QV) - q(i,j,k,QV); amrex::Real d3 = limiter(dlft, drgt); dlft = q(i,j,k,QW) - q(i-1,j,k,QW); drgt = q(i+1,j,k,QW) - q(i,j,k,QW); amrex::Real d4 = limiter(dlft, drgt); dq(i,j,k,0) = d0; dq(i,j,k,1) = d1; dq(i,j,k,2) = d2; dq(i,j,k,3) = d3; dq(i,j,k,4) = d4; } AMREX_GPU_DEVICE inline void cns_slope_y (int i, int j, int k, amrex::Array4<amrex::Real> const& dq, amrex::Array4<amrex::Real const> const& q) noexcept { amrex::Real dlft = 0.5*(q(i,j,k,QPRES)-q(i,j-1,k,QPRES))/q(i,j,k,QCS) - 0.5*q(i,j,k,QRHO)*(q(i,j,k,QV) - q(i,j-1,k,QV)); amrex::Real drgt = 0.5*(q(i,j+1,k,QPRES)-q(i,j,k,QPRES))/q(i,j,k,QCS) - 0.5*q(i,j,k,QRHO)*(q(i,j+1,k,QV) - q(i,j,k,QV)); amrex::Real d0 = limiter(dlft, drgt); amrex::Real cs2 = q(i,j,k,QCS)*q(i,j,k,QCS); dlft = (q(i,j,k,QRHO)-q(i,j-1,k,QRHO)) - (q(i,j,k,QPRES) - q(i,j-1,k,QPRES))/cs2; drgt = (q(i,j+1,k,QRHO)-q(i,j,k,QRHO)) - (q(i,j+1,k,QPRES) - q(i,j,k,QPRES))/cs2; amrex::Real d1 = limiter(dlft, drgt); dlft = 0.5*(q(i,j,k,QPRES)-q(i,j-1,k,QPRES))/q(i,j,k,QCS) + 0.5*q(i,j,k,QRHO)*(q(i,j,k,QV) - q(i,j-1,k,QV)); drgt = 0.5*(q(i,j+1,k,QPRES)-q(i,j,k,QPRES))/q(i,j,k,QCS) + 0.5*q(i,j,k,QRHO)*(q(i,j+1,k,QV) - q(i,j,k,QV)); amrex::Real d2 = limiter(dlft, drgt); dlft = q(i,j,k,QU) - q(i,j-1,k,QU); drgt = q(i,j+1,k,QU) - q(i,j,k,QU); amrex::Real d3 = limiter(dlft, drgt); dlft = q(i,j,k,QW) - q(i,j-1,k,QW); drgt = q(i,j+1,k,QW) - q(i,j,k,QW); amrex::Real d4 = limiter(dlft, drgt); dq(i,j,k,0) = d0; dq(i,j,k,1) = d1; dq(i,j,k,2) = d2; dq(i,j,k,3) = d3; dq(i,j,k,4) = d4; } AMREX_GPU_DEVICE inline void cns_slope_z (int i, int j, int k, amrex::Array4<amrex::Real> const& dq, amrex::Array4<amrex::Real const> const& q) noexcept { amrex::Real dlft = 0.5*(q(i,j,k,QPRES)-q(i,j,k-1,QPRES))/q(i,j,k,QCS) - 0.5*q(i,j,k,QRHO)*(q(i,j,k,QW) - q(i,j,k-1,QW)); amrex::Real drgt = 0.5*(q(i,j,k+1,QPRES)-q(i,j,k,QPRES))/q(i,j,k,QCS) - 0.5*q(i,j,k,QRHO)*(q(i,j,k+1,QW) - q(i,j,k,QW)); amrex::Real d0 = limiter(dlft, drgt); amrex::Real cs2 = q(i,j,k,QCS)*q(i,j,k,QCS); dlft = (q(i,j,k,QRHO)-q(i,j,k-1,QRHO)) - (q(i,j,k,QPRES) - q(i,j,k-1,QPRES))/cs2; drgt = (q(i,j,k+1,QRHO)-q(i,j,k,QRHO)) - (q(i,j,k+1,QPRES) - q(i,j,k,QPRES))/cs2; amrex::Real d1 = limiter(dlft, drgt); dlft = 0.5*(q(i,j,k,QPRES)-q(i,j,k-1,QPRES))/q(i,j,k,QCS) + 0.5*q(i,j,k,QRHO)*(q(i,j,k,QW) - q(i,j,k-1,QW)); drgt = 0.5*(q(i,j,k+1,QPRES)-q(i,j,k,QPRES))/q(i,j,k,QCS) + 0.5*q(i,j,k,QRHO)*(q(i,j,k+1,QW) - q(i,j,k,QW)); amrex::Real d2 = limiter(dlft, drgt); dlft = q(i,j,k,QU) - q(i,j,k-1,QU); drgt = q(i,j,k+1,QU) - q(i,j,k,QU); amrex::Real d3 = limiter(dlft, drgt); dlft = q(i,j,k,QV) - q(i,j,k-1,QV); drgt = q(i,j,k+1,QV) - q(i,j,k,QV); amrex::Real d4 = limiter(dlft, drgt); dq(i,j,k,0) = d0; dq(i,j,k,1) = d1; dq(i,j,k,2) = d2; dq(i,j,k,3) = d3; dq(i,j,k,4) = d4; } namespace { AMREX_GPU_DEVICE inline void riemann (const amrex::Real gamma, const amrex::Real smallp, const amrex::Real smallr, const amrex::Real rl, const amrex::Real ul, const amrex::Real pl, const amrex::Real ut1l, const amrex::Real ut2l, const amrex::Real rr, const amrex::Real ur, const amrex::Real pr, const amrex::Real ut1r, const amrex::Real ut2r, amrex::Real& flxrho, amrex::Real& flxu, amrex::Real& flxut, amrex::Real& flxutt, amrex::Real& flxe) noexcept { constexpr amrex::Real weakwv = 1.e-3; constexpr amrex::Real small = 1.e-6; amrex::Real clsql = gamma*pl*rl; amrex::Real clsqr = gamma*pr*rr; amrex::Real wl = std::sqrt(clsql); amrex::Real wr = std::sqrt(clsqr); amrex::Real cleft = wl/rl; amrex::Real cright = wr/rr; amrex::Real ccsmall = small*(cleft+cright); amrex::Real pstar = (wl*pr + wr*pl - wr*wl*(ur-ul))/(wl+wr); pstar = amrex::max(pstar,smallp); amrex::Real pstnm1 = pstar; amrex::Real wlsq = (.5*(gamma-1.)*(pstar+pl)+pstar)*rl; amrex::Real wrsq = (.5*(gamma-1.)*(pstar+pr)+pstar)*rr; wl = std::sqrt(wlsq); wr = std::sqrt(wrsq); amrex::Real ustarp = ul - (pstar-pl)/wl; amrex::Real ustarm = ur + (pstar-pr)/wr; pstar = (wl*pr + wr*pl - wr*wl*(ur-ul))/(wl+wr); pstar = amrex::max(pstar,smallp); amrex::Real ustar; for (int iter = 0; iter < 3; ++iter) { wlsq = (.5*(gamma-1.)*(pstar+pl)+pstar)*rl; wrsq = (.5*(gamma-1.)*(pstar+pr)+pstar)*rr; wl = 1./sqrt(wlsq); wr = 1./sqrt(wrsq); amrex::Real ustnm1 = ustarm; amrex::Real ustnp1 = ustarp; ustarm = ur - (pr - pstar)*wr; ustarp = ul + (pl - pstar)*wl; amrex::Real dpditer = amrex::Math::abs(pstnm1-pstar); amrex::Real zp = amrex::Math::abs(ustarp-ustnp1); if (zp-weakwv*cleft < 0.0 ) { zp = dpditer*wl; } amrex::Real zm = amrex::Math::abs(ustarm-ustnm1); if (zm-weakwv*cright < 0.0 ) { zm = dpditer*wr; } amrex::Real zz = zp+zm; amrex::Real denom = dpditer/ amrex::max(zz,ccsmall); pstnm1 = pstar; pstar = pstar - denom*(ustarm-ustarp); pstar = amrex::max(pstar,smallp); ustar = 0.5*(ustarm+ustarp); } amrex::Real ro, uo, po, sgnm, utrans1, utrans2; if (ustar > 0.) { ro = rl; uo = ul; po = pl; sgnm = 1.; utrans1 = ut1l; utrans2 = ut2l; } else if (ustar < 0.) { ro = rr; uo = ur; po = pr; sgnm = -1.; utrans1 = ut1r; utrans2 = ut2r; } else { uo = 0.5*(ur+ul); po = 0.5*(pr+pl); ro = 2.*(rl*rr)/(rl+rr); sgnm = 1.; utrans1 = 0.5*(ut1l+ut1r); utrans2 = 0.5*(ut2l+ut2r); } amrex::Real wosq = (.5*(gamma-1.)*(pstar+po)+pstar)*ro; amrex::Real co = std::sqrt(gamma * po / ro); amrex::Real wo = std::sqrt(wosq); amrex::Real dpjmp = pstar-po; amrex::Real rstar = ro/(1.-ro*dpjmp/wosq); amrex::Real cstar = sqrt(gamma * pstar / rstar); amrex::Real spout = co-sgnm*uo; amrex::Real spin = cstar - sgnm*uo; if(pstar >= po) { spin = wo/ro-sgnm*uo; spout = spin; } amrex::Real ss = amrex::max(spout-spin, spout+spin); amrex::Real frac = 0.5*(1.+(spin+spout)/amrex::max(ss,ccsmall)); amrex::Real rgdnv, ugdnv, pgdnv; if (spout < 0.) { rgdnv = ro; ugdnv = uo; pgdnv = po; } else if(spin >= 0.) { rgdnv = rstar; ugdnv = ustar; pgdnv = pstar; } else { rgdnv = frac*rstar + (1. - frac)* ro; ugdnv = frac*ustar + (1. - frac)* uo; pgdnv = frac*pstar + (1. - frac)* po; } flxrho = rgdnv*ugdnv; flxu = rgdnv*ugdnv*ugdnv+pgdnv; flxut = rgdnv*ugdnv*utrans1; flxutt = rgdnv*ugdnv*utrans2; flxe = ugdnv*(0.5*rgdnv*(ugdnv*ugdnv+utrans1*utrans1+utrans2*utrans2) + pgdnv/(gamma -1.) + pgdnv); } } AMREX_GPU_DEVICE inline void cns_riemann_x (int i, int j, int k, amrex::Array4<amrex::Real> const& fx, amrex::Array4<amrex::Real const> const& dq, amrex::Array4<amrex::Real const> const& q, Parm const& parm) noexcept { amrex::Real cspeed = q(i-1,j,k,QCS); amrex::Real rl = q(i-1,j,k,QRHO) + 0.5 * ( (dq(i-1,j,k,0)+dq(i-1,j,k,2))/cspeed + dq(i-1,j,k,1)); rl = amrex::max(rl, parm.smallr); amrex::Real ul = q(i-1,j,k,QU) + 0.5 * ( (dq(i-1,j,k,2)-dq(i-1,j,k,0))/q(i-1,j,k,QRHO)); amrex::Real pl = q(i-1,j,k,QPRES) + 0.5 * (dq(i-1,j,k,0)+dq(i-1,j,k,2))*cspeed; pl = amrex::max(pl, parm.smallp); amrex::Real ut1l = q(i-1,j,k,QV) + 0.5 * dq(i-1,j,k,3); amrex::Real ut2l = q(i-1,j,k,QW) + 0.5 * dq(i-1,j,k,4); cspeed = q(i,j,k,QCS); amrex::Real rr = q(i,j,k,QRHO) - 0.5 * ( (dq(i,j,k,0)+dq(i,j,k,2))/cspeed + dq(i,j,k,1)); rr = amrex::max(rr, parm.smallr); amrex::Real ur = q(i,j,k,QU) - 0.5 * ( (dq(i,j,k,2)-dq(i,j,k,0))/q(i,j,k,QRHO)); amrex::Real pr = q(i,j,k,QPRES) - 0.5 * (dq(i,j,k,0)+dq(i,j,k,2))*cspeed; pr = amrex::max(pr, parm.smallp); amrex::Real ut1r = q(i,j,k,QV) - 0.5 * dq(i,j,k,3); amrex::Real ut2r = q(i,j,k,QW) - 0.5 * dq(i,j,k,4); riemann(parm.eos_gamma, parm.smallp, parm.smallr, rl, ul, pl, ut1l, ut2l, rr, ur, pr, ut1r, ut2r, fx(i,j,k,URHO), fx(i,j,k,UMX), fx(i,j,k,UMY), fx(i,j,k,UMZ), fx(i,j,k,UEDEN)); } AMREX_GPU_DEVICE inline void cns_riemann_y (int i, int j, int k, amrex::Array4<amrex::Real> const& fy, amrex::Array4<amrex::Real const> const& dq, amrex::Array4<amrex::Real const> const& q, Parm const& parm) noexcept { amrex::Real cspeed = q(i,j-1,k,QCS); amrex::Real rl = q(i,j-1,k,QRHO) + 0.5 * ( (dq(i,j-1,k,0)+dq(i,j-1,k,2))/cspeed + dq(i,j-1,k,1)); rl = amrex::max(rl, parm.smallr); amrex::Real ul = q(i,j-1,k,QV) + 0.5 * ( (dq(i,j-1,k,2)-dq(i,j-1,k,0))/q(i,j-1,k,QRHO)); amrex::Real pl = q(i,j-1,k,QPRES) + 0.5 * (dq(i,j-1,k,0)+dq(i,j-1,k,2))*cspeed; pl = amrex::max(pl, parm.smallp); amrex::Real ut1l = q(i,j-1,k,QU) + 0.5 * dq(i,j-1,k,3); amrex::Real ut2l = q(i,j-1,k,QW) + 0.5 * dq(i,j-1,k,4); cspeed = q(i,j,k,QCS); amrex::Real rr = q(i,j,k,QRHO) - 0.5 * ( (dq(i,j,k,0)+dq(i,j,k,2))/cspeed + dq(i,j,k,1)); rr = amrex::max(rr, parm.smallr); amrex::Real ur = q(i,j,k,QV) - 0.5 * ( (dq(i,j,k,2)-dq(i,j,k,0))/q(i,j,k,QRHO)); amrex::Real pr = q(i,j,k,QPRES) - 0.5 * (dq(i,j,k,0)+dq(i,j,k,2))*cspeed; pr = amrex::max(pr, parm.smallp); amrex::Real ut1r = q(i,j,k,QU) - 0.5 * dq(i,j,k,3); amrex::Real ut2r = q(i,j,k,QW) - 0.5 * dq(i,j,k,4); riemann(parm.eos_gamma, parm.smallp, parm.smallr, rl, ul, pl, ut1l, ut2l, rr, ur, pr, ut1r, ut2r, fy(i,j,k,URHO), fy(i,j,k,UMY), fy(i,j,k,UMX), fy(i,j,k,UMZ), fy(i,j,k,UEDEN)); } AMREX_GPU_DEVICE inline void cns_riemann_z (int i, int j, int k, amrex::Array4<amrex::Real> const& fz, amrex::Array4<amrex::Real const> const& dq, amrex::Array4<amrex::Real const> const& q, Parm const& parm) noexcept { amrex::Real cspeed = q(i,j,k-1,QCS); amrex::Real rl = q(i,j,k-1,QRHO) + 0.5 * ( (dq(i,j,k-1,0)+dq(i,j,k-1,2))/cspeed + dq(i,j,k-1,1)); rl = amrex::max(rl, parm.smallr); amrex::Real ul = q(i,j,k-1,QW) + 0.5 * ( (dq(i,j,k-1,2)-dq(i,j,k-1,0))/q(i,j,k-1,QRHO)); amrex::Real pl = q(i,j,k-1,QPRES) + 0.5 * (dq(i,j,k-1,0)+dq(i,j,k-1,2))*cspeed; pl = amrex::max(pl, parm.smallp); amrex::Real ut1l = q(i,j,k-1,QU) + 0.5 * dq(i,j,k-1,3); amrex::Real ut2l = q(i,j,k-1,QV) + 0.5 * dq(i,j,k-1,4); cspeed = q(i,j,k,QCS); amrex::Real rr = q(i,j,k,QRHO) - 0.5 * ( (dq(i,j,k,0)+dq(i,j,k,2))/cspeed + dq(i,j,k,1)); rr = amrex::max(rr, parm.smallr); amrex::Real ur = q(i,j,k,QW) - 0.5 * ( (dq(i,j,k,2)-dq(i,j,k,0))/q(i,j,k,QRHO)); amrex::Real pr = q(i,j,k,QPRES) - 0.5 * (dq(i,j,k,0)+dq(i,j,k,2))*cspeed; pr = amrex::max(pr, parm.smallp); amrex::Real ut1r = q(i,j,k,QU) - 0.5 * dq(i,j,k,3); amrex::Real ut2r = q(i,j,k,QV) - 0.5 * dq(i,j,k,4); riemann(parm.eos_gamma, parm.smallp, parm.smallr, rl, ul, pl, ut1l, ut2l, rr, ur, pr, ut1r, ut2r, fz(i,j,k,URHO), fz(i,j,k,UMZ), fz(i,j,k,UMX), fz(i,j,k,UMY), fz(i,j,k,UEDEN)); } #endif
c3e9b49b0ccb293544c0b4d76edc2328384a9d98
b0e3cd0fe4f3694fc335dae319b0fbe19c3bdbe4
/branches/project_gary/src/simulators/cellMovement/blindSearch/blindagentmovementsimulator.cpp
fe7194e2da019b7adb8dc2f38fe97139e25a06c2
[]
no_license
emonet/BHIVE
50836093519288ca0819e4c28878c6cc0bac94b0
0792bfce81664fb2e43ce6df342cd9345876633c
refs/heads/master
2021-01-18T08:46:32.788310
2012-03-27T19:53:40
2012-03-27T19:53:40
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,826
cpp
#include "blindagentmovementsimulator.hh" using namespace std; using namespace Hive; using namespace ChemoPop; BlindAgentMovementSimulator::BlindAgentMovementSimulator() { this->rho = 0; } void BlindAgentMovementSimulator::setAgent(Agent *ag) { this->agent = ag; this->initialise(); } void BlindAgentMovementSimulator::step(double dt) { // get the double trav_dist = this->traveled_distance->getDouble(); double desr_dist = this->desired_distance_to_travel->getDouble(); double v = this->velocity->getDouble(); /// calculate the distance that remains to be traveled double remaining_distance = desr_dist -trav_dist; //cerr<<"remaining_distance: "<< remaining_distance <<endl; //cerr<<v*dt<<endl; /// will the move end within this time_step ? if (remaining_distance < v*dt) { /// continue traveling with a certain probability if (Util::RANDOM(1)*v*dt < remaining_distance) { /// update traveled_distance this->traveled_distance->setDouble(trav_dist + v*dt); /// set current_angle to zero this->current_angle->setDouble(0); //cerr<<"setting to zero"<<endl; } else { /// draw a new angle this->drawNewAngle(); /// draw a new desired_distance this->drawNewDistance(); /// set traveled_distance to having done a single step this->traveled_distance->setDouble(v*dt); // cerr<<"drawing new angle: "<<this->current_angle->getDouble()<<endl; // cerr<<"drawing new dist : "<<this->desired_distance_to_travel->getDouble()<<endl; } } else { /// need to continue in the current direction /// update traveled distance this->traveled_distance->setDouble(trav_dist + v*dt); /// set angle to zero this->current_angle->setDouble(0); } } void BlindAgentMovementSimulator::initialise() { this->traveled_distance = (DoubleData*) this->agent->getDatabase()->getDataItem("traveled_distance"); this->current_angle = (DoubleData*) this->agent->getDatabase()->getDataItem("current_angle"); this->desired_distance_to_travel = (DoubleData*) this->agent->getDatabase()->getDataItem("distance_desired_to_travel"); this->rho = (DoubleData*) this->agent->getDatabase()->getDataItem("rho"); this->velocity = (DoubleData*) this->agent->getDatabase()->getDataItem("velocity"); this->parameter_for_steplength_dist = (DoubleData*) this->agent->getDatabase()->getDataItem("parameter_for_steplength_dist"); } void BlindAgentMovementSimulator::drawNewAngle() { /// not sure how to draw a random number according to wrapped cauchy distribution /// will work on this ... double r = this->rho->getDouble(); double a = 1+r*r; double b = -2*r; double theta= 2*atan(pow(a*a-b*b,0.5)/(a-b)*tan(Util::RANDOM(1)*M_PI*pow(a*a-b*b,0.5)/(1-r*r))); this->current_angle->setDouble(abs(theta)); }
e56fabe246fd756159f0ec29c7043a521f7eceeb
06d594794f0c7e02dcbbd5b258f07d6e0cc32bae
/src/experiments/Mu+Lambda-ES/Uniform-Mutation/Uniform-Crossover-Weighted/LongFrag.cpp
56aae074ef9b75d8905a528f9448642f8321bbca
[]
no_license
NGTOne/stats-experiments
9c194e4c33cd07212ac35d7c79c7a0d74bc3f7b7
3fa6a5c008967ff073d60fac88458d250d96b30c
refs/heads/master
2020-07-15T09:07:08.915609
2017-03-24T17:30:31
2017-03-24T17:30:31
66,521,115
0
0
null
null
null
null
UTF-8
C++
false
false
417
cpp
#include "objectives/discrete/binary/LongestFragmentFunction.hpp" #include "StatsExperiment.hpp" #include <libHierGA/HierGA.hpp> #include <string> int main(int argc, char* argv[]) { StatsExperiment exper( 50, new LongestFragmentFunction(32), new MuPlusLambdaES( new UniformCrossover(1, {0.3, 0.7}), new UniformMutation(0.05), 150 ), argv[1], std::stoul(argv[2]), 32, 0 ); exper.run(); }
62e6177a60e4bb2816da4142e1fe99c5486bd691
f535eaca6e51b35c3bdbed16090be6694f4fcc82
/课题/读取装配关系/smartvars.h
0e2de70cab7ff2c7a6933383a1ad9e2402f033cc
[]
no_license
mubai-victor/project
61736495a05424a9c7b4a2c42a3dd234ad766f00
adb5c0b639a49e1ed1aa56e15a8485119fe111cc
refs/heads/master
2022-12-10T19:32:04.812484
2020-09-12T07:14:42
2020-09-12T07:14:42
290,642,415
0
0
null
null
null
null
UTF-8
C++
false
false
2,379
h
#pragma once template <class T,int type> class SafeArray { public: SafeArray(VARIANT *input): m_input(input), m_access(false), m_bCreate(false), m_pSafeArray(NULL), m_arrayData(NULL), m_result(S_OK) { if(m_input != NULL) { if (V_VT(m_input) != VT_EMPTY) { m_pSafeArray = V_ARRAY (m_input); m_result = SafeArrayAccessData ( m_pSafeArray, (void HUGEP**)&m_arrayData); m_access = m_result == S_OK ; } else m_access = true; } else { ASSERT(FALSE); m_input = &m_target; } } SafeArray(const VARIANT &input) : m_access(true), m_bCreate(false), m_pSafeArray(NULL), m_arrayData(NULL), m_result(S_OK) { m_input = (VARIANT *) &input; if (V_VT(m_input) != VT_EMPTY) { m_pSafeArray = V_ARRAY (m_input); m_result = SafeArrayAccessData ( m_pSafeArray, (void HUGEP**)&m_arrayData); m_access = m_result == S_OK ; } else m_access = true; } SafeArray(unsigned int size,unsigned int dims = 1): m_input(&m_target), m_access(false), m_bCreate(true), m_pSafeArray(NULL), m_arrayData(NULL), m_result(S_OK) { ASSERT(size >= 0); if(size > 0) { m_rgsabound[0].lLbound = 0; m_rgsabound[0].cElements = (int) size; m_pSafeArray = SafeArrayCreate(type, (int)dims, m_rgsabound); V_VT(m_input) = VT_ARRAY | type; m_result = SafeArrayAccessData( m_pSafeArray, (void HUGEP**)&m_arrayData); m_access = m_result == S_OK ; if(!m_access) V_VT(m_input) = VT_EMPTY; } else { V_VT(m_input) = VT_EMPTY; m_access = true; } } inline HRESULT status(){return m_result;} inline int getSize(int index = 0) {return (m_access&&m_pSafeArray)?m_pSafeArray->rgsabound[index].cElements:0;} ~SafeArray(){UnaccessData();} operator T* () {ASSERT(m_access);return m_arrayData;} operator VARIANT () {ASSERT(m_access);UnaccessData(); return *m_input;} T & operator[](int i) {ASSERT(m_access&&m_arrayData);return m_arrayData[i];} private: void UnaccessData(){ if(m_access){ m_result = SafeArrayUnaccessData( m_pSafeArray ); if(m_bCreate && m_result == S_OK) V_ARRAY(m_input) = m_pSafeArray; m_access = false; } } bool m_bCreate; bool m_access; VARIANT *m_input; VARIANT m_target; T *m_arrayData ; SAFEARRAY *m_pSafeArray; SAFEARRAYBOUND m_rgsabound[1]; HRESULT m_result; }; typedef SafeArray<double, VT_R8> SafeDoubleArray ; typedef SafeArray<long, VT_I4> SafeLongArray ; typedef SafeArray<BSTR, VT_BSTR> SafeBSTRArray ; typedef SafeArray<LPDISPATCH, VT_DISPATCH> SafeDISPATCHArray; typedef SafeArray<LPVARIANT, VT_VARIANT> SafeVARIANTArray;
c7ffd9a3a0ff7f22ae74faee7e315edd4c87433a
948f4e13af6b3014582909cc6d762606f2a43365
/testcases/juliet_test_suite/testcases/CWE121_Stack_Based_Buffer_Overflow/s04/CWE121_Stack_Based_Buffer_Overflow__CWE805_int_alloca_memcpy_81_bad.cpp
c76bfa5af06476341667aa792636f92b0c822f45
[]
no_license
junxzm1990/ASAN--
0056a341b8537142e10373c8417f27d7825ad89b
ca96e46422407a55bed4aa551a6ad28ec1eeef4e
refs/heads/master
2022-08-02T15:38:56.286555
2022-06-16T22:19:54
2022-06-16T22:19:54
408,238,453
74
13
null
2022-06-16T22:19:55
2021-09-19T21:14:59
null
UTF-8
C++
false
false
1,151
cpp
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE121_Stack_Based_Buffer_Overflow__CWE805_int_alloca_memcpy_81_bad.cpp Label Definition File: CWE121_Stack_Based_Buffer_Overflow__CWE805.label.xml Template File: sources-sink-81_bad.tmpl.cpp */ /* * @description * CWE: 121 Stack Based Buffer Overflow * BadSource: Set data pointer to the bad buffer * GoodSource: Set data pointer to the good buffer * Sinks: memcpy * BadSink : Copy int array to data using memcpy * Flow Variant: 81 Data flow: data passed in a parameter to an virtual method called via a reference * * */ #ifndef OMITBAD #include "std_testcase.h" #include "CWE121_Stack_Based_Buffer_Overflow__CWE805_int_alloca_memcpy_81.h" namespace CWE121_Stack_Based_Buffer_Overflow__CWE805_int_alloca_memcpy_81 { void CWE121_Stack_Based_Buffer_Overflow__CWE805_int_alloca_memcpy_81_bad::action(int * data) const { { int source[100] = {0}; /* fill with 0's */ /* POTENTIAL FLAW: Possible buffer overflow if data < 100 */ memcpy(data, source, 100*sizeof(int)); printIntLine(data[0]); } } } #endif /* OMITBAD */
ac0f1a8bece9b597e3ba2adbb4a5db8e9cf78dcf
4b0755a70031690df41ba29a5bad03acaad2c52f
/address.cpp
c7bee8e770cf29f00f53462b29604c3f473df7a0
[ "MIT" ]
permissive
etoki/cpp_learn
fe05c5fe19fd5879660251a65f56c6f11d201e14
d5a84df6682f2013770ea12d6e40328c5a74dff3
refs/heads/master
2021-01-19T13:37:05.880461
2017-10-13T14:06:32
2017-10-13T14:06:32
100,845,664
0
0
null
null
null
null
UTF-8
C++
false
false
193
cpp
#include <iostream> #include <stdio.h> using namespace std; int main() { int a; char b[10]; printf("a : %d\nb : %d\nmain : %d\n", &a, b, main); return 0; }
d5e9a6b824bb9e7a5bc05f8301b96b584ed25f18
81b45e7fc0139a3407423205fc48b149d3534200
/action_bus/src/navya_control/move_base.cc
aec66e609a03f8c1d47659d9b535df0a76915498
[]
no_license
omoifodarling/ros_action_driven_bus
2c55330625c7545facf3b153e30ce9505c07a234
42946e6e70fed3387a2ed98a8fa42e52e23b4ab4
refs/heads/master
2020-03-13T14:02:57.896694
2017-11-22T10:06:21
2017-11-22T10:06:21
131,150,859
0
0
null
null
null
null
UTF-8
C++
false
false
1,231
cc
#include <ros/ros.h> #include <move_base_msgs/MoveBaseAction.h> #include <actionlib/client/simple_action_client.h> typedef actionlib::SimpleActionClient<move_base_msgs::MoveBaseAction> MoveBaseClient; int main(int argc, char** argv){ ros::init(argc, argv, "simple_navigation_goals"); //tell the action client that we want to spin a thread by default MoveBaseClient ac("move_base", true); //wait for the action server to come up while(!ac.waitForServer(ros::Duration(5.0))){ ROS_INFO("Waiting for the move_base action server to come up"); } move_base_msgs::MoveBaseGoal goal; //we'll send a goal to the robot to move 1 meter forward //Let's do this for 20 seconds int t = 0; ros::Rate r(1); while( t < 60){ goal.target_pose.header.frame_id = "base_link"; goal.target_pose.header.stamp = ros::Time::now(); goal.target_pose.pose.position.x = 1.0; goal.target_pose.pose.orientation.w = 1.0; ROS_INFO("Sending goal"); ac.sendGoal(goal); ac.waitForResult(); if(ac.getState() == actionlib::SimpleClientGoalState::SUCCEEDED) ROS_INFO("Hooray, the base moved 1 meter forward"); else ROS_INFO("The base failed to move forward 1 meter for some reason"); r.sleep(); t++; } return 0; }
18055eea52f7d90f58b15621f2b2b9e047b952d0
e6a4cb771a984745467b0fdc8d107b45eb42b987
/andromeda/src/qtime/Calendar.h
25090cbf13389c6c4c4e731c4c6d189b5d84f71a
[]
no_license
rvanhezel/Andromeda
cb30dd383024ae7c3b67d35e1e38f312e98a5179
8c95904911f8ae4f108930d3cf07e33d2f110306
refs/heads/master
2020-03-30T20:37:05.572486
2018-10-09T10:44:53
2018-10-09T10:44:53
151,595,849
0
0
null
2018-10-04T15:40:05
2018-10-04T15:40:05
null
UTF-8
C++
false
false
519
h
#pragma once #include "libdef.h" #include <functional> #include "QDate.h" namespace qtime { class EXPORT_SYMBOL Calendar { public: virtual ~Calendar() = default; Calendar(); virtual bool isBankHoliday(const QDate&) const = 0; static bool isWeekend(const QDate&); bool isHoliday(const QDate&) const; bool isBusinessDay(const QDate&) const; QDate nextBusinessDay(const QDate& d) const; QDate prevBusinessDay(const QDate& d) const; static int EasterMonday(int year); }; }
ccf053cbc776c5bc68e465d096a4a42b90c650c5
ef33374c501ced159d6604d57ec563e4ff355d34
/Projects/Library/Source/Tests/TestTree.cpp
088e6bd81fdf0595633ef8cc708bc243aeace414
[ "MIT" ]
permissive
kalineh/KAI
9ebdb1a9d7a15b6b2fb9b550da6508352f2f422a
43ab555bcbad1886715cd00b2cdac89e12d5cfe5
refs/heads/master
2020-07-13T20:10:33.498730
2014-11-08T21:06:12
2014-11-08T21:06:12
26,581,693
1
0
null
null
null
null
UTF-8
C++
false
false
576
cpp
#include "KAI/Test/Base.h" #ifdef KAI_UNIT_TESTS # include "KAI/Tests/TestTree.h" KAI_TESTS_BEGIN void TestTree::Pre() { KAI_TEST_NOT_IMPLEMENTED(); } void TestTree::Post() { KAI_TEST_NOT_IMPLEMENTED(); } void TestTree::TestConstruction() { KAI_TEST_NOT_IMPLEMENTED(); } void TestTree::TestStore() { KAI_TEST_NOT_IMPLEMENTED(); } void TestTree::TestRetreive() { KAI_TEST_NOT_IMPLEMENTED(); } void TestTree::TestScope() { KAI_TEST_NOT_IMPLEMENTED(); } void TestTree::TestSearch() { KAI_TEST_NOT_IMPLEMENTED(); } KAI_TESTS_END #endif // KAI_UNIT_TESTS //EOF
bf01f8e8b9d6ee40c78c327a54a96f40630767a3
a9324dfc545e6bc89b0b505660a13e964cc47170
/src/rpcrawtransaction.cpp
877098af4488ea4c7d991a69a5e85ad7165dcdd7
[ "MIT" ]
permissive
lgsproject/LogisCoin
85bd286d8b46db4c14bb3c612c3a5c74cac22cc8
1ff570832b90d2c5d3bb3a951def398c955e1156
refs/heads/master
2020-03-25T19:43:42.413235
2019-01-31T13:33:57
2019-01-31T13:33:57
144,097,294
15
17
null
null
null
null
UTF-8
C++
false
false
37,221
cpp
// Copyright (c) 2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin developers // Copyright (c) 2014-2015 The Dash developers // Copyright (c) 2017-2018 The PIVX developers // Copyright (c) 2018 The LogisCoin developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "base58.h" #include "core_io.h" #include "init.h" #include "keystore.h" #include "main.h" #include "net.h" #include "primitives/transaction.h" #include "rpcserver.h" #include "script/script.h" #include "script/script_error.h" #include "script/sign.h" #include "script/standard.h" #include "swifttx.h" #include "uint256.h" #include "utilmoneystr.h" #include "zpivchain.h" #ifdef ENABLE_WALLET #include "wallet.h" #endif #include <stdint.h> #include <boost/assign/list_of.hpp> #include <univalue.h> using namespace boost; using namespace boost::assign; using namespace std; void ScriptPubKeyToJSON(const CScript& scriptPubKey, UniValue& out, bool fIncludeHex) { txnouttype type; vector<CTxDestination> addresses; int nRequired; out.push_back(Pair("asm", scriptPubKey.ToString())); if (fIncludeHex) out.push_back(Pair("hex", HexStr(scriptPubKey.begin(), scriptPubKey.end()))); if (!ExtractDestinations(scriptPubKey, type, addresses, nRequired)) { out.push_back(Pair("type", GetTxnOutputType(type))); return; } out.push_back(Pair("reqSigs", nRequired)); out.push_back(Pair("type", GetTxnOutputType(type))); UniValue a(UniValue::VARR); BOOST_FOREACH (const CTxDestination& addr, addresses) a.push_back(CBitcoinAddress(addr).ToString()); out.push_back(Pair("addresses", a)); } void TxToJSON(const CTransaction& tx, const uint256 hashBlock, UniValue& entry) { entry.push_back(Pair("txid", tx.GetHash().GetHex())); entry.push_back(Pair("version", tx.nVersion)); entry.push_back(Pair("locktime", (int64_t)tx.nLockTime)); UniValue vin(UniValue::VARR); BOOST_FOREACH (const CTxIn& txin, tx.vin) { UniValue in(UniValue::VOBJ); if (tx.IsCoinBase()) in.push_back(Pair("coinbase", HexStr(txin.scriptSig.begin(), txin.scriptSig.end()))); else { in.push_back(Pair("txid", txin.prevout.hash.GetHex())); in.push_back(Pair("vout", (int64_t)txin.prevout.n)); UniValue o(UniValue::VOBJ); o.push_back(Pair("asm", txin.scriptSig.ToString())); o.push_back(Pair("hex", HexStr(txin.scriptSig.begin(), txin.scriptSig.end()))); in.push_back(Pair("scriptSig", o)); } in.push_back(Pair("sequence", (int64_t)txin.nSequence)); vin.push_back(in); } entry.push_back(Pair("vin", vin)); UniValue vout(UniValue::VARR); for (unsigned int i = 0; i < tx.vout.size(); i++) { const CTxOut& txout = tx.vout[i]; UniValue out(UniValue::VOBJ); out.push_back(Pair("value", ValueFromAmount(txout.nValue))); out.push_back(Pair("n", (int64_t)i)); UniValue o(UniValue::VOBJ); ScriptPubKeyToJSON(txout.scriptPubKey, o, true); out.push_back(Pair("scriptPubKey", o)); vout.push_back(out); } entry.push_back(Pair("vout", vout)); if (hashBlock != 0) { entry.push_back(Pair("blockhash", hashBlock.GetHex())); BlockMap::iterator mi = mapBlockIndex.find(hashBlock); if (mi != mapBlockIndex.end() && (*mi).second) { CBlockIndex* pindex = (*mi).second; if (chainActive.Contains(pindex)) { entry.push_back(Pair("confirmations", 1 + chainActive.Height() - pindex->nHeight)); entry.push_back(Pair("time", pindex->GetBlockTime())); entry.push_back(Pair("blocktime", pindex->GetBlockTime())); } else entry.push_back(Pair("confirmations", 0)); } } } UniValue getrawtransaction(const UniValue& params, bool fHelp) { if (fHelp || params.size() < 1 || params.size() > 2) throw runtime_error( "getrawtransaction \"txid\" ( verbose )\n" "\nNOTE: By default this function only works sometimes. This is when the tx is in the mempool\n" "or there is an unspent output in the utxo for this transaction. To make it always work,\n" "you need to maintain a transaction index, using the -txindex command line option.\n" "\nReturn the raw transaction data.\n" "\nIf verbose=0, returns a string that is serialized, hex-encoded data for 'txid'.\n" "If verbose is non-zero, returns an Object with information about 'txid'.\n" "\nArguments:\n" "1. \"txid\" (string, required) The transaction id\n" "2. verbose (numeric, optional, default=0) If 0, return a string, other return a json object\n" "\nResult (if verbose is not set or set to 0):\n" "\"data\" (string) The serialized, hex-encoded data for 'txid'\n" "\nResult (if verbose > 0):\n" "{\n" " \"hex\" : \"data\", (string) The serialized, hex-encoded data for 'txid'\n" " \"txid\" : \"id\", (string) The transaction id (same as provided)\n" " \"version\" : n, (numeric) The version\n" " \"locktime\" : ttt, (numeric) The lock time\n" " \"vin\" : [ (array of json objects)\n" " {\n" " \"txid\": \"id\", (string) The transaction id\n" " \"vout\": n, (numeric) \n" " \"scriptSig\": { (json object) The script\n" " \"asm\": \"asm\", (string) asm\n" " \"hex\": \"hex\" (string) hex\n" " },\n" " \"sequence\": n (numeric) The script sequence number\n" " }\n" " ,...\n" " ],\n" " \"vout\" : [ (array of json objects)\n" " {\n" " \"value\" : x.xxx, (numeric) The value in btc\n" " \"n\" : n, (numeric) index\n" " \"scriptPubKey\" : { (json object)\n" " \"asm\" : \"asm\", (string) the asm\n" " \"hex\" : \"hex\", (string) the hex\n" " \"reqSigs\" : n, (numeric) The required sigs\n" " \"type\" : \"pubkeyhash\", (string) The type, eg 'pubkeyhash'\n" " \"addresses\" : [ (json array of string)\n" " \"logiscoinaddress\" (string) logiscoin address\n" " ,...\n" " ]\n" " }\n" " }\n" " ,...\n" " ],\n" " \"blockhash\" : \"hash\", (string) the block hash\n" " \"confirmations\" : n, (numeric) The confirmations\n" " \"time\" : ttt, (numeric) The transaction time in seconds since epoch (Jan 1 1970 GMT)\n" " \"blocktime\" : ttt (numeric) The block time in seconds since epoch (Jan 1 1970 GMT)\n" "}\n" "\nExamples:\n" + HelpExampleCli("getrawtransaction", "\"mytxid\"") + HelpExampleCli("getrawtransaction", "\"mytxid\" 1") + HelpExampleRpc("getrawtransaction", "\"mytxid\", 1")); LOCK(cs_main); uint256 hash = ParseHashV(params[0], "parameter 1"); bool fVerbose = false; if (params.size() > 1) fVerbose = (params[1].get_int() != 0); CTransaction tx; uint256 hashBlock = 0; if (!GetTransaction(hash, tx, hashBlock, true)) throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "No information available about transaction"); string strHex = EncodeHexTx(tx); if (!fVerbose) return strHex; UniValue result(UniValue::VOBJ); result.push_back(Pair("hex", strHex)); TxToJSON(tx, hashBlock, result); return result; } #ifdef ENABLE_WALLET UniValue listunspent(const UniValue& params, bool fHelp) { if (fHelp || params.size() > 4) throw runtime_error( "listunspent ( minconf maxconf [\"address\",...] )\n" "\nReturns array of unspent transaction outputs\n" "with between minconf and maxconf (inclusive) confirmations.\n" "Optionally filter to only include txouts paid to specified addresses.\n" "Results are an array of Objects, each of which has:\n" "{txid, vout, scriptPubKey, amount, confirmations}\n" "\nArguments:\n" "1. minconf (numeric, optional, default=1) The minimum confirmations to filter\n" "2. maxconf (numeric, optional, default=9999999) The maximum confirmations to filter\n" "3. \"addresses\" (string) A json array of logiscoin addresses to filter\n" " [\n" " \"address\" (string) logiscoin address\n" " ,...\n" " ]\n" "4. watchonlyconfig (numberic, optional, default=1) 1 = list regular unspent transactions, 2 = list only watchonly transactions, 3 = list all unspent transactions (including watchonly)\n" "\nResult\n" "[ (array of json object)\n" " {\n" " \"txid\" : \"txid\", (string) the transaction id \n" " \"vout\" : n, (numeric) the vout value\n" " \"address\" : \"address\", (string) the logiscoin address\n" " \"account\" : \"account\", (string) The associated account, or \"\" for the default account\n" " \"scriptPubKey\" : \"key\", (string) the script key\n" " \"amount\" : x.xxx, (numeric) the transaction amount in btc\n" " \"confirmations\" : n (numeric) The number of confirmations\n" " }\n" " ,...\n" "]\n" "\nExamples\n" + HelpExampleCli("listunspent", "") + HelpExampleCli("listunspent", "6 9999999 \"[\\\"1PGFqEzfmQch1gKD3ra4k18PNj3tTUUSqg\\\",\\\"1LtvqCaApEdUGFkpKMM4MstjcaL4dKg8SP\\\"]\"") + HelpExampleRpc("listunspent", "6, 9999999 \"[\\\"1PGFqEzfmQch1gKD3ra4k18PNj3tTUUSqg\\\",\\\"1LtvqCaApEdUGFkpKMM4MstjcaL4dKg8SP\\\"]\"")); RPCTypeCheck(params, boost::assign::list_of(UniValue::VNUM)(UniValue::VNUM)(UniValue::VARR)(UniValue::VNUM)); int nMinDepth = 1; if (params.size() > 0) nMinDepth = params[0].get_int(); int nMaxDepth = 9999999; if (params.size() > 1) nMaxDepth = params[1].get_int(); set<CBitcoinAddress> setAddress; if (params.size() > 2) { UniValue inputs = params[2].get_array(); for (unsigned int inx = 0; inx < inputs.size(); inx++) { const UniValue& input = inputs[inx]; CBitcoinAddress address(input.get_str()); if (!address.IsValid()) throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, string("Invalid LogisCoin address: ") + input.get_str()); if (setAddress.count(address)) throw JSONRPCError(RPC_INVALID_PARAMETER, string("Invalid parameter, duplicated address: ") + input.get_str()); setAddress.insert(address); } } int nWatchonlyConfig = 1; if(params.size() > 3) { nWatchonlyConfig = params[3].get_int(); if (nWatchonlyConfig > 3 || nWatchonlyConfig < 1) nWatchonlyConfig = 1; } UniValue results(UniValue::VARR); vector<COutput> vecOutputs; assert(pwalletMain != NULL); LOCK2(cs_main, pwalletMain->cs_wallet); pwalletMain->AvailableCoins(vecOutputs, false, NULL, false, ALL_COINS, false, nWatchonlyConfig); BOOST_FOREACH (const COutput& out, vecOutputs) { if (out.nDepth < nMinDepth || out.nDepth > nMaxDepth) continue; if (setAddress.size()) { CTxDestination address; if (!ExtractDestination(out.tx->vout[out.i].scriptPubKey, address)) continue; if (!setAddress.count(address)) continue; } CAmount nValue = out.tx->vout[out.i].nValue; const CScript& pk = out.tx->vout[out.i].scriptPubKey; UniValue entry(UniValue::VOBJ); entry.push_back(Pair("txid", out.tx->GetHash().GetHex())); entry.push_back(Pair("vout", out.i)); CTxDestination address; if (ExtractDestination(out.tx->vout[out.i].scriptPubKey, address)) { entry.push_back(Pair("address", CBitcoinAddress(address).ToString())); if (pwalletMain->mapAddressBook.count(address)) entry.push_back(Pair("account", pwalletMain->mapAddressBook[address].name)); } entry.push_back(Pair("scriptPubKey", HexStr(pk.begin(), pk.end()))); if (pk.IsPayToScriptHash()) { CTxDestination address; if (ExtractDestination(pk, address)) { const CScriptID& hash = boost::get<CScriptID>(address); CScript redeemScript; if (pwalletMain->GetCScript(hash, redeemScript)) entry.push_back(Pair("redeemScript", HexStr(redeemScript.begin(), redeemScript.end()))); } } entry.push_back(Pair("amount", ValueFromAmount(nValue))); entry.push_back(Pair("confirmations", out.nDepth)); entry.push_back(Pair("spendable", out.fSpendable)); results.push_back(entry); } return results; } #endif UniValue createrawtransaction(const UniValue& params, bool fHelp) { if (fHelp || params.size() != 2) throw runtime_error( "createrawtransaction [{\"txid\":\"id\",\"vout\":n},...] {\"address\":amount,...}\n" "\nCreate a transaction spending the given inputs and sending to the given addresses.\n" "Returns hex-encoded raw transaction.\n" "Note that the transaction's inputs are not signed, and\n" "it is not stored in the wallet or transmitted to the network.\n" "\nArguments:\n" "1. \"transactions\" (string, required) A json array of json objects\n" " [\n" " {\n" " \"txid\":\"id\", (string, required) The transaction id\n" " \"vout\":n (numeric, required) The output number\n" " }\n" " ,...\n" " ]\n" "2. \"addresses\" (string, required) a json object with addresses as keys and amounts as values\n" " {\n" " \"address\": x.xxx (numeric, required) The key is the logiscoin address, the value is the btc amount\n" " ,...\n" " }\n" "\nResult:\n" "\"transaction\" (string) hex string of the transaction\n" "\nExamples\n" + HelpExampleCli("createrawtransaction", "\"[{\\\"txid\\\":\\\"myid\\\",\\\"vout\\\":0}]\" \"{\\\"address\\\":0.01}\"") + HelpExampleRpc("createrawtransaction", "\"[{\\\"txid\\\":\\\"myid\\\",\\\"vout\\\":0}]\", \"{\\\"address\\\":0.01}\"")); LOCK(cs_main); RPCTypeCheck(params, boost::assign::list_of(UniValue::VARR)(UniValue::VOBJ)); UniValue inputs = params[0].get_array(); UniValue sendTo = params[1].get_obj(); CMutableTransaction rawTx; for (unsigned int idx = 0; idx < inputs.size(); idx++) { const UniValue& input = inputs[idx]; const UniValue& o = input.get_obj(); uint256 txid = ParseHashO(o, "txid"); const UniValue& vout_v = find_value(o, "vout"); if (!vout_v.isNum()) throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter, missing vout key"); int nOutput = vout_v.get_int(); if (nOutput < 0) throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter, vout must be positive"); CTxIn in(COutPoint(txid, nOutput)); rawTx.vin.push_back(in); } set<CBitcoinAddress> setAddress; vector<string> addrList = sendTo.getKeys(); BOOST_FOREACH(const string& name_, addrList) { CBitcoinAddress address(name_); if (!address.IsValid()) throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, string("Invalid LogisCoin address: ")+name_); if (setAddress.count(address)) throw JSONRPCError(RPC_INVALID_PARAMETER, string("Invalid parameter, duplicated address: ")+name_); setAddress.insert(address); CScript scriptPubKey = GetScriptForDestination(address.Get()); CAmount nAmount = AmountFromValue(sendTo[name_]); CTxOut out(nAmount, scriptPubKey); rawTx.vout.push_back(out); } return EncodeHexTx(rawTx); } UniValue decoderawtransaction(const UniValue& params, bool fHelp) { if (fHelp || params.size() != 1) throw runtime_error( "decoderawtransaction \"hexstring\"\n" "\nReturn a JSON object representing the serialized, hex-encoded transaction.\n" "\nArguments:\n" "1. \"hex\" (string, required) The transaction hex string\n" "\nResult:\n" "{\n" " \"txid\" : \"id\", (string) The transaction id\n" " \"version\" : n, (numeric) The version\n" " \"locktime\" : ttt, (numeric) The lock time\n" " \"vin\" : [ (array of json objects)\n" " {\n" " \"txid\": \"id\", (string) The transaction id\n" " \"vout\": n, (numeric) The output number\n" " \"scriptSig\": { (json object) The script\n" " \"asm\": \"asm\", (string) asm\n" " \"hex\": \"hex\" (string) hex\n" " },\n" " \"sequence\": n (numeric) The script sequence number\n" " }\n" " ,...\n" " ],\n" " \"vout\" : [ (array of json objects)\n" " {\n" " \"value\" : x.xxx, (numeric) The value in btc\n" " \"n\" : n, (numeric) index\n" " \"scriptPubKey\" : { (json object)\n" " \"asm\" : \"asm\", (string) the asm\n" " \"hex\" : \"hex\", (string) the hex\n" " \"reqSigs\" : n, (numeric) The required sigs\n" " \"type\" : \"pubkeyhash\", (string) The type, eg 'pubkeyhash'\n" " \"addresses\" : [ (json array of string)\n" " \"12tvKAXCxZjSmdNbao16dKXC8tRWfcF5oc\" (string) logiscoin address\n" " ,...\n" " ]\n" " }\n" " }\n" " ,...\n" " ],\n" "}\n" "\nExamples:\n" + HelpExampleCli("decoderawtransaction", "\"hexstring\"") + HelpExampleRpc("decoderawtransaction", "\"hexstring\"")); LOCK(cs_main); RPCTypeCheck(params, boost::assign::list_of(UniValue::VSTR)); CTransaction tx; if (!DecodeHexTx(tx, params[0].get_str())) throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed"); UniValue result(UniValue::VOBJ); TxToJSON(tx, 0, result); return result; } UniValue decodescript(const UniValue& params, bool fHelp) { if (fHelp || params.size() != 1) throw runtime_error( "decodescript \"hex\"\n" "\nDecode a hex-encoded script.\n" "\nArguments:\n" "1. \"hex\" (string) the hex encoded script\n" "\nResult:\n" "{\n" " \"asm\":\"asm\", (string) Script public key\n" " \"hex\":\"hex\", (string) hex encoded public key\n" " \"type\":\"type\", (string) The output type\n" " \"reqSigs\": n, (numeric) The required signatures\n" " \"addresses\": [ (json array of string)\n" " \"address\" (string) logiscoin address\n" " ,...\n" " ],\n" " \"p2sh\",\"address\" (string) script address\n" "}\n" "\nExamples:\n" + HelpExampleCli("decodescript", "\"hexstring\"") + HelpExampleRpc("decodescript", "\"hexstring\"")); LOCK(cs_main); RPCTypeCheck(params, boost::assign::list_of(UniValue::VSTR)); UniValue r(UniValue::VOBJ); CScript script; if (params[0].get_str().size() > 0) { vector<unsigned char> scriptData(ParseHexV(params[0], "argument")); script = CScript(scriptData.begin(), scriptData.end()); } else { // Empty scripts are valid } ScriptPubKeyToJSON(script, r, false); r.push_back(Pair("p2sh", CBitcoinAddress(CScriptID(script)).ToString())); return r; } /** Pushes a JSON object for script verification or signing errors to vErrorsRet. */ static void TxInErrorToJSON(const CTxIn& txin, UniValue& vErrorsRet, const std::string& strMessage) { UniValue entry(UniValue::VOBJ); entry.push_back(Pair("txid", txin.prevout.hash.ToString())); entry.push_back(Pair("vout", (uint64_t)txin.prevout.n)); entry.push_back(Pair("scriptSig", HexStr(txin.scriptSig.begin(), txin.scriptSig.end()))); entry.push_back(Pair("sequence", (uint64_t)txin.nSequence)); entry.push_back(Pair("error", strMessage)); vErrorsRet.push_back(entry); } UniValue signrawtransaction(const UniValue& params, bool fHelp) { if (fHelp || params.size() < 1 || params.size() > 4) throw runtime_error( "signrawtransaction \"hexstring\" ( [{\"txid\":\"id\",\"vout\":n,\"scriptPubKey\":\"hex\",\"redeemScript\":\"hex\"},...] [\"privatekey1\",...] sighashtype )\n" "\nSign inputs for raw transaction (serialized, hex-encoded).\n" "The second optional argument (may be null) is an array of previous transaction outputs that\n" "this transaction depends on but may not yet be in the block chain.\n" "The third optional argument (may be null) is an array of base58-encoded private\n" "keys that, if given, will be the only keys used to sign the transaction.\n" #ifdef ENABLE_WALLET + HelpRequiringPassphrase() + "\n" #endif "\nArguments:\n" "1. \"hexstring\" (string, required) The transaction hex string\n" "2. \"prevtxs\" (string, optional) An json array of previous dependent transaction outputs\n" " [ (json array of json objects, or 'null' if none provided)\n" " {\n" " \"txid\":\"id\", (string, required) The transaction id\n" " \"vout\":n, (numeric, required) The output number\n" " \"scriptPubKey\": \"hex\", (string, required) script key\n" " \"redeemScript\": \"hex\" (string, required for P2SH) redeem script\n" " }\n" " ,...\n" " ]\n" "3. \"privatekeys\" (string, optional) A json array of base58-encoded private keys for signing\n" " [ (json array of strings, or 'null' if none provided)\n" " \"privatekey\" (string) private key in base58-encoding\n" " ,...\n" " ]\n" "4. \"sighashtype\" (string, optional, default=ALL) The signature hash type. Must be one of\n" " \"ALL\"\n" " \"NONE\"\n" " \"SINGLE\"\n" " \"ALL|ANYONECANPAY\"\n" " \"NONE|ANYONECANPAY\"\n" " \"SINGLE|ANYONECANPAY\"\n" "\nResult:\n" "{\n" " \"hex\" : \"value\", (string) The hex-encoded raw transaction with signature(s)\n" " \"complete\" : true|false, (boolean) If the transaction has a complete set of signatures\n" " \"errors\" : [ (json array of objects) Script verification errors (if there are any)\n" " {\n" " \"txid\" : \"hash\", (string) The hash of the referenced, previous transaction\n" " \"vout\" : n, (numeric) The index of the output to spent and used as input\n" " \"scriptSig\" : \"hex\", (string) The hex-encoded signature script\n" " \"sequence\" : n, (numeric) Script sequence number\n" " \"error\" : \"text\" (string) Verification or signing error related to the input\n" " }\n" " ,...\n" " ]\n" "}\n" "\nExamples:\n" + HelpExampleCli("signrawtransaction", "\"myhex\"") + HelpExampleRpc("signrawtransaction", "\"myhex\"")); #ifdef ENABLE_WALLET LOCK2(cs_main, pwalletMain ? &pwalletMain->cs_wallet : NULL); #else LOCK(cs_main); #endif RPCTypeCheck(params, boost::assign::list_of(UniValue::VSTR)(UniValue::VARR)(UniValue::VARR)(UniValue::VSTR), true); vector<unsigned char> txData(ParseHexV(params[0], "argument 1")); CDataStream ssData(txData, SER_NETWORK, PROTOCOL_VERSION); vector<CMutableTransaction> txVariants; while (!ssData.empty()) { try { CMutableTransaction tx; ssData >> tx; txVariants.push_back(tx); } catch (const std::exception&) { throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed"); } } if (txVariants.empty()) throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "Missing transaction"); // mergedTx will end up with all the signatures; it // starts as a clone of the rawtx: CMutableTransaction mergedTx(txVariants[0]); // Fetch previous transactions (inputs): CCoinsView viewDummy; CCoinsViewCache view(&viewDummy); { LOCK(mempool.cs); CCoinsViewCache& viewChain = *pcoinsTip; CCoinsViewMemPool viewMempool(&viewChain, mempool); view.SetBackend(viewMempool); // temporarily switch cache backend to db+mempool view BOOST_FOREACH (const CTxIn& txin, mergedTx.vin) { const uint256& prevHash = txin.prevout.hash; CCoins coins; view.AccessCoins(prevHash); // this is certainly allowed to fail } view.SetBackend(viewDummy); // switch back to avoid locking mempool for too long } bool fGivenKeys = false; CBasicKeyStore tempKeystore; if (params.size() > 2 && !params[2].isNull()) { fGivenKeys = true; UniValue keys = params[2].get_array(); for (unsigned int idx = 0; idx < keys.size(); idx++) { UniValue k = keys[idx]; CBitcoinSecret vchSecret; bool fGood = vchSecret.SetString(k.get_str()); if (!fGood) throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid private key"); CKey key = vchSecret.GetKey(); if (!key.IsValid()) throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Private key outside allowed range"); tempKeystore.AddKey(key); } } #ifdef ENABLE_WALLET else if (pwalletMain) EnsureWalletIsUnlocked(); #endif // Add previous txouts given in the RPC call: if (params.size() > 1 && !params[1].isNull()) { UniValue prevTxs = params[1].get_array(); for (unsigned int idx = 0; idx < prevTxs.size(); idx++) { const UniValue& p = prevTxs[idx]; if (!p.isObject()) throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "expected object with {\"txid'\",\"vout\",\"scriptPubKey\"}"); UniValue prevOut = p.get_obj(); RPCTypeCheckObj(prevOut, boost::assign::map_list_of("txid", UniValue::VSTR)("vout", UniValue::VNUM)("scriptPubKey", UniValue::VSTR)); uint256 txid = ParseHashO(prevOut, "txid"); int nOut = find_value(prevOut, "vout").get_int(); if (nOut < 0) throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "vout must be positive"); vector<unsigned char> pkData(ParseHexO(prevOut, "scriptPubKey")); CScript scriptPubKey(pkData.begin(), pkData.end()); { CCoinsModifier coins = view.ModifyCoins(txid); if (coins->IsAvailable(nOut) && coins->vout[nOut].scriptPubKey != scriptPubKey) { string err("Previous output scriptPubKey mismatch:\n"); err = err + coins->vout[nOut].scriptPubKey.ToString() + "\nvs:\n" + scriptPubKey.ToString(); throw JSONRPCError(RPC_DESERIALIZATION_ERROR, err); } if ((unsigned int)nOut >= coins->vout.size()) coins->vout.resize(nOut + 1); coins->vout[nOut].scriptPubKey = scriptPubKey; coins->vout[nOut].nValue = 0; // we don't know the actual output value } // if redeemScript given and not using the local wallet (private keys // given), add redeemScript to the tempKeystore so it can be signed: if (fGivenKeys && scriptPubKey.IsPayToScriptHash()) { RPCTypeCheckObj(prevOut, boost::assign::map_list_of("txid", UniValue::VSTR)("vout", UniValue::VNUM)("scriptPubKey", UniValue::VSTR)("redeemScript",UniValue::VSTR)); UniValue v = find_value(prevOut, "redeemScript"); if (!v.isNull()) { vector<unsigned char> rsData(ParseHexV(v, "redeemScript")); CScript redeemScript(rsData.begin(), rsData.end()); tempKeystore.AddCScript(redeemScript); } } } } #ifdef ENABLE_WALLET const CKeyStore& keystore = ((fGivenKeys || !pwalletMain) ? tempKeystore : *pwalletMain); #else const CKeyStore& keystore = tempKeystore; #endif int nHashType = SIGHASH_ALL; if (params.size() > 3 && !params[3].isNull()) { static map<string, int> mapSigHashValues = boost::assign::map_list_of(string("ALL"), int(SIGHASH_ALL))(string("ALL|ANYONECANPAY"), int(SIGHASH_ALL | SIGHASH_ANYONECANPAY))(string("NONE"), int(SIGHASH_NONE))(string("NONE|ANYONECANPAY"), int(SIGHASH_NONE | SIGHASH_ANYONECANPAY))(string("SINGLE"), int(SIGHASH_SINGLE))(string("SINGLE|ANYONECANPAY"), int(SIGHASH_SINGLE | SIGHASH_ANYONECANPAY)); string strHashType = params[3].get_str(); if (mapSigHashValues.count(strHashType)) nHashType = mapSigHashValues[strHashType]; else throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid sighash param"); } bool fHashSingle = ((nHashType & ~SIGHASH_ANYONECANPAY) == SIGHASH_SINGLE); // Script verification errors UniValue vErrors(UniValue::VARR); // Sign what we can: for (unsigned int i = 0; i < mergedTx.vin.size(); i++) { CTxIn& txin = mergedTx.vin[i]; const CCoins* coins = view.AccessCoins(txin.prevout.hash); if (coins == NULL || !coins->IsAvailable(txin.prevout.n)) { TxInErrorToJSON(txin, vErrors, "Input not found or already spent"); continue; } const CScript& prevPubKey = coins->vout[txin.prevout.n].scriptPubKey; txin.scriptSig.clear(); // Only sign SIGHASH_SINGLE if there's a corresponding output: if (!fHashSingle || (i < mergedTx.vout.size())) SignSignature(keystore, prevPubKey, mergedTx, i, nHashType); // ... and merge in other signatures: BOOST_FOREACH (const CMutableTransaction& txv, txVariants) { txin.scriptSig = CombineSignatures(prevPubKey, mergedTx, i, txin.scriptSig, txv.vin[i].scriptSig); } ScriptError serror = SCRIPT_ERR_OK; if (!VerifyScript(txin.scriptSig, prevPubKey, STANDARD_SCRIPT_VERIFY_FLAGS, MutableTransactionSignatureChecker(&mergedTx, i), &serror)) { TxInErrorToJSON(txin, vErrors, ScriptErrorString(serror)); } } bool fComplete = vErrors.empty(); UniValue result(UniValue::VOBJ); result.push_back(Pair("hex", EncodeHexTx(mergedTx))); result.push_back(Pair("complete", fComplete)); if (!vErrors.empty()) { result.push_back(Pair("errors", vErrors)); } return result; } UniValue sendrawtransaction(const UniValue& params, bool fHelp) { if (fHelp || params.size() < 1 || params.size() > 3) throw runtime_error( "sendrawtransaction \"hexstring\" ( allowhighfees )\n" "\nSubmits raw transaction (serialized, hex-encoded) to local node and network.\n" "\nAlso see createrawtransaction and signrawtransaction calls.\n" "\nArguments:\n" "1. \"hexstring\" (string, required) The hex string of the raw transaction)\n" "2. allowhighfees (boolean, optional, default=false) Allow high fees\n" "3. swiftx (boolean, optional, default=false) Use SwiftX to send this transaction\n" "\nResult:\n" "\"hex\" (string) The transaction hash in hex\n" "\nExamples:\n" "\nCreate a transaction\n" + HelpExampleCli("createrawtransaction", "\"[{\\\"txid\\\" : \\\"mytxid\\\",\\\"vout\\\":0}]\" \"{\\\"myaddress\\\":0.01}\"") + "Sign the transaction, and get back the hex\n" + HelpExampleCli("signrawtransaction", "\"myhex\"") + "\nSend the transaction (signed hex)\n" + HelpExampleCli("sendrawtransaction", "\"signedhex\"") + "\nAs a json rpc call\n" + HelpExampleRpc("sendrawtransaction", "\"signedhex\"")); LOCK(cs_main); RPCTypeCheck(params, boost::assign::list_of(UniValue::VSTR)(UniValue::VBOOL)); // parse hex string from parameter CTransaction tx; if (!DecodeHexTx(tx, params[0].get_str())) throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed"); uint256 hashTx = tx.GetHash(); bool fOverrideFees = false; if (params.size() > 1) fOverrideFees = params[1].get_bool(); bool fSwiftX = false; if (params.size() > 2) fSwiftX = params[2].get_bool(); CCoinsViewCache& view = *pcoinsTip; const CCoins* existingCoins = view.AccessCoins(hashTx); bool fHaveMempool = mempool.exists(hashTx); bool fHaveChain = existingCoins && existingCoins->nHeight < 1000000000; if (!fHaveMempool && !fHaveChain) { // push to local node and sync with wallets if (fSwiftX) { mapTxLockReq.insert(make_pair(tx.GetHash(), tx)); CreateNewLock(tx); RelayTransactionLockReq(tx, true); } CValidationState state; if (!AcceptToMemoryPool(mempool, state, tx, false, NULL, !fOverrideFees)) { if (state.IsInvalid()) throw JSONRPCError(RPC_TRANSACTION_REJECTED, strprintf("%i: %s", state.GetRejectCode(), state.GetRejectReason())); else throw JSONRPCError(RPC_TRANSACTION_ERROR, state.GetRejectReason()); } } else if (fHaveChain) { throw JSONRPCError(RPC_TRANSACTION_ALREADY_IN_CHAIN, "transaction already in block chain"); } RelayTransaction(tx); return hashTx.GetHex(); } UniValue getspentzerocoinamount(const UniValue& params, bool fHelp) { if (fHelp || params.size() != 2) throw runtime_error( "getspentzerocoinamount hexstring index\n" "\nReturns value of spent zerocoin output designated by transaction hash and input index.\n" "\nArguments:\n" "1. hash (hexstring) Transaction hash\n" "2. index (int) Input index\n" "\nResult:\n" "\"value\" (int) Spent output value, -1 if error\n" "\nExamples:\n" + HelpExampleCli("getspentzerocoinamount", "78021ebf92a80dfccef1413067f1222e37535399797cce029bb40ad981131706 0")); LOCK(cs_main); uint256 txHash = ParseHashV(params[0], "parameter 1"); int inputIndex = params[1].get_int(); if (inputIndex < 0) throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter for transaction input"); CTransaction tx; uint256 hashBlock = 0; if (!GetTransaction(txHash, tx, hashBlock, true)) throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "No information available about transaction"); if (inputIndex >= (int)tx.vin.size()) throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter for transaction input"); const CTxIn& input = tx.vin[inputIndex]; if (!input.scriptSig.IsZerocoinSpend()) return -1; libzerocoin::CoinSpend spend = TxInToZerocoinSpend(input); CAmount nValue = libzerocoin::ZerocoinDenominationToAmount(spend.getDenomination()); return FormatMoney(nValue); }
0099824b6f6d06c49e3e4364c3404dabdc6b6efb
dc42e112c3cc5946f878ef87037ca1db66453421
/NOTEBOOK.cpp
b7c988ac088d635d741e1ab7337a9891e5a6a033
[]
no_license
dzendmitry/notebook
a389996545cebc9cc2fe3af8a24a32b728b2dbf6
9bdcd21fcc8185f654888c253e3f5221275fbb56
refs/heads/master
2021-01-23T11:07:13.366710
2013-12-12T21:55:46
2013-12-12T21:55:46
null
0
0
null
null
null
null
WINDOWS-1251
C++
false
false
14,707
cpp
#include "StdAfx.h" #include "NOTEBOOK.h" NOTEBOOK::NOTEBOOK() : FILE("notes.txt"), wasChanged(false) { std::fstream file(FILE, std::ios_base::in); if(!file.is_open()) throw std::ios_base::failure("NOTEBOOK::NOTEBOOK(): Ошибка. Невозможно открыть файл с записями. Cоздайте файл notes.txt рядом с .exe файлом программы и повторите попытку."); file >> notes; if(file.bad()) throw std::ios_base::failure("NOTEBOOK::NOTEBOOK(): Ошибка. Чтение из файла завершилось неудачей."); file.close(); } void NOTEBOOK::showAllCommands() { std::cout << std::endl; std::cout << "---- Меню ----" << std::endl; std::cout << CLEAR_SCREEN << " - Очистить экран." << std::endl; std::cout << COUNT_NOTES << " - Показать количество записей." << std::endl; std::cout << LIST_OF_NOTES << " - Показать все записи." << std::endl; std::cout << SHOW_ONE_NOTE << " - Показать запись под номером №." << std::endl; std::cout << ADD_NOTE << " - Добавить запись." << std::endl; std::cout << REMOVE_NOTE << " - Удалить запись." << std::endl; std::cout << REMOVE_ALL_NOTES << " - Удалить все записи." << std::endl; std::cout << MOVE_NOTE << " - Переместить запись." << std::endl; std::cout << SAVE << " - Сохранить записи." << std::endl; std::cout << CLEAN_NOTE << " - Очистить запись." << std::endl; std::cout << FIND_IN_NOTES << " - Найти в записях." << std::endl; std::cout << REPLACE_IN_NOTE << " - Сделать замену в записи." << std::endl; std::cout << REMOVE_FROM_NOTE << " - Удалить из записи(вход - номер позиции)." << std::endl; std::cout << REMOVE_FROM_NOTE_BY_TEXT << " - Удалить из записи(вход - строка)." << std::endl; std::cout << ADD_TO_NOTE << " - Добавить текст в запись." << std::endl; std::cout << MERGE_NOTES << " - Объединить две записи." << std::endl; std::cout << EXIT << " - Выход." << std::endl; } bool NOTEBOOK::processCommand(int& command) { switch(command) { case CLEAR_SCREEN: system("CLS"); break; case COUNT_NOTES: std::cout << std::endl << "Всего записей: " << notes.length() << std::endl; break; case LIST_OF_NOTES: if(notes.length() > 0) { notes.setOutWithNums(true); std::cout << std::endl << notes; notes.setOutWithNums(false); } else std::cout << std::endl << "Записи отсутствуют" << std::endl; break; case SHOW_ONE_NOTE: showOneNote(); break; case ADD_NOTE: addNote(); break; case REMOVE_NOTE: removeNote(); break; case REMOVE_ALL_NOTES: removeAllNotes(); break; case MOVE_NOTE: moveNote(); break; case SAVE: saveNotes(); break; case CLEAN_NOTE: cleanNote(); break; case FIND_IN_NOTES: findInNotes(); break; case REPLACE_IN_NOTE: replaceInNote(); break; case REMOVE_FROM_NOTE: removeFromNote(); break; case REMOVE_FROM_NOTE_BY_TEXT: replaceInNote(true); break; case ADD_TO_NOTE: addToNote(); break; case MERGE_NOTES: mergeNotes(); break; case EXIT: if(!getAnswer("Вы действительно желаете выйти?")) command = -1; else saveNotes(); break; default: std::cout << std::endl << "Ошибка. Команда с таким номером не найдена." << std::endl; return false; } return true; } void NOTEBOOK::showOneNote() { if(notes.length() == 0) { std::cout << std::endl << "Записей нет. Смотреть нечего." << std::endl; return; } int position = 0; if(notes.length() > 1) position = getPosition("Введите номер позиции, которую желаете просмотреть", notes.length()); if(position > -1) std::cout << std::endl << notes[position] << std::endl; } void NOTEBOOK::addNote() { int position = 0; dzString newNote; std::cout << "Введите запись, которую хотите добавить: "; std::cin >> newNote; if(newNote.length() == 1) { std::cout << std::endl << "Запись не содержит символов. Запись не будет добавлена." << std::endl; return; } if(notes.length() > 0) position = getPosition("Введите номер позиции в которую необходимо вставить запись", notes.length() + 1); if(position > -1) { notes.insert(newNote, position); wasChanged = true; std::cout << std::endl << "Добавление записи успешно произведено." << std::endl; } } void NOTEBOOK::removeNote() { if(notes.length() == 0) { std::cout << std::endl << "Записей нет. Удалять нечего." << std::endl; return; } int position = 0; if(notes.length() > 1) position = getPosition("Введите номер позиции, которую необходимо удалить", notes.length()); if( (position > -1) && getAnswer("Вы действительно хотите удалить запись?") ) { notes.erase(position, 1); wasChanged = true; std::cout << std::endl << "Удаление записи успешно произведено." << std::endl; } } void NOTEBOOK::removeAllNotes() { if(notes.length() == 0) { std::cout << std::endl << "Записей нет. Удалять нечего." << std::endl; return; } if(getAnswer("Вы действительно хотите удалить все записи?")) { notes.erase(); wasChanged = true; std::cout << std::endl << "Удаление записей успешно произведено." << std::endl; } } void NOTEBOOK::moveNote() { if(notes.length() < 2) { std::cout << std::endl << "Менее двух записей. Перемещать нечего." << std::endl; return; } int position1 = getPosition("Введите номер позиции, которую необходимо переместить", notes.length()); if(position1 > -1) { int position2 = getPosition("Введите номер позиции в которую необходимо поместить запись", notes.length()); if(position1 == position2) return; if(position2 > -1) { dzString tmpStr = notes[position1]; notes.erase(position1, 1); notes.insert(tmpStr, position2); wasChanged = true; std::cout << std::endl << "Перемещение записей успешно произведено." << std::endl; } } } void NOTEBOOK::saveNotes() { if(wasChanged && getAnswer("Вы желаете сохранить записи?")) { std::fstream file(FILE, std::ios_base::out); if(!file.is_open()) { std::cout << std::endl << "Ошибка. Невозможно открыть файл для записи." << std::endl; return; } file << notes; if(file.bad()) std::cout << std::endl << "Ошибка. Произошла ошибка во время записи." << std::endl; else { std::cout << std::endl << "Запись произведена успешно." << std::endl; wasChanged = false; } file.close(); } } void NOTEBOOK::cleanNote() { if(notes.length() == 0) { std::cout << std::endl << "Записей нет. Очищать нечего." << std::endl; return; } int position = 0; if(notes.length() > 1) position = getPosition("Введите номер позиции, которую желаете очистить.", notes.length()); if(position > -1 && getAnswer("Вы действительно хотите очистить запись?")) { notes[position].clear(); wasChanged = true; std::cout << std::endl << "Очистка записи успешно произведена." << std::endl; } } void NOTEBOOK::findInNotes() { if(notes.length() == 0) { std::cout << "Записей нет. Негде искать." << std::endl; return; } dzString strForSearch; std::cout << "Введите фразу, которую хотите найти: "; std::cin >> strForSearch; bool firstFound = true; for(int i = 0; i < notes.length(); i++) { if(notes[i].find(strForSearch) > -1) { if(firstFound) { std::cout << std::endl << "Фраза нашлась в записях:" << std::endl; firstFound = false; } notes.setOutWithNums(true); std::cout << (i+1) << " - " << notes[i] << std::endl; notes.setOutWithNums(false); } } if(firstFound) std::cout << std::endl << "Фраза не была найдена." << std::endl; } void NOTEBOOK::replaceInNote(bool delByTxt) { if(notes.length() == 0) { std::cout << "Записей нет. Нечего заменять/удалять." << std::endl; return; } int position = 0; if(notes.length() > 1) position = getPosition("Введите номер записи в которой желаете произвести замену/удаление.", notes.length()); if(position > -1) { dzString strForReplace; std::cout << "Введите фразу, которую хотите заменить/удалить: "; std::cin >> strForReplace; dzString strToReplace; if(!delByTxt) { std::cout << "Введите фразу на которую хотите заменить/удалить: "; std::cin >> strToReplace; } else strToReplace = ""; bool all = getAnswer("Заменить/Удалить все вхождения фразы в запись?"); int entry; if(!all) { do { std::cout << "Какое вхождение заменить/удалить?[1..]: "; std::cin >> entry; if (std::cin.fail()) std::cin.clear(); while (std::cin.get() != '\n'); if(entry <= 0) std::cout << "Ошибка. Введите номер вхождения от 1 до ..." << std::endl; } while(entry <= 0); } if(getAnswer("Вы точно хотите произвести замену/удаление?")) { int startPos = 0; if(!all) for(int i = 1; i < entry; i++) { startPos = notes[position].find(strForReplace, startPos); if(startPos > -1) startPos++; } if( (startPos > -1) && notes[position].replace(strForReplace, strToReplace, all, startPos)) std::cout << std::endl << "Замена/Удаление успешно произведены." << std::endl; else std::cout << std::endl << "Замена/Удаление не были произведены." << std::endl; wasChanged = true; } } } void NOTEBOOK::removeFromNote() { if(notes.length() == 0) { std::cout << std::endl << "Записей нет. Неоткуда удалять." << std::endl; return; } int position = getPosition("Введите номер записи, в которой желаете произвести удаление.", notes.length()); if(position > -1) { if(notes[position].isEmpty()) { std::cout << std::endl << "Эта запись пуста. Нечего удалять" << std::endl; return; } int posInNoteFrom = getPosition("Введите номер позиции, с которой необходимо произвести удаление.", notes[position].length() - 1); if(posInNoteFrom > -1) { int delLen = getPosition("Сколько символов удалить?", notes[position].length() - posInNoteFrom - 1); if(delLen > -1 && getAnswer("Вы точно хотите произвести удаление символов?")) { notes[position].erase(posInNoteFrom, delLen+1); wasChanged = true; std::cout << std::endl << "Удаление успешно произведено." << std::endl; } } } } void NOTEBOOK::addToNote() { if(notes.length() == 0) { std::cout << std::endl << "Записей нет. Некуда добавлять." << std::endl; return; } int position = getPosition("Введите номер записи в которую нужно добавить текст.", notes.length()); if(position > -1) { dzString txt; std::cout << "Введите текст, который хотите добавить: "; std::cin >> txt; int posInNote = getPosition("Введите позицию, в которую хотите добавить текст.", notes[position].length()); if(posInNote > -1) { notes[position].insert(txt, posInNote); wasChanged = true; std::cout << std::endl << "Текст успешно добавлен." << std::endl; } } } void NOTEBOOK::mergeNotes() { if(notes.length() < 2) { std::cout << std::endl << "В книге менее двух записей. Объединять нечего." << std::endl; return; } int position1 = getPosition("Введие номер записи, которую хотите объединить.", notes.length()); if(position1 > -1) { int position2 = 0; do { position2 = getPosition("Введите номер записи с которой хотите объединить.", notes.length()); if(position1 == position2) std::cout << std::endl << "Невозможно объединить позицию с самой собой." << std::endl << std::endl; } while( (position2 != -1) && position1 == position2); if(position2 > -1) { (notes[position2] += " ") += notes[position1]; notes.erase(position1, 1); wasChanged = true; std::cout << std::endl << "Объединение успешно произведено." << std::endl; } } } int NOTEBOOK::getPosition(const char *message, int top, int bottom) { int position = 0; bool ok; do { std::cout << message << " [" << bottom << ".." << top << "] или 0 для отмены: "; std::cin >> position; if (std::cin.fail()) std::cin.clear(); while (std::cin.get() != '\n'); ok = (position >= bottom) && (position <= top); if(position && !ok) std::cout << "Ошибка. Неверно введен номер позиции. Пожалуйста, повторите попытку." << std::endl; } while(position && !ok); --position; return position; } bool NOTEBOOK::getAnswer(const char *message) { char answer; do { std::cout << message << " [y/n]: "; std::cin >> answer; while (std::cin.get() != '\n'); answer = tolower(answer); if( !( (answer == 'y') || (answer == 'n') ) ) std::cout << "Ошибка. Введите y или n." << std::endl; } while( !( (answer == 'y') || (answer == 'n') ) ); if(answer == 'y') return true; return false; }
5d8031c1d50c8dd6ffa7d6ea3de5019203dab9e1
a5468a15a5918b3ea2cc2b17da530ad475939c7d
/Sources/Network/Address.h
efa3feb2e204d96ef17a367acddf28ce90b25212
[ "MIT" ]
permissive
TraurigeNarr/SupportSDK
7f9bb8678b0ef66948218945d00dbf5736f8ad19
02939aa54ad434993f806f7cb58ef14f4f52702e
refs/heads/master
2020-04-04T05:50:26.928699
2017-11-06T10:52:43
2017-11-06T10:52:43
24,842,561
0
3
null
2017-11-06T21:29:01
2014-10-06T11:03:29
C++
UTF-8
C++
false
false
959
h
#ifndef __ADDRESS_H__ #define __ADDRESS_H__ #include "NetworkAPI.h" namespace Network { class Address { public: NETWORK_API Address(); NETWORK_API Address(unsigned char a, unsigned char b, unsigned char c, unsigned char d, unsigned short port); NETWORK_API Address(unsigned int address, unsigned short port); NETWORK_API ~Address(); NETWORK_API unsigned int GetAddress() const; NETWORK_API unsigned char GetA() const; NETWORK_API unsigned char GetB() const; NETWORK_API unsigned char GetC() const; NETWORK_API unsigned char GetD() const; NETWORK_API unsigned short GetPort() const; NETWORK_API bool operator == (const Address & other) const; NETWORK_API bool operator != (const Address & other) const; NETWORK_API bool operator < (const Address & other) const; private: unsigned int m_address; unsigned short m_port; }; } // Network #endif
a6a3b3075832a9ef0f0ed5ff401880da2b6c6aea
6070397a3eb57657f49f039d107875282f22fc00
/include/sort.h
88bb2aa2b2e120045c15aeb205aec7eb16ceac6a
[]
no_license
velamen2009/Algorithm
659d6f38180949c542929a9785a3945c17e1e3e8
8fd15fbfb75cd1b69c75668615cc11efda932bab
refs/heads/master
2021-01-21T13:03:40.169612
2016-05-03T18:54:43
2016-05-03T18:54:43
49,113,526
0
0
null
null
null
null
UTF-8
C++
false
false
4,758
h
#ifndef __SORT_H__ #define __SORT_H__ #include<iostream> #include<vector> #include "generic.h" using namespace std; namespace alg{ template<typename T> class SortClass{ public: SortClass(vector<T>& sort_list, bool(*comp)(T,T), void(*_swap)(T&, T&)){ m_sort_list = &sort_list; compare = comp; swap = _swap; } ~SortClass(){} // //Print List // void displaySort(){ for(size_t i=0; i!=m_sort_list->size();++i){ cout<<(*m_sort_list)[i]<<"\t"; } cout<<"\n"; } // //Insert Sort // void insertSort(){ int j; T temp; for(size_t i=1; i!=m_sort_list->size(); ++i){ temp = (*m_sort_list)[i]; j=i-1; while(j>=0 && compare((*m_sort_list)[j],(*m_sort_list)[j+1])){ swap((*m_sort_list)[j],(*m_sort_list)[j+1]); --j; } (*m_sort_list)[++j]=temp; } } // //Swap Sort // void swapSort(){ for(size_t i=0; i!=m_sort_list->size()-1; ++i){ for(size_t j=i+1; j!=m_sort_list->size(); ++j){ if(compare((*m_sort_list)[i],(*m_sort_list)[j])){ swap((*m_sort_list)[i],(*m_sort_list)[j]); } } } } // //Bubble Sort // void bubbleSort(){ for(size_t i=0; i!=m_sort_list->size()-1; ++i){ for(size_t j=0; j!=m_sort_list->size()-1-i; ++j){ if(compare((*m_sort_list)[j],(*m_sort_list)[j+1])){ swap((*m_sort_list)[j],(*m_sort_list)[j+1]); } } } } // //Bubble Sort Improved // void bubbleSortImproved(){ bool swapped = true; for(size_t i=0; i!=m_sort_list->size()-1&&swapped; ++i){ swapped=false; for(size_t j=0; j!=m_sort_list->size()-1-i; ++j){ if(compare((*m_sort_list)[j],(*m_sort_list)[j+1])){ swap((*m_sort_list)[j],(*m_sort_list)[j+1]); swapped=true; } } } } // //Selection Sort // void selectionSort(){ for(size_t i=0; i!=m_sort_list->size()-1; ++i){ for(size_t j=i+1; j!=m_sort_list->size(); ++j){ if(compare((*m_sort_list)[i],(*m_sort_list)[j])){ swap((*m_sort_list)[i],(*m_sort_list)[j]); } } } } // //Heap Sort // void heapSort(){ for(int i=m_sort_list->size()/2-1; i>=0; --i){ heapAdjust(i, m_sort_list->size()); } for(int i=m_sort_list->size()-1; i!=0; --i){ swap((*m_sort_list)[i],(*m_sort_list)[0]); heapAdjust(0, i); } } // //Merge Sort // void mergeSortTopDown(){ for(int i=0; i!=m_sort_list->size(); ++i){ m_merge_list.push_back((*m_sort_list)[i]); } topDownSplitMerge(0, m_sort_list->size()); } // //Quick Sort // void quickSort(){ _quickSort(0, m_sort_list->size()-1); } private: void heapAdjust(int s, int m){ T temp = (*m_sort_list)[s]; for(size_t j=2*s+1; j<m; j=j*2+1){ if(j+1<m && compare((*m_sort_list)[j+1],(*m_sort_list)[j])){ ++j; } if(compare(temp, (*m_sort_list)[j])){ break; } (*m_sort_list)[s] = (*m_sort_list)[j]; s=j; } (*m_sort_list)[s] = temp; } void _quickSort(int begin, int end){ if(begin<end){ int pivot_idx = partition(begin, end); _quickSort(begin, pivot_idx-1); _quickSort(pivot_idx+1, end); } } int partition(int begin, int end){ int pivot_idx = RANDOM(begin, end); T pivot = (*m_sort_list)[pivot_idx]; swap((*m_sort_list)[begin],(*m_sort_list)[pivot_idx]); while(begin<end){ while(begin<end&&compare((*m_sort_list)[end],pivot)){ --end; } swap((*m_sort_list)[begin],(*m_sort_list)[end]); while(begin<end&&compare(pivot,(*m_sort_list)[begin])){ ++begin; } swap((*m_sort_list)[begin],(*m_sort_list)[end]); } return begin; } void topDownSplitMerge(int begin, int end){ /* if size==1, * consider it's sorted */ if(end-begin<2){ return; } int middle = (begin+end)/2; topDownSplitMerge(begin, middle); topDownSplitMerge(middle, end); topDownMerge(begin, middle, end); copyArray(begin, end); } void topDownMerge(int begin, int middle, int end){ int i=begin, j=middle; for(int k=begin; k!=end; ++k){ if(i<middle && (j>=end || compare((*m_sort_list)[j],(*m_sort_list)[i]))){ m_merge_list[k] = (*m_sort_list)[i]; ++i; } else{ m_merge_list[k] = (*m_sort_list)[j]; ++j; } } } void copyArray(int begin, int end){ for(int i=begin; i!=end; ++i){ (*m_sort_list)[i] = m_merge_list[i]; } } private: vector<T> *m_sort_list; vector<T> m_merge_list; bool (*compare)(T, T); void(*swap)(T&, T&); }; } #endif
df0317487e4fbefdd5e2b4947047057a5ec0c5b3
72e3e602546bc94a392ed7a485a948aa3895218e
/Engine/textureshaderclass.cpp
9951cd382490409646299c89652330b887efbf0c
[]
no_license
fromasmtodisasm/DirectXCpp
b3c304c9c0748313e33d4994db59dc58d0b0e580
3026189a07af7567d83ee69ca651969ebb5446bc
refs/heads/master
2021-06-12T09:41:32.160190
2017-03-21T22:19:17
2017-03-21T22:19:17
null
0
0
null
null
null
null
UTF-8
C++
false
false
9,080
cpp
#include "TextureShaderClass.h" #include <fstream> TextureShaderClass::TextureShaderClass() { vertexShader = 0; pixelShader = 0; layout = 0; matrixBuffer = 0; sampleState = 0; } TextureShaderClass::TextureShaderClass(const TextureShaderClass& other) { } TextureShaderClass::~TextureShaderClass() { } bool TextureShaderClass::Initialize(ID3D11Device* device, HWND hwnd) { bool result; // Initialize the vertex and pixel shaders. result = InitializeShader(device, hwnd, L"..\\Engine\\textureVS.hlsl", L"..\\Engine\\texturePS.hlsl"); if (!result) { return false; } return true; } void TextureShaderClass::Shutdown() { ShutdownShader(); } void TextureShaderClass::ShutdownShader() { if (sampleState) { sampleState->Release(); sampleState = 0; } // Release the matrix constant buffer. if (matrixBuffer) { matrixBuffer->Release(); matrixBuffer = 0; } // Release the layout. if (layout) { layout->Release(); layout = 0; } // Release the pixel shader. if (pixelShader) { pixelShader->Release(); pixelShader = 0; } // Release the vertex shader. if (vertexShader) { vertexShader->Release(); vertexShader = 0; } } bool TextureShaderClass::Render(ID3D11DeviceContext *deviceContext, int indexCount, XMMATRIX& worldMatrix, XMMATRIX& viewMatrix, XMMATRIX& projectionMatrix, ID3D11ShaderResourceView *texture) { bool result; // Set the shader parameters that it will use for rendering. result = SetShaderParameters(deviceContext, worldMatrix, viewMatrix, projectionMatrix, texture); if (!result) { return false; } // Now render the prepared buffers with the shader. RenderShader(deviceContext, indexCount); return true; } bool TextureShaderClass::InitializeShader(ID3D11Device* device, HWND hwnd, WCHAR* vsFilename, WCHAR* psFilename) { HRESULT result; ID3D10Blob* errorMessage; ID3D10Blob* vertexShaderBuffer; ID3D10Blob* pixelShaderBuffer; D3D11_INPUT_ELEMENT_DESC polygonLayout[2]; unsigned int numElements; D3D11_BUFFER_DESC matrixBufferDesc; D3D11_SAMPLER_DESC samplerDesc; // Initialize the pointers this function will use to null. errorMessage = 0; vertexShaderBuffer = 0; pixelShaderBuffer = 0; // Compile the vertex result = D3DCompileFromFile(vsFilename, NULL, NULL, "TextureVertexShader", "vs_5_0", D3D10_SHADER_ENABLE_STRICTNESS, 0, &vertexShaderBuffer, &errorMessage); if (FAILED(result)) { // If the shader failed to compile it should have writen something to the error message. if (errorMessage) { OutputShaderErrorMessage(errorMessage, hwnd, vsFilename); } // If there was nothing in the error message then it simply could not find the shader file itself. else { MessageBox(hwnd, vsFilename, L"Missing Shader File", MB_OK); } return false; } // Compile the pixel shader code. result = D3DCompileFromFile(psFilename, NULL, NULL, "TexturePixelShader", "ps_5_0", D3D10_SHADER_ENABLE_STRICTNESS, 0, &pixelShaderBuffer, &errorMessage); if (FAILED(result)) { // If the shader failed to compile it should have writen something to the error message. if (errorMessage) { OutputShaderErrorMessage(errorMessage, hwnd, psFilename); } // If there was nothing in the error message then it simply could not find the file itself. else { MessageBox(hwnd, psFilename, L"Missing Shader File", MB_OK); } return false; } // Create the vertex shader from the buffer. result = device->CreateVertexShader(vertexShaderBuffer->GetBufferPointer(), vertexShaderBuffer->GetBufferSize(), NULL, &vertexShader); if (FAILED(result)) { return false; } // Create the pixel shader from the buffer. result = device->CreatePixelShader(pixelShaderBuffer->GetBufferPointer(), pixelShaderBuffer->GetBufferSize(), NULL, &pixelShader); if (FAILED(result)) { return false; } // Create the vertex input layout description. // This setup needs to match the VertexType stucture in the ModelClass and in the shader. polygonLayout[0].SemanticName = "POSITION"; polygonLayout[0].SemanticIndex = 0; polygonLayout[0].Format = DXGI_FORMAT_R32G32B32_FLOAT; polygonLayout[0].InputSlot = 0; polygonLayout[0].AlignedByteOffset = 0; polygonLayout[0].InputSlotClass = D3D11_INPUT_PER_VERTEX_DATA; polygonLayout[0].InstanceDataStepRate = 0; polygonLayout[1].SemanticName = "TEXCOORD"; polygonLayout[1].SemanticIndex = 0; polygonLayout[1].Format = DXGI_FORMAT_R32G32_FLOAT; polygonLayout[1].InputSlot = 0; polygonLayout[1].AlignedByteOffset = D3D11_APPEND_ALIGNED_ELEMENT; polygonLayout[1].InputSlotClass = D3D11_INPUT_PER_VERTEX_DATA; polygonLayout[1].InstanceDataStepRate = 0; // Get a count of the elements in the layout. numElements = sizeof(polygonLayout) / sizeof(polygonLayout[0]); // Create the vertex input layout. result = device->CreateInputLayout(polygonLayout, numElements, vertexShaderBuffer->GetBufferPointer(), vertexShaderBuffer->GetBufferSize(), &layout); if (FAILED(result)) { return false; } // Release the vertex shader buffer and pixel shader buffer since they are no longer needed. vertexShaderBuffer->Release(); vertexShaderBuffer = 0; pixelShaderBuffer->Release(); pixelShaderBuffer = 0; // Setup the description of the dynamic matrix constant buffer that is in the vertex shader. matrixBufferDesc.Usage = D3D11_USAGE_DYNAMIC; matrixBufferDesc.ByteWidth = sizeof(MatrixBufferType); matrixBufferDesc.BindFlags = D3D11_BIND_CONSTANT_BUFFER; matrixBufferDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE; matrixBufferDesc.MiscFlags = 0; matrixBufferDesc.StructureByteStride = 0; result = device->CreateBuffer(&matrixBufferDesc, NULL, &matrixBuffer); if (FAILED(result)) { return false; } //Create the constant bufer samplerDesc.Filter = D3D11_FILTER_MIN_MAG_MIP_LINEAR; samplerDesc.AddressU = D3D11_TEXTURE_ADDRESS_WRAP; samplerDesc.AddressV = D3D11_TEXTURE_ADDRESS_WRAP; samplerDesc.AddressW = D3D11_TEXTURE_ADDRESS_WRAP; samplerDesc.MipLODBias = 0.0f; samplerDesc.MaxAnisotropy = 1; samplerDesc.ComparisonFunc = D3D11_COMPARISON_ALWAYS; samplerDesc.BorderColor[0] = 0; samplerDesc.BorderColor[1] = 0; samplerDesc.BorderColor[2] = 0; samplerDesc.BorderColor[3] = 0; samplerDesc.MinLOD = 0; samplerDesc.MaxLOD = D3D11_FLOAT32_MAX; result = device->CreateSamplerState(&samplerDesc, &sampleState); if (FAILED(result)) { return false; } return true; } void TextureShaderClass::OutputShaderErrorMessage(ID3D10Blob* errorMessage, HWND hwnd, WCHAR* shaderFilename) { char* compileErrors; unsigned long long bufferSize, i; std::ofstream fout; // Get a pointer to the error message text buffer. compileErrors = (char*)(errorMessage->GetBufferPointer()); // Get the length of the message. bufferSize = errorMessage->GetBufferSize(); // Open a file to write the error message to. fout.open("shader-error.txt"); // Write out the error message. for (i = 0; i < bufferSize; i++) { fout << compileErrors[i]; } // Close the file. fout.close(); // Release the error message. errorMessage->Release(); errorMessage = 0; // Pop a message up on the screen to notify the user to check the text file for compile errors. MessageBox(hwnd, L"Error compiling shader. Check shader-error.txt for message.", shaderFilename, MB_OK); } bool TextureShaderClass::SetShaderParameters(ID3D11DeviceContext *deviceContext, XMMATRIX& worldMatrix, XMMATRIX& viewMatrix, XMMATRIX& projectionMatrix, ID3D11ShaderResourceView* texture) { HRESULT result; D3D11_MAPPED_SUBRESOURCE mappedResource; MatrixBufferType* dataPtr; unsigned int bufferNumber; // Transposing the matrices should'nt be needed worldMatrix = XMMatrixTranspose(worldMatrix); viewMatrix = XMMatrixTranspose(viewMatrix); projectionMatrix = XMMatrixTranspose(projectionMatrix); // Lock the constant buffer so it can be written to. result = deviceContext->Map(matrixBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedResource); if (FAILED(result)) { return false; } // Get a pointer to the data in the constant buffer. dataPtr = (MatrixBufferType*)mappedResource.pData; // Copy the matrices into the constant buffer. dataPtr->world = worldMatrix; dataPtr->view = viewMatrix; dataPtr->projection = projectionMatrix; // Unlock the constant buffer. deviceContext->Unmap(matrixBuffer, 0); // Set the position of the constant buffer in the vertex shader. bufferNumber = 0; // Finanly set the constant buffer in the vertex shader with the updated values. deviceContext->VSSetConstantBuffers(bufferNumber, 1, &matrixBuffer); deviceContext->PSSetShaderResources(0, 1, &texture); return true; } void TextureShaderClass::RenderShader(ID3D11DeviceContext* deviceContext, int indexCount) { // Set the vertex input layout. deviceContext->IASetInputLayout(layout); // Set the vertex and pixel shaders that will be used to render this triangle. deviceContext->VSSetShader(vertexShader, NULL, 0); deviceContext->PSSetShader(pixelShader, NULL, 0); deviceContext->PSSetSamplers(0, 1, &sampleState); // Render the triangle. deviceContext->DrawIndexed(indexCount, 0, 0); }
dba94c373d25540b862972d1a5ae6f625b3d3dec
8aa9b9fb5cb1e0ed3b107f9967d2cb52e204cc1b
/Server/KFPlugin/KFRouteClient/KFRouteClientModule.cpp
54cacd9f0dd0d29192258fe61259e35c6f03783e
[ "Apache-2.0" ]
permissive
yankunjing/KFrame
59a6f5c65700efb1fbbca103940f7e105f23db9c
658283e0d10a9f5adf7ded0fe76697180061e98d
refs/heads/master
2020-04-10T06:28:59.139963
2018-12-07T03:06:50
2018-12-07T03:06:50
null
0
0
null
null
null
null
UTF-8
C++
false
false
4,405
cpp
#include "KFRouteClientModule.h" #include "KFProtocol/KFProtocol.h" namespace KFrame { void KFRouteClientModule::BeforeRun() { _kf_cluster->RegisterConnectionFunction( __KF_STRING__( route ), this, &KFRouteClientModule::OnConnectionRouteCluster ); //////////////////////////////////////////////////////////////////////////////////////////////////////////////// __REGISTER_MESSAGE__( KFMsg::S2S_TRANSMIT_ROUTE_ZONE_MESSAGE_ACK, &KFRouteClientModule::HandleTransmitRouteZoneMessageAck ); } void KFRouteClientModule::BeforeShut() { _kf_cluster->UnRegisterConnectionFunction( __KF_STRING__( route ) ); /////////////////////////////////////////////////////////////////////////////////////////////////////////////// __UNREGISTER_MESSAGE__( KFMsg::S2S_TRANSMIT_ROUTE_ZONE_MESSAGE_ACK ); } //////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////// void KFRouteClientModule::SetTransmitFunction( KFTransmitFunction& function ) { _kf_transmit_function = function; } void KFRouteClientModule::UnRegisterTransmitFunction() { _kf_transmit_function = nullptr; } //////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////// void KFRouteClientModule::OnConnectionRouteCluster( uint64 serverid ) { // 只有Game才注册路由信息 auto kfglobal = KFGlobal::Instance(); if ( kfglobal->_app_type != __KF_STRING__( game ) ) { return; } // 连接到Route Proxy, 发送区信息到Proxy KFMsg::S2SRegisterRouteZoneReq req; auto zonedata = req.mutable_zonedata(); zonedata->set_zoneid( _kf_zone->GetZone()->_id ); zonedata->set_serverid( kfglobal->_app_id._union._id ); _kf_cluster->SendToShard( __KF_STRING__( route ), KFMsg::S2S_REGISTER_ROUTE_ZONE_REQ, &req ); } bool KFRouteClientModule::SendToRoute( uint64 serverid, uint64 playerid, uint32 msgid, ::google::protobuf::Message* message ) { if ( serverid == _invalid_int || playerid == _invalid_int ) { return false; } bool ok = false; if ( _kf_zone->IsServerSameZone( serverid ) ) { ok = _kf_game->TransmitToPlayer( playerid, msgid, message ); } else { auto data = message->SerializeAsString(); ok = SendToRoute( serverid, playerid, msgid, data.data(), static_cast< uint32 >( data.length() ) ); } return ok; } bool KFRouteClientModule::SendToRoute( uint64 serverid, uint64 playerid, uint32 msgid, const char* data, uint32 length ) { KFMsg::S2STransmitRouteZoneMessageReq req; auto transmitdata = req.mutable_transmitdata(); transmitdata->set_serverid( serverid ); transmitdata->set_playerid( playerid ); transmitdata->set_msgid( msgid ); transmitdata->set_msgdata( data, length ); return _kf_cluster->SendToShard( __KF_STRING__( route ), KFMsg::S2S_TRANSMIT_ROUTE_ZONE_MESSAGE_REQ, &req ); } __KF_MESSAGE_FUNCTION__( KFRouteClientModule::HandleTransmitRouteZoneMessageAck ) { __PROTO_PARSE__( KFMsg::S2STransmitRouteZoneMessageAck ); auto transmitdata = &kfmsg.transmitdata(); auto msgid = transmitdata->msgid(); auto tempguid = kfid; tempguid._data_id = transmitdata->playerid(); auto msgdata = transmitdata->msgdata().data(); auto msglength = static_cast< uint32 >( transmitdata->msgdata().length() ); bool ok = _kf_message->CallFunction( tempguid, msgid, msgdata, msglength ); if ( ok ) { return; } if ( _kf_transmit_function != nullptr ) { auto ok = _kf_transmit_function( tempguid, msgid, msgdata, msglength ); if ( !ok ) { __LOG_ERROR__( "route transmit msgid[{}] failed!", msgid ); } } else { __LOG_ERROR__( "msgid[{}] can't find handle", msgid ); } } }
cca00e9da81193513240af2681ad6d333de43296
0a1ec42ddace93933d677475a4938f1c2d58a552
/engine_pre_afx11/afx/util/afxPath3D.cc
62b208f18285558d7c848df201034485b09a6a39
[]
no_license
ClayHanson/tge-152-fork
f8a242e401e3ea85eebfc75ff2b3dfc84b4fa056
f19fae0c05ee0dbd9822a73ba1fca0fe95d43f53
refs/heads/master
2023-03-16T14:30:30.793979
2013-05-01T05:51:43
2013-05-01T05:51:43
null
0
0
null
null
null
null
UTF-8
C++
false
false
6,927
cc
//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// // Arcane-FX // Copyright (C) Faust Logic, Inc. //~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// #include "afx/util/afxPath3D.h" #include "console/console.h" afxPath3D::afxPath3D() : start_time(0), num_points(0), loop_type(LOOP_CONSTANT) { } afxPath3D::~afxPath3D() { } void afxPath3D::sortAll() { curve.sort(); curve_parameters.sort(); } void afxPath3D::setStartTime( F32 time ) { start_time = time; } void afxPath3D::setLoopType( U32 loop_type ) { this->loop_type = loop_type; } //~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// F32 afxPath3D::getEndTime() { return end_time; } int afxPath3D::getNumPoints() { return num_points; } Point3F afxPath3D::getPointPosition( int index ) { if (index < 0 || index >= num_points) return Point3F(0.0f, 0.0f, 0.0f); return curve.getPoint(index); } F32 afxPath3D::getPointTime( int index ) { if (index < 0 || index >= num_points) return 0.0f; return curve_parameters.getKeyTime(index); } F32 afxPath3D::getPointParameter( int index ) { if (index < 0 || index >= num_points) return 0.0f; return curve_parameters.getKeyValue(index); } Point2F afxPath3D::getParameterSegment( F32 time ) { return curve_parameters.getSegment(time); } void afxPath3D::setPointPosition( int index, Point3F &p ) { if (index < 0 || index >= num_points) return; curve.setPoint(index, p); } //~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// F32 afxPath3D::calcCurveTime( F32 time ) { if( time <= start_time ) return 0.0f; if( time <= end_time ) return time-start_time; switch( loop_type ) { case LOOP_CYCLE : { return mFmod( time-start_time, end_time-start_time ); } case LOOP_OSCILLATE : { F32 t1 = time-start_time; F32 t2 = end_time-start_time; if( (int)(t1/t2) % 2 ) // odd segment return t2 - mFmod( t1, t2 ); else // even segment return mFmod( t1, t2 ); } case LOOP_CONSTANT : default: return end_time; } } Point3F afxPath3D::evaluateAtTime( F32 time ) { F32 ctime = calcCurveTime( time ); F32 param = curve_parameters.evaluate( ctime ); return curve.evaluate(param); } Point3F afxPath3D::evaluateTangentAtTime( F32 time ) { F32 ctime = calcCurveTime( time ); F32 param = curve_parameters.evaluate( ctime ); return curve.evaluateTangent(param); } Point3F afxPath3D::evaluateTangentAtPoint( int index ) { F32 param = curve_parameters.getKeyValue(index); return curve.evaluateTangent(param); } //~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// void afxPath3D::buildPath( int num_points, Point3F curve_points[], F32 start_time, F32 end_time ) { this->num_points = num_points; // Add points to path F32 param_inc = 1.0f / (F32)(num_points - 1); F32 param = 0.0f; for( int i = 0; i < num_points; i++, param += param_inc ) { if( i == num_points-1 ) param = 1.0f; curve.addPoint( param, curve_points[i] ); } curve.computeTangents(); initPathParametersNEW( curve_points, start_time, end_time ); sortAll(); } void afxPath3D::buildPath( int num_points, Point3F curve_points[], F32 speed ) { this->num_points = num_points; // Add points to path F32 param_inc = 1.0f / (F32)(num_points - 1); F32 param = 0.0f; for( int i = 0; i < num_points; i++, param += param_inc ) { if( i == num_points-1 ) param = 1.0f; curve.addPoint( param, curve_points[i] ); } initPathParameters( curve_points, speed ); sortAll(); } void afxPath3D::buildPath( int num_points, Point3F curve_points[], Point2F curve_params[] ) { this->num_points = num_points; // Add points to path F32 param_inc = 1.0f / (F32)(num_points - 1); F32 param = 0.0f; for( int i = 0; i < num_points; i++, param += param_inc ) { if( i == num_points-1 ) param = 1.0f; curve.addPoint( param, curve_points[i] ); } // for (int i = 0; i < num_points; i++) curve_parameters.addKey( curve_params[i] ); // Set end time end_time = curve_params[num_points - 1].x; sortAll(); } void afxPath3D::reBuildPath() { curve.computeTangents(); sortAll(); } void afxPath3D::initPathParameters( Point3F curve_points[], F32 speed ) { // Compute the time for each point dependent on the speed of the character and the // distance it must travel (approximately!) int num_segments = num_points - 1; F32 *point_distances = new F32[num_segments]; for( int i = 0; i < num_segments; i++ ) { Point3F p1 = curve_points[i+1]; Point3F p0 = curve_points[i]; point_distances[i] = (p1-p0).len(); } F32 *times = new F32[num_segments]; F32 last_time = 0;//start_time; for( int i = 0; i < num_segments; i++ ) { times[i] = last_time + (point_distances[i] / speed); last_time = times[i]; } curve_parameters.addKey( 0, 0.0f );//start_time, 0.0f ); F32 param_inc = 1.0f / (F32)(num_points - 1); F32 param = 0.0f + param_inc; for( int i = 0; i < num_segments; i++, param += param_inc ) curve_parameters.addKey( times[i], param ); // Set end time end_time = times[num_segments-1]; if (point_distances) delete [] point_distances; if (times) delete [] times; } void afxPath3D::initPathParametersNEW( Point3F curve_points[], F32 start_time, F32 end_time ) { int num_segments = num_points - 1; F32 *point_distances = new F32[num_segments]; F32 total_distance = 0.0f; for( int i = 0; i < num_segments; i++ ) { Point3F p1 = curve_points[i+1]; Point3F p0 = curve_points[i]; point_distances[i] = (p1-p0).len(); total_distance += point_distances[i]; } F32 duration = end_time - start_time; F32 time = 0.0f; //start_time; curve_parameters.addKey( time, 0.0f ); F32 param_inc = 1.0f / (F32)(num_points - 1); F32 param = 0.0f + param_inc; for( int i=0; i < num_segments; i++, param += param_inc ) { time += (point_distances[i]/total_distance) * duration; curve_parameters.addKey( time, param ); } // Set end time ???? //end_time = time; this->start_time = start_time; this->end_time = end_time; if (point_distances) delete [] point_distances; } void afxPath3D::print() { // curve.print(); curve_parameters.print(); } //~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
[ "mint@mint.(none)" ]
mint@mint.(none)
636f589911220edd2ad0e7025f79356e0faa0a05
d3d1d7d99054b8684ed5fc784421024050a95c79
/codechef/ghc32020/moon.cpp
cdbf59d903aac73c55fcfaa2c48ff3f4169ccd9c
[]
no_license
rishabhSharmaOfficial/CompetitiveProgramming
76e7ac3f8fe8c53599e600fc2df2520451b39710
85678a6dc1ee437d917adde8ec323a55a340375e
refs/heads/master
2023-04-28T05:51:18.606350
2021-05-15T07:04:33
2021-05-15T07:04:33
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,366
cpp
#include<bits/stdc++.h> #define ll long long int #define pii pair<int,int> #define mod 1000000007 #define eps 0.000000001 #define all(x) x.begin(), x.end() #define allr(x) x.rbegin(), x.rend() #define sz(x) ((int)x.size()) #define ln(x) ((int)x.length()) #define mp make_pair #define pb push_back #define ff first #define ss second #define FASTIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); #define dbg(x) cout<<#x<<" "<<x<<endl; const double PI = acos(-1.0); using namespace std; int gcd(int a, int b, int &x, int &y) { if (a == 0) { x = 0; y = 1; return b; } int x1, y1; int d = gcd(b % a, a, x1, y1); x = y1 - (b / a) * x1; y = x1; return d; } bool fas(int a, int b, int c, int &x0, int &y0, int &g) { g = gcd(abs(a), abs(b), x0, y0); if (c % g) { return false; } x0 *= c / g; y0 *= c / g; if (a < 0) x0 = -x0; if (b < 0) y0 = -y0; return true; } void ss(int &x, int &y, int a, int b, int cnt) { x += cnt * b; y -= cnt * a; } int frange(int a, int b, int c, int minx, int maxx, int miny, int maxy) { int x, y, g; if (!fas(a, b, c, x, y, g)) return 0; a /= g; b /= g; int sign_a = a > 0 ? +1 : -1; int sign_b = b > 0 ? +1 : -1; ss(x, y, a, b, (minx - x) / b); if (x < minx) ss(x, y, a, b, sign_b); if (x > maxx) return 0; int lx1 = x; ss(x, y, a, b, (maxx - x) / b); if (x > maxx) ss(x, y, a, b, -sign_b); int rx1 = x; ss(x, y, a, b, -(miny - y) / a); if (y < miny) ss(x, y, a, b, -sign_a); if (y > maxy) return 0; int lx2 = x; ss(x, y, a, b, -(maxy - y) / a); if (y > maxy) ss(x, y, a, b, sign_a); int rx2 = x; if (lx2 > rx2) swap(lx2, rx2); int lx = max(lx1, lx2); int rx = min(rx1, rx2); if (lx > rx) return 0; return (rx - lx) / abs(b) + 1; } int main() { FASTIO; int t; cin >> t; while(t--) { int n, m, x, y; cin >> n >> m >> x >> y; if((n * x + m * y) % 2) { cout << "NO\n"; continue; } int half = (n * x + m * y) / 2; if(frange(x, y, half, 0, n, 0, m)) cout << "YES\n"; else cout << "NO\n"; } return 0; }
a2a02ca114b0bd29e36989bfe196dabf74cd8dd4
54dc6841240780614a176ed6a88a46bd57967a19
/PhysicalTests/src/PT.hpp
c0fb73546ffe2c2206a1ba240047686d64a13612
[]
no_license
saini8/PhysicalTests
4fe50462dc68e93ca2273d0fe568b326c3895b54
61063dc0dcc0ae8cca817864c4eabeb7e2e43412
refs/heads/master
2021-01-23T20:13:43.748205
2013-11-15T17:23:14
2013-11-15T17:23:14
null
0
0
null
null
null
null
UTF-8
C++
false
false
134
hpp
/* * PT.hpp * * Created on: Nov 15, 2013 * Author: Jinthujah */ #ifndef PT_HPP_ #define PT_HPP_ #endif /* PT_HPP_ */
73609353fe01c07379ce1871a4f2d188257fd9ff
39adfee7b03a59c40f0b2cca7a3b5d2381936207
/codeforces/601/A.cpp
c5dee594cd0b7abc5579455c96cc16cbdc50325a
[]
no_license
ngthanhtrung23/CompetitiveProgramming
c4dee269c320c972482d5f56d3808a43356821ca
642346c18569df76024bfb0678142e513d48d514
refs/heads/master
2023-07-06T05:46:25.038205
2023-06-24T14:18:48
2023-06-24T14:18:48
179,512,787
78
22
null
null
null
null
UTF-8
C++
false
false
2,435
cpp
#include <bits/stdc++.h> #define FOR(i,a,b) for(int i=(a),_b=(b); i<=_b; ++i) #define FORD(i,a,b) for(int i=(a),_b=(b); i>=_b; --i) #define REP(i,a) for(int i=0,_a=(a); i < _a; ++i) #define DEBUG(X) { cout << #X << " = " << X << endl; } #define PR(A,n) { cout << #A << " = "; FOR(_,1,n) cout << A[_] << ' '; cout << endl; } #define PR0(A,n) { cout << #A << " = "; REP(_,n) cout << A[_] << ' '; cout << endl; } #define ll long long #define SZ(x) ((int) (x).size()) using namespace std; const int MN = 411; int c[MN][MN]; int n, m; int f[2][MN][MN]; deque<int> qu, qv, qt; void go0(int t, int u, int v, int l) { if (f[t][u][v] < 0) { f[t][u][v] = l; qt.push_front(t); qu.push_front(u); qv.push_front(v); } } void go1(int t, int u, int v, int l) { if (f[t][u][v] < 0) { f[t][u][v] = l + 1; qt.push_back(t); qu.push_back(u); qv.push_back(v); } } int solve() { while (!qu.empty()) qu.pop_front(); while (!qv.empty()) qv.pop_front(); while (!qt.empty()) qt.pop_front(); qt.push_back(0); qu.push_back(1); qv.push_back(1); f[0][1][1] = 0; while (!qt.empty()) { int t = qt.front(); qt.pop_front(); int u = qu.front(); qu.pop_front(); int v = qv.front(); qv.pop_front(); if (u == n && v == n) return f[t][u][v]; int l = f[t][u][v]; if (t == 0) { // move u if (u == n) { go1(1, u, v, l); } else { FOR(x,1,n) if (c[u][x] == 0) { go1(1, x, v, l); } } } else { // move v if (v == n) { go0(0, u, v, l); } else { FOR(x,1,n) if (c[v][x] == 1) { if (x != n && x == u) continue; go0(0, u, x, l); } } } } return -1; } int main() { ios :: sync_with_stdio(0); cin.tie(0); cout << (fixed) << setprecision(9); while (scanf("%d%d", &n, &m) == 2) { memset(c, 0, sizeof c); FOR(i,1,m) { int u, v; scanf("%d%d", &u, &v); c[u][v] = c[v][u] = 1; } memset(f, -1, sizeof f); cout << solve() << endl; } }
634866c135a352c952a56ee68e782a745482ceb3
d20cf7de868dfb2c53578a70d0dda21306167d72
/data/preprocessed/train/student_47/sources/ConsoleOutput.cpp
cc04dd731c2c3565e8710a48f09d25284a6a207e
[]
no_license
bulacu-magda/Alemia
905a84ca79157fb657eb424e337b0303fd3323bd
0fd019c4517064d300399feb94dbcb0f467e8d48
refs/heads/main
2023-03-01T17:41:08.788500
2021-02-05T08:00:35
2021-02-05T08:00:35
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,301
cpp
#include "ConsoleOutput.h" #include <windows.h> using namespace UserInterface; ConsoleOutput* ConsoleOutput::instance; ConsoleOutput::ConsoleOutput() { // setting console width and height HWND console = GetConsoleWindow(); MoveWindow(console, 0, 0, CON_WIDTH, CON_HEIGHT, TRUE); // hiding scrollbar HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE); CONSOLE_SCREEN_BUFFER_INFO info; GetConsoleScreenBufferInfo(handle, &info); COORD new_size = { info.srWindow.Right - info.srWindow.Left + 1, info.srWindow.Bottom - info.srWindow.Top + 1 }; SetConsoleScreenBufferSize(handle, new_size); // hide blinking cursor CONSOLE_CURSOR_INFO cursorInfo; GetConsoleCursorInfo(handle, &cursorInfo); cursorInfo.bVisible = false; // set the cursor visibility SetConsoleCursorInfo(handle, &cursorInfo); } ConsoleOutput::~ConsoleOutput() { } ConsoleOutput & ConsoleOutput::getInstance() { // singleton logics if (!instance) { instance = new ConsoleOutput(); } return *instance; } ConsoleOutput & UserInterface::ConsoleOutput::operator()(int row, int col) { /*should check wether the row and the column values ar within the limits of the current window*/ COORD coord; coord.X = col; coord.Y = row; SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), coord); return *this; }
957d9801e12aac883a6d399ebc2b513288602bdb
2a55c197c48c06459aee72560132106729ddebc4
/bfs2.cpp
09980d4bc16a12e07902b3f3fa6b38cb30884cd0
[]
no_license
vadimkantorov/urfu
b5c3b93b3d6e95f5c893318190ff0380a63788c2
fd0bf1cf4e2d29c5bc53f95c1c63a24f4fbee032
refs/heads/master
2020-04-11T03:51:16.777181
2015-02-24T23:43:05
2015-02-24T23:43:05
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,075
cpp
#include <iostream> #include <vector> #include <stack> #include <queue> using namespace std; struct Graph { static const int N = 100; vector<int> M[N]; bool visited[N]; int parent[N]; int source; void AddEdge(int u, int v) { M[u].push_back(v); M[v].push_back(u); } void BFS(int start) { source = start; queue<int> Q; Q.push(start); visited[start] = true; while(!Q.empty()) { int u = Q.front(); Q.pop(); for(int i = 0; i < M[u].size(); i++) { int v = M[u][i]; if(!visited[v]) { visited[v] = true; parent[v] = u; Q.push(v); } } } } void PrintShortestPath(int to) { stack<int> s; for(int v = to; v != source; v = parent[v]) s.push(v); s.push(source); while(!s.empty()) { int v = s.top(); s.pop(); cout << v << endl; } } }; Graph g; void main() { freopen("input.txt","r",stdin); int from, to, n, m; cin >> from >> to; cin >> n >> m; for(int i = 0; i < m; i++) { int u,v; cin >> u >> v; g.AddEdge(u,v); } g.BFS(from); g.PrintShortestPath(to); }
6bf14726c14e862b9d6bfb179543cdd7870938f8
52ada127e8ac22173754b1d22db1b805091e7118
/src/config.cpp
bc9f7d29f6bd37376d43c47cf76c7613090345b7
[ "MIT" ]
permissive
dgengtek/taskd
a60ed234fff5068df796b4a6fcbe219325007996
2f40c1babd7cc8ffdf483da87fd703045d402e87
refs/heads/master
2020-03-28T22:03:59.297548
2014-01-16T00:23:15
2014-01-16T00:23:15
null
0
0
null
null
null
null
UTF-8
C++
false
false
6,017
cpp
//////////////////////////////////////////////////////////////////////////////// // taskd - Taskserver // // Copyright 2010 - 2014, Göteborg Bit Factory. // // 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. // // http://www.opensource.org/licenses/mit-license.php // //////////////////////////////////////////////////////////////////////////////// #include <cmake.h> #include <iostream> #include <stdlib.h> #include <ConfigFile.h> #include <Directory.h> #include <taskd.h> #include <text.h> #include <util.h> //////////////////////////////////////////////////////////////////////////////// // taskd config --data <root> [<name> [<value>]] void command_config (Database& db, const std::vector <std::string>& args) { bool verbose = db._config->getBoolean ("verbose"); bool confirmation = db._config->getBoolean ("confirmation"); std::string name; std::string value; bool nonNull = false; std::vector <std::string>::const_iterator i; for (i = ++(args.begin ()); i != args.end (); ++i) { if (name == "") name = *i; else if (value == "") { nonNull = true; if (value != "") value += ' '; value += *i; } } std::string root = db._config->get ("root"); Directory root_dir (root); if (!root_dir.exists ()) throw std::string ("ERROR: The '--data' path does not exist."); // Load the config file. Config config; config.load (root_dir._data + "/config"); config.set ("root", root_dir._data); // taskd config <name> <value> // - set <name> to <value> if (name != "" && nonNull) { bool change = false; // Read .taskd/config std::vector <std::string> contents; File::read (config._original_file, contents); bool found = false; std::vector <std::string>::iterator line; for (line = contents.begin (); line != contents.end (); ++line) { // If there is a comment on the line, it must follow the pattern. std::string::size_type comment = line->find ("#"); std::string::size_type pos = line->find (name + "="); if (pos != std::string::npos && (comment == std::string::npos || comment > pos)) { found = true; if (!confirmation || confirm (format ("Are you sure you want to change the value of '{1}' from '{2}' to '{3}'?", name, config.get (name), value))) { if (comment != std::string::npos) *line = name + "=" + value + " " + line->substr (comment); else *line = name + "=" + value; change = true; } } } // Not found, so append instead. if (!found && (!confirmation || confirm (format ("Are you sure you want to add '{1}' with a value of '{2}'?", name, value)))) { contents.push_back (name + "=" + value); change = true; } // Write .taskd (or equivalent) if (change) { File::write (config._original_file, contents); if (verbose) std::cout << format ("Config file {1} modified.", config._original_file._data) << "\n"; } else { if (verbose) std::cout << "No changes made.\n"; } } // taskd config <name> // - remove <name> else if (name != "") { // Read .taskd/config std::vector <std::string> contents; File::read (config._original_file, contents); bool change = false; bool found = false; std::vector <std::string>::iterator line; for (line = contents.begin (); line != contents.end (); ++line) { // If there is a comment on the line, it must follow the pattern. std::string::size_type comment = line->find ("#"); std::string::size_type pos = line->find (name + "="); if (pos != std::string::npos && (comment == std::string::npos || comment > pos)) { found = true; // Remove name if (!confirmation || confirm (format ("Are you sure you want to remove '{1}'?", name))) { *line = ""; change = true; } } } if (!found) throw format ("ERROR: No entry named '{1}' found.", name); // Write .taskd (or equivalent) if (change) { if (! config._original_file.exists ()) config._original_file.create (0600); File::write (config._original_file, contents); if (verbose) std::cout << format ("Config file {1} modified.", config._original_file._data) << "\n"; } else { if (verbose) std::cout << "No changes made.\n"; } } // taskd config // - list all settings. else { if (verbose) std::cout << "\nConfiguration read from " << config._original_file._data << "\n\n"; taskd_renderMap (config, "Variable", "Value"); } } ////////////////////////////////////////////////////////////////////////////////
3088f0ba2d3d128b2ab337a234057b4990951b4a
ce24e2784ac30cbbe451893f3dcf650df24fc2f8
/c++/inline/A.cxx
8a73fff1b631c848d05d3a57be4c54c8e9b0d96d
[]
no_license
bluecoder008/sandbox
41b4fb1c68cd92cf201068e1a909b19406746598
22417b9da18fc42e6abf9b0b10163a125f883445
refs/heads/master
2022-05-29T23:59:46.914257
2022-05-13T07:01:45
2022-05-13T07:01:45
3,956,036
0
0
null
2014-09-28T22:52:57
2012-04-07T06:03:26
JavaScript
UTF-8
C++
false
false
98
cxx
#include <iostream> #include "A.hxx" inline void A::print() { std::cout << a_ << std::endl; }
4bcd3da8122987da684296c0c08a95378a69a513
b2e9c0fb1d5996df7b8aa2cb7368bad34dd32713
/formats/ini/Common.cpp
fd7169f7e16ff02ea504cd5554414663a459c60b
[ "MIT" ]
permissive
xguerin/ace
668bba8f829e3f4f744a1444e8bd960a34dffe00
cbfbf75840afa6c34f1b129a6be46e2a633b0095
refs/heads/master
2023-04-13T23:26:06.492570
2022-05-25T14:44:13
2022-05-25T14:44:13
282,903,412
3
0
MIT
2021-02-02T12:26:04
2020-07-27T13:17:10
C++
UTF-8
C++
false
false
7,094
cpp
/** * Copyright (c) 2016 Xavier R. Guerin * * 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. */ #include "Common.h" #include "Lexer.h" #include "Array.h" #include "Object.h" #include "Primitive.h" #include <ace/tree/Array.h> #include <ace/tree/Object.h> #include <ace/tree/Primitive.h> #include <ace/common/Log.h> #include <ace/common/String.h> #include <iostream> #include <string> namespace { static bool isWhiteSpace(std::string const& str) { if (str.empty()) { return true; } for (auto const& c : str) { if (c != ' ' && c != '\t' && c != '\f') { return false; } } return true; } ace::tree::Value::Ref build(ace::tree::Object const& g, std::string const& n, ace::ini::Value::Ref const& r) { switch (r->type()) { case ace::ini::Value::Type::Boolean: { auto const& v = static_cast<ace::ini::Boolean const&>(*r); return ace::tree::Primitive::build(n, v.value()); } case ace::ini::Value::Type::Key: { auto const& v = static_cast<ace::ini::Key const&>(*r); return ace::tree::Primitive::build(n, v.value()); } case ace::ini::Value::Type::String: { auto const& v = static_cast<ace::ini::String const&>(*r); return ace::tree::Primitive::build(n, v.value()); } case ace::ini::Value::Type::Integer: { auto const& v = static_cast<ace::ini::Integer const&>(*r); return ace::tree::Primitive::build(n, v.value()); } case ace::ini::Value::Type::Float: { auto const& v = static_cast<ace::ini::Float const&>(*r); return ace::tree::Primitive::build(n, v.value()); } case ace::ini::Value::Type::Reference: { auto const& v = static_cast<ace::ini::Reference const&>(*r); std::vector<ace::tree::Value::Ref> lasso; g.get(*v.path(), lasso); if (lasso.size() == 0) { return ace::tree::Primitive::build(n, ""); } else { return lasso.front(); } } case ace::ini::Value::Type::Environment: { auto const& v = static_cast<ace::ini::Environment const&>(*r); return ace::tree::Primitive::build(n, v.value()); } case ace::ini::Value::Type::System: { auto const& v = static_cast<ace::ini::System const&>(*r); return ace::tree::Primitive::build(n, v.result()); } } return nullptr; } ace::tree::Object::Ref processStream(std::istream& in) { std::string line; std::vector<std::string> parts; ace::tree::Path::Ref dest; auto top = ace::tree::Object::build(); auto cur = top; while (!in.eof()) { std::getline(in, line); ace::common::String::split(std::string(line), '=', parts); if (parts.size() == 1) { auto e = ace::inifmt::Scan().parse(parts[0]); /** * If e is invalid and line is whitespace, simply continue */ if (e == nullptr) { if (isWhiteSpace(line)) { continue; } ACE_LOG(Error, "Parsing failed"); return nullptr; } if (e->type() != ace::ini::Statement::Type::Section) { ACE_LOG(Error, "Parsing failed"); return nullptr; } auto const& section = static_cast<ace::ini::Section const&>(*e); /** * Process section */ if (cur != top) { top->put(*dest, cur); } cur = ace::tree::Object::build(section.name()); dest = section.path(); } else if (parts.size() >= 2) { /** * Process key */ auto k = ace::inifmt::Scan().parse(parts[0]); if (k == nullptr) { ACE_LOG(Error, "Parsing failed"); return nullptr; } if (k->type() != ace::ini::Statement::Type::ValueList) { ACE_LOG(Error, "Parsing failed"); return nullptr; } auto const& vl = static_cast<ace::ini::ValueList const&>(*k); if (vl.values().size() != 1) { ACE_LOG(Error, "Parsing failed"); return nullptr; } if (vl.values().front()->type() != ace::ini::Value::Type::Key) { ACE_LOG(Error, "Parsing failed"); return nullptr; } auto const& key = static_cast<ace::ini::Key const&>(*vl.values().front()); /** * Process value */ auto rest = std::vector<std::string>(++parts.begin(), parts.end()); std::string rem = ace::common::String::join(rest, '='); auto v = ace::inifmt::Scan().parse(rem); if (v == nullptr) { ACE_LOG(Error, "Parsing failed"); return nullptr; } if (v->type() != ace::ini::Statement::Type::ValueList) { ACE_LOG(Error, "Parsing failed"); return nullptr; } auto const& array = static_cast<ace::ini::ValueList const&>(*v); /** * Process the values */ if (array.values().size() == 1) { cur->put(key.value(), ::build(*top, key.value(), array.values().front())); } else { auto ary = ace::tree::Array::build(key.value()); for (auto const& w : array.values()) { ary->push_back(::build(*top, key.value(), w)); } cur->put(key.value(), ary); } } } /** * Push the last object */ if (cur != top) { top->put(*dest, cur); } return top; } } namespace ace { namespace inifmt { namespace Common { tree::Value::Ref parseFile(std::string const& path) { std::ifstream ifs(path); if (ifs.fail()) { ACE_LOG(Error, "Cannot open file: ", path); return nullptr; } auto result = processStream(ifs); ifs.close(); return result; } tree::Value::Ref parseString(std::string const& str) { std::istringstream iss(str); return processStream(iss); } void dump(tree::Value const& v, std::ostream& o) { switch (v.type()) { case tree::Value::Type::Boolean: case tree::Value::Type::String: case tree::Value::Type::Integer: case tree::Value::Type::Float: { inifmt::Primitive::dump(v, o); } break; case tree::Value::Type::Object: { inifmt::Object::dump(v, o); } break; case tree::Value::Type::Array: { inifmt::Array::dump(v, o); } break; default: { } break; } } }}}
23b7c01decf52ac985ae48c7a4433592de646cc1
b0dd7779c225971e71ae12c1093dc75ed9889921
/libs/interprocess/example/doc_anonymous_mutex_shared_data.hpp
686d463eedfedeefd309d3cd12897dbe540f0a46
[ "LicenseRef-scancode-warranty-disclaimer", "BSL-1.0" ]
permissive
blackberry/Boost
6e653cd91a7806855a162347a5aeebd2a8c055a2
fc90c3fde129c62565c023f091eddc4a7ed9902b
refs/heads/1_48_0-gnu
2021-01-15T14:31:33.706351
2013-06-25T16:02:41
2013-06-25T16:02:41
2,599,411
244
154
BSL-1.0
2018-10-13T18:35:09
2011-10-18T14:25:18
C++
UTF-8
C++
false
false
1,059
hpp
////////////////////////////////////////////////////////////////////////////// // // (C) Copyright Ion Gaztanaga 2006-2012. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // // See http://www.boost.org/libs/interprocess for documentation. // ////////////////////////////////////////////////////////////////////////////// #include <boost/interprocess/detail/config_begin.hpp> //[doc_anonymous_mutex_shared_data #include <boost/interprocess/sync/interprocess_mutex.hpp> struct shared_memory_log { enum { NumItems = 100 }; enum { LineSize = 100 }; shared_memory_log() : current_line(0) , end_a(false) , end_b(false) {} //Mutex to protect access to the queue boost::interprocess::interprocess_mutex mutex; //Items to fill char items[NumItems][LineSize]; int current_line; bool end_a; bool end_b; }; //] #include <boost/interprocess/detail/config_end.hpp>
5ed5eb5ccb91dadcfda9a45add19ba526bed6bd3
9c062ceb9959f3ffedd998f078b04a6b1dda3ffb
/mainwindow.cpp
b1a253d8248ce5919a1cb83eb87d422f30d2d82f
[]
no_license
zuzintosha/QtParserMathExpressions
c342e20f39e8f8bff0722e730b62c168923bc856
4f582bb021881bc1301778f925ba26d7b44f1c23
refs/heads/master
2020-04-09T12:21:56.955289
2018-12-04T11:25:10
2018-12-04T11:25:10
160,346,364
1
0
null
null
null
null
UTF-8
C++
false
false
767
cpp
#include "mainwindow.h" #include "ui_mainwindow.h" #include <qtparser.h> #include <QDebug> MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); } MainWindow::~MainWindow() { delete ui; } void MainWindow::on_pushButtonParseExpression_clicked() { QString inputExpression = ui->lineEditInputExpression->text(); QByteArray inputExpressionBA = inputExpression.toLocal8Bit(); const char *c_inputExpression = inputExpressionBA.data(); QtParser p(c_inputExpression); qDebug() << "Input expression: " << inputExpression; auto result = QtParser::eval(p.parse()); QString answerExpression = QString::number(result); ui->lineEditParseAnswer->setText(answerExpression); }
e4208a66ee3c77e40d40733dcb24f9c25bccf480
756953bd7487da84962013ed4efc19a5ed2561a5
/src/modules/gfx/viewport.h
a476dce79fa03308775edd909f2c3ff028985385
[]
no_license
Dummiesman/mm2hook
a4ade067fdc981ea4accde5dbfeb7653b2b5247f
511c96a24b88f3210791dd8ea668fb377b02c4f5
refs/heads/master
2023-08-19T05:39:17.219544
2023-08-10T15:32:00
2023-08-10T15:32:00
93,969,666
2
0
null
2017-06-10T22:53:27
2017-06-10T22:53:27
null
UTF-8
C++
false
false
1,708
h
#pragma once namespace MM2 { // Forward declarations class gfxViewport; // External declarations // Class definitions class gfxViewport { private: Matrix44 m_Projection; Matrix44 m_ViewModel; Matrix44 Camera; Matrix44 World; int field_100; int field_104; int field_108; int field_10C; int field_110; int field_114; int field_118; int field_11C; int Flags; float DefaultAspect; int field_128; float Near; float Far; float field_134; float field_138; float field_13C; float float140; float float144; float float148; float float14C; float float150; float float154; float float158; D3DVIEWPORT7 m_Viewport; float Fov; float Aspect; public: AGE_API void ResetWindow() { hook::Thunk<0x4B14A0>::Call<void>(this); } AGE_API void Ortho(float left, float right, float bottom, float top, float nearVal, float farVal) { hook::Thunk<0x4B1800>::Call<void>(this, left, right, bottom, top, nearVal, farVal); } AGE_API void Perspective(float fov, float aspect, float nearClip, float farClip) { hook::Thunk<0x4B1640>::Call<void>(this, fov, aspect, nearClip, farClip); } AGE_API void SetWindow(int left, int top, int width, int height, float dvMinZ, float dvMaxZ) { hook::Thunk<0x4B14C0>::Call<void>(this, left, top, width, height, dvMinZ, dvMaxZ); } }; ASSERT_SIZEOF(gfxViewport, 0x17C); }
f0bcf95d2031a556100949cb31082e36a0a4b3b2
9c68a6091faa0d9237efbc65e9111f44e8365303
/Code/EGR/recorder/recorder.h
4adf1d39faad97b04013f265b020f882d1c8052a
[]
no_license
tmf/ergonomic-gestures-recognition
07c0b761158489ec821fce86bb73e7f785c27c18
984a29ada36203cda4f59c73972fb22937904d87
refs/heads/master
2021-01-02T22:50:31.540599
2014-03-19T23:41:15
2014-03-19T23:41:15
null
0
0
null
null
null
null
UTF-8
C++
false
false
499
h
#ifndef RECORDER_H #define RECORDER_H #include <QtGui/QMainWindow> #include <QTimer> #include "ui_recorder.h" class recorder : public QMainWindow { Q_OBJECT public: recorder(QWidget *parent = 0, Qt::WFlags flags = 0); ~recorder(); private: Ui::recorderClass ui; QTimer timer; IplImage *buffer; bool recording; bool tracker; public slots: void frame(); void saveTracker(); void recordTracker(); void showTracker(); void test(); }; #endif // RECORDER_H
b651d1f5a5a8e2486e24f15eeca0afbc39705e4d
1673fddc4307dc9703a93bdef55df3ecd3f2efbd
/cquery_snapshots/cquery_1/tests/namespaces/anonymous_function.cc
c20ef5eff8333c6829d1af80c9d16857369a1fd5
[ "MIT" ]
permissive
openjamoses/projects_snapshots_1
69e77c20e72d6d3e65faba21a51a2adb18fa7bb4
a6aea1a68044968681068cd16d119c231e45d7e2
refs/heads/master
2022-12-17T19:51:29.159524
2020-09-26T23:30:46
2020-09-26T23:30:46
298,916,205
0
1
null
null
null
null
UTF-8
C++
false
false
231
cc
namespace { void foo(); } /* OUTPUT: { "funcs": [{ "id": 0, "usr": "c:anonymous_function.cc@aN@F@foo#", "short_name": "foo", "detailed_name": "void ::foo()", "declarations": ["2:6-2:9"] }] } */
04a181ba37644e1b6cd4486e9c8c747b0dae5c17
12d49cf0bdd8844d747f40783ce547e940540f0c
/grail/classes/array/unique.cpp
b506a28ea0a57b86d7092c9c6f9c38bce5612793
[]
no_license
guenhae/Orbit
42375d44a0d8a047243b89826815512e4723fb0a
5d676bdb92a85702d24e39064ed04ee2ffd92b6a
refs/heads/master
2021-01-10T10:58:24.647783
2016-01-27T23:29:12
2016-01-27T23:29:12
50,544,898
0
0
null
null
null
null
UTF-8
C++
false
false
2,096
cpp
// This code copyright (c) by the Grail project. // No commercial use permitted without written consent. // August 1994 /*************************************************************************** File: classes/array/unique.cpp ----- Description: ------------ This file contains the definition of the following function: array<Item>& array<Item>::unique() This function is a public member of the template class array (declared in array.h). Revision History: ----------------- The Grail Project Initial version of source code M.Hoeberechts 98/05/27 Added header and comments ***************************************************************************/ /*************************************************************************** array<Item>& array<Item>::unique() Description: This function is a public member of the template class array (declared in array.h). This function first sorts the array, then eliminates any duplicate elements in the array and compacts the remaining elements. operator== for Items is used to determine equality of Items. A reference to this array is returned. This function can be called in the following way: this_array.unique() Parameters: none Return Value: array<Item>& - a reference to this array ***************************************************************************/ template <class Item> array<Item>& array<Item>::unique() { int i; int j; // array must have two items to have duplicates if (sz < 2) return *this; sort(); // loop through the original array using i and move elements to // eliminate duplicates using j and k int k = 0; for (i=j=0; i<sz; ++i) { // move i past same elements if (p[i] == p[j]) continue; // move one copy of a repeated element or move other elements // down to fill space left by repeated elements if (k != j) p[k] = p[j]; ++k; j = i; } p[k] = p[j]; sz = k+1; return *this; }
1384fda0f320064e4a7a36e4a846e3efbd616b6d
3233939b13373df1e8347a1d0fdc0ef4df5420c1
/src/std/Windows/Systems/systemInput.tpp
1d4c14be03d6ad4e8f5ccf64ac6ef73d326f3720
[]
no_license
Teckwar160/EGE
706f52a23c4fe88e47ebf6a96615c52a6ca39eb6
9cdffdbccd66eabb18b2d5d4a6671777f690dfb3
refs/heads/master
2022-12-14T06:35:02.070262
2020-08-27T00:33:43
2020-08-27T00:33:43
277,684,954
0
1
null
2020-09-26T06:41:15
2020-07-07T01:19:23
C++
UTF-8
C++
false
false
261
tpp
#ifndef SYSTEMINPUT_TPP #define SYSTEMINPUT_TPP #include <std/Windows/Systems/systemInput.hpp> namespace EGE::STD::TERMINAL::WINDOWS{ char systemInput::update(){ if(kbhit()){ return getch(); } return 0; } } #endif
68ad5bbc53a4718d54f4a558eed07ab44cea4b3c
3ea34c23f90326359c3c64281680a7ee237ff0f2
/Data/1539/H
bbadc61c88ff46fd75c4516a9d0a99eff062d3d9
[]
no_license
lcnbr/EM
c6b90c02ba08422809e94882917c87ae81b501a2
aec19cb6e07e6659786e92db0ccbe4f3d0b6c317
refs/heads/master
2023-04-28T20:25:40.955518
2020-02-16T23:14:07
2020-02-16T23:14:07
null
0
0
null
null
null
null
UTF-8
C++
false
false
92,208
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | foam-extend: Open Source Cstd::filesystem::create_directory();FD | | \\ / O peration | Version: 4.0 | | \\ / A nd | Web: http://www.foam-extend.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volVectorField; location "Data/1539"; object H; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; internalField nonuniform List<vector> 4096 ( (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (3.65746058156997e-13,5.30460445185537e-13,-2.07500624447964e-12) (1.6141710334227e-12,3.19489612355243e-12,-2.21002469189903e-12) (1.9239061847099e-12,5.96633428387612e-12,-1.67974185864784e-12) (1.6763048949866e-12,9.69409050224817e-12,-6.74974435207531e-13) (1.40447412919112e-12,1.40284294640094e-11,-1.72081582721594e-14) (1.4446450051477e-12,2.25539353657801e-11,-4.88333825684944e-15) (1.95528347827688e-12,3.58518187693655e-11,1.35157354313537e-13) (9.57966879702912e-13,5.84279942988674e-11,2.9343308831196e-13) (7.38199311486012e-13,9.5430130366036e-11,2.84439692067269e-13) (1.95276160935091e-12,1.44281196220335e-10,8.21551088992938e-14) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (1.17147597552439e-12,6.03423496687796e-13,-5.00372776592205e-12) (2.46574179748043e-12,3.17342593459475e-12,-4.89211386729357e-12) (3.10878613844959e-12,6.14452273407457e-12,-4.20706042999141e-12) (3.45599513022849e-12,9.72845216906658e-12,-2.62449393104984e-12) (3.22986621542248e-12,1.40892632253017e-11,-1.10655806475601e-12) (3.36126425616885e-12,2.24844350042525e-11,-4.27623628145011e-13) (4.33372237164697e-12,3.57522882785919e-11,1.43876962281282e-13) (2.43035841209883e-12,5.79045118810596e-11,4.48497923730585e-13) (6.45989710813991e-13,9.51914152547812e-11,2.75983938442705e-13) (3.49073146536896e-13,1.44437119516013e-10,1.84011235809998e-14) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (1.07214918223617e-12,8.6470700347014e-13,-8.22738798706357e-12) (2.28712187079202e-12,3.39285404990976e-12,-8.16861779914404e-12) (3.45966010053768e-12,6.1480196568751e-12,-7.41528929738877e-12) (4.03175307406145e-12,9.52146323615683e-12,-5.60721310329088e-12) (4.04899729553203e-12,1.39759682436083e-11,-3.50423268789296e-12) (3.92369033883799e-12,2.20169837260585e-11,-1.9895642463563e-12) (3.70841849632936e-12,3.54348901297567e-11,-1.05495536298685e-12) (7.26729171542534e-13,5.7505628036342e-11,-8.61261587428886e-13) (-2.71841705858701e-12,9.48755879975689e-11,-9.14811910357118e-13) (-4.01034979039619e-12,1.44600862921823e-10,-7.52356909321665e-13) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (6.74919337986352e-13,1.09317288587665e-12,-1.09232471099124e-11) (1.36910744874831e-12,3.50995833491016e-12,-1.10012991001197e-11) (2.73993223442396e-12,6.10004366657596e-12,-1.05409955682465e-11) (3.20362024558413e-12,9.18962547184165e-12,-9.10475197074418e-12) (3.02262669426211e-12,1.36113082727197e-11,-7.27513136376844e-12) (1.80899632975887e-12,2.15109426046213e-11,-5.48342318135374e-12) (2.28547286067177e-13,3.55044667662273e-11,-4.2680182084242e-12) (-3.77094063350239e-12,5.7591881421239e-11,-3.4606252230922e-12) (-8.33832951927688e-12,9.42243118271648e-11,-2.62070267424175e-12) (-1.10288242665352e-11,1.43506938410479e-10,-1.57408897821335e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (9.76362417243853e-13,1.31276642361702e-12,-1.55739180787168e-11) (1.7352575017213e-12,3.40260141957276e-12,-1.51802395139268e-11) (1.93341125561581e-12,5.44414773921184e-12,-1.46200352136501e-11) (1.42931201870089e-12,8.32049635212617e-12,-1.37987545490243e-11) (9.11705214233764e-13,1.28157875902038e-11,-1.26352300999967e-11) (-2.03981935356886e-12,2.07909659423444e-11,-1.10596678077522e-11) (-5.66846350423659e-12,3.52300508841162e-11,-9.64497372643963e-12) (-1.09636443624318e-11,5.75024335220923e-11,-7.79121638726612e-12) (-1.6498662446554e-11,9.326882123247e-11,-5.36242908448953e-12) (-2.02422952605513e-11,1.41455122573194e-10,-2.52511651124517e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (4.66539086856496e-13,1.23966397177794e-12,-2.25840734465589e-11) (2.0100589718045e-13,2.81460586476113e-12,-2.22576733569412e-11) (7.46669061018161e-14,4.21499969514666e-12,-2.21168951487487e-11) (-1.23876225621412e-12,6.85942813356105e-12,-2.18941445843949e-11) (-3.73411225842703e-12,1.14029909208831e-11,-2.09151347344284e-11) (-7.73494953392643e-12,1.94065501501889e-11,-1.96775019242361e-11) (-1.24627086081575e-11,3.41786159933982e-11,-1.82658025103155e-11) (-1.87463759378931e-11,5.61176364558043e-11,-1.51861804428268e-11) (-2.47796579567742e-11,9.0786673009221e-11,-1.05981608018229e-11) (-2.8423338716199e-11,1.38171892705035e-10,-5.21382464627048e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-2.55205817134965e-13,1.10840987357864e-12,-3.41131222833823e-11) (-1.46442814732139e-12,2.14914527839708e-12,-3.39270289419185e-11) (-2.1375375653545e-12,3.19374215297169e-12,-3.42153975688273e-11) (-3.95212136199277e-12,5.38087654708533e-12,-3.45092247504128e-11) (-8.22742081044917e-12,9.56148506055475e-12,-3.37361273692885e-11) (-1.3347109370866e-11,1.69178384122359e-11,-3.28296221476362e-11) (-1.91027328181866e-11,3.07592373795792e-11,-3.09241629828182e-11) (-2.56197036178001e-11,5.17703957781673e-11,-2.62614526981803e-11) (-3.17723064862889e-11,8.55304864159648e-11,-1.90500560717165e-11) (-3.51672806655979e-11,1.32339691786467e-10,-1.0049619512132e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-1.08072569870367e-12,9.65957737570768e-13,-5.47032943236793e-11) (-2.96575116353292e-12,1.89755355033932e-12,-5.47761366700251e-11) (-4.42303697233256e-12,2.73101639273283e-12,-5.50068982157599e-11) (-7.21950171232899e-12,4.14453736210375e-12,-5.54019914917241e-11) (-1.29332965262349e-11,7.85210546490445e-12,-5.47749842192647e-11) (-1.88691762451383e-11,1.42514605514177e-11,-5.3578049197282e-11) (-2.52708179984323e-11,2.55883325301482e-11,-5.07763164052596e-11) (-3.15070440323409e-11,4.45495646930957e-11,-4.42288520701575e-11) (-3.72910508216801e-11,7.66215092700346e-11,-3.37225970667412e-11) (-4.08483209085702e-11,1.21918383504183e-10,-1.87101776899531e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-2.28879086401461e-12,6.82852601984917e-13,-8.951908812619e-11) (-4.87616020602089e-12,1.63935577757225e-12,-8.98405629205104e-11) (-6.94686223292745e-12,2.5131191900013e-12,-8.98591284011836e-11) (-1.06056537206835e-11,2.89301082375223e-12,-8.95043984594061e-11) (-1.66191256144258e-11,5.55660132842508e-12,-8.86054834181988e-11) (-2.24974806101079e-11,1.0552638042953e-11,-8.67697060167148e-11) (-2.90485657158752e-11,1.88390601242265e-11,-8.28084809097429e-11) (-3.46566406610386e-11,3.40908212850528e-11,-7.46973628997985e-11) (-3.89075361206229e-11,6.15206929113712e-11,-6.02761023852082e-11) (-4.21429459589985e-11,1.02609437460524e-10,-3.59259528001366e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-2.67069007748228e-12,5.2878651830526e-13,-1.38670396339941e-10) (-5.65048289156121e-12,9.18624528333013e-13,-1.38634660716184e-10) (-7.60979316148441e-12,1.42833111892334e-12,-1.38604283541639e-10) (-1.15801273875188e-11,1.28099300171913e-12,-1.37526406806267e-10) (-1.77645895066786e-11,2.72453921948079e-12,-1.36337260470603e-10) (-2.36473471126404e-11,5.75598013438489e-12,-1.34350760939345e-10) (-3.09571712120893e-11,1.04220254897709e-11,-1.29408131780204e-10) (-3.70378791658306e-11,1.94217750349532e-11,-1.19709839823151e-10) (-4.06819096359066e-11,3.70329817992637e-11,-1.01165408014545e-10) (-4.37932508201812e-11,6.61936115391182e-11,-6.49625561266312e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (4.27801454076762e-13,-3.36904048738611e-14,-2.96305526926914e-12) (1.10535838912735e-12,2.89913901661211e-12,-3.0056900121134e-12) (7.40950311061285e-13,7.75990941534234e-12,-2.35470454825442e-12) (9.84176951230759e-13,1.55236376355234e-11,-1.81063610649417e-12) (1.33131554785436e-12,2.49760739363755e-11,-1.10676321068671e-12) (1.37410467414333e-12,4.00991799859188e-11,-8.90059767266203e-13) (1.896538235128e-12,6.31799293325896e-11,-2.94311346209096e-13) (1.49044269348891e-12,1.02277676985226e-10,3.34550473893413e-13) (1.17919900573916e-12,1.76094925995435e-10,4.34117367576673e-13) (1.87899342211377e-12,3.36039767311008e-10,1.21229322671159e-13) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (7.98578570113919e-13,3.24556173686724e-13,-6.64885146291205e-12) (1.56126024486755e-12,2.99381252745634e-12,-6.42787001581503e-12) (1.52272271672382e-12,7.95603975758966e-12,-5.67352704853027e-12) (2.14504819684937e-12,1.51883048651459e-11,-4.41978757060299e-12) (2.66422676052853e-12,2.49431618680714e-11,-2.529573168556e-12) (3.25721494389358e-12,4.00753412033613e-11,-1.3440721038706e-12) (4.34649955892819e-12,6.30612510929766e-11,-3.05094266631077e-14) (3.00175624229584e-12,1.01863085794775e-10,8.01785713759112e-13) (1.21939978331453e-12,1.75553202520814e-10,6.44522909846366e-13) (2.03730864284521e-13,3.35858819398548e-10,4.45989509977802e-13) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (7.84913111911364e-13,7.70855688533671e-13,-1.19018753368905e-11) (1.41668908403827e-12,3.41876242132687e-12,-1.1620608431329e-11) (1.69955989674744e-12,7.8457577484756e-12,-1.07586682291567e-11) (2.26061042298336e-12,1.45219130422262e-11,-9.37759781152012e-12) (2.89898882482951e-12,2.45568773855449e-11,-7.07204882427009e-12) (3.49512257686967e-12,3.95021680712193e-11,-4.71296547516068e-12) (3.44514808433787e-12,6.30319618911938e-11,-2.27191109234476e-12) (6.94026109520387e-13,1.02080031771086e-10,-1.1596439214789e-12) (-2.22959588944478e-12,1.74920325242875e-10,-1.06924093628712e-12) (-3.66878218848044e-12,3.35507170040683e-10,-6.12108139061928e-13) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (5.33377790452665e-13,1.09556654065221e-12,-1.71648600732539e-11) (1.01616083221173e-12,3.71789097184014e-12,-1.71435568411965e-11) (1.95958456428024e-12,7.8439112236035e-12,-1.67032617362715e-11) (2.24312875832755e-12,1.38134874433787e-11,-1.52957074412195e-11) (2.02643919437155e-12,2.31605105111456e-11,-1.30868518026649e-11) (1.31356801910165e-12,3.78666353018014e-11,-1.04628655617214e-11) (-3.04429817144836e-13,6.26891105504304e-11,-7.58594358471704e-12) (-4.52141528327474e-12,1.02461795389728e-10,-5.56677870124682e-12) (-8.42945262028645e-12,1.74217301291399e-10,-4.11109416644626e-12) (-1.05510974073704e-11,3.34285253536221e-10,-2.29961450855539e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (6.55786304292158e-13,1.38694034182699e-12,-2.57197085559657e-11) (1.76304875625367e-12,3.67556142199205e-12,-2.54807256628223e-11) (2.34127863505248e-12,6.69161494822731e-12,-2.49645933736133e-11) (1.72685578824448e-12,1.17786998641749e-11,-2.40269000938543e-11) (7.48939591328225e-13,2.0480344133864e-11,-2.26642573458335e-11) (-2.07009764277595e-12,3.48913519916427e-11,-2.06778846068317e-11) (-6.47078595260438e-12,6.07511485136034e-11,-1.90491745449275e-11) (-1.20076345987799e-11,1.02171776982368e-10,-1.48008785722939e-11) (-1.68538267965735e-11,1.72979168217058e-10,-9.79479055292405e-12) (-1.948418190396e-11,3.3157557150234e-10,-4.65558606577687e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (2.71393095438487e-13,1.59003447534337e-12,-3.84688694084445e-11) (7.25688275351668e-13,3.6346085972126e-12,-3.86959641606882e-11) (8.73173883920322e-13,5.54762115179054e-12,-3.874013522812e-11) (-7.39220519707069e-13,9.71605620213985e-12,-3.86571931144229e-11) (-3.13023920829536e-12,1.74307731472059e-11,-3.76676658047205e-11) (-6.65793720990624e-12,3.12096541940249e-11,-3.60568223244101e-11) (-1.21229520617676e-11,5.83716266298915e-11,-3.43077658963596e-11) (-1.89871549011959e-11,9.90801117401423e-11,-2.82988314725606e-11) (-2.49078075190138e-11,1.68816537523674e-10,-1.91910926431211e-11) (-2.78049624435868e-11,3.26542747114711e-10,-9.39476047710572e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-2.98847022590842e-13,1.91994764738511e-12,-5.94323603449969e-11) (-9.24467792354941e-13,3.59532968945194e-12,-5.96308381500507e-11) (-1.38098462352954e-12,4.87619837297356e-12,-5.97095851189077e-11) (-3.48887955813986e-12,7.74267665162397e-12,-5.99962409993913e-11) (-7.42454643643861e-12,1.38350569055476e-11,-5.97595031392796e-11) (-1.25861906748481e-11,2.59370948830551e-11,-5.92507222473836e-11) (-1.85945382533594e-11,5.2220147304307e-11,-5.57161870642609e-11) (-2.56102691592635e-11,9.14303582375079e-11,-4.80311172345572e-11) (-3.18637659001415e-11,1.59630649798237e-10,-3.43059018551357e-11) (-3.47955918946711e-11,3.16184108466565e-10,-1.79387527277083e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-7.24778216772167e-13,1.73889868409026e-12,-9.66024973159401e-11) (-2.47679184503073e-12,3.10888597958928e-12,-9.67448829345117e-11) (-3.81004649363434e-12,4.23758034314135e-12,-9.63034832500339e-11) (-6.59498244643831e-12,6.09918739001412e-12,-9.62028339200221e-11) (-1.18347274117591e-11,1.16341141585951e-11,-9.62568684206719e-11) (-1.79720865286732e-11,2.27961030788553e-11,-9.54508634469458e-11) (-2.50690099275965e-11,4.45755309491508e-11,-9.08620217120667e-11) (-3.15545556278498e-11,7.90766945903888e-11,-7.88750708983813e-11) (-3.72026538396721e-11,1.43612683696261e-10,-5.97213886100054e-11) (-4.02495525555151e-11,2.97223676646353e-10,-3.34624490590688e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-1.81324998601443e-12,1.3377967259177e-12,-1.66502853468273e-10) (-4.13686347610781e-12,2.26278024863974e-12,-1.66515004988834e-10) (-6.21680410362538e-12,3.4045974834871e-12,-1.65621131248802e-10) (-9.89255093985354e-12,4.32245879335129e-12,-1.64618170785614e-10) (-1.56228409069519e-11,8.46580617924701e-12,-1.64111280343256e-10) (-2.16620478085335e-11,1.70738092765958e-11,-1.6220911998688e-10) (-2.87426490913846e-11,3.29340432244749e-11,-1.5567248102532e-10) (-3.44088549255456e-11,6.07160681278639e-11,-1.40835408965879e-10) (-3.87699745936579e-11,1.17015969128647e-10,-1.14904616176059e-10) (-4.16530728375608e-11,2.62919297118692e-10,-7.15158339164349e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-2.17763918293436e-12,9.5355865326831e-13,-3.26385810620485e-10) (-4.76223553777309e-12,1.17881775511326e-12,-3.25881732851894e-10) (-7.25933877793437e-12,1.80048851107011e-12,-3.25039734738662e-10) (-1.14882807214612e-11,2.02094724559429e-12,-3.2349237006432e-10) (-1.70265498184602e-11,4.29187213161131e-12,-3.2240126492535e-10) (-2.28339961374027e-11,9.11323755784582e-12,-3.19712823737654e-10) (-3.02334376793745e-11,1.78789532240628e-11,-3.11713089989484e-10) (-3.61605359394491e-11,3.45404591258652e-11,-2.94242451046396e-10) (-3.98517797245621e-11,7.27247661103328e-11,-2.60511000567123e-10) (-4.25621954075887e-11,1.90278451671755e-10,-1.88938357224658e-10) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (1.12189618576333e-13,-3.5875484697121e-14,-2.19880903483105e-12) (3.59699413853124e-13,2.705794638441e-12,-2.22557033396478e-12) (7.51527564739772e-16,8.80909710471205e-12,-1.90282588054529e-12) (6.15636826282053e-13,1.89573088577426e-11,-1.81259172271032e-12) (1.14752417239493e-12,3.17585361666661e-11,-1.16670088042417e-12) (8.02195035581126e-13,4.98300346136304e-11,-5.4895272975828e-13) (1.38635465412492e-12,7.48102969482745e-11,1.99059805435565e-13) (1.80546699046909e-12,1.10726173962787e-10,6.93861924407739e-13) (2.03381052521801e-12,1.62772149742591e-10,2.95229884286251e-13) (2.18117065744224e-12,2.22215982080183e-10,-2.98289754637458e-13) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (1.31297608228006e-13,5.93131639942529e-13,-5.26044068620498e-12) (3.81967383138089e-13,3.2214855222837e-12,-5.44128107817215e-12) (3.79265247549009e-13,9.36337774108562e-12,-5.33602722041803e-12) (9.21225618204568e-13,1.87329145635345e-11,-4.52213892452167e-12) (1.86501017855493e-12,3.17067550653479e-11,-2.68667728022085e-12) (2.51682539875313e-12,4.95410894271949e-11,-6.26866869636209e-13) (3.5434936190981e-12,7.46232846801536e-11,1.24419604546917e-12) (2.94207307105573e-12,1.11327657829542e-10,1.57613867564296e-12) (2.05081046097384e-12,1.63050392658427e-10,7.82357180952211e-13) (1.00136973220224e-12,2.21852545977455e-10,3.08842129340742e-13) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (1.78935352615507e-13,1.28336832548094e-12,-1.07241628356368e-11) (2.55620332813065e-13,3.79145891650707e-12,-1.07476948813843e-11) (3.20336004046528e-13,9.215289377005e-12,-1.06029075352309e-11) (6.63487034140016e-13,1.77714819872098e-11,-9.67784079266502e-12) (1.93627234980905e-12,3.06011015845816e-11,-7.237689789864e-12) (2.68960096335699e-12,4.82334371795616e-11,-3.2588613898381e-12) (2.67573225542727e-12,7.48639626243241e-11,1.26367037903824e-12) (2.21859504673827e-13,1.12840989664561e-10,1.55404704859488e-12) (-1.98370473449391e-12,1.63496332471549e-10,6.5006127088091e-13) (-3.05897382352832e-12,2.21973387297494e-10,3.01032690553943e-13) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (2.20700756773594e-13,1.63442461252249e-12,-1.69882769968447e-11) (6.18195278080246e-13,3.95941970512373e-12,-1.73412032303948e-11) (1.70432654424254e-12,8.59832537459304e-12,-1.75300205781941e-11) (2.06906069843183e-12,1.56877102377841e-11,-1.61506422334413e-11) (2.08261933113893e-12,2.67616493643746e-11,-1.33693744869907e-11) (1.41192935219866e-12,4.36416302009422e-11,-8.90673816646974e-12) (-3.85632664087586e-13,7.40233009350778e-11,-2.45015944932445e-12) (-5.68708141054194e-12,1.14815670879755e-10,-1.82431596695472e-12) (-9.00279920352005e-12,1.64466913884086e-10,-2.14938222358507e-12) (-1.01410298819301e-11,2.22589462505034e-10,-1.5954270110596e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (2.13709277504141e-13,1.94240608631201e-12,-2.72319200450483e-11) (1.2878692921687e-12,3.87478764825202e-12,-2.74232762147661e-11) (2.54757915154908e-12,6.81547190312987e-12,-2.75779350665901e-11) (2.4268567017909e-12,1.19324223437655e-11,-2.67502439503231e-11) (1.81213784010428e-12,2.07925409875976e-11,-2.54201661735463e-11) (-1.7109907617848e-14,3.48724075140965e-11,-2.35988569871926e-11) (-8.33956004184663e-12,6.66039073762612e-11,-2.74221165293456e-11) (-1.39220573767348e-11,1.17009679622797e-10,-1.82210606177551e-11) (-1.78304005887255e-11,1.65135706638378e-10,-1.13486656230257e-11) (-1.91069435825244e-11,2.21391715107023e-10,-5.74299700447475e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (1.6857467637649e-13,1.9173475117518e-12,-4.32873338225043e-11) (8.0913825012959e-13,3.8540634475041e-12,-4.37150787064019e-11) (1.46165454851867e-12,5.42709501942723e-12,-4.41598834756722e-11) (2.44631722351757e-13,8.73635522489333e-12,-4.44282793768606e-11) (-1.14536644788887e-12,1.52063294324617e-11,-4.43003183336839e-11) (-3.13443432675884e-12,2.78253686264044e-11,-4.3803002307929e-11) (-1.19804071598663e-11,6.75990800971686e-11,-4.74973404645559e-11) (-2.04451402284003e-11,1.15428466331541e-10,-3.81926088737147e-11) (-2.55182519594181e-11,1.61620000245165e-10,-2.47613565136844e-11) (-2.68410842729497e-11,2.16282326784538e-10,-1.22099797372296e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (8.06797463566001e-14,1.79065241592909e-12,-6.73902799220047e-11) (-3.59277114140845e-13,3.59802538671963e-12,-6.74859391890793e-11) (-4.55710713457456e-13,4.39015848411372e-12,-6.78236649256751e-11) (-2.08212815629399e-12,5.67631541567967e-12,-6.88635144901436e-11) (-5.73238458110093e-12,9.13553595438356e-12,-7.06592629070194e-11) (-1.29797340541957e-11,1.6626453444702e-11,-7.39966629018266e-11) (-1.86349917275642e-11,5.87389544246923e-11,-6.9220004820496e-11) (-2.69818208921424e-11,1.06739856672509e-10,-6.57378175510127e-11) (-3.22129489251634e-11,1.51083908691975e-10,-4.37950784878441e-11) (-3.37739128023532e-11,2.04394410118484e-10,-2.17777110864299e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-1.81290639492047e-13,1.40207781615011e-12,-1.01688045451358e-10) (-2.07208579898328e-12,2.97139863801156e-12,-1.0187538799395e-10) (-3.07771296428037e-12,3.93670800987265e-12,-1.02104744320975e-10) (-4.76421934840348e-12,4.59816713410046e-12,-1.02698183265565e-10) (-9.47242440617537e-12,9.13130083980564e-12,-1.04337274306992e-10) (-1.68386344615086e-11,2.10482331004503e-11,-1.06858778297465e-10) (-2.54144730164087e-11,5.36517406002695e-11,-1.06950621742473e-10) (-3.23476114545895e-11,8.86873975609813e-11,-9.02992817604843e-11) (-3.68648788226317e-11,1.30383632249928e-10,-6.45335692059854e-11) (-3.94076220865454e-11,1.82211846263227e-10,-3.40390428488347e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-1.41686039324119e-12,1.20725877267356e-12,-1.49785378552473e-10) (-3.94677472291027e-12,2.18199600089304e-12,-1.49693721026593e-10) (-5.61565559432828e-12,3.12086300809603e-12,-1.49344519971459e-10) (-8.09792983405276e-12,3.57100333070111e-12,-1.49048173716709e-10) (-1.3351067215034e-11,7.86535914811379e-12,-1.4957569706777e-10) (-2.02381150515049e-11,1.83500567332722e-11,-1.49264830064262e-10) (-2.85246311509005e-11,3.88068971771574e-11,-1.43988158625698e-10) (-3.41640387139484e-11,6.47779944286355e-11,-1.2592385490477e-10) (-3.78675538344675e-11,9.96832850784178e-11,-9.64728350498534e-11) (-4.05280613071926e-11,1.46771971505256e-10,-5.49672463822762e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-1.72815829860246e-12,8.67367042330189e-13,-2.09430876642711e-10) (-4.42541589657998e-12,1.09258694322822e-12,-2.08539783302848e-10) (-7.00621494067918e-12,1.70640486365855e-12,-2.07711507337846e-10) (-1.0558438615497e-11,1.87080127141696e-12,-2.06725221105695e-10) (-1.54231188739167e-11,4.5480924510912e-12,-2.06365616917573e-10) (-2.17204923280868e-11,1.04270036519754e-11,-2.04104435232e-10) (-2.98251233980158e-11,2.07009969802828e-11,-1.95911789569614e-10) (-3.53515272935697e-11,3.54485175706011e-11,-1.76455526412607e-10) (-3.86996569567158e-11,5.71050069152692e-11,-1.4252452668345e-10) (-4.12221009598476e-11,8.97899328610712e-11,-8.74656626519415e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-4.90056206909277e-13,-1.08850567214208e-13,-2.13383714937202e-12) (-4.78735923434532e-13,2.38528381207609e-12,-2.24898220181582e-12) (-6.43763266632644e-13,8.79031379000985e-12,-2.16782694426629e-12) (1.94140278225918e-13,1.92205056317655e-11,-2.16873954372802e-12) (5.81557123049372e-13,3.30445691909206e-11,-1.42746702839412e-12) (3.43127686843031e-13,5.2458914014816e-11,-2.11635034382832e-13) (1.07856480327351e-12,7.59904672525608e-11,1.25150508269932e-12) (1.60261516385974e-12,1.04044856602192e-10,1.81840439934651e-12) (2.34908724825529e-12,1.36216990763902e-10,9.76326760963257e-13) (2.24631700563336e-12,1.62563990291127e-10,1.84544364973976e-13) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-3.78098685339219e-13,5.08852616954375e-13,-5.30984811200682e-12) (-2.9325986881953e-13,3.02261589897438e-12,-5.57529139864667e-12) (-2.86534684299695e-13,9.30853802485829e-12,-5.6974854606025e-12) (4.71965502628428e-14,1.89177967673475e-11,-4.79604613493719e-12) (9.10853248712144e-13,3.24933834164136e-11,-2.71301669318586e-12) (1.9534147313043e-12,5.14888527120765e-11,9.98472419729319e-13) (2.9708730447128e-12,7.61556982747951e-11,5.30982119177345e-12) (2.22252273078855e-12,1.05676216893217e-10,5.33986122240378e-12) (2.07838569946339e-12,1.37561346053885e-10,3.16182523406571e-12) (1.1893705415813e-12,1.62908381010093e-10,1.39720429627973e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-1.48588888686427e-13,1.39058080047429e-12,-1.0166709046804e-11) (-5.71278019776488e-14,3.97108975029286e-12,-1.04026306936011e-11) (1.22332639101116e-14,9.13216406880189e-12,-1.05125070026348e-11) (3.07107780762879e-13,1.74112291606969e-11,-9.36585957010173e-12) (1.79689616999945e-12,2.95987453311645e-11,-5.80783126939931e-12) (2.75887617303359e-12,4.78369822611997e-11,1.65754681410435e-12) (3.22601727521955e-12,7.70986542757985e-11,1.3100861018761e-11) (-8.48835932894775e-13,1.08918946040102e-10,1.04831809283609e-11) (-2.60525756676618e-12,1.39975306906499e-10,5.60111173111864e-12) (-3.37401634024277e-12,1.64589675370333e-10,2.37509391468244e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (2.65645516568318e-13,1.97995104474498e-12,-1.6420208832408e-11) (8.9164468275043e-13,4.38627067126015e-12,-1.71584125435217e-11) (2.10780167095154e-12,8.22787931414954e-12,-1.74520848000852e-11) (3.04308084597677e-12,1.38481652313442e-11,-1.57785844219329e-11) (3.58909138742485e-12,2.24404126590091e-11,-1.1170199857977e-11) (3.72457332190239e-12,3.74023540206692e-11,-1.31164404061158e-12) (6.40791741239249e-12,8.07361680363745e-11,2.74731010899818e-11) (-7.5560238970859e-12,1.16854677469755e-10,1.35628713718982e-11) (-1.02255471702248e-11,1.4474160859189e-10,4.44504002924512e-12) (-1.05387094951553e-11,1.67774477483888e-10,8.65449086010916e-13) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (4.30124021787109e-13,2.30265097013353e-12,-2.63456786826648e-11) (1.46325234475752e-12,4.09195306126316e-12,-2.69441551675278e-11) (3.10826491897259e-12,6.18819133661937e-12,-2.71895292148858e-11) (4.29284604389236e-12,8.76548300272416e-12,-2.59438459204169e-11) (5.5770402089141e-12,1.24338348793014e-11,-2.27964393236268e-11) (1.08531885221179e-11,1.27091118264878e-11,-1.57180005397387e-11) (-1.85357886742453e-11,1.6438749097083e-10,-5.58271014203111e-17) (-1.92132390802704e-11,1.34814928367073e-10,-1.67362292421874e-11) (-1.992036281414e-11,1.5091808501205e-10,-8.25181706881602e-12) (-1.97405522643659e-11,1.69458577866498e-10,-4.22210599774626e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (7.23014656116405e-13,1.75528741039941e-12,-4.19647788762215e-11) (1.50998108017163e-12,3.08400432084406e-12,-4.26293292613304e-11) (2.76698698506587e-12,3.90100784073813e-12,-4.32326668145064e-11) (3.17671048838362e-12,4.23604296960638e-12,-4.33306921207346e-11) (4.42811100442104e-12,3.64033533936691e-12,-4.21042888422806e-11) (1.17588190115305e-11,-1.51022391821198e-12,-3.63796958171578e-11) (-1.24250130781791e-11,1.62588019969281e-10,-7.10384733812075e-16) (-2.5187782929385e-11,1.37414177146264e-10,-4.44108490544065e-11) (-2.75335371826302e-11,1.49695720670113e-10,-2.5277244989865e-11) (-2.71631473442157e-11,1.65780201136153e-10,-1.20039020157176e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (5.64913613235357e-13,1.18300268511629e-12,-6.40260311255223e-11) (6.05075371146085e-13,2.12077951945953e-12,-6.43592887470828e-11) (1.0375893252605e-12,1.95127030191272e-12,-6.52678044569671e-11) (7.91768542156537e-13,-3.0561083321029e-13,-6.72077591245473e-11) (-2.39074947178701e-12,-7.69158351036402e-12,-7.15139659851738e-11) (-2.21781717912254e-11,-4.55502892524431e-11,-9.24663957814663e-11) (-1.70299651724824e-11,1.94573148560738e-10,-2.11940962985159e-10) (-3.0872100843806e-11,1.33741805013761e-10,-1.04007446239253e-10) (-3.35300398846105e-11,1.39793645479311e-10,-5.0890024884687e-11) (-3.33690600335038e-11,1.54350757807517e-10,-2.24698872872851e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (2.00870946561747e-13,7.14849903961281e-13,-9.03156387891427e-11) (-1.05332683478818e-12,1.47505003399353e-12,-9.08192228410048e-11) (-1.6684290178672e-12,1.36186403940034e-12,-9.18681917534052e-11) (-2.09796450371312e-12,-6.77247631544596e-13,-9.38491040515893e-11) (-5.68497872392448e-12,-1.51982512747681e-12,-9.7950841498968e-11) (-1.40486146495261e-11,2.16265684725927e-12,-1.10030116064535e-10) (-2.7220969575095e-11,6.96095550424551e-11,-1.4086686591537e-10) (-3.42039208767881e-11,9.58142913855551e-11,-1.00430440845242e-10) (-3.66590580081819e-11,1.13925765784696e-10,-6.36791602058424e-11) (-3.80067901774587e-11,1.31586420581617e-10,-3.13193357605621e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-1.16862618888854e-12,7.42614088865368e-13,-1.20164589967963e-10) (-3.20656672033666e-12,1.11144266739289e-12,-1.20460117128821e-10) (-4.49754370458202e-12,1.16817373080554e-12,-1.2100987653886e-10) (-5.87020442376691e-12,2.88637295308508e-13,-1.22177127153453e-10) (-1.03446675215537e-11,3.11619865558445e-12,-1.24426363638802e-10) (-1.75917334087705e-11,1.34284889079232e-11,-1.27688358082101e-10) (-2.84830346749985e-11,4.21412072235005e-11,-1.29082634390336e-10) (-3.42855817107192e-11,6.33094865748894e-11,-1.07496891401907e-10) (-3.67948643390236e-11,8.12046481436257e-11,-7.69339991365466e-11) (-3.85132690452506e-11,9.80202932549743e-11,-4.09881356303443e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-1.75188459613493e-12,6.10241536347771e-13,-1.46740202726381e-10) (-4.16110491835389e-12,6.71123290237817e-13,-1.46573327283202e-10) (-6.28609630916877e-12,7.63591083125245e-13,-1.46477667615988e-10) (-9.04724153219524e-12,4.63902811908889e-13,-1.46860546346508e-10) (-1.31362081084067e-11,3.07475474782789e-12,-1.48039536663993e-10) (-1.94861343384646e-11,9.43238410350712e-12,-1.46938571520916e-10) (-2.85803895747157e-11,2.08761102688186e-11,-1.4036626331857e-10) (-3.38340094520771e-11,3.21414851620167e-11,-1.21444772431196e-10) (-3.66535140731117e-11,4.31806586563299e-11,-9.12244129564275e-11) (-3.88978307506268e-11,5.37970198171201e-11,-5.0602305743182e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-9.92614338631708e-13,5.31518854824809e-13,-2.61397608330281e-12) (-1.19722326786647e-12,2.88066590157381e-12,-2.78670029516908e-12) (-1.16107490203559e-12,9.67392342131191e-12,-2.87844877660465e-12) (-2.44423372680189e-13,1.9908213918342e-11,-2.8367308542946e-12) (-8.3089096480622e-14,3.25538810790154e-11,-1.49430544387233e-12) (-1.49951127463855e-13,5.07560568570071e-11,4.43755449195503e-13) (3.46434464386486e-13,7.13784625399636e-11,2.71306152545735e-12) (8.13332511204843e-13,9.23938343038733e-11,3.26738373379681e-12) (1.79651435426598e-12,1.13227485303263e-10,2.22701584315751e-12) (2.08647065164183e-12,1.26899280541974e-10,1.27784181836711e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-9.9438358218728e-13,9.45790550955086e-13,-6.77689213387182e-12) (-1.11953965820289e-12,3.28240391449972e-12,-7.14366015364895e-12) (-1.01160005389447e-12,9.80075039346078e-12,-7.21532605821531e-12) (-5.29265284868456e-13,1.9043226578944e-11,-5.89439935729427e-12) (9.40022210795459e-14,3.10939327077274e-11,-2.82344663152909e-12) (1.29393641015666e-12,4.90206129450517e-11,2.33215191231034e-12) (1.99787701310064e-12,7.19007212009067e-11,9.81761178865132e-12) (1.15782957215985e-12,9.45042650865536e-11,9.69837090005315e-12) (1.42904578465685e-12,1.15082611449474e-10,6.23076642275615e-12) (9.05280477631039e-13,1.28596837529742e-10,3.21808234581062e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-5.02037486198989e-13,1.60269897696343e-12,-1.15253691803687e-11) (-3.62432413875381e-13,3.8457764957698e-12,-1.16598864838738e-11) (-2.30129413971913e-13,8.86820002402692e-12,-1.1462249198318e-11) (3.12143409375753e-13,1.63347631329537e-11,-9.61538983133418e-12) (1.4898507586474e-12,2.62519600579775e-11,-4.60278433119766e-12) (1.75019020892651e-12,4.2412339119088e-11,5.81072037472485e-12) (2.20618360511848e-12,7.49831945682222e-11,3.16717121550367e-11) (-3.90249816533121e-12,1.00195603916365e-10,2.43193890113448e-11) (-4.14554143572838e-12,1.1940340475834e-10,1.23349587851384e-11) (-4.18372453898752e-12,1.32067101328138e-10,5.31738982528252e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (6.81149302286746e-13,1.73240576909058e-12,-1.64683412949834e-11) (1.47963454932194e-12,3.65897522611701e-12,-1.68917676920652e-11) (2.47398927033588e-12,6.94948026593816e-12,-1.66046871991502e-11) (3.51737851064822e-12,1.10416615360611e-11,-1.46301748104173e-11) (3.73711334976075e-12,1.54290849963945e-11,-9.66974596753962e-12) (-3.66929614552724e-13,1.68866299512324e-11,-2.546430822718e-12) (-6.33331758039695e-11,9.27578942188603e-11,2.12612035267787e-16) (-1.63984434517548e-11,1.16747470219713e-10,5.60058336489475e-11) (-1.28224326471858e-11,1.27800441694147e-10,1.66240962995124e-11) (-1.13573607919953e-11,1.36926826596069e-10,5.01038307029122e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (1.57596406637566e-12,1.81037419644919e-12,-2.4529657078803e-11) (2.7165751325369e-12,3.05289687515814e-12,-2.47462883292316e-11) (4.14976512036617e-12,4.74129006920967e-12,-2.41736609296248e-11) (5.67487948023316e-12,5.72506610048435e-12,-2.22903235798829e-11) (7.29210096495609e-12,6.69687248764175e-12,-1.84786303096963e-11) (9.35457955421353e-12,6.90850331069308e-12,-1.12862936503767e-11) (-1.44257611554238e-16,8.79409222941044e-16,-3.56712171805129e-17) (-3.02969000328586e-11,1.63634058856025e-10,7.24830093499528e-17) (-2.2727709543292e-11,1.40785167159146e-10,1.47145113286007e-13) (-2.02842815316875e-11,1.4126379761119e-10,-6.75406412544151e-13) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (1.95984976653355e-12,1.19181416242409e-12,-3.75469828861192e-11) (3.07654343472945e-12,1.62581172735829e-12,-3.7902506280492e-11) (4.81474983011233e-12,2.17639936613031e-12,-3.78227919498366e-11) (6.49196101275563e-12,1.22283304689839e-12,-3.67563217190083e-11) (1.00354368290074e-11,-1.35399943116849e-12,-3.36821304037298e-11) (1.94198989133889e-11,-5.33888929765941e-12,-2.46953668304234e-11) (-2.99996318314105e-18,6.65730605484874e-16,-6.52387551599497e-17) (-4.06490148614362e-11,1.60370355252185e-10,-3.24353094525396e-16) (-3.0904804965908e-11,1.40805712819396e-10,-1.42970745910384e-11) (-2.77376060314185e-11,1.39246484441322e-10,-8.52790849903251e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (1.36632401591863e-12,4.65935422410742e-13,-5.55488588412779e-11) (2.15932056651853e-12,3.27293391362996e-13,-5.61440467655791e-11) (3.5669502553602e-12,-7.36828253022943e-14,-5.68539079339364e-11) (5.46961220110608e-12,-3.12263693449399e-12,-5.72874647844696e-11) (1.23899219416198e-11,-1.02890115889567e-11,-5.6633510660159e-11) (4.95834493127198e-11,-2.49364355185232e-11,-5.07583682304972e-11) (1.11599971178855e-16,9.16052872980429e-16,-1.13126916182574e-15) (-4.60620085702643e-11,1.6919224258972e-10,-1.00642057489353e-10) (-3.60822977873677e-11,1.32611580187683e-10,-4.59520479093618e-11) (-3.30746100949412e-11,1.28102886536404e-10,-1.94030519139826e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (6.76690813422967e-13,3.39287802270985e-13,-7.47731803291979e-11) (3.59249444300574e-13,6.15918178233759e-14,-7.55748324557854e-11) (5.06173588856844e-13,-8.9544433992528e-13,-7.67682639685129e-11) (1.03788801684429e-12,-4.66776860894229e-12,-7.87120145139749e-11) (1.75827205856245e-12,-1.33885966684704e-11,-8.2640575945755e-11) (5.52230314062149e-12,-4.5627201302314e-11,-9.60793581583568e-11) (-4.01890468261442e-11,1.00641912770132e-10,-1.53255099011071e-10) (-3.84503967056037e-11,1.03670733605541e-10,-9.63134763630188e-11) (-3.62977648123665e-11,1.01848998755022e-10,-5.62715480823226e-11) (-3.57599986113728e-11,1.04990717359079e-10,-2.63990739981785e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-7.4072647551794e-13,5.68380869247459e-13,-9.37436108547945e-11) (-2.21648793317791e-12,3.95873742511929e-13,-9.44638762366518e-11) (-2.92571044223798e-12,-2.50472873867699e-13,-9.55022537512532e-11) (-3.79623345507052e-12,-1.90128804307615e-12,-9.72266575878325e-11) (-7.04122917049692e-12,-2.24378411731445e-12,-9.99667567817414e-11) (-1.22013522961576e-11,3.26103214684736e-12,-1.05389910855593e-10) (-2.88036807087063e-11,4.44835497794734e-11,-1.12661725028049e-10) (-3.36804725632129e-11,6.07210007433148e-11,-9.01518002009783e-11) (-3.4716738357942e-11,6.84210934193315e-11,-6.10860129263745e-11) (-3.52781312376326e-11,7.44048763061967e-11,-3.1202877806142e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-1.30851850296637e-12,6.07187824074158e-13,-1.07372112585716e-10) (-3.58564129532932e-12,5.41943716912061e-13,-1.0786874054201e-10) (-5.13962649552427e-12,2.31492611103203e-13,-1.08660464774264e-10) (-7.40434840280106e-12,-2.7329744639777e-13,-1.09723578232392e-10) (-1.11624185036563e-11,1.16676344970298e-12,-1.1103572417518e-10) (-1.66260584373047e-11,6.73118296831784e-12,-1.11222261689473e-10) (-2.66257701932712e-11,1.95410436369084e-11,-1.07108291417263e-10) (-3.19128837648291e-11,2.85163010038847e-11,-9.04077056768294e-11) (-3.40949626300053e-11,3.46133147560808e-11,-6.47972996224919e-11) (-3.57031166767172e-11,3.8826127778324e-11,-3.41280370212478e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-1.23416182287939e-12,2.64673074736483e-12,-4.30437520474338e-12) (-1.50721279938358e-12,5.66930887336768e-12,-4.1769472543303e-12) (-1.32961979647702e-12,1.16410467968548e-11,-3.97932965939456e-12) (-7.21861443708999e-13,2.12265530562598e-11,-3.84198591280069e-12) (-5.61201618265414e-13,3.31316119909827e-11,-2.05638937666668e-12) (-6.83813291783913e-13,4.88889221822091e-11,3.29510944120479e-13) (-7.30146404860443e-13,6.57874662268604e-11,2.77705569019424e-12) (-2.5673038088471e-13,8.1366235892207e-11,3.43988333402389e-12) (8.90562232922956e-13,9.45710303946776e-11,2.7558403178588e-12) (1.66675548227412e-12,1.02257503559272e-10,1.64332928184038e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-1.28452398841319e-12,2.78927783154985e-12,-8.71696519612677e-12) (-1.61124633491378e-12,5.62828068243551e-12,-8.53432841772793e-12) (-1.39997638536211e-12,1.16413366091579e-11,-8.24533840451643e-12) (-8.91754564658793e-13,2.02252872175703e-11,-6.98818380496105e-12) (-2.19623673007498e-13,3.11544963916882e-11,-3.46149970166091e-12) (4.16750359753859e-13,4.64768822247497e-11,2.12617194823484e-12) (-9.65355465629297e-13,6.51052968701319e-11,9.71851895578701e-12) (-1.06590478030869e-12,8.24902664020299e-11,1.06883004155005e-11) (1.20936552654734e-13,9.61043025636702e-11,7.52697101433239e-12) (6.53099025091107e-13,1.04300652060911e-10,3.95913727853549e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-4.97226974815816e-13,3.03627462900448e-12,-1.34027047131396e-11) (-3.73268429788424e-13,5.72652979214041e-12,-1.24302486851193e-11) (-1.58269022878037e-13,1.0496760611453e-11,-1.10833893143124e-11) (5.9263950615443e-13,1.71605266464915e-11,-8.63761892442039e-12) (1.89922111428307e-12,2.56901597561737e-11,-3.43348271023432e-12) (1.41490759647761e-12,3.88775374177274e-11,6.49810353340152e-12) (-8.21619290183223e-12,6.4258964450003e-11,2.87214924374006e-11) (-8.46993424254959e-12,8.64674557176445e-11,2.68559851924634e-11) (-5.52500941167969e-12,1.00096084702413e-10,1.4835207077881e-11) (-3.72605998184925e-12,1.08191545779281e-10,6.44538196951835e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (1.02660727202385e-12,2.49650320216349e-12,-1.71150383208182e-11) (1.79863240736257e-12,4.78111147312357e-12,-1.61406635050051e-11) (2.70766707835448e-12,8.02903721698853e-12,-1.43312493074437e-11) (3.87354510335075e-12,1.16894341530304e-11,-1.14019098831922e-11) (5.34601071367806e-12,1.48362934416271e-11,-5.91723727705416e-12) (7.06455359122905e-12,1.43518331878112e-11,8.9343914225693e-13) (-2.65817820312421e-11,6.40374828912404e-11,1.20370357433564e-16) (-2.39032947386246e-11,9.78558943892005e-11,5.91807258199631e-11) (-1.41934448829402e-11,1.07576057248904e-10,2.06278133838773e-11) (-1.06839487367657e-11,1.13251197621109e-10,6.9760141982208e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (2.41115535081686e-12,2.18007519714731e-12,-2.33954687291626e-11) (3.57103288074171e-12,3.66197323136585e-12,-2.24095340158831e-11) (4.83131847368906e-12,5.32512307993257e-12,-2.04917667816269e-11) (6.36541926363477e-12,5.97961865370048e-12,-1.74730399898383e-11) (8.15063622444152e-12,5.84141198422038e-12,-1.25548102946617e-11) (1.03157141833862e-11,4.3029015600966e-12,-5.94352835722115e-12) (-3.87332206285311e-17,4.4371723798898e-16,-3.3454478192478e-17) (-2.71802690592928e-11,1.35093823806095e-10,8.37810400363161e-17) (-2.1925703677691e-11,1.19495640109905e-10,4.53306582628395e-12) (-1.89423747743545e-11,1.18262968926605e-10,1.89263628495559e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (3.0412519009349e-12,1.77590235266334e-12,-3.28095600053763e-11) (4.29534744005004e-12,2.22283970045512e-12,-3.21669271483502e-11) (5.99836179075113e-12,2.24636475998431e-12,-3.10865927197544e-11) (7.76323967880947e-12,1.00136071860081e-12,-2.90197211958327e-11) (9.9836854135315e-12,-1.55684227973227e-12,-2.46540562654231e-11) (1.43221435425574e-11,-4.74106703918294e-12,-1.61374739561841e-11) (5.79210868674984e-18,2.62608813254938e-16,-5.54404841178628e-17) (-3.51741519610251e-11,1.31534363413742e-10,-2.39668243662716e-16) (-2.84798384262202e-11,1.19513899373142e-10,-8.26660334536672e-12) (-2.51219166255263e-11,1.16388295048268e-10,-5.12099488457477e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (2.08815956033674e-12,1.29687363160517e-12,-4.5456997845026e-11) (3.13488330845396e-12,9.55036378877911e-13,-4.53814611806378e-11) (4.8222686205028e-12,-1.86452015933562e-13,-4.53396908375448e-11) (6.36078975124152e-12,-3.13109046058151e-12,-4.47278423054934e-11) (9.61436459148102e-12,-8.85452423806708e-12,-4.25077464012083e-11) (1.95169781351567e-11,-1.86899658036788e-11,-3.46397726604218e-11) (4.11029029022222e-17,4.22543261880726e-16,-5.67654063813197e-16) (-3.5230509166118e-11,1.4308931088603e-10,-8.37963584103042e-11) (-3.18687123500456e-11,1.12656904009362e-10,-3.59798415550794e-11) (-2.93654928316317e-11,1.05895308768908e-10,-1.46681482224292e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (1.24924987305367e-12,1.17764516319852e-12,-5.93499164343779e-11) (1.21839903229821e-12,5.70349842113852e-13,-5.95243096121329e-11) (1.80495266823302e-12,-1.07529799402423e-12,-6.03559030179e-11) (2.19996888281045e-12,-4.43362425161538e-12,-6.17857412237336e-11) (4.05224171999262e-12,-1.29736352137796e-11,-6.46217678424508e-11) (1.38098105442215e-11,-4.33894496118853e-11,-7.46377238316614e-11) (-4.09723064835607e-11,8.37962315198936e-11,-1.21018203324003e-10) (-3.55425921240711e-11,8.99274631195425e-11,-7.69316761467649e-11) (-3.27423335607543e-11,8.57798815214635e-11,-4.43065716609313e-11) (-3.15732315567304e-11,8.54001958378222e-11,-2.04270834590714e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-5.92680484523209e-14,9.21629047575611e-13,-7.26600387904611e-11) (-1.32418039295066e-12,4.1943714420732e-13,-7.26717427061473e-11) (-1.68327209071174e-12,-5.04652382746116e-13,-7.37610175786812e-11) (-2.68412485781954e-12,-1.34372947939152e-12,-7.56010167251419e-11) (-5.02862266366048e-12,-2.16660504412478e-12,-7.7881925754541e-11) (-8.39968894519327e-12,1.23679540249962e-12,-8.23493403720947e-11) (-2.63710993931959e-11,3.85747753168518e-11,-8.81500615909515e-11) (-3.05415600983904e-11,5.23331436094505e-11,-7.01072880120512e-11) (-3.07920948149386e-11,5.65510428169995e-11,-4.68481366794292e-11) (-3.09022605158535e-11,5.91829042412122e-11,-2.34627769102496e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-2.04702722598119e-13,5.39897483235312e-13,-8.11524942027326e-11) (-2.2519733461637e-12,2.22314252570069e-13,-8.11844631326061e-11) (-3.84502042629232e-12,-3.33810787332218e-14,-8.24076787879766e-11) (-6.36549990641105e-12,1.80751561103015e-13,-8.36935152850637e-11) (-9.80911753965972e-12,1.26382114079773e-12,-8.45675447343377e-11) (-1.4008845741198e-11,5.5784111150651e-12,-8.50738154630687e-11) (-2.37853122967967e-11,1.71801814622464e-11,-8.16756081151379e-11) (-2.90069888152818e-11,2.44590162386837e-11,-6.80407876786717e-11) (-3.01509104751607e-11,2.80773694850865e-11,-4.79632713973529e-11) (-3.10050259196592e-11,3.0197870780884e-11,-2.47795043119497e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-1.50413685743267e-12,4.23307492669471e-12,-5.44216524311603e-12) (-1.66380220340548e-12,8.94590689769986e-12,-5.10607697068738e-12) (-1.4672533553896e-12,1.47941034459169e-11,-4.49868112637034e-12) (-1.50619214114909e-12,2.31586539541259e-11,-4.01931636942943e-12) (-9.69986339764853e-13,3.37407981629659e-11,-2.41642450707985e-12) (-7.19318080388857e-13,4.681297096983e-11,-1.99081331041361e-13) (-7.10804691988319e-13,6.01331287525988e-11,1.80421203111542e-12) (-6.96717874522162e-13,7.24405434375713e-11,2.76006009009648e-12) (4.698010999586e-13,8.10296642381517e-11,2.39426778168417e-12) (1.26693626247229e-12,8.57132196604148e-11,1.25907595369392e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-1.71415756428455e-12,4.20249947309856e-12,-9.69928195114133e-12) (-1.99848545784527e-12,8.41089980745541e-12,-9.26466601266951e-12) (-1.51255498719424e-12,1.43698200307642e-11,-8.34724141501481e-12) (-1.3536780968768e-12,2.21124151372582e-11,-6.47939448317322e-12) (-3.42958687391578e-13,3.18015104260506e-11,-3.08371262010587e-12) (4.23748159200165e-13,4.45411308539626e-11,1.68488154935375e-12) (-1.08880450520259e-12,5.85739188253734e-11,7.27183297031798e-12) (-1.88176469476564e-12,7.20669625375157e-11,9.47068858161133e-12) (-3.03011850324274e-13,8.16622436431576e-11,6.862896671102e-12) (7.21342585199126e-13,8.69994852513883e-11,3.5058461159185e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-9.29911575981459e-13,3.94653683933999e-12,-1.38087089131603e-11) (-7.74709481587412e-13,7.62791755188269e-12,-1.26312183890121e-11) (-1.36316018299085e-13,1.26476170561836e-11,-1.04422626180279e-11) (8.59595785418522e-13,1.90392356367925e-11,-7.01004668272435e-12) (2.82150118521775e-12,2.70172447035335e-11,-1.63201985672792e-12) (3.71722292236689e-12,3.86604698380174e-11,7.00535599719956e-12) (-6.12920409811615e-12,5.47396382327818e-11,1.93307663261754e-11) (-7.83759479951631e-12,7.30214882536706e-11,2.37768911513078e-11) (-4.61515684969871e-12,8.38154207063554e-11,1.40222624769664e-11) (-2.34032985418734e-12,8.96948528016974e-11,6.23095220749824e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (3.68660461240587e-13,3.27158273096604e-12,-1.73568123999193e-11) (1.10835645156646e-12,6.09386805027923e-12,-1.62632555528375e-11) (2.48224179112529e-12,9.81302932210186e-12,-1.39123807248741e-11) (4.09868799658484e-12,1.42819578405957e-11,-9.64285340747767e-12) (7.53021575174128e-12,1.90683056745523e-11,-2.04518510947566e-12) (1.80068039908324e-11,2.69194641036383e-11,1.11393498782796e-11) (-2.17253483068454e-11,4.29196965343062e-11,4.50772689796499e-11) (-2.25883117194384e-11,7.74745567516601e-11,5.56010020682888e-11) (-1.246122855826e-11,8.83793272362473e-11,2.09080558390973e-11) (-8.71970584406957e-12,9.3330746935585e-11,7.68085683972549e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (1.82939348199694e-12,2.67123171625182e-12,-2.25790374763219e-11) (3.09239917741772e-12,4.37815349045526e-12,-2.1555087510468e-11) (4.89135000185629e-12,6.36694639917368e-12,-1.93038510579703e-11) (6.42544750354949e-12,7.94306346346851e-12,-1.4892589739354e-11) (8.9376085509587e-12,8.1343475639296e-12,-8.14494278421476e-12) (1.34161878799223e-11,1.67527837537714e-12,-2.87322950830878e-13) (2.51396858767175e-17,4.49972062593298e-16,-1.22407953151044e-16) (-2.81537907121803e-11,9.63696559357881e-11,1.87570794763909e-11) (-1.9303533399576e-11,9.53435576364392e-11,1.01510145632574e-11) (-1.51750646110008e-11,9.64687104488022e-11,3.88084233598534e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (2.87764776496047e-12,2.18844920870686e-12,-2.94675868944147e-11) (4.48281633303015e-12,2.98160817108691e-12,-2.84289998951918e-11) (6.36430704273617e-12,3.16497091927432e-12,-2.65208938901425e-11) (7.53002592762226e-12,2.89569210614028e-12,-2.31850809283848e-11) (8.76478506259852e-12,1.69991710928698e-12,-1.79613567422419e-11) (1.21336237913482e-11,-7.04967193122891e-13,-1.00280366699859e-11) (3.00854196058138e-17,3.01985345449026e-16,-1.6355468482845e-16) (-3.84627357561908e-11,9.30923831674559e-11,1.84011806065808e-11) (-2.47684515231979e-11,9.4381351067532e-11,1.91576667651807e-14) (-1.97499252307421e-11,9.42864402591783e-11,-1.85030959968363e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (2.13185136431956e-12,1.5485797933282e-12,-3.7540545515112e-11) (3.47779950213043e-12,1.9130462277213e-12,-3.6808642229916e-11) (5.09926606653905e-12,1.28518753332595e-12,-3.57876705161871e-11) (5.44322763797512e-12,-4.54701742159608e-13,-3.41956256163299e-11) (5.86550182643569e-12,-4.17216959896411e-12,-3.17314777318605e-11) (9.57725693700157e-12,-1.1014423556886e-11,-2.53630729035816e-11) (2.28825098000203e-17,3.77493213017144e-16,-5.18025000735455e-16) (-2.98851782548505e-11,9.42979638477115e-11,-3.79778573983695e-11) (-2.6303383194847e-11,8.76550804225635e-11,-2.04366307747957e-11) (-2.35385281229692e-11,8.53946780823424e-11,-9.23204569476036e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (1.67965916641036e-12,9.50477184299488e-13,-4.68814356115189e-11) (2.20090513598191e-12,1.20608781653411e-12,-4.6548482278511e-11) (2.66414526281421e-12,5.69051088684356e-13,-4.67516205391384e-11) (1.94610072927238e-12,-1.13888237445566e-12,-4.70112394456903e-11) (3.2611675395535e-12,-5.88462035147182e-12,-4.76714211754932e-11) (1.5564045022155e-11,-2.07990849133293e-11,-4.97826196067328e-11) (-3.98373774577299e-11,6.09001284661055e-11,-5.53610024947665e-11) (-3.05733770998093e-11,6.87609028823791e-11,-4.62091057999054e-11) (-2.73929830581938e-11,6.86983500206392e-11,-2.92978868570024e-11) (-2.57830234192429e-11,6.90106021547419e-11,-1.4119102622909e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (3.34167431563805e-13,4.97984225711254e-13,-5.65933313626385e-11) (-3.77826287437316e-14,6.99405910707755e-13,-5.65912686069304e-11) (-3.1454424828901e-13,3.43515435200137e-13,-5.73999932187996e-11) (-1.92769686892929e-12,2.42492870742783e-13,-5.84482305058453e-11) (-3.99163423100947e-12,3.27201181856178e-13,-5.91813954405436e-11) (-6.94058343890241e-12,4.63278599426392e-12,-6.03237292001578e-11) (-2.30192791175307e-11,3.14613005468093e-11,-5.97519516748347e-11) (-2.59265840602539e-11,4.23645240668499e-11,-4.94085931391995e-11) (-2.57037812522137e-11,4.58519923554188e-11,-3.36962971234607e-11) (-2.53800039657588e-11,4.76904094928177e-11,-1.69216242614842e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (3.67163690510531e-13,5.91242473709982e-14,-6.20035590326657e-11) (-8.06443438222808e-13,1.61542007833385e-13,-6.24666238865659e-11) (-2.5925650079385e-12,1.38944215826111e-13,-6.36541881512102e-11) (-5.31071889603387e-12,6.85318757125761e-13,-6.48819097291898e-11) (-8.03902567013125e-12,1.72600511667887e-12,-6.52758606420476e-11) (-1.18286419740638e-11,5.44112275844505e-12,-6.48987414149075e-11) (-2.02399512710164e-11,1.4537587317809e-11,-6.10290388433565e-11) (-2.46254888579154e-11,2.02457265095174e-11,-5.085575278137e-11) (-2.52573080754941e-11,2.28049872703977e-11,-3.58614461705958e-11) (-2.55866594507372e-11,2.43505357341901e-11,-1.85003028389285e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-1.80964967623134e-12,5.14512509315976e-12,-5.33222812767196e-12) (-1.73619095750852e-12,1.09343926280528e-11,-5.19143253749992e-12) (-1.52233469714279e-12,1.80728973920111e-11,-4.60741169069802e-12) (-2.06284518664195e-12,2.69379845468267e-11,-3.6083216949992e-12) (-1.2480417788983e-12,3.61271174263618e-11,-2.05786215203279e-12) (-4.50771326680056e-13,4.45506274253892e-11,-3.15025604443882e-14) (-1.07442823774485e-13,5.35057160036957e-11,1.43301442181383e-12) (4.26553339808415e-14,6.22798925115348e-11,2.25880303515031e-12) (9.72413522924761e-13,6.72857558115145e-11,1.99360814692351e-12) (1.23974662517799e-12,6.95184570181482e-11,9.23909568904425e-13) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-1.89281086898514e-12,5.15101071794336e-12,-9.3374593508666e-12) (-2.13292779990899e-12,1.04046730274957e-11,-9.0005122742909e-12) (-1.65819894448315e-12,1.71262308930122e-11,-7.936877214889e-12) (-1.67618045948133e-12,2.52037694160929e-11,-5.69339219860183e-12) (-3.27287134321547e-13,3.38479897166361e-11,-2.47266614519785e-12) (7.17457754175512e-13,4.29236801029697e-11,1.75180172377783e-12) (5.46620476107993e-13,5.2518420141507e-11,5.81869000087912e-12) (-2.2849850042502e-13,6.17166814551979e-11,7.1961473910353e-12) (9.00861641686308e-13,6.79107214369537e-11,5.10180503294823e-12) (1.53182115083285e-12,7.04713076752772e-11,2.53578520062789e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-1.43244799173215e-12,4.78281060407765e-12,-1.3424610966479e-11) (-1.42961575097903e-12,9.20425270138551e-12,-1.22671000964229e-11) (-7.33944219500863e-13,1.4816179649018e-11,-1.00218200759917e-11) (2.38846755639681e-13,2.15435113626257e-11,-6.35185323846628e-12) (2.13306436024098e-12,2.92192942409545e-11,-1.11465661447562e-12) (3.13281832776782e-12,3.89899482948012e-11,5.9619442005987e-12) (1.24461277523687e-12,5.11609236646256e-11,1.43851385790552e-11) (-2.53603462315513e-12,6.26963515939196e-11,1.48083880369704e-11) (-1.38775311013585e-12,6.9807503606079e-11,9.50320016171407e-12) (2.54728219421268e-13,7.28647784670526e-11,4.47087966727307e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-1.24545371140915e-13,3.64142106015015e-12,-1.68504374751764e-11) (4.73196183410487e-13,7.15018468437119e-12,-1.57460235342234e-11) (1.65879739667327e-12,1.15326267560821e-11,-1.33234495748879e-11) (2.83991407568656e-12,1.67622317257853e-11,-8.72019628374578e-12) (5.27963887462585e-12,2.30623625193046e-11,-1.18786189511483e-12) (9.31307061772882e-12,3.2327510527306e-11,1.05125647344107e-11) (1.06701651667988e-11,5.15379462569115e-11,3.26109881683342e-11) (-6.79046467434733e-12,6.60559315174344e-11,2.43078742541272e-11) (-6.19825995909458e-12,7.30493074959703e-11,1.27733677434849e-11) (-4.17681251757024e-12,7.61507510581935e-11,5.35453742799154e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (1.28822602369163e-12,2.66654231248227e-12,-2.09461249333356e-11) (2.2377080442724e-12,5.21949498542661e-12,-2.0029324936138e-11) (3.68206416314047e-12,7.95634144575052e-12,-1.76598991074069e-11) (4.72517190573492e-12,1.10022348542946e-11,-1.2680642282837e-11) (7.51441917222432e-12,1.46505843524108e-11,-5.32548991283511e-12) (1.55092329055649e-11,1.71597226953877e-11,6.2083390824171e-12) (-1.87570287579414e-11,6.98156609901562e-11,2.83177828167947e-11) (-1.62704530307556e-11,7.38163844355046e-11,1.65721273511698e-11) (-1.20711546034878e-11,7.62268090774964e-11,8.05577631666499e-12) (-9.11195208536757e-12,7.79117797473845e-11,2.88938920064146e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (2.47893018108279e-12,2.07967375520235e-12,-2.63336036656108e-11) (3.64327227136328e-12,3.75726200495374e-12,-2.52334678810533e-11) (4.90827746694692e-12,4.79460953250944e-12,-2.28979140161322e-11) (5.65669558976667e-12,6.45196614630532e-12,-1.88435646802312e-11) (6.70355169859375e-12,8.17261891319968e-12,-1.29246360618818e-11) (1.24152070398307e-11,8.45952786560926e-12,-2.29258860331542e-12) (-1.84013895837136e-11,6.86338555599739e-11,2.79348173302429e-11) (-2.12862934966312e-11,7.35931183662724e-11,7.90151604565754e-12) (-1.61727136117181e-11,7.49553233640279e-11,4.34241136492844e-13) (-1.27084726535861e-11,7.57380174531897e-11,-7.85635602461049e-13) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (1.99805068814469e-12,1.42822652092967e-12,-3.23996528530442e-11) (3.163786199564e-12,2.51402883978203e-12,-3.12618338072806e-11) (4.22335761134158e-12,2.94152166208654e-12,-2.95459926591481e-11) (3.66326038578906e-12,3.48012348612694e-12,-2.70968315360917e-11) (1.20954775068099e-12,1.99479990100293e-12,-2.47390094809429e-11) (-6.00063658512977e-12,-9.85125546323913e-12,-2.47415469439974e-11) (-2.29223887169863e-11,7.86626316149134e-11,-4.36947098168353e-11) (-2.18893439131464e-11,7.07131187684291e-11,-2.100507516527e-11) (-1.85512378729069e-11,6.85922197176235e-11,-1.21577281927258e-11) (-1.63864978901709e-11,6.85426318850157e-11,-5.76428229300639e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (1.79919879199572e-12,7.24164146317919e-13,-3.8980025186219e-11) (2.91072530240024e-12,1.62527684643362e-12,-3.81643094512767e-11) (3.14929982287587e-12,2.13311910539953e-12,-3.73094713843813e-11) (1.22490721386078e-12,3.00670311100246e-12,-3.61770759078302e-11) (-8.39455562534072e-13,3.69791147009562e-12,-3.54114657963198e-11) (-4.28944299739504e-12,7.65333993800978e-12,-3.5959528612601e-11) (-1.95504462332806e-11,4.42565757670127e-11,-3.83200923996327e-11) (-2.10882172271981e-11,5.28259359905447e-11,-2.94442165685957e-11) (-1.97254096270746e-11,5.44804415890882e-11,-1.94417698954402e-11) (-1.85819333802078e-11,5.55626718977662e-11,-9.82600864571278e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (7.70964654220376e-13,5.74483276340419e-13,-4.58847895226891e-11) (1.30880588599326e-12,1.45177558217917e-12,-4.55994204451452e-11) (9.38264258143939e-13,1.77578445227447e-12,-4.5271744118502e-11) (-1.63735782062011e-12,2.97387102099158e-12,-4.49508450358532e-11) (-4.24810440621689e-12,4.90220587937374e-12,-4.43777667173027e-11) (-8.32069772845104e-12,1.05751136098901e-11,-4.38961752248205e-11) (-1.64389244241191e-11,2.64821700863556e-11,-4.20545296654835e-11) (-1.95200825186541e-11,3.44672946891824e-11,-3.4427658029831e-11) (-1.94314490291685e-11,3.7168505376276e-11,-2.36827969727505e-11) (-1.89617544686143e-11,3.86077487819068e-11,-1.19611165190725e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (8.89352791781876e-13,2.97617280342199e-13,-4.95446402917058e-11) (5.42662834254979e-13,9.42860017668349e-13,-4.95693824760717e-11) (-1.2258992141331e-12,1.15779962909273e-12,-4.93775052512911e-11) (-4.23144922604982e-12,2.15534851402203e-12,-4.95093924959587e-11) (-6.69013978059208e-12,3.62366206817198e-12,-4.89803656691044e-11) (-1.02572217871715e-11,6.62529015037155e-12,-4.75269990150931e-11) (-1.58756500151959e-11,1.28814407597516e-11,-4.41014460987661e-11) (-1.93740689591733e-11,1.70358933763415e-11,-3.66206274676321e-11) (-1.98134641367714e-11,1.8800722430883e-11,-2.58280311020402e-11) (-1.97364265554795e-11,1.99455150558299e-11,-1.32097432714939e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-1.95633089115754e-12,6.95606181111226e-12,-5.27379126178625e-12) (-1.79049220375455e-12,1.42054290442329e-11,-5.50992374707474e-12) (-1.57475819384437e-12,2.12428819284875e-11,-5.18652462632039e-12) (-1.87908959887036e-12,2.89765243844841e-11,-3.89629598665417e-12) (-9.95273660778957e-13,3.68817717978519e-11,-2.16678366949702e-12) (-2.88340986486101e-13,4.30334875931287e-11,-2.44474145103863e-13) (5.40644250876056e-14,4.80207864943553e-11,8.80368740713679e-13) (8.71061278502599e-13,5.31132652717235e-11,1.0797590244127e-12) (1.41714647551193e-12,5.62394336531091e-11,9.38468986581888e-13) (1.21080553698593e-12,5.76288602082754e-11,3.22457390012404e-13) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-1.86155783169787e-12,6.47322586196107e-12,-8.89370206013519e-12) (-1.99614253322538e-12,1.3040402550443e-11,-9.05543201122606e-12) (-1.59163271677607e-12,1.93902138393468e-11,-8.33530601452069e-12) (-1.23664845938929e-12,2.66088773466785e-11,-6.00990927807371e-12) (7.69404723654461e-14,3.47372318037781e-11,-2.79293499670355e-12) (5.84301285234367e-13,4.18968023103928e-11,8.21356475515681e-13) (5.26659562873699e-13,4.76854903073915e-11,3.44625583166047e-12) (8.86173718911036e-13,5.32099105452337e-11,3.86266266294066e-12) (1.57009930488846e-12,5.73809032537407e-11,2.5088362433224e-12) (1.67413555968336e-12,5.8663807567948e-11,1.13047802081909e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-1.44856931783779e-12,5.85618877675357e-12,-1.32969953619036e-11) (-1.62082775440889e-12,1.13159716316024e-11,-1.26189742866943e-11) (-1.12035816409016e-12,1.65370579348255e-11,-1.07875856956999e-11) (-2.1707023151159e-13,2.2863252080342e-11,-7.17466310860294e-12) (1.21339526681813e-12,3.12128182901222e-11,-2.5094227128699e-12) (1.37206171682603e-12,3.96417898422114e-11,2.63406124793496e-12) (4.44340724923939e-13,4.74195142064537e-11,6.92710545641047e-12) (-5.90426671354088e-13,5.45882814344696e-11,7.12082002761138e-12) (4.02763494419832e-13,5.91818604232137e-11,4.65983068133573e-12) (1.43963529554649e-12,6.05667690230331e-11,2.19499007087836e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-2.54080564434864e-13,4.38252854916728e-12,-1.66706129930169e-11) (-1.86880769675314e-14,8.7149467527342e-12,-1.55235213138005e-11) (6.31829415877857e-13,1.27832213706002e-11,-1.30629471969453e-11) (1.06757655855266e-12,1.81763078927166e-11,-8.64414137360058e-12) (1.99099041195877e-12,2.66841088883484e-11,-2.86771771084346e-12) (2.38243501570113e-12,3.6124506814955e-11,4.30020124869985e-12) (6.95564347777393e-13,4.75464994865282e-11,1.1384405865811e-11) (-3.01641108181958e-12,5.65484264440641e-11,9.70879105226929e-12) (-1.95693122514396e-12,6.13266961554373e-11,5.58564630583978e-12) (-5.83303778756891e-13,6.31030943488946e-11,2.30002739777552e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (9.58294583772125e-13,3.03036521512216e-12,-2.04113957633808e-11) (1.33051519601332e-12,6.46007686655887e-12,-1.89681438684214e-11) (1.86453925181974e-12,9.25372168248225e-12,-1.63162312286942e-11) (1.92028824370323e-12,1.34054919571643e-11,-1.19293548770368e-11) (2.45855561618934e-12,2.12406715410437e-11,-6.52510157318003e-12) (2.09998400098056e-12,3.12906180603608e-11,8.27825879959069e-13) (-5.82956786213332e-12,5.04943973466745e-11,8.45500173710226e-12) (-7.53083592698637e-12,5.8984268325421e-11,6.31062485554921e-12) (-5.63328177396962e-12,6.28042155355513e-11,2.86790559295038e-12) (-4.04880059056445e-12,6.44469491860757e-11,6.9214292016811e-13) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (2.03024163082226e-12,1.97989462518017e-12,-2.47654110367633e-11) (2.55095157161676e-12,4.63226829138328e-12,-2.32541587804793e-11) (2.70701600147063e-12,6.23023258314052e-12,-2.06013452789098e-11) (2.70960963159131e-12,9.55956888691867e-12,-1.71832407819899e-11) (2.24932325223026e-12,1.62191244501192e-11,-1.2852398342842e-11) (4.98584435150137e-13,2.62448803745984e-11,-6.60560036624164e-12) (-8.39686435401496e-12,4.89881027512046e-11,1.07477524926121e-12) (-1.09390189896672e-11,5.77708523803607e-11,-1.00608882647352e-12) (-8.58973322630109e-12,6.11793702404931e-11,-2.32331566166966e-12) (-6.29872268784514e-12,6.25326176008904e-11,-1.42974638172127e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (1.56429401695711e-12,1.40404477262676e-12,-2.8803633995187e-11) (2.33669704480529e-12,3.11407999047465e-12,-2.75555264327861e-11) (2.58259904495702e-12,4.20175497437912e-12,-2.55187966339296e-11) (1.77885870576403e-12,6.8623669501145e-12,-2.31304193275793e-11) (-4.91026355330047e-13,1.1741308161095e-11,-2.08247112348556e-11) (-4.5520691135556e-12,1.98757249134793e-11,-1.87918242094819e-11) (-1.12059675205848e-11,4.59608157849688e-11,-1.87538992950001e-11) (-1.28495081078152e-11,5.26228070935867e-11,-1.3200277048208e-11) (-1.08329056441023e-11,5.51398434147911e-11,-8.9551036905203e-12) (-9.17082019591846e-12,5.69829500298397e-11,-4.33199630770916e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (1.13316392705288e-12,8.91043840983133e-13,-3.43057223754413e-11) (2.22938849973502e-12,2.02976429779704e-12,-3.34722863044564e-11) (2.37423899946105e-12,2.93185108748311e-12,-3.18460444720985e-11) (4.92129192366874e-13,5.42623309997781e-12,-2.99971872948035e-11) (-1.49568715552338e-12,9.59155988943304e-12,-2.86605456478248e-11) (-4.85065288217218e-12,1.76095545599601e-11,-2.74427565562422e-11) (-1.0651916383753e-11,3.40481350744326e-11,-2.56197814701414e-11) (-1.27320225989772e-11,4.14335156559375e-11,-2.01429855804907e-11) (-1.20292346639713e-11,4.45613404952519e-11,-1.41314486402946e-11) (-1.1453018910066e-11,4.71475781055148e-11,-7.43233149898535e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (7.62461572666324e-13,7.99069706955832e-13,-4.07937492006021e-11) (1.49004512387441e-12,1.58060468202083e-12,-3.99716958069876e-11) (1.23534999868481e-12,2.16952103061317e-12,-3.85884108403543e-11) (-1.39191363219953e-12,4.36660417602207e-12,-3.71417529724271e-11) (-3.45115208752465e-12,7.69883420685882e-12,-3.59488265028704e-11) (-6.21251982829377e-12,1.34454798121132e-11,-3.4484714361378e-11) (-1.04650667331148e-11,2.27956271550992e-11,-3.13399465392087e-11) (-1.28335422629075e-11,2.85541503320023e-11,-2.53652118424869e-11) (-1.27853465374405e-11,3.13228543883439e-11,-1.79131851965282e-11) (-1.2260637261609e-11,3.33767257454958e-11,-9.34245484460489e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (1.21171225648975e-12,5.37857422821706e-13,-4.48761671240454e-11) (1.29364562714271e-12,1.16428557676086e-12,-4.3733913465058e-11) (6.37876596272207e-14,1.35286472576811e-12,-4.18346161532262e-11) (-2.60512753888068e-12,2.59553603783758e-12,-4.05152557057362e-11) (-4.51984436642933e-12,4.56598008087269e-12,-3.9450141378098e-11) (-7.05748455312607e-12,7.29178419952803e-12,-3.76038504776043e-11) (-1.04750278865866e-11,1.15787635169745e-11,-3.41053440881037e-11) (-1.31307719484216e-11,1.45322311385605e-11,-2.79746224395895e-11) (-1.36310295364414e-11,1.61830837312795e-11,-2.01814689308817e-11) (-1.30006547711564e-11,1.74110661701775e-11,-1.05970409373369e-11) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-1.23736245669868e-12,8.76593741473708e-12,-5.14318494046056e-12) (-9.48864830739127e-13,1.64092015985518e-11,-5.25615467912423e-12) (-1.01231874437173e-12,2.29542523976044e-11,-4.54383699629127e-12) (-1.24095487819763e-12,3.03167911692561e-11,-3.29546106714161e-12) (-7.7304319112029e-13,3.74836994089859e-11,-1.77874295281787e-12) (-2.76498589548108e-13,4.25506381709859e-11,-4.19937749319645e-13) (1.89970328338862e-13,4.48184704052139e-11,1.62593299748062e-13) (9.15706042835072e-13,4.71533156696906e-11,1.80110347762748e-14) (8.91688471446376e-13,4.94378448991705e-11,1.72019314469638e-13) (4.98315567308894e-13,5.0762413575961e-11,-2.70077877393135e-14) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-1.08279079540369e-12,7.64154469670019e-12,-8.85150663815333e-12) (-9.91837611077145e-13,1.47480190849846e-11,-8.76692824178375e-12) (-1.06387354868236e-12,2.06935577240339e-11,-7.59180319643911e-12) (-7.07997474452558e-13,2.75591181767771e-11,-5.73619747531766e-12) (-1.29374861917847e-14,3.53518510143551e-11,-2.73421801541405e-12) (2.14414397265661e-13,4.16916085324057e-11,2.69882100752058e-13) (3.76228832527398e-13,4.51530229985007e-11,1.91976439053324e-12) (8.61629249284584e-13,4.79150134328365e-11,1.75569749724744e-12) (1.14750035791664e-12,5.05285604728309e-11,6.92332898635329e-13) (9.0165212543441e-13,5.12337213555326e-11,2.01815509898267e-13) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-6.52930165448672e-13,6.47417550493972e-12,-1.31887868114623e-11) (-8.51191466534429e-13,1.25810564285593e-11,-1.22671314859581e-11) (-9.7944418697147e-13,1.77740784542348e-11,-1.03435367353423e-11) (-1.95366439624435e-13,2.38491412424182e-11,-7.71262061928898e-12) (5.98620707803532e-13,3.23348134120069e-11,-3.66224636352598e-12) (5.96300535586989e-13,4.02561406398779e-11,3.32844734659984e-13) (1.23640873672609e-13,4.56933187243064e-11,3.10687392440499e-12) (-8.95823346984651e-14,4.98400072807429e-11,3.25343686342132e-12) (7.22768372645478e-13,5.21665782194834e-11,1.63975218379392e-12) (1.09830004056033e-12,5.2337188990861e-11,7.07492770093353e-13) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-4.9008909598793e-14,4.89959001399291e-12,-1.69605510632139e-11) (-2.24392307658833e-13,9.80627021141583e-12,-1.55520043913685e-11) (-2.5747671933563e-13,1.41637181512111e-11,-1.30989903272318e-11) (6.19688313498513e-14,1.96034005470118e-11,-9.53835372865862e-12) (2.66508799728358e-13,2.89383430216288e-11,-5.14807724556911e-12) (1.32119153223991e-13,3.80784119857302e-11,-3.4090471806864e-13) (-5.76718698801854e-13,4.5670396658952e-11,3.60498458613142e-12) (-1.32910821679647e-12,5.13641096256766e-11,3.4970470179822e-12) (-1.48831697178498e-13,5.38216060058306e-11,1.87779353244122e-12) (3.72868781843004e-13,5.41429818015129e-11,9.88167171623753e-13) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (5.65513278779834e-13,3.44203443257012e-12,-2.16315790009101e-11) (5.06411131467775e-13,7.128863839626e-12,-1.98871952838572e-11) (5.01151999483776e-13,1.03456048332893e-11,-1.73337284503458e-11) (3.61958010104814e-13,1.52750928952849e-11,-1.35863031323635e-11) (1.27175253986996e-13,2.43976792938428e-11,-9.35337923765172e-12) (-4.81454170422453e-13,3.42646418347514e-11,-4.25312391342144e-12) (-2.17889638510284e-12,4.52016155282957e-11,-4.36563759234201e-14) (-2.87470071937917e-12,5.16542548944448e-11,6.89310863150538e-13) (-1.83267380612095e-12,5.45624006694673e-11,1.03729121445642e-13) (-1.44232608520958e-12,5.55040177549757e-11,4.78345840157037e-14) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (1.09483922709436e-12,2.26316399429654e-12,-2.59485008582461e-11) (1.41632637095627e-12,5.08180813756142e-12,-2.42194843963872e-11) (1.31738911333502e-12,7.09933151478173e-12,-2.15313281918207e-11) (1.0759691292413e-12,1.14041270107092e-11,-1.85198406860398e-11) (4.80341564638909e-13,1.94245992235801e-11,-1.50934706444646e-11) (-8.12635719252546e-13,2.95737201268587e-11,-1.06388188694468e-11) (-3.28871331202159e-12,4.22897519041193e-11,-6.55820941391877e-12) (-4.47374686766459e-12,4.9365135916742e-11,-4.96919084325102e-12) (-3.44377568057751e-12,5.27856214007946e-11,-3.94392532439286e-12) (-2.17880149853423e-12,5.41095262537809e-11,-1.98914649178061e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (8.29187386211247e-13,1.62898675952091e-12,-2.86926267556572e-11) (1.38428293862448e-12,3.80997830396533e-12,-2.74207508851565e-11) (1.46412562553571e-12,5.40523312233902e-12,-2.53244746694125e-11) (9.09284463130908e-13,9.053726098364e-12,-2.29557215508964e-11) (-3.74165109033463e-13,1.5450289013232e-11,-2.06192123545828e-11) (-2.32382367449072e-12,2.46804749520596e-11,-1.76608342587637e-11) (-4.84690905690788e-12,3.74120200214238e-11,-1.45690373221009e-11) (-5.90539002787201e-12,4.38661235302043e-11,-1.08734716365178e-11) (-4.8775101073438e-12,4.73870668876117e-11,-7.8999816602428e-12) (-3.66744457931027e-12,4.99415782634657e-11,-4.22214279260591e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (3.91701990114519e-13,1.18629827523603e-12,-3.27291659361134e-11) (1.0523062831341e-12,3.09798502686241e-12,-3.20577649728654e-11) (1.28771187904938e-12,4.50060562935281e-12,-3.04510935582139e-11) (2.15116469340654e-13,7.62650136519341e-12,-2.84563313574932e-11) (-8.20750564541824e-13,1.21177458083998e-11,-2.65986356832278e-11) (-2.50955322042823e-12,1.92648543408594e-11,-2.41168363568557e-11) (-4.87620435406515e-12,2.88695452789435e-11,-2.08891396943466e-11) (-5.86419421525357e-12,3.4987243526081e-11,-1.66995477529452e-11) (-5.48986569837736e-12,3.88317179126197e-11,-1.21461791556939e-11) (-5.11449804903999e-12,4.20519908915514e-11,-6.69199113260832e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (2.01620463181758e-13,9.06599302098536e-13,-3.83629598285116e-11) (5.23079262511707e-13,2.5436198953425e-12,-3.7700300578854e-11) (6.05348435595722e-13,3.79355530768536e-12,-3.63960421365943e-11) (-8.13771963575449e-13,5.98392216027308e-12,-3.43673021213193e-11) (-1.78241010304507e-12,8.81519591748881e-12,-3.23103459037903e-11) (-3.20359203785747e-12,1.35276044579082e-11,-2.96794056024011e-11) (-5.222937791709e-12,1.9803748983471e-11,-2.60170091731976e-11) (-6.26364971542373e-12,2.45696807135822e-11,-2.13482682883479e-11) (-6.21630623230418e-12,2.78876641911565e-11,-1.55777828768799e-11) (-5.63743253089158e-12,3.02455017099052e-11,-8.57643942231159e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (6.07316020323616e-13,4.45560515633009e-13,-4.23905710156372e-11) (5.58633892070607e-13,1.76244071558811e-12,-4.13376944796804e-11) (9.72919379074198e-14,2.37016372801515e-12,-3.90166198720217e-11) (-1.0747058286813e-12,3.11319397915932e-12,-3.65491642060991e-11) (-1.80015518604664e-12,4.40184551304083e-12,-3.45106760556209e-11) (-3.26420674310535e-12,6.66161599085756e-12,-3.1908985728627e-11) (-5.02698601812066e-12,9.9120703069211e-12,-2.85115764808747e-11) (-6.39169431856706e-12,1.25355455866844e-11,-2.36264921920744e-11) (-7.03237379870774e-12,1.46700145042846e-11,-1.7482640923957e-11) (-6.1866295383183e-12,1.60316297566985e-11,-9.84500021838021e-12) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) ) ; boundaryField { fuel { type fixedValue; value uniform (0.1 0 0); } air { type fixedValue; value uniform (-0.1 0 0); } outlet { type zeroGradient; } frontAndBack { type empty; } } // ************************************************************************* //
a3bf59e8c69855a4132f3cf46338015102d5015f
a5d8cfe55b77b3cbf04e81c3fb7ebfac28a6283d
/backtracking/1748.cpp
d1055eb40ca969ad98872997dd4b1e1aaf77469e
[]
no_license
Ywook/algorithm
c8869044189216e0705532d8b4ee3cc9e5cb9263
43d7541bb8497f0bbf14216297b80da249470979
refs/heads/master
2021-05-12T18:50:38.620098
2019-07-15T14:14:25
2019-07-15T14:14:25
117,075,205
0
0
null
null
null
null
UTF-8
C++
false
false
637
cpp
#include<iostream> #include<cstdio> using namespace std; int main(){ int n; int ans = 0; scanf("%d", &n); for(int i = 1; i <= n; i++){ if(i < 10){ ans += 1; }else if(i < 100){ ans += 2; }else if(i < 1000){ ans += 3; }else if(i < 10000){ ans += 4; }else if(i < 100000){ ans += 5; }else if(i < 1000000){ ans += 6; }else if(i < 10000000){ ans += 7; }else if(i < 100000000){ ans += 8; }else{ ans += 9; } } printf("%d\n",ans); }
5adfddffb0d925767f90d465d72692e3860b8a87
9ac8e18d226532c8a2e84b30afffc546724ca3e0
/ConsoleRPG/Armor.cpp
6598015fa74f641f778d0b136c9708b49d7c4395
[]
no_license
ajenkins23/ConsoleRPG
2922c6987ec2a5e3fc6ed7986330a42a2da48182
122572f5e0cd66bad0d765000d14c92d2a6d2dfe
refs/heads/master
2023-05-01T17:09:46.909818
2021-05-04T18:15:55
2021-05-04T18:15:55
363,714,487
0
0
null
2021-05-04T18:15:56
2021-05-02T17:49:47
C++
UTF-8
C++
false
false
418
cpp
#include "Armor.h" Armor::Armor(int type, int defence, string name, int level, int buyValue, int sellValue, int rarity) : Item(name, level, buyValue, sellValue, rarity) { this->type = type; this->defence = defence; } Armor::~Armor() { } Armor* Armor::clone() const { return new Armor(*this); } string Armor::toString() { string str = to_string(this->type) + " / " + to_string(this->defence); return str; }
394d8d078f17c6473a35749bd308adbf3030bd05
45d03d5ed27ac010c041a567da147ccc3591d13d
/dynamic/ed.cpp
2752af4769412e9b207e5c700392a0bfe2f3a5d9
[]
no_license
achallion/cpptopics
30198e89343ceafb564c7100cef52c1c6988a311
4199e56f95f9263b5b6f810900b44e1437d5f372
refs/heads/master
2023-07-07T04:20:17.989745
2023-06-28T07:01:02
2023-06-28T07:01:02
218,488,647
0
0
null
null
null
null
UTF-8
C++
false
false
793
cpp
#include <bits/stdc++.h> using namespace std; int ed(string init, string final) { int n1 = init.size(); int n2 = final.size(); vector<vector<int>> dp(n1 + 1, vector<int>(n2 + 1, -1)); // base for (int i = 0; i <= n1; i++) { dp[i][0] = i; } for (int i = 0; i <= n2; i++) { dp[0][i] = i; } // rec for (int i = 1; i <= n1; i++) { for (int j = 1; j <= n2; j++) { int ans = min(dp[i][j - 1] + 1, dp[i - 1][j] + 1); ans = min(ans, dp[i - 1][j - 1] + (init[i - 1] == final[j - 1] ? 0 : 1)); dp[i][j] = ans; } } return dp[n1][n2]; } int main() { string init, final; init = "saturday"; final = "sunday"; cout << ed(init, final); return 0; }
b0f21419425b0aa4f4e7d8ad5e88b72926914208
a7e40f5b729e46c7555943efce48f726820b95c3
/src/bh_src/Src/Modules/Sensing/RobotModelProvider.h
5badc5720192d64864719e6e12c65c7d4d137848
[]
no_license
uchile/bh-motion_ros-pkg
995f7e9b41da22a9f190b991622333b47942aaae
5aac68185f6ac0b48b4241b09c85734c9c59b642
refs/heads/master
2016-09-06T21:38:42.112878
2013-06-21T20:35:09
2013-06-21T20:35:09
10,834,419
1
0
null
null
null
null
ISO-8859-1
C++
false
false
1,225
h
/** * @file RobotModelProvider.h * * This file declares a module that provides information about the current state of the robot's limbs. * * @author <a href="mailto:[email protected]">Alexander Härtl</a> */ #pragma once //#include "Tools/Module/Module.h" #include "../../Representations/Sensing/RobotModel.h" #include "../../Representations/Configuration/RobotDimensions.h" #include "../../Representations/Configuration/MassCalibration.h" #include "../../Representations/Infrastructure/JointData.h" /* MODULE(RobotModelProvider) REQUIRES(RobotDimensions) REQUIRES(FilteredJointData) REQUIRES(MassCalibration) PROVIDES_WITH_MODIFY_AND_DRAW(RobotModel) END_MODULE */ /** * @class RobotModelProvider * * A module for computing the current state of the robot's limbs */ class RobotModelProvider//: public RobotModelProviderBase { //private: public: /** Executes this module * @param robotModel The data structure that is filled by this module */ void update(RobotModel& robotModel, const FilteredJointData& theFilteredJointData, const RobotDimensions& theRobotDimension, const MassCalibration& theMassCalibration); };
df037186b7e1db2773750238cd056e5624397ef5
4832502c844d78c385121b2a983bc754d7bd288e
/travail/main.cpp
9e8d72dbe1c20212e6c7d25ab9bcdf0aed39d657
[]
no_license
WhereIsLucas/methodesNumeriquesMatMolle
dfd0278d4e490ce0dc03d250167192681c103deb
e7027f3aeb119e7d451fabef6d5e1a55cd437d0d
refs/heads/master
2021-02-12T10:53:47.749432
2020-04-02T16:44:44
2020-04-02T16:44:44
244,587,787
0
0
null
null
null
null
UTF-8
C++
false
false
13,729
cpp
#include <cmath> #include <cstdlib> #include <string> #include <ctime> #include <unistd.h> #include <sstream> #include <iostream> #include "Cell.h" #include "Disk.h" #include "Plan.h" int main(int argc, char **argv) { srand(time(NULL)); int i, j, k; //contact double e = 0.9; double mu = 0.6; double kn = 200.; double kt = 100000.; double dt = 0.000001; //video int fps = 100; double tStartCapture = 0.; double totalTime = 1; int totalFrames = (int) (totalTime - tStartCapture) * fps; double recTime; //container double containerRadius = .3; double lx = 0.03; double ly = 0.06; double amplx = 0.; double amply = 0.; double freqx = 0.; double freqy = 0.; Plan *wall = new Plan[4]; wall[0].initPlan(0., -ly / 2., 0., 1., amplx, amply, freqx, freqy); wall[1].initPlan(0., ly / 2., 0., -1., amplx, amply, freqx, freqy); wall[2].initPlan(-lx / 2., 0., 1., 0., amplx, amply, freqx, freqy); wall[3].initPlan(lx / 2., 0., -1., 0., amplx, amply, freqx, freqy); //grains int numberOfGrains = 100; double radius; double mass; double x, y, vx, vy; double eta; double rho = 2000.; Disk *grain = new Disk[numberOfGrains]; int numberOfPlacedGrains = 0; int numberOfOverlaps; //place grains while (numberOfPlacedGrains < numberOfGrains) { numberOfOverlaps = 0; radius = 0.0005; mass = 4. / 3. * M_PI * radius * radius * radius * rho; x = -lx / 2. + radius + ((double) (rand()) / RAND_MAX) * (lx - 2. * radius); y = -ly / 2. + radius + ((double) (rand()) / RAND_MAX) * (ly - 2. * radius); vx = 0.; vy = 0.; for (i = 0; i < numberOfPlacedGrains; i++) { if ((x - grain[i].x()) * (x - grain[i].x()) + (y - grain[i].y()) * (y - grain[i].y()) < (radius + grain[i].radius()) * (radius + grain[i].radius())) { numberOfOverlaps++; i = numberOfPlacedGrains; } } if (numberOfOverlaps == 0) { grain[numberOfPlacedGrains].initDisk(numberOfPlacedGrains, radius, mass, x, y, vx, vy); numberOfPlacedGrains++; } } //CLEAR FILES for (int l = 0; l <= totalFrames; l++) { std::string fileName = "grain" + std::to_string(l) + ".txt"; remove(fileName.c_str()); } //record initial state for (i = 0; i < numberOfGrains; i++) { grain[i].print(0); } //linked cells double cellSize = 2.2 * radius; int nCellx = (lx + 2. * amplx) / cellSize; int nCelly = (ly + 2. * amply) / cellSize; int nCell = nCellx * nCelly; Cell *cellule = new Cell[nCell]; double dx = (lx + 2. * amplx) / nCellx; double dy = (ly + 2. * amply) / nCelly; int ix, iy, jx, jy; for (i = 0; i < nCell; i++) { iy = i / nCellx; ix = i % nCellx; cellule[i].initCell(i); for (j = i + 1; j < nCell; j++) { jy = j / nCellx; jx = j % nCellx; if (abs(ix - jx) < 2 && abs(iy - jy) < 2) { cellule[i].addNeighbor(j); } } } /********************/ //variables int cellIndex, hol; int neighborCellIndex, nNeighbors; double rx, ry, nx, ny, tx, ty; double vn, vnx, vny, vt, vtx, vty; double rij, delta; double effectiveMass; double Fn, Fnx, Fny; double Ft, Ftx, Fty; double M, t; for (t = 0.; t < totalTime; t += dt) { /*** refresh and update position***/ //linked cells for (i = 0; i < nCell; i++) { cellule[i].setHeadOfList(-9); } //grains for (i = 0; i < numberOfGrains; i++) { //update positions grain[i].updatePosition(dt / 2.); //class in linked cells cellIndex = (int) ((grain[i].x() + lx / 2. + amplx) / dx) + (int) ((grain[i].y() + ly / 2. + amply) / dy) * nCellx; grain[i].setLinkedCell(cellIndex); hol = cellule[cellIndex].headOfList(); grain[i].setLinkedDisk(hol); cellule[cellIndex].setHeadOfList(i); //reset force grain[i].resetForce(); //set gravity force grain[i].addGravityForce(0., -9.81); } //container for (i = 0; i < 4; i++) { wall[i].updatePosition(t + dt / 2.); } /*** contact detection and forces ***/ for (i = 0; i < numberOfGrains; i++) { //in same Cell cellIndex = grain[i].linkedCell(); j = cellule[cellIndex].headOfList(); while (j != -9) { if (i < j) { nx = grain[i].x() - grain[j].x(); ny = grain[i].y() - grain[j].y(); rij = sqrt(nx * nx + ny * ny); nx /= rij; ny /= rij; delta = rij - (grain[i].radius() + grain[j].radius()); if (delta < 0) { //contact base vx = grain[i].vx() - grain[j].vx() + grain[i].radius() * grain[i].w() * ny + grain[j].radius() * grain[j].w() * ny; vy = grain[i].vy() - grain[j].vy() - grain[i].radius() * grain[i].w() * nx - grain[j].radius() * grain[j].w() * nx; vn = vx * nx + vy * ny; vnx = vn * nx; vny = vn * ny; vtx = vx - vnx; vty = vy - vny; vt = sqrt(vtx * vtx + vty * vty); if (vt != 0.) { tx = vtx / vt; ty = vty / vt; } else { tx = 0.; ty = 0.; } //contact forces and torque effectiveMass = (grain[i].mass() * grain[j].mass()) / (grain[i].mass() + grain[j].mass()); eta = -2. * log(e) * sqrt(effectiveMass * kn / (log(e) * log(e) + M_PI * M_PI)); Fn = -kn * delta - eta * vn; Ft = -kt * vt; //forces if (Fn > 0) { Fnx = Fn * nx; Fny = Fn * ny; grain[i].addForce(Fnx, Fny); grain[j].addForce(-Fnx, -Fny); } else { Fn = 0.; } if (fabs(Ft) > mu * Fn) { Ftx = -mu * Fn * tx; Fty = -mu * Fn * ty; grain[i].addForce(Ftx, Fty); grain[j].addForce(-Ftx, -Fty); } else { Ftx = Ft * tx; Fty = Ft * ty; grain[i].addForce(Ftx, Fty); grain[j].addForce(-Ftx, -Fty); } //torque M = -grain[i].radius() * nx * Fty + grain[i].radius() * ny * Ftx; grain[i].addMomentum(M); M = -grain[j].radius() * nx * Fty + grain[j].radius() * ny * Ftx; grain[j].addMomentum(M); } } j = grain[j].linkedDisk(); } //in neighbor cells nNeighbors = cellule[cellIndex].numberOfNeighbors(); for (k = 0; k < nNeighbors; k++) { neighborCellIndex = cellule[cellIndex].neighbor(k); j = cellule[neighborCellIndex].headOfList(); while (j != -9) { nx = grain[i].x() - grain[j].x(); ny = grain[i].y() - grain[j].y(); rij = sqrt(nx * nx + ny * ny); nx /= rij; ny /= rij; delta = rij - (grain[i].radius() + grain[j].radius()); if (delta < 0) { //contact base vx = grain[i].vx() - grain[j].vx() + grain[i].radius() * grain[i].w() * ny + grain[j].radius() * grain[j].w() * ny; vy = grain[i].vy() - grain[j].vy() - grain[i].radius() * grain[i].w() * nx - grain[j].radius() * grain[j].w() * nx; vn = vx * nx + vy * ny; vnx = vn * nx; vny = vn * ny; vtx = vx - vnx; vty = vy - vny; vt = sqrt(vtx * vtx + vty * vty); if (vt != 0.) { tx = vtx / vt; ty = vty / vt; } else { tx = 0.; ty = 0.; } //contact forces and torque effectiveMass = (grain[i].mass() * grain[j].mass()) / (grain[i].mass() + grain[j].mass()); eta = -2. * log(e) * sqrt(effectiveMass * kn / (log(e) * log(e) + M_PI * M_PI)); Fn = -kn * delta - eta * vn; Ft = -kt * vt; //forces if (Fn > 0) { Fnx = Fn * nx; Fny = Fn * ny; grain[i].addForce(Fnx, Fny); grain[j].addForce(-Fnx, -Fny); } else { Fn = 0.; } if (fabs(Ft) > mu * Fn) { Ftx = -mu * Fn * tx; Fty = -mu * Fn * ty; grain[i].addForce(Ftx, Fty); grain[j].addForce(-Ftx, -Fty); } else { Ftx = Ft * tx; Fty = Ft * ty; grain[i].addForce(Ftx, Fty); grain[j].addForce(-Ftx, -Fty); } //torque M = -grain[i].radius() * nx * Fty + grain[i].radius() * ny * Ftx; grain[i].addMomentum(M); M = -grain[j].radius() * nx * Fty + grain[j].radius() * ny * Ftx; grain[j].addMomentum(M); } j = grain[j].linkedDisk(); } } //with walls for (j = 0; j < 4; j++) { nx = wall[j].nx(); ny = wall[j].ny(); rx = grain[i].x() - wall[j].x(); ry = grain[i].y() - wall[j].y(); delta = (rx * nx + ry * ny) - grain[i].radius(); if (delta < 0) { vx = grain[i].vx() - wall[j].vx() + grain[i].radius() * grain[i].w() * ny; vy = grain[i].vy() - wall[j].vy() - grain[i].radius() * grain[i].w() * nx; vn = vx * nx + vy * ny; vnx = vn * nx; vny = vn * ny; vtx = vx - vnx; vty = vy - vny; vt = sqrt(vtx * vtx + vty * vty); if (vt != 0.) { tx = vtx / vt; ty = vty / vt; } else { tx = 0.; ty = 0.; } //contact forces and torque effectiveMass = grain[i].mass(); eta = -2. * log(e) * sqrt(effectiveMass * kn / (log(e) * log(e) + M_PI * M_PI)); Fn = -kn * delta - eta * vn; Ft = -kt * vt; //forces if (Fn > 0) { Fnx = Fn * nx; Fny = Fn * ny; grain[i].addForce(Fnx, Fny); } else { Fn = 0.; } if (fabs(Ft) > mu * Fn) { Ftx = -mu * Fn * tx; Fty = -mu * Fn * ty; grain[i].addForce(Ftx, Fty); } else { Ftx = Ft * tx; Fty = Ft * ty; grain[i].addForce(Ftx, Fty); } //torque M = -grain[i].radius() * nx * Fty + grain[i].radius() * ny * Ftx; grain[i].addMomentum(M); } } } //update velocity and position for (i = 0; i < numberOfGrains; i++) { grain[i].updateVelocity(dt); grain[i].updatePosition(dt / 2.); } for (i = 0; i < 4; i++) { wall[i].updateVelocity(t + dt); wall[i].updatePosition(t + dt); } //record recTime = t - tStartCapture; if (recTime >= 0.) { if ((int) ((recTime + dt) * fps) > (int) (recTime * fps)) { for (i = 0; i < numberOfGrains; i++) { grain[i].print((int) ((recTime + dt) * fps)); } } } } delete[] cellule; delete[] wall; delete[] grain; return 0; }
6d5cb6eec8c55f8550af4e247c7a48f72cf68fdb
67baab02cfda6c54a287d63d0874824cf15f3ba6
/lib/graph/flow_shell/project_selection.h
5162616c0a936b4479b9fe7c869b3c0cf4d962d5
[ "MIT" ]
permissive
sogapalag/problems
a14eedd8cfcdb52661479c8c90e08737aaeeb32b
0ea7d65448e1177f8b3f81124a82d187980d659c
refs/heads/master
2021-01-12T17:49:52.007234
2020-08-18T14:51:40
2020-08-18T14:51:40
71,629,601
1
0
null
null
null
null
UTF-8
C++
false
false
2,086
h
#include "../dinic.h" struct ProjectSelection { int n; int s,t; Dinic mc; using F = Dinic::F; F positive; ProjectSelection(int _n) : n(_n) , s(n) , t(n+1) , mc(n+2, s, t) , positive(0) {} // i: [0..n) void add_proj(int i, F profit) { if (profit >= 0) { mc.add(s, i, profit); positive += profit; } else { mc.add(i, t, -profit); } } // u dep on v: [0..n) // i.e. u implies v void add_dep(int u, int v) { mc.add(u, v); } F profit() { return positive - mc.flow(); } // A\{s} := s_achivable bool chosen(int i) const { return mc.d[i] != -1; } }; template <typename T=int> struct Compress { map<T, int> id; vector<T> num; inline int get_id(T x) { if (!id.count(x)) { id[x] = num.size(); num.emplace_back(x); } return id[x]; } inline int get_num(int i) { assert(0 <= i && i < num.size()); return num[i]; } }; // used for most projects without deps. need to shrink struct ProjectSelectionDumper { using F = Dinic::F; F sum; ProjectSelectionDumper(const vector<F>& profits, const vector<pair<int, int>>& deps) { vector<bool> trk(profits.size(), false); Compress<int> c; for (auto& p: deps) { c.get_id(p.first); c.get_id(p.second); trk[p.first] = true; trk[p.second] = true; } ProjectSelection ps(c.num.size()); sum = 0; // must choose profit > 0 without deps for (int i = 0; i < (int)profits.size(); i++) { if (trk[i]) { ps.add_proj(c.get_id(i), profits[i]); } else if (profits[i] > 0) { sum += profits[i]; } } for (auto& p: deps) { int u = c.get_id(p.first); int v = c.get_id(p.second); ps.add_dep(u, v); } sum += ps.profit(); } };
b01cfdeef3020b862eebaa8d703daa3868d377e7
47609d52e8a740fc3d8e27623b72fcd61886cf75
/code/chapter16/chrono/chrono.cpp
9021e05dae2553cb827cb989142a92ce02cbcf04
[]
no_license
blalalt/cpp_language
3cf68e84d14ab53d7161085c1f056c9b4095dedf
8ec2bf98fa10d8b2b6125eda22c3aa2fc0199d7b
refs/heads/master
2020-08-08T01:20:04.737657
2020-02-12T07:37:17
2020-02-12T07:37:17
213,656,311
1
0
null
null
null
null
UTF-8
C++
false
false
826
cpp
#include "chrono.h" namespace chrono { Date::Date(int dd, Month mm, int yy) :d{dd}, m{mm}, y{yy} { if (y == 0) y = default_date().year; if (m == Month{}) m = default_date().month; if (d == 0) d = default_date().day; if (!is_valid()) throw Bad_date(); } bool Date::is_valid() { return is_date(d, m, y); } Date& Date::add_month(int n) { if (n == 0) return *this; if (n > 0) { int delta_y = n / 12; int mm = static_cast<int>(m) + n%12; if (12 < mm) { ++delta_y; mm -= 12; } y += delta_y; m = static_cast<Month>(mm); return *this; } // .. 处理负数 .. return *this; } } // namespace chrono
d3fbeac2835c0626df77c544987df7537fe22ee2
2a37344369e1d46b34b7ba835bb110e3d6aad8b3
/include/sqlpp11/data_types/text/result_field.h
80f1663239520769a79a1544a1524174b042c8e8
[ "BSD-2-Clause" ]
permissive
kiss88/sqlpp11
5032553e34b037a525d070554e389966c9593c85
81ca67c76a90a4812397eef2bfe94656eb33b9ef
refs/heads/master
2020-05-21T08:52:58.846625
2016-09-30T04:19:15
2016-09-30T04:19:15
69,889,432
2
0
null
2016-10-03T16:31:30
2016-10-03T16:31:29
null
UTF-8
C++
false
false
2,885
h
/* * Copyright (c) 2013-2015, Roland Bock * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright notice, this * list of conditions and the following disclaimer in the documentation and/or * other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef SQLPP_TEXT_RESULT_FIELD_H #define SQLPP_TEXT_RESULT_FIELD_H #include <sqlpp11/basic_expression_operators.h> #include <sqlpp11/result_field.h> #include <sqlpp11/result_field_base.h> #include <sqlpp11/data_types/text/data_type.h> #include <sqlpp11/field_spec.h> #include <ostream> namespace sqlpp { template <typename Db, typename NameType, bool CanBeNull, bool NullIsTrivialValue> struct result_field_t<Db, field_spec_t<NameType, text, CanBeNull, NullIsTrivialValue>> : public result_field_base<Db, field_spec_t<NameType, text, CanBeNull, NullIsTrivialValue>> { template <typename Target> void _bind(Target& target, size_t index) { const char* text{nullptr}; size_t len{}; target._bind_text_result(index, &text, &len); this->_value = {text, len}; this->_is_null = (len == 0); } template <typename Target> void _post_bind(Target& target, size_t index) { const char* text{nullptr}; size_t len{}; target._post_bind_text_result(index, &text, &len); this->_value = {text, len}; this->_is_null = (len == 0); } }; template <typename Db, typename NameType, bool CanBeNull, bool NullIsTrivialValue> inline std::ostream& operator<<( std::ostream& os, const result_field_t<Db, field_spec_t<NameType, text, CanBeNull, NullIsTrivialValue>>& e) { if (e.is_null() and not NullIsTrivialValue) { return os << "NULL"; } else { return os << e.value(); } } } #endif
6997c1abc4e8a86299af41d391bc736f0fa13112
d8217c2c380ac954e67f3809f6f31628b2c53acc
/src/qt/bitcoingui.cpp
091add0f5cbf4f0c53db3fec9b0e90fca30b6685
[ "MIT" ]
permissive
fflowres/testcoin2
1e01b2439886f19439bb7939cdee32992f88f4bc
a1dfab693c2f9df7689f06a1780ce37348ac9e9d
refs/heads/master
2020-05-29T19:01:51.503809
2013-11-09T04:49:55
2013-11-09T04:49:55
null
0
0
null
null
null
null
UTF-8
C++
false
false
35,635
cpp
/* * Qt4 bitcoin GUI. * * W.J. van der Laan 2011-2012 * The Bitcoin Developers 2011-2012 * The Litecoin Developers 201-2013 */ #include "bitcoingui.h" #include "transactiontablemodel.h" #include "addressbookpage.h" #include "sendcoinsdialog.h" #include "signverifymessagedialog.h" #include "optionsdialog.h" #include "aboutdialog.h" #include "clientmodel.h" #include "walletmodel.h" #include "editaddressdialog.h" #include "optionsmodel.h" #include "transactiondescdialog.h" #include "addresstablemodel.h" #include "transactionview.h" #include "overviewpage.h" #include "miningpage.h" #include "bitcoinunits.h" #include "guiconstants.h" #include "askpassphrasedialog.h" #include "notificator.h" #include "guiutil.h" #include "rpcconsole.h" #ifdef Q_WS_MAC #include "macdockiconhandler.h" #endif #include <QApplication> #include <QMainWindow> #include <QMenuBar> #include <QMenu> #include <QIcon> #include <QTabWidget> #include <QVBoxLayout> #include <QToolBar> #include <QStatusBar> #include <QLabel> #include <QLineEdit> #include <QPushButton> #include <QLocale> #include <QMessageBox> #include <QProgressBar> #include <QStackedWidget> #include <QDateTime> #include <QMovie> #include <QFileDialog> #include <QDesktopServices> #include <QTimer> #include <QDragEnterEvent> #include <QUrl> #include <iostream> BitcoinGUI::BitcoinGUI(QWidget *parent): QMainWindow(parent), clientModel(0), walletModel(0), encryptWalletAction(0), changePassphraseAction(0), aboutQtAction(0), trayIcon(0), notificator(0), rpcConsole(0) { resize(850, 550); setWindowTitle(tr("TooCoin") + " - " + tr("Wallet")); #ifndef Q_WS_MAC qApp->setWindowIcon(QIcon(":icons/bitcoin")); setWindowIcon(QIcon(":icons/bitcoin")); #else setUnifiedTitleAndToolBarOnMac(true); QApplication::setAttribute(Qt::AA_DontShowIconsInMenus); #endif // Accept D&D of URIs setAcceptDrops(true); // Create actions for the toolbar, menu bar and tray/dock icon createActions(); // Create application menu bar createMenuBar(); // Create the toolbars createToolBars(); // Create the tray icon (or setup the dock icon) createTrayIcon(); // Create tabs overviewPage = new OverviewPage(); miningPage = new MiningPage(this); transactionsPage = new QWidget(this); QVBoxLayout *vbox = new QVBoxLayout(); transactionView = new TransactionView(this); vbox->addWidget(transactionView); transactionsPage->setLayout(vbox); addressBookPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::SendingTab); receiveCoinsPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::ReceivingTab); sendCoinsPage = new SendCoinsDialog(this); signVerifyMessageDialog = new SignVerifyMessageDialog(this); centralWidget = new QStackedWidget(this); centralWidget->addWidget(overviewPage); centralWidget->addWidget(miningPage); centralWidget->addWidget(transactionsPage); centralWidget->addWidget(addressBookPage); centralWidget->addWidget(receiveCoinsPage); centralWidget->addWidget(sendCoinsPage); #ifdef FIRST_CLASS_MESSAGING centralWidget->addWidget(signVerifyMessageDialog); #endif setCentralWidget(centralWidget); // Create status bar statusBar(); // Status bar notification icons QFrame *frameBlocks = new QFrame(); frameBlocks->setContentsMargins(0,0,0,0); frameBlocks->setMinimumWidth(73); frameBlocks->setMaximumWidth(73); QHBoxLayout *frameBlocksLayout = new QHBoxLayout(frameBlocks); frameBlocksLayout->setContentsMargins(3,0,3,0); frameBlocksLayout->setSpacing(3); labelEncryptionIcon = new QLabel(); labelMiningIcon = new QLabel(); labelConnectionsIcon = new QLabel(); labelBlocksIcon = new QLabel(); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelEncryptionIcon); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelMiningIcon); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelConnectionsIcon); frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelBlocksIcon); frameBlocksLayout->addStretch(); // Progress bar and label for blocks download progressBarLabel = new QLabel(); progressBarLabel->setVisible(false); progressBar = new QProgressBar(); progressBar->setAlignment(Qt::AlignCenter); progressBar->setVisible(false); statusBar()->addWidget(progressBarLabel); statusBar()->addWidget(progressBar); statusBar()->addPermanentWidget(frameBlocks); syncIconMovie = new QMovie(":/movies/update_spinner", "mng", this); // Clicking on a transaction on the overview page simply sends you to transaction history page connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), this, SLOT(gotoHistoryPage())); connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), transactionView, SLOT(focusTransaction(QModelIndex))); // Doubleclicking on a transaction on the transaction history page shows details connect(transactionView, SIGNAL(doubleClicked(QModelIndex)), transactionView, SLOT(showDetails())); rpcConsole = new RPCConsole(this); connect(openRPCConsoleAction, SIGNAL(triggered()), rpcConsole, SLOT(show())); // Clicking on "Verify Message" in the address book sends you to the verify message tab connect(addressBookPage, SIGNAL(verifyMessage(QString)), this, SLOT(gotoVerifyMessageTab(QString))); // Clicking on "Sign Message" in the receive coins page sends you to the sign message tab connect(receiveCoinsPage, SIGNAL(signMessage(QString)), this, SLOT(gotoSignMessageTab(QString))); gotoOverviewPage(); } BitcoinGUI::~BitcoinGUI() { if(trayIcon) // Hide tray icon, as deleting will let it linger until quit (on Ubuntu) trayIcon->hide(); #ifdef Q_WS_MAC delete appMenuBar; #endif } void BitcoinGUI::createActions() { QActionGroup *tabGroup = new QActionGroup(this); overviewAction = new QAction(QIcon(":/icons/overview"), tr("&Overview"), this); overviewAction->setToolTip(tr("Show general overview of wallet")); overviewAction->setCheckable(true); overviewAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_1)); tabGroup->addAction(overviewAction); miningAction = new QAction(QIcon(":/icons/mining"), tr("&Mining"), this); miningAction->setToolTip(tr("Configure mining")); miningAction->setCheckable(true); tabGroup->addAction(miningAction); historyAction = new QAction(QIcon(":/icons/history"), tr("&Transactions"), this); historyAction->setToolTip(tr("Browse transaction history")); historyAction->setCheckable(true); historyAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_4)); tabGroup->addAction(historyAction); addressBookAction = new QAction(QIcon(":/icons/address-book"), tr("&Address Book"), this); addressBookAction->setToolTip(tr("Edit the list of stored addresses and labels")); addressBookAction->setCheckable(true); addressBookAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_5)); tabGroup->addAction(addressBookAction); receiveCoinsAction = new QAction(QIcon(":/icons/receiving_addresses"), tr("&Receive coins"), this); receiveCoinsAction->setToolTip(tr("Show the list of addresses for receiving payments")); receiveCoinsAction->setCheckable(true); receiveCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_3)); tabGroup->addAction(receiveCoinsAction); sendCoinsAction = new QAction(QIcon(":/icons/send"), tr("&Send coins"), this); sendCoinsAction->setToolTip(tr("Send coins to a TooCoin address")); sendCoinsAction->setCheckable(true); sendCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_2)); tabGroup->addAction(sendCoinsAction); signMessageAction = new QAction(QIcon(":/icons/edit"), tr("Sign &message..."), this); signMessageAction->setToolTip(tr("Sign a message to prove you own a Bitcoin address")); tabGroup->addAction(signMessageAction); verifyMessageAction = new QAction(QIcon(":/icons/transaction_0"), tr("&Verify message..."), this); verifyMessageAction->setToolTip(tr("Verify a message to ensure it was signed with a specified Bitcoin address")); tabGroup->addAction(verifyMessageAction); #ifdef FIRST_CLASS_MESSAGING firstClassMessagingAction = new QAction(QIcon(":/icons/edit"), tr("S&ignatures"), this); firstClassMessagingAction->setToolTip(signMessageAction->toolTip() + QString(". / ") + verifyMessageAction->toolTip() + QString(".")); firstClassMessagingAction->setCheckable(true); tabGroup->addAction(firstClassMessagingAction); #endif connect(overviewAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(overviewAction, SIGNAL(triggered()), this, SLOT(gotoOverviewPage())); connect(miningAction, SIGNAL(triggered()), this, SLOT(gotoMiningPage())); connect(historyAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(historyAction, SIGNAL(triggered()), this, SLOT(gotoHistoryPage())); connect(addressBookAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(addressBookAction, SIGNAL(triggered()), this, SLOT(gotoAddressBookPage())); connect(receiveCoinsAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(receiveCoinsAction, SIGNAL(triggered()), this, SLOT(gotoReceiveCoinsPage())); connect(sendCoinsAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(sendCoinsAction, SIGNAL(triggered()), this, SLOT(gotoSendCoinsPage())); connect(signMessageAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(signMessageAction, SIGNAL(triggered()), this, SLOT(gotoSignMessageTab())); connect(verifyMessageAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(verifyMessageAction, SIGNAL(triggered()), this, SLOT(gotoVerifyMessageTab())); #ifdef FIRST_CLASS_MESSAGING connect(firstClassMessagingAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); // Always start with the sign message tab for FIRST_CLASS_MESSAGING connect(firstClassMessagingAction, SIGNAL(triggered()), this, SLOT(gotoSignMessageTab())); #endif quitAction = new QAction(QIcon(":/icons/quit"), tr("E&xit"), this); quitAction->setToolTip(tr("Quit application")); quitAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q)); quitAction->setMenuRole(QAction::QuitRole); aboutAction = new QAction(QIcon(":/icons/bitcoin"), tr("&About TooCoin"), this); aboutAction->setToolTip(tr("Show information about TooCoin")); aboutAction->setMenuRole(QAction::AboutRole); aboutQtAction = new QAction(tr("About &Qt"), this); aboutQtAction->setToolTip(tr("Show information about Qt")); aboutQtAction->setMenuRole(QAction::AboutQtRole); optionsAction = new QAction(QIcon(":/icons/options"), tr("&Options..."), this); optionsAction->setToolTip(tr("Modify configuration options for TooCoin")); optionsAction->setMenuRole(QAction::PreferencesRole); toggleHideAction = new QAction(QIcon(":/icons/bitcoin"), tr("Show/Hide &TooCoin"), this); toggleHideAction->setToolTip(tr("Show or hide the TooCoin window")); exportAction = new QAction(QIcon(":/icons/export"), tr("&Export..."), this); exportAction->setToolTip(tr("Export the data in the current tab to a file")); encryptWalletAction = new QAction(QIcon(":/icons/lock_closed"), tr("&Encrypt Wallet..."), this); encryptWalletAction->setToolTip(tr("Encrypt or decrypt wallet")); encryptWalletAction->setCheckable(true); backupWalletAction = new QAction(QIcon(":/icons/filesave"), tr("&Backup Wallet..."), this); backupWalletAction->setToolTip(tr("Backup wallet to another location")); changePassphraseAction = new QAction(QIcon(":/icons/key"), tr("&Change Passphrase..."), this); changePassphraseAction->setToolTip(tr("Change the passphrase used for wallet encryption")); openRPCConsoleAction = new QAction(QIcon(":/icons/debugwindow"), tr("&Debug window"), this); openRPCConsoleAction->setToolTip(tr("Open debugging and diagnostic console")); connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit())); connect(optionsAction, SIGNAL(triggered()), this, SLOT(optionsClicked())); connect(aboutAction, SIGNAL(triggered()), this, SLOT(aboutClicked())); connect(aboutQtAction, SIGNAL(triggered()), qApp, SLOT(aboutQt())); connect(toggleHideAction, SIGNAL(triggered()), this, SLOT(toggleHidden())); connect(encryptWalletAction, SIGNAL(triggered(bool)), this, SLOT(encryptWallet(bool))); connect(backupWalletAction, SIGNAL(triggered()), this, SLOT(backupWallet())); connect(changePassphraseAction, SIGNAL(triggered()), this, SLOT(changePassphrase())); } void BitcoinGUI::createMenuBar() { #ifdef Q_WS_MAC // Create a decoupled menu bar on Mac which stays even if the window is closed appMenuBar = new QMenuBar(); #else // Get the main window's menu bar on other platforms appMenuBar = menuBar(); #endif // Configure the menus QMenu *file = appMenuBar->addMenu(tr("&File")); file->addAction(backupWalletAction); file->addAction(exportAction); #ifndef FIRST_CLASS_MESSAGING file->addAction(signMessageAction); file->addAction(verifyMessageAction); #endif file->addSeparator(); file->addAction(quitAction); QMenu *settings = appMenuBar->addMenu(tr("&Settings")); settings->addAction(encryptWalletAction); settings->addAction(changePassphraseAction); settings->addSeparator(); settings->addAction(optionsAction); QMenu *help = appMenuBar->addMenu(tr("&Help")); help->addAction(openRPCConsoleAction); help->addSeparator(); help->addAction(aboutAction); help->addAction(aboutQtAction); } void BitcoinGUI::createToolBars() { QToolBar *toolbar = addToolBar(tr("Tabs toolbar")); toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); toolbar->addAction(overviewAction); toolbar->addAction(sendCoinsAction); toolbar->addAction(receiveCoinsAction); toolbar->addAction(historyAction); toolbar->addAction(addressBookAction); toolbar->addAction(miningAction); #ifdef FIRST_CLASS_MESSAGING toolbar->addAction(firstClassMessagingAction); #endif QToolBar *toolbar2 = addToolBar(tr("Actions toolbar")); toolbar2->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); toolbar2->addAction(exportAction); } void BitcoinGUI::setClientModel(ClientModel *clientModel) { this->clientModel = clientModel; if(clientModel) { // Replace some strings and icons, when using the testnet if(clientModel->isTestNet()) { setWindowTitle(windowTitle() + QString(" ") + tr("[testnet]")); #ifndef Q_WS_MAC qApp->setWindowIcon(QIcon(":icons/bitcoin_testnet")); setWindowIcon(QIcon(":icons/bitcoin_testnet")); #else MacDockIconHandler::instance()->setIcon(QIcon(":icons/bitcoin_testnet")); #endif if(trayIcon) { trayIcon->setToolTip(tr("TooCoin client") + QString(" ") + tr("[testnet]")); trayIcon->setIcon(QIcon(":/icons/toolbar_testnet")); toggleHideAction->setIcon(QIcon(":/icons/toolbar_testnet")); } aboutAction->setIcon(QIcon(":/icons/toolbar_testnet")); } // Keep up to date with client setNumConnections(clientModel->getNumConnections()); connect(clientModel, SIGNAL(numConnectionsChanged(int)), this, SLOT(setNumConnections(int))); setNumBlocks(clientModel->getNumBlocks(), clientModel->getNumBlocksOfPeers()); connect(clientModel, SIGNAL(numBlocksChanged(int,int)), this, SLOT(setNumBlocks(int,int))); setMining(false, 0); connect(clientModel, SIGNAL(miningChanged(bool,int)), this, SLOT(setMining(bool,int))); // Report errors from network/worker thread connect(clientModel, SIGNAL(error(QString,QString,bool)), this, SLOT(error(QString,QString,bool))); rpcConsole->setClientModel(clientModel); addressBookPage->setOptionsModel(clientModel->getOptionsModel()); receiveCoinsPage->setOptionsModel(clientModel->getOptionsModel()); } } void BitcoinGUI::setWalletModel(WalletModel *walletModel) { this->walletModel = walletModel; if(walletModel) { // Report errors from wallet thread connect(walletModel, SIGNAL(error(QString,QString,bool)), this, SLOT(error(QString,QString,bool))); // Put transaction list in tabs transactionView->setModel(walletModel); overviewPage->setModel(walletModel); addressBookPage->setModel(walletModel->getAddressTableModel()); receiveCoinsPage->setModel(walletModel->getAddressTableModel()); sendCoinsPage->setModel(walletModel); signVerifyMessageDialog->setModel(walletModel); miningPage->setModel(clientModel); setEncryptionStatus(walletModel->getEncryptionStatus()); connect(walletModel, SIGNAL(encryptionStatusChanged(int)), this, SLOT(setEncryptionStatus(int))); // Balloon popup for new transaction connect(walletModel->getTransactionTableModel(), SIGNAL(rowsInserted(QModelIndex,int,int)), this, SLOT(incomingTransaction(QModelIndex,int,int))); // Ask for passphrase if needed connect(walletModel, SIGNAL(requireUnlock()), this, SLOT(unlockWallet())); } } void BitcoinGUI::createTrayIcon() { QMenu *trayIconMenu; #ifndef Q_WS_MAC trayIcon = new QSystemTrayIcon(this); trayIconMenu = new QMenu(this); trayIcon->setContextMenu(trayIconMenu); trayIcon->setToolTip(tr("TooCoin client")); trayIcon->setIcon(QIcon(":/icons/toolbar")); connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(trayIconActivated(QSystemTrayIcon::ActivationReason))); trayIcon->show(); #else // Note: On Mac, the dock icon is used to provide the tray's functionality. MacDockIconHandler *dockIconHandler = MacDockIconHandler::instance(); trayIconMenu = dockIconHandler->dockMenu(); #endif // Configuration of the tray icon (or dock icon) icon menu trayIconMenu->addAction(toggleHideAction); trayIconMenu->addSeparator(); trayIconMenu->addAction(sendCoinsAction); trayIconMenu->addAction(receiveCoinsAction); #ifndef FIRST_CLASS_MESSAGING trayIconMenu->addSeparator(); #endif trayIconMenu->addAction(signMessageAction); trayIconMenu->addAction(verifyMessageAction); trayIconMenu->addSeparator(); trayIconMenu->addAction(optionsAction); trayIconMenu->addAction(openRPCConsoleAction); #ifndef Q_WS_MAC // This is built-in on Mac trayIconMenu->addSeparator(); trayIconMenu->addAction(quitAction); #endif notificator = new Notificator(qApp->applicationName(), trayIcon); } #ifndef Q_WS_MAC void BitcoinGUI::trayIconActivated(QSystemTrayIcon::ActivationReason reason) { if(reason == QSystemTrayIcon::Trigger) { // Click on system tray icon triggers "show/hide TooCoin" toggleHideAction->trigger(); } } #endif void BitcoinGUI::optionsClicked() { if(!clientModel || !clientModel->getOptionsModel()) return; OptionsDialog dlg; dlg.setModel(clientModel->getOptionsModel()); dlg.exec(); } void BitcoinGUI::aboutClicked() { AboutDialog dlg; dlg.setModel(clientModel); dlg.exec(); } void BitcoinGUI::setNumConnections(int count) { QString icon; switch(count) { case 0: icon = ":/icons/connect_0"; break; case 1: case 2: case 3: icon = ":/icons/connect_1"; break; case 4: case 5: case 6: icon = ":/icons/connect_2"; break; case 7: case 8: case 9: icon = ":/icons/connect_3"; break; default: icon = ":/icons/connect_4"; break; } labelConnectionsIcon->setPixmap(QIcon(icon).pixmap(STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE)); labelConnectionsIcon->setToolTip(tr("%n active connection(s) to TooCoin network", "", count)); } void BitcoinGUI::setNumBlocks(int count, int nTotalBlocks) { // don't show / hide progressBar and it's label if we have no connection(s) to the network if (!clientModel || clientModel->getNumConnections() == 0) { progressBarLabel->setVisible(false); progressBar->setVisible(false); return; } QString tooltip; if(count < nTotalBlocks) { int nRemainingBlocks = nTotalBlocks - count; float nPercentageDone = count / (nTotalBlocks * 0.01f); if (clientModel->getStatusBarWarnings() == "") { progressBarLabel->setText(tr("Synchronizing with network...")); progressBarLabel->setVisible(true); progressBar->setFormat(tr("~%n block(s) remaining", "", nRemainingBlocks)); progressBar->setMaximum(nTotalBlocks); progressBar->setValue(count); progressBar->setVisible(true); } else { progressBarLabel->setText(clientModel->getStatusBarWarnings()); progressBarLabel->setVisible(true); progressBar->setVisible(false); } tooltip = tr("Downloaded %1 of %2 blocks of transaction history (%3% done).").arg(count).arg(nTotalBlocks).arg(nPercentageDone, 0, 'f', 2); } else { if (clientModel->getStatusBarWarnings() == "") progressBarLabel->setVisible(false); else { progressBarLabel->setText(clientModel->getStatusBarWarnings()); progressBarLabel->setVisible(true); } progressBar->setVisible(false); tooltip = tr("Downloaded %1 blocks of transaction history.").arg(count); } tooltip = tr("Current difficulty is %1.").arg(clientModel->GetDifficulty()) + QString("<br>") + tooltip; QDateTime now = QDateTime::currentDateTime(); QDateTime lastBlockDate = clientModel->getLastBlockDate(); int secs = lastBlockDate.secsTo(now); QString text; // Represent time from last generated block in human readable text if(secs <= 0) { // Fully up to date. Leave text empty. } else if(secs < 60) { text = tr("%n second(s) ago","",secs); } else if(secs < 60*60) { text = tr("%n minute(s) ago","",secs/60); } else if(secs < 24*60*60) { text = tr("%n hour(s) ago","",secs/(60*60)); } else { text = tr("%n day(s) ago","",secs/(60*60*24)); } // Set icon state: spinning if catching up, tick otherwise if(secs < 90*60 && count >= nTotalBlocks) { tooltip = tr("Up to date") + QString(".<br>") + tooltip; labelBlocksIcon->setPixmap(QIcon(":/icons/synced").pixmap(STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE)); overviewPage->showOutOfSyncWarning(false); } else { tooltip = tr("Catching up...") + QString("<br>") + tooltip; labelBlocksIcon->setMovie(syncIconMovie); syncIconMovie->start(); overviewPage->showOutOfSyncWarning(true); } if(!text.isEmpty()) { tooltip += QString("<br>"); tooltip += tr("Last received block was generated %1.").arg(text); } // Don't word-wrap this (fixed-width) tooltip tooltip = QString("<nobr>") + tooltip + QString("</nobr>"); labelBlocksIcon->setToolTip(tooltip); progressBarLabel->setToolTip(tooltip); progressBar->setToolTip(tooltip); } void BitcoinGUI::setMining(bool mining, int hashrate) { if (mining) { labelMiningIcon->setPixmap(QIcon(":/icons/mining_active").pixmap(STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE)); labelMiningIcon->setToolTip(tr("Mining TooCoin at %1 hashes per second").arg(hashrate)); } else { labelMiningIcon->setPixmap(QIcon(":/icons/mining_inactive").pixmap(STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE)); labelMiningIcon->setToolTip(tr("Not mining TooCoin")); } } void BitcoinGUI::error(const QString &title, const QString &message, bool modal) { // Report errors from network/worker thread if(modal) { QMessageBox::critical(this, title, message, QMessageBox::Ok, QMessageBox::Ok); } else { notificator->notify(Notificator::Critical, title, message); } } void BitcoinGUI::changeEvent(QEvent *e) { QMainWindow::changeEvent(e); #ifndef Q_WS_MAC // Ignored on Mac if(e->type() == QEvent::WindowStateChange) { if(clientModel && clientModel->getOptionsModel()->getMinimizeToTray()) { QWindowStateChangeEvent *wsevt = static_cast<QWindowStateChangeEvent*>(e); if(!(wsevt->oldState() & Qt::WindowMinimized) && isMinimized()) { QTimer::singleShot(0, this, SLOT(hide())); e->ignore(); } } } #endif } void BitcoinGUI::closeEvent(QCloseEvent *event) { if(clientModel) { #ifndef Q_WS_MAC // Ignored on Mac if(!clientModel->getOptionsModel()->getMinimizeToTray() && !clientModel->getOptionsModel()->getMinimizeOnClose()) { qApp->quit(); } #endif } QMainWindow::closeEvent(event); } void BitcoinGUI::askFee(qint64 nFeeRequired, bool *payFee) { QString strMessage = tr("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?").arg( BitcoinUnits::formatWithUnit(BitcoinUnits::BTC, nFeeRequired)); QMessageBox::StandardButton retval = QMessageBox::question( this, tr("Confirm transaction fee"), strMessage, QMessageBox::Yes|QMessageBox::Cancel, QMessageBox::Yes); *payFee = (retval == QMessageBox::Yes); } void BitcoinGUI::incomingTransaction(const QModelIndex & parent, int start, int end) { if(!walletModel || !clientModel) return; TransactionTableModel *ttm = walletModel->getTransactionTableModel(); qint64 amount = ttm->index(start, TransactionTableModel::Amount, parent) .data(Qt::EditRole).toULongLong(); if(!clientModel->inInitialBlockDownload()) { // On new transaction, make an info balloon // Unless the initial block download is in progress, to prevent balloon-spam QString date = ttm->index(start, TransactionTableModel::Date, parent) .data().toString(); QString type = ttm->index(start, TransactionTableModel::Type, parent) .data().toString(); QString address = ttm->index(start, TransactionTableModel::ToAddress, parent) .data().toString(); QIcon icon = qvariant_cast<QIcon>(ttm->index(start, TransactionTableModel::ToAddress, parent) .data(Qt::DecorationRole)); notificator->notify(Notificator::Information, (amount)<0 ? tr("Sent transaction") : tr("Incoming transaction"), tr("Date: %1\n" "Amount: %2\n" "Type: %3\n" "Address: %4\n") .arg(date) .arg(BitcoinUnits::formatWithUnit(walletModel->getOptionsModel()->getDisplayUnit(), amount, true)) .arg(type) .arg(address), icon); } } void BitcoinGUI::gotoOverviewPage() { overviewAction->setChecked(true); centralWidget->setCurrentWidget(overviewPage); exportAction->setEnabled(false); disconnect(exportAction, SIGNAL(triggered()), 0, 0); } void BitcoinGUI::gotoMiningPage() { miningAction->setChecked(true); centralWidget->setCurrentWidget(miningPage); exportAction->setEnabled(false); disconnect(exportAction, SIGNAL(triggered()), 0, 0); } void BitcoinGUI::gotoHistoryPage() { historyAction->setChecked(true); centralWidget->setCurrentWidget(transactionsPage); exportAction->setEnabled(true); disconnect(exportAction, SIGNAL(triggered()), 0, 0); connect(exportAction, SIGNAL(triggered()), transactionView, SLOT(exportClicked())); } void BitcoinGUI::gotoAddressBookPage() { addressBookAction->setChecked(true); centralWidget->setCurrentWidget(addressBookPage); exportAction->setEnabled(true); disconnect(exportAction, SIGNAL(triggered()), 0, 0); connect(exportAction, SIGNAL(triggered()), addressBookPage, SLOT(exportClicked())); } void BitcoinGUI::gotoReceiveCoinsPage() { receiveCoinsAction->setChecked(true); centralWidget->setCurrentWidget(receiveCoinsPage); exportAction->setEnabled(true); disconnect(exportAction, SIGNAL(triggered()), 0, 0); connect(exportAction, SIGNAL(triggered()), receiveCoinsPage, SLOT(exportClicked())); } void BitcoinGUI::gotoSendCoinsPage() { sendCoinsAction->setChecked(true); centralWidget->setCurrentWidget(sendCoinsPage); exportAction->setEnabled(false); disconnect(exportAction, SIGNAL(triggered()), 0, 0); } void BitcoinGUI::gotoSignMessageTab(QString addr) { #ifdef FIRST_CLASS_MESSAGING firstClassMessagingAction->setChecked(true); centralWidget->setCurrentWidget(signVerifyMessageDialog); exportAction->setEnabled(false); disconnect(exportAction, SIGNAL(triggered()), 0, 0); signVerifyMessageDialog->showTab_SM(false); #else // call show() in showTab_SM() signVerifyMessageDialog->showTab_SM(true); #endif if(!addr.isEmpty()) signVerifyMessageDialog->setAddress_SM(addr); } void BitcoinGUI::gotoVerifyMessageTab(QString addr) { #ifdef FIRST_CLASS_MESSAGING firstClassMessagingAction->setChecked(true); centralWidget->setCurrentWidget(signVerifyMessageDialog); exportAction->setEnabled(false); disconnect(exportAction, SIGNAL(triggered()), 0, 0); signVerifyMessageDialog->showTab_VM(false); #else // call show() in showTab_VM() signVerifyMessageDialog->showTab_VM(true); #endif if(!addr.isEmpty()) signVerifyMessageDialog->setAddress_VM(addr); } void BitcoinGUI::dragEnterEvent(QDragEnterEvent *event) { // Accept only URIs if(event->mimeData()->hasUrls()) event->acceptProposedAction(); } void BitcoinGUI::dropEvent(QDropEvent *event) { if(event->mimeData()->hasUrls()) { int nValidUrisFound = 0; QList<QUrl> uris = event->mimeData()->urls(); foreach(const QUrl &uri, uris) { if (sendCoinsPage->handleURI(uri.toString())) nValidUrisFound++; } // if valid URIs were found if (nValidUrisFound) gotoSendCoinsPage(); else notificator->notify(Notificator::Warning, tr("URI handling"), tr("URI can not be parsed! This can be caused by an invalid TooCoin address or malformed URI parameters.")); } event->acceptProposedAction(); } void BitcoinGUI::handleURI(QString strURI) { // URI has to be valid if (sendCoinsPage->handleURI(strURI)) { showNormalIfMinimized(); gotoSendCoinsPage(); } else notificator->notify(Notificator::Warning, tr("URI handling"), tr("URI can not be parsed! This can be caused by an invalid TooCoin address or malformed URI parameters.")); } void BitcoinGUI::setEncryptionStatus(int status) { switch(status) { case WalletModel::Unencrypted: labelEncryptionIcon->hide(); encryptWalletAction->setChecked(false); changePassphraseAction->setEnabled(false); encryptWalletAction->setEnabled(true); break; case WalletModel::Unlocked: labelEncryptionIcon->show(); labelEncryptionIcon->setPixmap(QIcon(":/icons/lock_open").pixmap(STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE)); labelEncryptionIcon->setToolTip(tr("Wallet is <b>encrypted</b> and currently <b>unlocked</b>")); encryptWalletAction->setChecked(true); changePassphraseAction->setEnabled(true); encryptWalletAction->setEnabled(false); // TODO: decrypt currently not supported break; case WalletModel::Locked: labelEncryptionIcon->show(); labelEncryptionIcon->setPixmap(QIcon(":/icons/lock_closed").pixmap(STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE)); labelEncryptionIcon->setToolTip(tr("Wallet is <b>encrypted</b> and currently <b>locked</b>")); encryptWalletAction->setChecked(true); changePassphraseAction->setEnabled(true); encryptWalletAction->setEnabled(false); // TODO: decrypt currently not supported break; } } void BitcoinGUI::encryptWallet(bool status) { if(!walletModel) return; AskPassphraseDialog dlg(status ? AskPassphraseDialog::Encrypt: AskPassphraseDialog::Decrypt, this); dlg.setModel(walletModel); dlg.exec(); setEncryptionStatus(walletModel->getEncryptionStatus()); } void BitcoinGUI::backupWallet() { QString saveDir = QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation); QString filename = QFileDialog::getSaveFileName(this, tr("Backup Wallet"), saveDir, tr("Wallet Data (*.dat)")); if(!filename.isEmpty()) { if(!walletModel->backupWallet(filename)) { QMessageBox::warning(this, tr("Backup Failed"), tr("There was an error trying to save the wallet data to the new location.")); } } } void BitcoinGUI::changePassphrase() { AskPassphraseDialog dlg(AskPassphraseDialog::ChangePass, this); dlg.setModel(walletModel); dlg.exec(); } void BitcoinGUI::unlockWallet() { if(!walletModel) return; // Unlock wallet when requested by wallet model if(walletModel->getEncryptionStatus() == WalletModel::Locked) { AskPassphraseDialog dlg(AskPassphraseDialog::Unlock, this); dlg.setModel(walletModel); dlg.exec(); } } void BitcoinGUI::showNormalIfMinimized(bool fToggleHidden) { // activateWindow() (sometimes) helps with keyboard focus on Windows if (isHidden()) { show(); activateWindow(); } else if (isMinimized()) { showNormal(); activateWindow(); } else if (GUIUtil::isObscured(this)) { raise(); activateWindow(); } else if(fToggleHidden) hide(); } void BitcoinGUI::toggleHidden() { showNormalIfMinimized(true); }
[ "root@ubuntu-vm1.(none)" ]
root@ubuntu-vm1.(none)
6e955182060859e6a8887b4de726a543708a16d3
18618cb79f05fc6830112ea9301f0b8f0c8a3cf4
/week3_paths1/1_bfs/ss.cpp
0552d349a429bdd26afaf7e80f4a52add7d748b7
[]
no_license
vini7148/Graphs
8a519e8900403af4d0f401cb2da84d5b270b0beb
7c3c32a238a101e6a54af5b2ecceef39ab9f66cd
refs/heads/master
2020-08-21T21:47:52.886512
2019-10-19T18:50:34
2019-10-19T18:50:34
216,254,022
1
0
null
null
null
null
UTF-8
C++
false
false
139
cpp
#include <iostream> #include <vector> using namespace std; class graph { }; int main() { graph g; g.input(); g.output(); }
cdff9c442884dd55a54484cb6e6986e8ea7e55f3
c073f252b1bba67be6064e3fc2ee7282f2e264b0
/orca_shared/src/pwm.cpp
98335427a66041aebd8621e7203d67476b2df0b7
[ "MIT" ]
permissive
jquintas/orca3
ce26753c54bcf33ae1906bc45f8653d7f85c19d7
fd48e1740ec7d34f16c254400bd756c69128bf42
refs/heads/main
2023-08-25T17:52:09.842945
2021-11-08T16:40:06
2021-11-08T16:40:06
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,836
cpp
// MIT License // // Copyright (c) 2021 Clyde McQueen // // 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. #include "orca_shared/pwm.hpp" #include "orca_shared/util.hpp" #include "orca_msgs/msg/thrust.hpp" namespace orca { uint16_t tilt_to_pwm(const int tilt) { return orca::scale( tilt, TILT_MIN, TILT_MAX, orca_msgs::msg::CameraTilt::TILT_45_UP, orca_msgs::msg::CameraTilt::TILT_45_DOWN); } int pwm_to_tilt(const uint16_t pwm) { return orca::scale( pwm, orca_msgs::msg::CameraTilt::TILT_45_UP, orca_msgs::msg::CameraTilt::TILT_45_DOWN, TILT_MIN, TILT_MAX); } uint16_t brightness_to_pwm(const int brightness) { return orca::scale( brightness, BRIGHTNESS_MIN, BRIGHTNESS_MAX, orca_msgs::msg::Lights::LIGHTS_OFF, orca_msgs::msg::Lights::LIGHTS_FULL); } int pwm_to_brightness(const uint16_t pwm) { return orca::scale( pwm, orca_msgs::msg::Lights::LIGHTS_OFF, orca_msgs::msg::Lights::LIGHTS_FULL, BRIGHTNESS_MIN, BRIGHTNESS_MAX); } uint16_t effort_to_pwm(const uint16_t thrust_dz_pwm, const double effort) { uint16_t thrust_range_pwm = 400 - thrust_dz_pwm; return clamp( static_cast<uint16_t>(orca_msgs::msg::Thrust::THRUST_STOP + (effort > THRUST_STOP ? thrust_dz_pwm : (effort < THRUST_STOP ? -thrust_dz_pwm : 0)) + std::round(effort * thrust_range_pwm)), orca_msgs::msg::Thrust::THRUST_FULL_REV, orca_msgs::msg::Thrust::THRUST_FULL_FWD); } double pwm_to_effort(const uint16_t thrust_dz_pwm, const uint16_t pwm) { uint16_t thrust_range_pwm = 400 - thrust_dz_pwm; return static_cast<double>( pwm - orca_msgs::msg::Thrust::THRUST_STOP + (pwm > orca_msgs::msg::Thrust::THRUST_STOP ? -thrust_dz_pwm : (pwm < orca_msgs::msg::Thrust::THRUST_STOP ? thrust_dz_pwm : 0))) / thrust_range_pwm; } } // namespace orca
452bfd50b08cec3a63e438242fa49aa14633f8f4
9029e19e83262ecad3b64b8a8eb8202df1756c85
/aws-cpp-sdk-email/source/model/MissingRenderingAttributeException.cpp
0806c5b390b81f15163cbfcc9bb747a9adf8a1a7
[ "MIT", "Apache-2.0", "JSON" ]
permissive
thesunisgas/aws-sdk-cpp
5da80c064039e2c4636d87bf69f9059fcfcc83c5
5e13f32f0c3f1e7c259bd06404b3aba12fa7b9a5
refs/heads/master
2022-08-25T13:15:44.713783
2019-03-12T20:52:49
2020-05-19T05:11:57
261,756,291
2
2
null
2020-05-06T12:47:07
2020-05-06T12:47:06
null
UTF-8
C++
false
false
2,272
cpp
/* * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ #include <aws/email/model/MissingRenderingAttributeException.h> #include <aws/core/utils/xml/XmlSerializer.h> #include <aws/core/utils/StringUtils.h> #include <aws/core/utils/memory/stl/AWSStringStream.h> #include <utility> using namespace Aws::Utils::Xml; using namespace Aws::Utils; namespace Aws { namespace SES { namespace Model { MissingRenderingAttributeException::MissingRenderingAttributeException() : m_templateNameHasBeenSet(false) { } MissingRenderingAttributeException::MissingRenderingAttributeException(const XmlNode& xmlNode) : m_templateNameHasBeenSet(false) { *this = xmlNode; } MissingRenderingAttributeException& MissingRenderingAttributeException::operator =(const XmlNode& xmlNode) { XmlNode resultNode = xmlNode; if(!resultNode.IsNull()) { XmlNode templateNameNode = resultNode.FirstChild("TemplateName"); if(!templateNameNode.IsNull()) { m_templateName = Aws::Utils::Xml::DecodeEscapedXmlText(templateNameNode.GetText()); m_templateNameHasBeenSet = true; } } return *this; } void MissingRenderingAttributeException::OutputToStream(Aws::OStream& oStream, const char* location, unsigned index, const char* locationValue) const { if(m_templateNameHasBeenSet) { oStream << location << index << locationValue << ".TemplateName=" << StringUtils::URLEncode(m_templateName.c_str()) << "&"; } } void MissingRenderingAttributeException::OutputToStream(Aws::OStream& oStream, const char* location) const { if(m_templateNameHasBeenSet) { oStream << location << ".TemplateName=" << StringUtils::URLEncode(m_templateName.c_str()) << "&"; } } } // namespace Model } // namespace SES } // namespace Aws
b97b77ed300580cd41d9407dd84f742a0b8fcbc2
f22845ffd08b5104940ce668859c014450526635
/libreoj/LIBREOJ10006.cpp
aaa7039f7fc9ffdfd346566f50df965dee60e3e7
[]
no_license
btnkij/ACM
ffd2797548ab13ac8670f5b2ef873af023280daf
36bf2950146e1477cbd201ba0281912dd0a289aa
refs/heads/master
2022-12-15T15:01:57.690973
2020-09-16T11:13:30
2020-09-16T11:13:30
172,726,050
0
0
null
null
null
null
UTF-8
C++
false
false
1,472
cpp
/** * Number:loj10006 * Title:「一本通 1.1 练习 2」数列分段 * Status:AC * Tag:[贪心] **/ #include <cstdio> #include <iostream> #include <algorithm> #include <cmath> #include <cstring> #include <vector> #include <queue> #include <stack> using namespace std; #define INF 0x3f3f3f3f #define PI acos(-1) typedef long long ll; typedef unsigned long long ull; inline int readi(int& i1) { return scanf("%d", &i1); } inline int readi(int& i1, int& i2) { return scanf("%d %d", &i1, &i2); } inline int readi(int& i1, int& i2, int& i3) { return scanf("%d %d %d", &i1, &i2, &i3); } inline int readi(int& i1, int& i2, int& i3, int& i4) { return scanf("%d %d %d %d", &i1, &i2, &i3, &i4); } inline int reads(char* s1) { return scanf("%s", s1); } #define mset(mem, val) memset(mem, val, sizeof(mem)) #define rep(i, begin, end) for (int i = (begin); i <= (end); i++) #define rep2(i1, begin1, end1, i2, begin2, end2) rep(i1, begin1, end1) rep(i2, begin2, end2) #define repne(i, begin, end) for (int i = (begin); i < (end); i++) #define repne2(i1, begin1, end1, i2, begin2, end2) repne(i1, begin1, end1) repne(i2, begin2, end2) int main() { #ifdef __DEBUG__ freopen("in.txt", "r", stdin); freopen("out.txt", "w", stdout); #endif int n,m; readi(n,m); int sum=0, ans=0; while(n--) { int t; readi(t); sum+=t; if(sum>m) { sum=t; ans++; } } printf("%d",ans+(sum>0)); return 0; }
e12a73c2cebc9a911f208ece27f238685610fdc2
5178ebecc4458b360b7593e31353ab18e519953e
/include/npstat/stat/NtupleRecordTypes.hh
03f908547f6136cbe4d4247f1cee20715bed22b3
[]
no_license
KanZhang23/Tmass
9ee2baff245a1842e3ceaaa04eb8f5fb923faea9
6cf430a7a8e717874298d99977cb50c8943bb1b9
refs/heads/master
2022-01-10T10:51:49.627777
2019-06-12T14:53:17
2019-06-12T14:53:17
null
0
0
null
null
null
null
UTF-8
C++
false
false
6,924
hh
#ifndef NPSTAT_NTUPLERECORDTYPES_HH_ #define NPSTAT_NTUPLERECORDTYPES_HH_ //========================================================================= // NtupleRecordTypes.hh // // Special record types for storing ArchivedNtuple contents in the archives. // Applications should never use this header directly. // // Author: I. Volobouev // // November 2010 //========================================================================= #include <stdexcept> #include "geners/AbsRecord.hh" #include "geners/AbsReference.hh" #include "geners/binaryIO.hh" #include "npstat/stat/NtupleRecordTypesFwd.hh" namespace npstat { namespace Private { template<class Ntuple> class NtupleHeaderRecord : public gs::AbsRecord { public: inline explicit NtupleHeaderRecord(const Ntuple& obj) : gs::AbsRecord(obj.classId(), "npstat::NtupleHeader", obj.name_.c_str(), obj.category_.c_str()), obj_(obj) {} inline virtual ~NtupleHeaderRecord() {} inline bool writeData(std::ostream& os) const { obj_.classId().write(os); obj_.fillBuffer_.classId().write(os); gs::write_pod_vector(os, obj_.columnNames()); gs::write_pod(os, obj_.title()); const unsigned long rowsPerBuffer = obj_.rowsPerBuffer(); gs::write_pod(os, rowsPerBuffer); gs::write_pod(os, obj_.writesByColumn()); return !os.fail(); } private: NtupleHeaderRecord(); const Ntuple& obj_; }; template<class Ntuple> class NtupleFooterRecord : public gs::AbsRecord { public: inline explicit NtupleFooterRecord(const Ntuple& obj) : gs::AbsRecord(obj.classId(), "npstat::NtupleFooter", obj.name_.c_str(), obj.category_.c_str()), obj_(obj) {} inline virtual ~NtupleFooterRecord() {} inline bool writeData(std::ostream& os) const { unsigned long nrows = obj_.nRows(); gs::write_pod(os, nrows); gs::write_pod(os, obj_.headerSaved_); gs::write_pod_vector(os, obj_.idlist_); const unsigned char writeColumnWise = obj_.writesByColumn(); gs::write_pod(os, writeColumnWise); if (writeColumnWise) gs::write_pod_vector(os, obj_.columnOffsets_); return !os.fail(); } private: NtupleFooterRecord(); const Ntuple& obj_; }; template<class Ntuple> class NtupleBufferRecord : public gs::AbsRecord { public: inline explicit NtupleBufferRecord(const Ntuple& obj) : gs::AbsRecord(obj.fillBuffer_.classId(), "npstat::NtupleBuffer", obj.name_.c_str(), obj.category_.c_str()), obj_(obj) {} inline virtual ~NtupleBufferRecord() {} inline bool writeData(std::ostream& os) const {return obj_.fillBuffer_.write(os);} private: NtupleBufferRecord(); const Ntuple& obj_; }; template<class Ntuple> class NtupleBufferReference : public gs::AbsReference { public: typedef NtupleBuffer<typename Ntuple::value_type> Buffer; inline NtupleBufferReference(const Ntuple& obj, const unsigned long long itemId) : gs::AbsReference(obj.ar_, obj.bufferClass_, "npstat::NtupleBuffer", itemId), obj_(obj) {} inline virtual ~NtupleBufferReference() {} inline void restore(const unsigned long number, Buffer* buf) const { const unsigned long long itemId = id(number); if (itemId == 0ULL) throw std::out_of_range( "In npstat::NtupleBufferReference::restore: " "buffer number out of range"); Buffer::restore(obj_.bufferClass_, this->positionInputStream(itemId), buf); } private: const Ntuple& obj_; }; template<class Ntuple> class NtupleColumnReference : public gs::AbsReference { public: inline NtupleColumnReference(const Ntuple& obj, const unsigned long long itemId, const unsigned long column, const long long offset) : gs::AbsReference(obj.ar_, obj.bufferClass_, "npstat::NtupleBuffer", itemId), obj_(obj), offset_(offset), col_(column) {} inline virtual ~NtupleColumnReference() {} inline bool fillItems(typename Ntuple::value_type* buf, const unsigned long lenBuf) const { const unsigned long long itemId = id(0); if (itemId == 0) return false; else { NtupleBuffer<typename Ntuple::value_type>::readColumn( obj_.bufferClass_, this->positionInputStream(itemId), col_, offset_, buf, lenBuf); return true; } } private: const Ntuple& obj_; long long offset_; unsigned long col_; }; // We want to see the ntuple footer reference before reading // the ntuple, so do not use an ntuple object to construct // this reference. struct NtupleFooterReference : public gs::AbsReference { inline NtupleFooterReference( gs::AbsArchive& ar, const gs::ClassId& classId, const char* name, const char* category) : gs::AbsReference(ar, classId, "npstat::NtupleFooter", name, category) {} inline virtual ~NtupleFooterReference() {} inline bool fillItems(unsigned long* nrows, unsigned long long* headerId, std::vector<unsigned long long>* idlist, std::vector<long long>* columnOffsets, unsigned long long* recordOffset, const unsigned long number) const { const unsigned long long itemId = id(number); if (itemId == 0) return false; std::istream& s = this->positionInputStream(itemId); *recordOffset = archive().catalogEntry(itemId)->offset(); gs::read_pod(s, nrows); gs::read_pod(s, headerId); gs::read_pod_vector(s, idlist); unsigned char writeColumnWise = false; gs::read_pod(s, &writeColumnWise); if (writeColumnWise) gs::read_pod_vector(s, columnOffsets); else columnOffsets->clear(); return !s.fail(); } }; } } #endif // NPSTAT_NTUPLERECORDTYPES_HH_
15f28377b83bb03b810440086326114e0466cf38
83cf336f297d27b4b89e93a4a6fa7b77c5815ed6
/Tests/FSM/beeps.cpp
bb84d5b525ee427973e9735e38b9b6153a354343
[ "MIT" ]
permissive
zteifel/booboo
4750165fec81cc676cc768ff5adf21b2c1c554d8
58a7c6b186cb1dafa9adccaf94ead25127a9a3d6
refs/heads/master
2021-01-21T12:53:23.803338
2016-05-29T09:34:02
2016-05-29T09:34:14
54,257,190
0
0
null
null
null
null
UTF-8
C++
false
false
293
cpp
#include "beeps.h" #include "Arduino.h" #include "declarations.h" void beep() { for (int i=1000; i<2000; i=i*1.02) { tone(beepPin,i,10); delay(20); } for (int i=2000; i>1000; i=i*.98) { tone(beepPin,i,10); delay(20); } } void error(){ tone(beepPin, 1000, 5000); }
2d63c2e1b69d3e06818d3bac11b31a88f432c9a1
92e6bb39bde3b0068b8f916511a9c1e5b3d0a6c1
/TrainingFramework/src/GameObject/Enemy2.h
e031b1794ab55573ccab5bb2a34fa22542f75ce3
[]
no_license
An094/PoosQuest
c3d97babd0961f0ae5caf580e82adb9829ae9755
a5a14428cdb4d0cd16d7c178767e30ee4e13c48a
refs/heads/master
2023-04-15T15:06:03.808185
2021-04-07T14:52:20
2021-04-07T14:52:20
350,909,764
0
0
null
null
null
null
UTF-8
C++
false
false
599
h
#pragma once #include "Enemy.h" class Enemy2 : public Enemy { public: Enemy2(int x, int y, int dir, int move, int maxMove1, int maxMove2, int speed, std::shared_ptr<Map2> map); ~Enemy2(); void Update(float); void Draw(); void MoveDirWithPoo(float, Vector2); void BackDefault(); bool getActive() { return true; } Vector2 getPos() { return enemy->Get2DPosition(); } private: float speed = 120.0f; float maxMoveDis[4]; float currentMove; int defaultDir; Vector2 currentPos; Vector2 oldPos; Vector2 defaultPos; std::shared_ptr<Map2> m_map; std::shared_ptr<SpriteAnimation2D> enemy; };
f7df0289df7741f0f9512b57faddb33d965e1284
49b05e95d9003b7f1f4f66620c3e051a27648d91
/Servers/LookupServer/main.cpp
283aadec911b4d25704172da13944520ea24892a
[ "BSD-2-Clause" ]
permissive
ygorko/serenity
8f1d25b8d48465c9353c585b64e4e089c3434bbf
ccc6e69a294edacf7bec77cb2c2640ada7fe1f77
refs/heads/master
2020-05-31T03:40:53.063797
2019-06-03T17:52:31
2019-06-03T19:17:58
null
0
0
null
null
null
null
UTF-8
C++
false
false
8,839
cpp
#include "DNSPacket.h" #include "DNSRecord.h" #include <AK/AKString.h> #include <AK/BufferStream.h> #include <AK/ByteBuffer.h> #include <AK/HashMap.h> #include <Kernel/Net/IPv4.h> #include <LibCore/CConfigFile.h> #include <arpa/inet.h> #include <netinet/in.h> #include <stdio.h> #include <stdlib.h> #include <sys/select.h> #include <sys/socket.h> #include <sys/time.h> #include <unistd.h> #define T_A 1 #define T_NS 2 #define T_CNAME 5 #define T_SOA 6 #define T_PTR 12 #define T_MX 15 #define C_IN 1 static Vector<IPv4Address> lookup(const String& hostname, bool& did_timeout, const String& DNS_IP); static String parse_dns_name(const byte*, int& offset, int max_offset); int main(int argc, char**argv) { (void)argc; (void)argv; unlink("/tmp/.LookupServer-socket"); auto config = CConfigFile::get_for_system("LookupServer"); dbgprintf("LookupServer: Using network config file at %s.\n", config->file_name().characters()); auto DNS_IP = config->read_entry("DNS", "IPAddress", "127.0.0.53"); HashMap<String, IPv4Address> dns_cache; int server_fd = socket(AF_LOCAL, SOCK_STREAM | SOCK_CLOEXEC, 0); if (server_fd < 0) { perror("socket"); return 1; } sockaddr_un address; address.sun_family = AF_LOCAL; strcpy(address.sun_path, "/tmp/.LookupServer-socket"); int rc = bind(server_fd, (const sockaddr*)&address, sizeof(address)); if (rc < 0) { perror("bind"); return 1; } rc = listen(server_fd, 5); if (rc < 0) { perror("listen"); return 1; } for (;;) { fd_set rfds; FD_ZERO(&rfds); FD_SET(server_fd, &rfds); rc = select(server_fd + 1, &rfds, nullptr, nullptr, nullptr); if (rc < 1) { perror("select"); return 1; } sockaddr_un client_address; socklen_t client_address_size = sizeof(client_address); int client_fd = accept(server_fd, (sockaddr*)&client_address, &client_address_size); if (client_fd < 0) { perror("accept"); continue; } FD_ZERO(&rfds); FD_SET(client_fd, &rfds); rc = select(client_fd + 1, &rfds, nullptr, nullptr, nullptr); if (rc < 1) { perror("select"); return 1; } char client_buffer[1024]; int nrecv = read(client_fd, client_buffer, sizeof(client_buffer) - 1); if (nrecv < 0) { perror("recv"); close(client_fd); continue; } client_buffer[nrecv] = '\0'; auto hostname = String(client_buffer, nrecv, Chomp); dbgprintf("LookupServer: Got request for '%s' (using IP %s)\n", hostname.characters(), DNS_IP.characters()); Vector<IPv4Address> addresses; if (!hostname.is_empty()) { bool did_timeout; int retries = 3; do { did_timeout = false; addresses = lookup(hostname, did_timeout, DNS_IP); if (!did_timeout) break; } while (--retries); if (did_timeout) { fprintf(stderr, "LookupServer: Out of retries :(\n"); close(client_fd); continue; } } if (addresses.is_empty()) { int nsent = write(client_fd, "Not found.\n", sizeof("Not found.\n")); if (nsent < 0) perror("write"); close(client_fd); continue; } for (auto& address : addresses) { auto line = String::format("%s\n", address.to_string().characters()); int nsent = write(client_fd, line.characters(), line.length()); if (nsent < 0) { perror("write"); break; } } close(client_fd); } return 0; } static word get_next_id() { static word s_next_id = 0; return ++s_next_id; } Vector<IPv4Address> lookup(const String& hostname, bool& did_timeout, const String& DNS_IP) { // FIXME: First check if it's an IP address in a string! DNSPacket request_header; request_header.set_id(get_next_id()); request_header.set_is_query(); request_header.set_opcode(0); request_header.set_truncated(false); request_header.set_recursion_desired(true); request_header.set_question_count(1); auto buffer = ByteBuffer::create_uninitialized(1024); { BufferStream stream(buffer); stream << ByteBuffer::wrap(&request_header, sizeof(request_header)); auto parts = hostname.split('.'); for (auto& part : parts) { stream << (byte)part.length(); stream << part; } stream << '\0'; stream << htons(T_A); stream << htons(C_IN); stream.snip(); } int fd = socket(AF_INET, SOCK_DGRAM, 0); if (fd < 0) { perror("socket"); return { }; } struct timeval timeout { 1, 0 }; int rc = setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, &timeout, sizeof(timeout)); if (rc < 0) { perror("setsockopt"); close(fd); return { }; } struct sockaddr_in dst_addr; memset(&dst_addr, 0, sizeof(dst_addr)); dst_addr.sin_family = AF_INET; dst_addr.sin_port = htons(53); rc = inet_pton(AF_INET, DNS_IP.characters(), &dst_addr.sin_addr); int nsent = sendto(fd, buffer.pointer(), buffer.size(), 0,(const struct sockaddr *)&dst_addr, sizeof(dst_addr)); if (nsent < 0) { perror("sendto"); return { }; } ASSERT(nsent == buffer.size()); struct sockaddr_in src_addr; socklen_t src_addr_len = sizeof(src_addr); byte response_buffer[4096]; ssize_t nrecv = recvfrom(fd, response_buffer, sizeof(response_buffer) - 1, 0, (struct sockaddr*)&src_addr, &src_addr_len); if (nrecv < 0) { if (errno == EAGAIN) { did_timeout = true; } else { perror("recvfrom"); } close(fd); return { }; } close(fd); response_buffer[nrecv] = '\0'; if (nrecv < (int)sizeof(DNSPacket)) { dbgprintf("LookupServer: Response not big enough (%d) to be a DNS packet :(\n", nrecv); return { }; } auto& response_header = *(DNSPacket*)(response_buffer); dbgprintf("Got response (ID: %u)\n", response_header.id()); dbgprintf(" Question count: %u\n", response_header.question_count()); dbgprintf(" Answer count: %u\n", response_header.answer_count()); dbgprintf(" Authority count: %u\n", response_header.authority_count()); dbgprintf("Additional count: %u\n", response_header.additional_count()); if (response_header.id() != request_header.id()) { dbgprintf("LookupServer: ID mismatch (%u vs %u) :(\n", response_header.id(), request_header.id()); return { }; } if (response_header.question_count() != 1) { dbgprintf("LookupServer: Question count (%u vs %u) :(\n", response_header.question_count(), request_header.question_count()); return { }; } if (response_header.answer_count() < 1) { dbgprintf("LookupServer: Not enough answers (%u) :(\n", response_header.answer_count()); return { }; } int offset = 0; auto question = parse_dns_name((const byte*)response_header.payload(), offset, nrecv); offset += 4; Vector<IPv4Address> addresses; for (word i = 0; i < response_header.answer_count(); ++i) { auto& record = *(const DNSRecord*)(&((const byte*)response_header.payload())[offset]); auto ipv4_address = IPv4Address((const byte*)record.data()); dbgprintf("LookupServer: Answer #%u: (question: %s), type=%u, ttl=%u, length=%u, data=%s\n", i, question.characters(), record.type(), record.ttl(), record.data_length(), ipv4_address.to_string().characters()); offset += sizeof(DNSRecord) + record.data_length(); if (record.type() == T_A) addresses.append(ipv4_address); // FIXME: Parse some other record types perhaps? } return addresses; } static String parse_dns_name(const byte* data, int& offset, int max_offset) { Vector<char, 128> buf; while (offset < max_offset) { byte ch = data[offset]; if (ch == '\0') { ++offset; break; } if ((ch & 0xc0) == 0xc0) { ASSERT_NOT_REACHED(); // FIXME: Parse referential names. offset += 2; } for (int i = 0; i < ch; ++i) { buf.append(data[offset + i + 1]); } buf.append('.'); offset += ch + 1; } return String::copy(buf); }
567f4d20e18c4a61b913bb42a4ff706578b129d7
133b34954a0a82f6c88d26336073d429875beef1
/8. CountString/8. CountString/Source.cpp
f7c8d4f1617880a06c2f3e922e4800cbe3c752a5
[]
no_license
RiasKlein/Various_CPP
496d8130566469c096735c4aff6bf055d96c3a82
84d63a98bfe853d685bdf62b75859e44d105fa5a
refs/heads/master
2021-06-15T18:40:24.696160
2017-05-05T05:25:48
2017-05-05T05:25:48
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,777
cpp
/* Write a program to count the number of occurrences of a letter in a string. */ #include <iostream> // cout, endl #include <string> // string #include <algorithm> // count using namespace std; int count_string_for_char(string str, char target); int count_string_for_char_v2(string str, char target); int count_string_for_char_v3(string str, char target); int main() { string str = "Hello"; char target = 'l'; cout << count_string_for_char_v3(str, target) << endl; return 0; } /* Returns the number of times the target char occurs in the given string. This requires the algorithm library: #include <algorithm> @param str The string to check for the target char @param target The char to look for in the given string @return The number of times the target char occurs in the given string */ int count_string_for_char_v3(string str, char target) { return count(str.begin(), str.end(), target); } /* Returns the number of times the target char occurs in the given string. @param str The string to check for the target char @param target The char to look for in the given string @return The number of times the target char occurs in the given string */ int count_string_for_char_v2(string str, char target) { int count = 0; for (char a : str) { if (a == target) { count++; } } return count; } /* Returns the number of times the target char occurs in the given string. @param str The string to check for the target char @param target The char to look for in the given string @return The number of times the target char occurs in the given string */ int count_string_for_char(string str, char target) { int count = 0; for (int i = 0; i < str.length(); i++) { char cur = str[i]; if (cur == target) { count++; } } return count; }
7dc7d654d0c7f0c89cbd60222f806ec36d01434e
07b4a3ed9a81da575288ecb957cf7bc389f835bf
/laboratorul 3/problema 1/Math.h
320f4520a7d97ab763efab5b13b0da498e615ab7
[]
no_license
WoozyDeveloper/OOP-laborator
5408f16b0ed6a1dff1f4069cdfddf411deeb4cc3
5174fe509ab9c5a7088b7bcda32a0d2352f995d8
refs/heads/main
2023-05-08T09:35:25.763602
2021-05-20T23:04:05
2021-05-20T23:04:05
340,070,573
0
0
null
null
null
null
UTF-8
C++
false
false
488
h
#pragma once class Math { public: static int Add(int, int); static int Add(int, int, int); static int Add(double, double); static int Add(double, double, double); static int Mul(int, int); static int Mul(int, int, int); static int Mul(double, double); static int Mul(double, double, double); static int Add(int count, ...); // sums up a list of integers static char* Add(const char*, const char*); static char* Sub(const char*, const char*); };
df3f366626d31bc3f32d6636966b5c8ed52391cd
4f8841b93021d5ca70f9500d141a4d956f8a7c3c
/tests/UnitTest.hpp
021fb5b0c83709ac78aa77525de58b2d6ccbb033
[ "WTFPL" ]
permissive
Liareth/nwtrees
9bb73bdba79eecd4f0d9f35b637eea8766798182
d47b98d78958efcc492dd4358b98f8e3f0bd38a3
refs/heads/main
2023-04-03T22:20:49.905839
2021-04-18T16:33:57
2021-04-18T16:33:57
358,019,994
6
0
null
null
null
null
UTF-8
C++
false
false
2,644
hpp
#pragma once #include <cstddef> namespace test { struct UnitTestResult { const char* failed_condition = nullptr; const char* failed_file; int failed_line; }; using UnitTestFunc = UnitTestResult(*)(); struct UnitTest { const char* class_name; const char* test_name; UnitTestFunc function; }; void register_unit_test(const char* class_name, const char* test_name, UnitTestFunc function); struct ScopedUnitTest{ ScopedUnitTest(const char* class_name, const char* test_name, UnitTestFunc function) { register_unit_test(class_name, test_name, function); } }; template <typename T> struct TestBase { using _TestType = T; UnitTestResult test_result; }; template <typename T> struct TestName { constexpr TestName(const char* name) { str = name; } static inline const char* str; }; #define _TEST_CLASS(name) \ class name; \ static ::test::TestName<name> _reg_##name(#name); \ class name : ::test::TestBase<name> #define _TEST_METHOD(name) \ static ::test::UnitTestResult _invoke_##name() \ { \ _TestType test; \ test._##name(); \ return test.test_result; \ } \ static inline ::test::ScopedUnitTest _invoker_##name \ { \ ::test::TestName<_TestType>::str, \ #name, \ &_invoke_##name \ }; \ void _##name() #define TEST_CLASS(name) _TEST_CLASS(Test_##name) #define TEST_METHOD(name) _TEST_METHOD(name) #define BENCHMARK_CLASS(name) _TEST_CLASS(Benchmark_##name) #define BENCHMARK_METHOD(name) _TEST_METHOD(name) void debug_break(); #define TEST_EXPECT(cond) \ do \ { \ if (!(cond) && !test_result.failed_condition) \ { \ ::test::debug_break(); \ test_result.failed_condition = (#cond); \ test_result.failed_file = __FILE__; \ test_result.failed_line = __LINE__; \ } \ } while (0) }
0e185b8401045a8cc28fad813467025a2aefedf7
38d2a9f6b5ce131caf17fc62384547df688b91a7
/hmailserver/source/Server/Common/SQL/MySQLInterface.cpp
3ab6c3d015109099608a175dda81d3639f77b54e
[]
no_license
martinknafve/hmailserver
52ba7a50c59558d0b6064802df29e90a9614687e
707bcf05f4e1b38a9bf6ad7e1ed774237af1e2b2
refs/heads/master
2016-09-06T06:11:27.196192
2014-07-02T09:40:14
2014-07-02T09:40:14
15,649,163
4
1
null
null
null
null
UTF-8
C++
false
false
3,906
cpp
// Copyright (c) 2010 Martin Knafve / hMailServer.com. // http://www.hmailserver.com #include "stdafx.h" #include "MySQLInterface.h" #ifdef _DEBUG #define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__) #define new DEBUG_NEW #endif namespace HM { MySQLInterface::MySQLInterface() : m_hLibraryInstance(0), p_mysql_real_connect(0), p_mysql_close(0), p_mysql_init(0), p_mysql_error(0), p_mysql_query(0), p_mysql_store_result(0), p_mysql_free_result(0), p_mysql_insert_id(0), p_mysql_errno(0), p_mysql_num_rows(0), p_mysql_fetch_row(0), p_mysql_num_fields(0), p_mysql_fetch_field_direct(0), p_mysql_get_server_version(0) { } MySQLInterface::~MySQLInterface() { if (m_hLibraryInstance) { FreeLibrary(m_hLibraryInstance); } } String MySQLInterface::_GetLibraryFileName() { LPTSTR szPath = (LPTSTR)alloca( 2048 ); DWORD dwPathLength; dwPathLength = GetModuleFileName(NULL, szPath, 2048 ); szPath[ dwPathLength ] = 0; // --- nullterminated. String sPath(szPath); int iLastSlash = max(sPath.ReverseFind(_T("\\")), sPath.ReverseFind(_T("/"))); String sRetVal = sPath.Mid(0, iLastSlash); sRetVal += "\\libmysql.dll"; return sRetVal; } bool MySQLInterface::Load(String &sErrorMessage) { String sLibrary = _GetLibraryFileName(); m_hLibraryInstance = LoadLibrary(sLibrary); if (!m_hLibraryInstance) { sErrorMessage = "Error:\r\n" "The MySQL client (libmysql.dll, 32 bit) could not be loaded.\r\n" "hMailServer needs this file to be able to connect to MySQL.\r\n" "The MySQL client needs to be manually copied to the hMailServer Bin directory. The file is not included in the hMailServer installation.\r\n" "Path: " + sLibrary; ErrorManager::Instance()->ReportError(ErrorManager::Critical, 5094, "MySQLInterface::Load", sErrorMessage); return false; } p_mysql_real_connect = (hm_mysql_real_connect*)GetProcAddress( (HMODULE)m_hLibraryInstance, "mysql_real_connect" ); p_mysql_close = (hm_mysql_close*) GetProcAddress( (HMODULE)m_hLibraryInstance, "mysql_close" ); p_mysql_init = (hm_mysql_init*) GetProcAddress( (HMODULE)m_hLibraryInstance, "mysql_init" ); p_mysql_error = (hm_mysql_error*) GetProcAddress( (HMODULE)m_hLibraryInstance, "mysql_error" ); p_mysql_query = (hm_mysql_query*) GetProcAddress( (HMODULE)m_hLibraryInstance, "mysql_query" ); p_mysql_store_result = (hm_mysql_store_result*) GetProcAddress( (HMODULE)m_hLibraryInstance, "mysql_store_result" ); p_mysql_free_result = (hm_mysql_free_result*) GetProcAddress( (HMODULE)m_hLibraryInstance, "mysql_free_result" ); p_mysql_insert_id = (hm_mysql_insert_id*) GetProcAddress( (HMODULE)m_hLibraryInstance, "mysql_insert_id" ); p_mysql_errno = (hm_mysql_errno*) GetProcAddress( (HMODULE)m_hLibraryInstance, "mysql_errno" ); p_mysql_num_rows = (hm_mysql_num_rows*) GetProcAddress( (HMODULE)m_hLibraryInstance, "mysql_num_rows" ); p_mysql_fetch_row = (hm_mysql_fetch_row*) GetProcAddress( (HMODULE)m_hLibraryInstance, "mysql_fetch_row" ); p_mysql_num_fields = (hm_mysql_num_fields*) GetProcAddress( (HMODULE)m_hLibraryInstance, "mysql_num_fields" ); p_mysql_fetch_field_direct = (hm_mysql_fetch_field_direct*) GetProcAddress( (HMODULE)m_hLibraryInstance, "mysql_fetch_field_direct" ); p_mysql_get_server_version = (hm_mysql_get_server_version*) GetProcAddress( (HMODULE)m_hLibraryInstance, "mysql_get_server_version" ); return true; } bool MySQLInterface::IsLoaded() { if (m_hLibraryInstance > 0) return true; else return false; } }
1fad7362389ecb675c198bd8713531ce14e55453
a06a9ae73af6690fabb1f7ec99298018dd549bb7
/_Library/_Include/boost/units/detail/push_front_or_add.hpp
fa51c2e5a3d1f5b1761508d644b45b2ccaf34a17
[]
no_license
longstl/mus12
f76de65cca55e675392eac162dcc961531980f9f
9e1be111f505ac23695f7675fb9cefbd6fa876e9
refs/heads/master
2021-05-18T08:20:40.821655
2020-03-29T17:38:13
2020-03-29T17:38:13
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,238
hpp
//////////////////////////////////////////////////////////////////////////////// // push_front_or_add.hpp // Boost.Units - A C++ library for zero-overhead dimensional analysis and // unit/quantity manipulation and conversion // // Copyright (C) 2003-2008 Matthias Christian Schabel // Copyright (C) 2008 Steven Watanabe // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_UNITS_DETAIL_PUSH_FRONT_OR_ADD_HPP #define BOOST_UNITS_DETAIL_PUSH_FRONT_OR_ADD_HPP #include <boost/mpl/plus.hpp> #include <boost/mpl/front.hpp> #include <boost/mpl/push_front.hpp> #include <boost/mpl/pop_front.hpp> #include <boost/type_traits/is_same.hpp> #include <boost/units/units_fwd.hpp> #include <boost/units/detail/push_front_if.hpp> namespace boost { namespace units { template<class Item, class Next> struct list; namespace detail { template<class T> struct is_empty_dim; /// add an instantiation of dim to Sequence. template<bool> struct push_front_or_add_impl; template<> struct push_front_or_add_impl<true> { template<typename Sequence, typename T> struct apply { typedef typename mpl::plus<T, typename Sequence::item>::type item; typedef typename push_front_if<!is_empty_dim<item>::value>::template apply< typename Sequence::next, item > type; }; }; template<> struct push_front_or_add_impl<false> { template<typename Sequence, typename T> struct apply { typedef list<T, Sequence> type; }; }; template<typename Sequence, typename T> struct push_front_or_add { typedef typename push_front_or_add_impl<boost::is_same<typename T::tag_type, typename Sequence::item::tag_type>::value>::template apply< Sequence, T >::type type; }; template<typename T> struct push_front_or_add<dimensionless_type, T> { typedef list<T, dimensionless_type> type; }; } // namespace detail } // namespace units } // namespace boost #endif ///////////////////////////////////////////////// // vnDev.Games - Trong.LIVE - DAO VAN TRONG // ////////////////////////////////////////////////////////////////////////////////
7bfcb5445438143a5064ef3090fbc20fe0d94d4f
3b79040a92c13adb69d7ffca6ea24715bca5b6b0
/Terrain/main.cpp
aecdd7fe8fd5a82e881112b3f5eddaed5b1eb769
[ "MIT" ]
permissive
QuincyKing/Terrain
b51bd7182f66af22d71c4dc23d3c37fcd492019a
d3ba900f532c5f68c7dffd5fb7adf1ed852231e3
refs/heads/master
2021-01-12T03:48:12.326671
2018-06-11T15:21:34
2018-06-11T15:21:34
78,264,617
4
1
null
null
null
null
GB18030
C++
false
false
19,804
cpp
#include "Kriging.h" #include "TerrainModel.h" #include "D3DInputClass.h" #include "D3DCameraClass.h" #include "D3DUtil.h" #include "BaseData.h" #include "Sag.h" #include "KeyLevel.h" #include "Math.h" #include "RW/ReaderBase.h" #include "RW/WriteBase.h" #include "RW/ReaderInfo.h" #include "RW/ReaderTerrainData.h" #include "RW/ReaderData.h" #include "RW/ReaderPara.h" #include <d3d9.h> #include <d3dx9.h> #include <tchar.h> #include <atlstr.h> #include <Windows.h> #include <algorithm> #include <memory> using namespace std; #pragma comment(lib, "winmm.lib") #pragma comment(lib, "d3d9.lib") #pragma comment(lib, "d3dx9.lib") #pragma comment(lib, "dinput8.lib") #pragma comment(lib, "dxguid.lib") #define WINDOW_WIDTH 800 #define WINDOW_HEIGHT 700 #define WINDOW_TITLE L"三维地质图" #define D3DFVF_CUSTOMVERTEX (D3DFVF_XYZ | D3DFVF_TEX1) wchar_t g_strFPS[50]; IDirect3DDevice9 *device = 0; ID3DXFont *pFont = NULL; D3DInputClass *g_pD3DInput = NULL; D3DXMATRIX g_matWorld; IDirect3DVertexBuffer9 *g_pVertexBuffer = NULL; IDirect3DVertexBuffer9 *g_pUpgradeVertexBuffer = NULL; IDirect3DTexture9 *g_pTexture1 = NULL; IDirect3DTexture9 *g_pTexture2 = NULL; IDirect3DTexture9 *g_pTexture3 = NULL; IDirect3DTexture9 *g_pTexture4 = NULL; IDirect3DTexture9 *g_pTexture5 = NULL; IDirect3DTexture9 *g_pTexture6 = NULL; IDirect3DTexture9 *g_pTexture7 = NULL; CameraClass *g_pCamera = NULL; TerrainModel terrainModel; TerrainModel UTM; D3DXMATRIX g_projection; int flag = 0; int upgrade = 1; ReaderPara<>* rp; ReaderInfo<>* rif; ReaderData<>* rdt; extern vector<double> H; extern double mm; vector<double> E; vector<double> V; vector<double> K; vector<double> mP0; const double mPi = 400000; const double mQi = 400000; const double mq = 1.1; const double mbeta = BasicLib::ToRadian(5.0); #pragma comment(linker, "/subsystem:console /entry:WinMainCRTStartup") struct CUSTOMVERTEX { float _x, _y, _z; float _u, _v; CUSTOMVERTEX() {} CUSTOMVERTEX(Point3D temp) :_x(temp.x), _y(temp.y), _z(temp.z), _u(temp.u), _v(temp.v) { } CUSTOMVERTEX(Point3D temp, float _u, float _v) :_x(temp.x), _y(temp.y), _z(temp.z), _u(_u), _v(_v) { } }; LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); HRESULT Direct3D_Init(HWND hwnd); HRESULT Objects_Init(); VOID Direct3D_Render(HWND hwnd); VOID Direct3D_CleanUp(); VOID Direct3D_Update(HWND hwnd); BOOL Device_Read(IDirectInputDevice8 *pDIDevice, void* pBuffer, long lSize); float Get_FPS(); VOID InputModel(TerrainModel &terrainModel); VOID SagUpgrade(const vector<double>, const double, const double, const vector<double> &, const double, const double, const double); VOID UpgradeInit(); VOID CalP0(vector<double> &P0); int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) { WNDCLASSEX wndClass = { 0 }; wndClass.cbSize = sizeof(WNDCLASSEX); wndClass.style = CS_HREDRAW | CS_VREDRAW; wndClass.lpfnWndProc = WndProc; wndClass.cbClsExtra = 0; wndClass.cbWndExtra = 0; wndClass.hInstance = hInstance; wndClass.hIcon = (HICON)::LoadImage(NULL, L"", IMAGE_ICON, 0, 0, LR_DEFAULTSIZE | LR_LOADFROMFILE); wndClass.hCursor = LoadCursor(NULL, IDC_ARROW); wndClass.hbrBackground = (HBRUSH)GetStockObject(GRAY_BRUSH); wndClass.lpszMenuName = NULL; wndClass.lpszClassName = L"Terrain"; if (!RegisterClassEx(&wndClass)) return -1; HWND hwnd = CreateWindow(L"Terrain", WINDOW_TITLE, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, WINDOW_WIDTH, WINDOW_HEIGHT, NULL, NULL, hInstance, NULL); if (E_FAIL == Direct3D_Init(hwnd)) { MessageBox(hwnd, _T("Direct初始化失败!"), _T("消息窗口"), 0); } MoveWindow(hwnd, 250, 80, WINDOW_WIDTH, WINDOW_HEIGHT, true); ShowWindow(hwnd, nShowCmd); UpdateWindow(hwnd); g_pD3DInput = new D3DInputClass(); g_pD3DInput->Init(hwnd, hInstance, DISCL_FOREGROUND | DISCL_NONEXCLUSIVE, DISCL_FOREGROUND | DISCL_NONEXCLUSIVE); MSG msg = { 0 }; while (msg.message != WM_QUIT) { if (PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) { TranslateMessage(&msg); DispatchMessage(&msg); } else { Direct3D_Render(hwnd); Direct3D_Update(hwnd); } } UnregisterClass(L"Terrain", wndClass.hInstance); return 0; } LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { switch (message) { case WM_PAINT: Direct3D_Render(hwnd); ValidateRect(hwnd, NULL); break; case WM_KEYDOWN: if (wParam == VK_ESCAPE) DestroyWindow(hwnd); break; case WM_KEYUP: if (wParam == VK_ESCAPE) PostQuitMessage(0); break; case WM_DESTROY: Direct3D_CleanUp(); PostQuitMessage(0); break; default: return DefWindowProc(hwnd, message, wParam, lParam); } return 0; } HRESULT Direct3D_Init(HWND hwnd) { IDirect3D9 *d3d9; d3d9 = Direct3DCreate9(D3D_SDK_VERSION); D3DCAPS9 caps; int vp = 0; if (FAILED(d3d9->GetDeviceCaps(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, &caps))) { MessageBox(hwnd, L"", L"window", 0); return E_FAIL; } if (caps.DevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) { vp = D3DCREATE_HARDWARE_VERTEXPROCESSING; } else { vp = D3DCREATE_SOFTWARE_VERTEXPROCESSING; } D3DPRESENT_PARAMETERS d3dpp; ZeroMemory(&d3dpp, sizeof(d3dpp)); d3dpp.BackBufferWidth = WINDOW_WIDTH; d3dpp.BackBufferHeight = WINDOW_HEIGHT; d3dpp.BackBufferFormat = D3DFMT_A8R8G8B8; d3dpp.BackBufferCount = 1; d3dpp.MultiSampleType = D3DMULTISAMPLE_NONE; d3dpp.MultiSampleQuality = 0; d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; d3dpp.hDeviceWindow = hwnd; d3dpp.Windowed = true; d3dpp.EnableAutoDepthStencil = true; d3dpp.AutoDepthStencilFormat = D3DFMT_D24S8; d3dpp.Flags = 0; d3dpp.FullScreen_RefreshRateInHz = 0; d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE; if (FAILED(d3d9->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hwnd, vp, &d3dpp, &device))) { MessageBox(hwnd, L"2", L"window", 0); return E_FAIL; } SAFE_RELEASE(d3d9); Objects_Init(); return S_OK; } HRESULT Objects_Init() { Para para; rp = new ReaderPara<>("para.te"); para = rp->GetData(); E = para.GetE(); V = para.GetV(); K = para.GetK(); Kriging *kriging = new Kriging(); delete kriging; InputModel(terrainModel); const int count = 8*terrainModel.m_gtp.m_GTPSet.size(); D3DXCreateFont(device, 18, 0, 0, 1, false, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, DEFAULT_QUALITY, 0, _T("微软雅黑"), &pFont); device->CreateVertexBuffer(3*count*sizeof(CUSTOMVERTEX), 0, D3DFVF_CUSTOMVERTEX, D3DPOOL_MANAGED, &g_pVertexBuffer, 0); CUSTOMVERTEX *pVertices; g_pVertexBuffer->Lock(0, 0, (void**)&pVertices, 0); multimap<int, GTP>::iterator index = terrainModel.m_gtp.m_GTPSet.begin(); for (size_t i = 0; i < terrainModel.m_gtp.m_GTPSet.size(); i++, index++) { for (int j = 0; j < 8; j++) { pVertices[ i*24+j*3 ] = CUSTOMVERTEX(terrainModel.m_ver[terrainModel.m_ts[ (*index).second.triangles[j] ][0]], 0.0f, 0.0f); pVertices[ i*24+j*3+1 ] = CUSTOMVERTEX(terrainModel.m_ver[terrainModel.m_ts[ (*index).second.triangles[j] ][1]], 1.0f, 0.0f); pVertices[ i*24+j*3+2 ] = CUSTOMVERTEX(terrainModel.m_ver[ terrainModel.m_ts[ (*index).second.triangles[j] ][2]], 1.0f, 1.0f); } } g_pVertexBuffer->Unlock(); CalP0(mP0); SagUpgrade(mP0, mPi, mQi, K, mm, mq, mbeta); UpgradeInit(); g_pCamera = new CameraClass(device); g_pCamera->SetCameraPosition(&D3DXVECTOR3(1200.0f, 548.03f, 1200.49f)); g_pCamera->SetTargetPosition(&D3DXVECTOR3(10156.0f, 1737.0f, 2000.49f)); g_pCamera->SetViewMatrix(); g_pCamera->SetProjMatrix(); D3DXCreateTextureFromFile(device, L"./img/0.jpg", &g_pTexture1); D3DXCreateTextureFromFile(device, L"./img/1.jpg", &g_pTexture2); D3DXCreateTextureFromFile(device, L"./img/2.jpg", &g_pTexture3); D3DXCreateTextureFromFile(device, L"./img/3.jpg", &g_pTexture4); D3DXCreateTextureFromFile(device, L"./img/4.jpg", &g_pTexture5); D3DXCreateTextureFromFile(device, L"./img/5.jpg", &g_pTexture6); device->SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE); device->SetRenderState(D3DRS_SHADEMODE, D3DSHADE_GOURAUD); device->SetRenderState(D3DRS_LIGHTING, false); return S_OK; } void UpgradeInit() { const int count = 8 * UTM.m_gtp.m_GTPSet.size(); device->CreateVertexBuffer(3 * count*sizeof(CUSTOMVERTEX), 0, D3DFVF_CUSTOMVERTEX, D3DPOOL_MANAGED, &g_pUpgradeVertexBuffer, 0); CUSTOMVERTEX *pVertices; g_pUpgradeVertexBuffer->Lock(0, 0, (void**)&pVertices, 0); multimap<int, GTP>::iterator index = UTM.m_gtp.m_GTPSet.begin(); for (size_t i = 0; i < UTM.m_gtp.m_GTPSet.size(); i++, index++) { for (int j = 0; j < 8; j++) { pVertices[i * 24 + j * 3] = CUSTOMVERTEX(UTM.m_ver[terrainModel.m_ts[(*index).second.triangles[j]][0]], 0.0f, 0.0f); pVertices[i * 24 + j * 3 + 1] = CUSTOMVERTEX(UTM.m_ver[terrainModel.m_ts[(*index).second.triangles[j]][1]], 1.0f, 0.0f); pVertices[i * 24 + j * 3 + 2] = CUSTOMVERTEX(UTM.m_ver[terrainModel.m_ts[(*index).second.triangles[j]][2]], 1.0f, 1.0f); } } g_pUpgradeVertexBuffer->Unlock(); } void UnitFrameStates() { device->SetFVF(NULL); device->SetRenderState(D3DRS_ZENABLE, D3DZB_TRUE); device->SetRenderState(D3DRS_FILLMODE, D3DFILL_SOLID); device->SetRenderState(D3DRS_ALPHATESTENABLE, FALSE); device->SetRenderState(D3DRS_ZWRITEENABLE, TRUE); device->SetRenderState(D3DRS_FOGENABLE, FALSE); device->SetSamplerState(0, D3DSAMP_ADDRESSU, D3DTADDRESS_WRAP); device->SetSamplerState(0, D3DSAMP_ADDRESSV, D3DTADDRESS_WRAP); device->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE); device->SetTextureStageState(0, D3DTSS_COLORARG2, D3DTA_CURRENT); device->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_SELECTARG1); device->SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE); device->SetTextureStageState(0, D3DTSS_ALPHAARG2, D3DTA_CURRENT); device->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1); device->SetSamplerState(0, D3DSAMP_MINFILTER, D3DTEXF_POINT); device->SetSamplerState(0, D3DSAMP_MAGFILTER, D3DTEXF_POINT); device->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_DISABLE); device->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE); device->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_ONE); device->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_ZERO); } void Direct3D_Render(HWND hwnd) { device->Clear(0, NULL, D3DCLEAR_TARGET|D3DCLEAR_ZBUFFER, 0xffffff, 1.0f, 0); RECT formatRect; GetClientRect(hwnd, &formatRect); vector<double> tm; for (int f = 0; f < 11; f++) { tm.push_back(terrainModel.m_ver[f].z - UTM.m_ver[f].z); } device->BeginScene(); if (upgrade == 1) { device->SetFVF(D3DFVF_CUSTOMVERTEX); device->SetStreamSource(0, g_pVertexBuffer, 0, sizeof(CUSTOMVERTEX)); int nums = 24 * terrainModel.m_gtp.m_GTPSet.size() / terrainModel.m_z; device->SetTexture(0, g_pTexture1); device->DrawPrimitive(D3DPT_TRIANGLELIST, 0, nums); device->SetTexture(0, g_pTexture2); device->DrawPrimitive(D3DPT_TRIANGLELIST, nums, nums); device->SetTexture(0, g_pTexture3); device->DrawPrimitive(D3DPT_TRIANGLELIST, 2 * nums, nums); device->SetTexture(0, g_pTexture4); device->DrawPrimitive(D3DPT_TRIANGLELIST, 3 * nums, nums); device->SetTexture(0, g_pTexture5); device->DrawPrimitive(D3DPT_TRIANGLELIST, 4 * nums, nums); device->SetTexture(0, g_pTexture6); device->DrawPrimitive(D3DPT_TRIANGLELIST, 5 * nums, nums); /*int nums1 = (terrainModel.m_x - 1)*(terrainModel.m_y - 1) * 2; int nums2 = (terrainModel.m_x - 1)*(terrainModel.m_y - 1) * 2 + (terrainModel.m_x - 1)*terrainModel.m_y * 2 + (terrainModel.m_y - 1)*terrainModel.m_x * 2; device->DrawPrimitive(D3DPT_TRIANGLELIST, 0, nums1); for (int k = 1; k <= terrainModel.m_z; k++) { device->SetTexture(0, g_pTexture[k]); nums1 += nums2; device->DrawPrimitive(D3DPT_TRIANGLELIST, 3*nums1, nums2); }*/ /*device->DrawIndexedPrimitive(D3DPT_TRIANGLELIST, 0, 0, terrainModel.m_ver.m_vertices.size(), 0, terrainModel.m_ts.m_triangleSet.size());*/ } else { device->SetFVF(D3DFVF_CUSTOMVERTEX); device->SetStreamSource(0, g_pUpgradeVertexBuffer, 0, sizeof(CUSTOMVERTEX)); int nums = 24 * UTM.m_gtp.m_GTPSet.size() / UTM.m_z; device->SetTexture(0, g_pTexture1); device->DrawPrimitive(D3DPT_TRIANGLELIST, 0, nums); device->SetTexture(0, g_pTexture2); device->DrawPrimitive(D3DPT_TRIANGLELIST, nums, nums); device->SetTexture(0, g_pTexture3); device->DrawPrimitive(D3DPT_TRIANGLELIST, 2 * nums, nums); device->SetTexture(0, g_pTexture4); device->DrawPrimitive(D3DPT_TRIANGLELIST, 3 * nums, nums); device->SetTexture(0, g_pTexture5); device->DrawPrimitive(D3DPT_TRIANGLELIST, 4 * nums, nums); device->SetTexture(0, g_pTexture6); device->DrawPrimitive(D3DPT_TRIANGLELIST, 5 * nums, nums); } int charCount = swprintf_s(g_strFPS, 20, _T("FPS:%0.0f"), Get_FPS()); pFont->DrawText(NULL, g_strFPS, charCount, &formatRect, DT_TOP | DT_LEFT, D3DCOLOR_XRGB(0, 0, 0)); UnitFrameStates(); device->EndScene(); device->Present(0, 0, 0, 0); } void SagUpgrade(const vector<double> P0, const double Pi, const double Qi, const vector<double> &K, const double m, const double q, const double beta) { UTM = terrainModel; shared_ptr<KeyLevel<double> > keylevel = make_shared<KeyLevel<double> >(E, H, V); shared_ptr<Sag> sag = make_shared<Sag>(P0, Pi, Qi, K[keylevel->GetKeyLevel()], m, q, beta); size_t z; int tmp = keylevel->GetKeyLevel(); for (z = 0; z < K.size() - keylevel->GetKeyLevel(); z++) { for (size_t x = 0; x < size_t(UTM.m_x); x++) { for (size_t y = 0; y < size_t(UTM.m_y); y++) { double Z = sag->Deflection(UTM.m_ver[z*UTM.m_x*UTM.m_y + y*UTM.m_x + x].x, UTM.m_ver[z*UTM.m_x*UTM.m_y + y*UTM.m_x + x].y, z); if (Z < 0.00000) { Z *= -1; } UTM.m_ver[z*UTM.m_x*UTM.m_y + y*UTM.m_x + x].SetZ(float(UTM.m_ver[z*UTM.m_x*UTM.m_y + y*UTM.m_x + x].z - Z)); } } } //非弯曲带整体下移煤层的高度 for (; z < size_t(UTM.m_z - 1); z++) { for (size_t x = 0; x < size_t(UTM.m_x); x++) { for (size_t y = 0; y < size_t(UTM.m_y); y++) { double diffZ = UTM.m_ver[(UTM.m_z - 1)*UTM.m_x*UTM.m_y + y*UTM.m_x + x].z - UTM.m_ver[(UTM.m_z - 2)*UTM.m_x*UTM.m_y + y*UTM.m_x + x].z; UTM.m_ver[z*UTM.m_x*UTM.m_y + y*UTM.m_x + x].SetZ(float(UTM.m_ver[z*UTM.m_x*UTM.m_y + y*UTM.m_x + x].z + diffZ)); } } } } void Direct3D_Update(HWND hwnd) { g_pD3DInput->GetInput(); if (g_pD3DInput->IsKeyDown(DIK_1) || g_pD3DInput->IsKeyDown(DIK_NUMPAD1)) device->SetRenderState(D3DRS_FILLMODE, D3DFILL_SOLID); if (g_pD3DInput->IsKeyDown(DIK_1) || g_pD3DInput->IsKeyDown(DIK_NUMPAD2)) device->SetRenderState(D3DRS_FILLMODE, D3DFILL_WIREFRAME); if (g_pD3DInput->IsKeyDown(DIK_A)) g_pCamera->MoveAlongRightVec(-1.0f); if (g_pD3DInput->IsKeyDown(DIK_D)) g_pCamera->MoveAlongRightVec(1.0f); if (g_pD3DInput->IsKeyDown(DIK_W)) g_pCamera->MoveAlongLookVec(1.0); if (g_pD3DInput->IsKeyDown(DIK_S)) g_pCamera->MoveAlongLookVec(-1.0f); if (g_pD3DInput->IsKeyDown(DIK_R)) g_pCamera->MoveAlongUpVec(1.0f); if (g_pD3DInput->IsKeyDown(DIK_F)) g_pCamera->MoveAlongUpVec(-1.0f); if (g_pD3DInput->IsKeyDown(DIK_LEFT)) g_pCamera->RotationUpVec(-0.003f); if (g_pD3DInput->IsKeyDown(DIK_RIGHT)) g_pCamera->RotationUpVec(0.003f); if (g_pD3DInput->IsKeyDown(DIK_UP)) g_pCamera->RotationRightVec(-0.003f); if (g_pD3DInput->IsKeyDown(DIK_DOWN)) g_pCamera->RotationRightVec(0.003f); if (g_pD3DInput->IsKeyDown(DIK_Q)) g_pCamera->RotationLookVec(0.001f); if (g_pD3DInput->IsKeyDown(DIK_E)) g_pCamera->RotationLookVec(-0.001f); if (g_pD3DInput->IsMouseButtonDown(0)) { g_pCamera->RotationUpVec(g_pD3DInput->MouseDX()* 0.001f); g_pCamera->RotationRightVec(g_pD3DInput->MouseDY() * 0.001f); } if (g_pD3DInput->IsKeyDown(DIK_U) && upgrade == 1) { upgrade ^= 1; } if (g_pD3DInput->IsKeyDown(DIK_Y) && upgrade == 0) { upgrade ^= 1; } D3DXMATRIX matView; g_pCamera->CalculateViewMatrix(&matView); device->SetTransform(D3DTS_VIEW, &matView); } void Direct3D_CleanUp() { SAFE_RELEASE(pFont); SAFE_RELEASE(device); } void InputModel(TerrainModel &terrainModel) { rif = new ReaderInfo<>("info.te"); Info info = rif->GetData(); terrainModel.m_x = info.countx; terrainModel.m_y = info.county; terrainModel.m_z = info.countz; rdt = new ReaderData<>("data.te"); terrainModel.m_ver = rdt->GetData(); int xPos, yPos, zPos; int countTri = 0; int countZ = info.countx * info.county; for (size_t i = 0; i < terrainModel.m_ver.m_vertices.size() - (terrainModel.m_x * terrainModel.m_y); i++) { zPos = i / (info.countx * info.county); yPos = i % (info.countx * info.county) / info.countx; xPos = i % (info.countx * info.county) % info.countx; if ((xPos + 1 < info.countx) && (yPos + 1 < info.county)) { uint32_t triSet[8]; Triangle triUp(i, i + info.countx, i + 1); terrainModel.m_ts.push(triUp); triSet[0] = countTri++; Triangle triRight1(i, i + countZ, i + countZ + info.countx); terrainModel.m_ts.push(triRight1); triSet[1] = countTri++; Triangle triRight2(i, i + info.countx, i + countZ + info.countx); terrainModel.m_ts.push(triRight2); triSet[2] = countTri++; Triangle triLeft1(i + 1, i + countZ + 1, i + info.countx); terrainModel.m_ts.push(triLeft1); triSet[3] = countTri++; Triangle triLeft2(i + info.countx + countZ, i + info.countx, i + countZ + 1); terrainModel.m_ts.push(triLeft2); triSet[4] = countTri++; Triangle triFront1(i, i + countZ + 1, i + 1); terrainModel.m_ts.push(triFront1); triSet[5] = countTri++; Triangle triFront2(i, i + countZ, i + countZ + 1); terrainModel.m_ts.push(triFront2); triSet[6] = countTri++; Triangle triDown(i + countZ, i + countZ + 1, i + countZ + info.countx); terrainModel.m_ts.push(triDown); triSet[7] = countTri++; GTP temp(triSet); terrainModel.m_gtp.push(temp, zPos); } if ((xPos - 1 >= 0) && (yPos - 1 >= 0)) { uint32_t triSet[8]; Triangle triUp(i, i - info.countx, i - 1); terrainModel.m_ts.push(triUp); triSet[0] = countTri++; Triangle triRight1(i, i + countZ, i + countZ - info.countx); terrainModel.m_ts.push(triRight1); triSet[1] = countTri++; Triangle triRight2(i, i - info.countx, i + countZ - info.countx); terrainModel.m_ts.push(triRight2); triSet[2] = countTri++; Triangle triLeft1(i - 1, i + countZ - 1, i - info.countx); terrainModel.m_ts.push(triLeft1); triSet[3] = countTri++; Triangle triLeft2(i - info.countx + countZ, i - info.countx, i + countZ - 1); terrainModel.m_ts.push(triLeft2); triSet[4] = countTri++; Triangle triFront1(i, i + countZ - 1, i - 1); terrainModel.m_ts.push(triFront1); triSet[5] = countTri++; Triangle triFront2(i, i + countZ, i + countZ - 1); terrainModel.m_ts.push(triFront2); triSet[6] = countTri++; Triangle triDown(i + countZ, i + countZ - 1, i + countZ - info.countx); terrainModel.m_ts.push(triDown); triSet[7] = countTri++; GTP temp(triSet); terrainModel.m_gtp.push(temp, zPos); } } } void CalP0(vector<double> &P0) { double sumHV = 0.0; double sumEH = 0.0; double EH; for (size_t index = 0; index < H.size(); index++) { EH = E[index] * pow(H[index], 3); sumEH += EH; sumHV += H[index] * V[index]; if (fabs(sumEH) < 0.00000001) { mP0.push_back(1.0); continue; } mP0.push_back(EH * sumHV / sumEH); } } float Get_FPS() { static float fps = 0; static int frameCount = 0; static float currentTime = 0.0f; static float lastTime = 0.0f; frameCount++; currentTime = timeGetTime()*0.001f; if (currentTime - lastTime > 1.0f) { fps = (float)frameCount / (currentTime - lastTime); lastTime = currentTime; frameCount = 0; } return fps; }
aab9d1fe165ba3130f854d1a919f178d4e8c07c5
f02d4250f0f48a94390d589a679c7f76743e505d
/src/cliff_data/src/cliff_data_node.cpp
b3696616a2b34c85e8c4d43ec17664aedc6497ab
[]
no_license
mhamester/myrobot
187076b2a0819be0e84a5da36cd13b074a5a0e1b
4bf0793f7959af5c4326f7810100b15dff2b2898
refs/heads/main
2023-02-15T09:30:26.220280
2021-01-07T18:48:49
2021-01-07T18:48:49
null
0
0
null
null
null
null
UTF-8
C++
false
false
5,354
cpp
/* Node to convert the IR range data to cliff data. IR ranges higher than cliff_mark_threshold are replaced with cliff_mark_distance. IR ranges lower than cliff_mark_threshold are replaced with a static value. Subscribes to topics publishing range data and publishes the cliff data to respective topics. */ #include <ros/ros.h> #include <sensor_msgs/Range.h> #include <std_msgs/Int32.h> ros::Publisher pub_cliff; ros::Publisher pub_cliff_back; ros::Publisher pub_cliff_left_1; ros::Publisher pub_cliff_right_1; ros::Publisher pub_cliff_left_2; ros::Publisher pub_cliff_right_2; double cliff_mark_threshold; double cliff_mark_distance; //IR range data to cliff data conversion float ir_to_cliff(double range){ if (range>cliff_mark_threshold) { return cliff_mark_distance; } else { return 10; } } void clbk_ir_front(const sensor_msgs::Range::ConstPtr& msg){ ROS_INFO("Range received"); sensor_msgs::Range cliff_range; cliff_range.header.stamp = ros::Time::now(); cliff_range.header.frame_id = msg->header.frame_id; cliff_range.radiation_type = msg->radiation_type; cliff_range.field_of_view = msg->field_of_view; cliff_range.min_range = msg->min_range; cliff_range.max_range = msg->max_range; cliff_range.range = ir_to_cliff(msg->range); pub_cliff.publish(cliff_range); } void clbk_ir_back(const sensor_msgs::Range::ConstPtr& msg){ ROS_INFO("Range received"); sensor_msgs::Range cliff_range; cliff_range.header.stamp = ros::Time::now(); cliff_range.header.frame_id = msg->header.frame_id; cliff_range.radiation_type = msg->radiation_type; cliff_range.field_of_view = msg->field_of_view; cliff_range.min_range = msg->min_range; cliff_range.max_range = msg->max_range; cliff_range.range = ir_to_cliff(msg->range); pub_cliff_back.publish(cliff_range); } void clbk_ir_left_1(const sensor_msgs::Range::ConstPtr& msg){ ROS_INFO("Range received"); sensor_msgs::Range cliff_range; cliff_range.header.stamp = ros::Time::now(); cliff_range.header.frame_id = msg->header.frame_id; cliff_range.radiation_type = msg->radiation_type; cliff_range.field_of_view = msg->field_of_view; cliff_range.min_range = msg->min_range; cliff_range.max_range = msg->max_range; cliff_range.range = ir_to_cliff(msg->range); pub_cliff_left_1.publish(cliff_range); } void clbk_ir_right_1(const sensor_msgs::Range::ConstPtr& msg){ ROS_INFO("Range received"); sensor_msgs::Range cliff_range; cliff_range.header.stamp = ros::Time::now(); cliff_range.header.frame_id = msg->header.frame_id; cliff_range.radiation_type = msg->radiation_type; cliff_range.field_of_view = msg->field_of_view; cliff_range.min_range = msg->min_range; cliff_range.max_range = msg->max_range; cliff_range.range = ir_to_cliff(msg->range); pub_cliff_right_1.publish(cliff_range); } void clbk_ir_left_2(const sensor_msgs::Range::ConstPtr& msg){ ROS_INFO("Range received"); sensor_msgs::Range cliff_range; cliff_range.header.stamp = ros::Time::now(); cliff_range.header.frame_id = msg->header.frame_id; cliff_range.radiation_type = msg->radiation_type; cliff_range.field_of_view = msg->field_of_view; cliff_range.min_range = msg->min_range; cliff_range.max_range = msg->max_range; cliff_range.range = ir_to_cliff(msg->range); pub_cliff_left_2.publish(cliff_range); } void clbk_ir_right_2(const sensor_msgs::Range::ConstPtr& msg){ ROS_INFO("Range received"); sensor_msgs::Range cliff_range; cliff_range.header.stamp = ros::Time::now(); cliff_range.header.frame_id = msg->header.frame_id; cliff_range.radiation_type = msg->radiation_type; cliff_range.field_of_view = msg->field_of_view; cliff_range.min_range = msg->min_range; cliff_range.max_range = msg->max_range; cliff_range.range = ir_to_cliff(msg->range); pub_cliff_right_2.publish(cliff_range); } int main(int argc, char **argv) { ros::init(argc, argv, "cliff_data"); ros::NodeHandle n; ros::NodeHandle nh; nh.getParam("cliff_mark_threshold", cliff_mark_threshold); nh.getParam("cliff_mark_distance", cliff_mark_distance); ros::Subscriber sub_ir =n.subscribe("/sensor/cliff_ir_front", 1, clbk_ir_front); ros::Subscriber sub_ir_back =n.subscribe("/sensor/cliff_ir_back", 1, clbk_ir_back); ros::Subscriber sub_ir_left_1 =n.subscribe("/sensor/cliff_ir_left_1", 1, clbk_ir_left_1); ros::Subscriber sub_ir_right_1 =n.subscribe("/sensor/cliff_ir_right_1", 1, clbk_ir_right_1); ros::Subscriber sub_ir_left_2 =n.subscribe("/sensor/cliff_ir_left_2", 1, clbk_ir_left_2); ros::Subscriber sub_ir_right_2 =n.subscribe("/sensor/cliff_ir_right_2", 1, clbk_ir_right_2); pub_cliff = n.advertise<sensor_msgs::Range>("/sensor/cliff_range_front", 1); pub_cliff_back = n.advertise<sensor_msgs::Range>("/sensor/cliff_range_back", 1); pub_cliff_left_1 = n.advertise<sensor_msgs::Range>("/sensor/cliff_range_left_1", 1); pub_cliff_right_1 = n.advertise<sensor_msgs::Range>("/sensor/cliff_range_right_1", 1); pub_cliff_left_2 = n.advertise<sensor_msgs::Range>("/sensor/cliff_range_left_2", 1); pub_cliff_right_2 = n.advertise<sensor_msgs::Range>("/sensor/cliff_range_right_2", 1); ros::spin(); }
1707264b62ee0da1732f7779f44f0d106a7ef8cb
6b2a8dd202fdce77c971c412717e305e1caaac51
/solutions_1595491_0/C++/Saibai/main.cpp
a4b693f6dad3db11d513e4539524138e272187a9
[]
no_license
alexandraback/datacollection
0bc67a9ace00abbc843f4912562f3a064992e0e9
076a7bc7693f3abf07bfdbdac838cb4ef65ccfcf
refs/heads/master
2021-01-24T18:27:24.417992
2017-05-23T09:23:38
2017-05-23T09:23:38
84,313,442
2
4
null
null
null
null
UTF-8
C++
false
false
1,929
cpp
// // main.cpp // Dancing with the Googlers // // Created by Sebastian Grail on 14/04/12. // Copyright (c) 2012 Sebastian Grail. All rights reserved. // #include <iostream> #include <vector> #include <fstream> using namespace std; int min(int a, int b); int maxSpecialCase(int number); int maxNormalCase(int number); vector<int>& getNumbersFromLine(ifstream& inputStream); int min(int a, int b) { return a<b ? a : b; } int maxNormalCase(int number) { return number/3 + (number%3!=0); } int maxSpecialCase(int number) { return number/3 +1 + (number%3==2); } vector<int>& getNumbersFromLine(ifstream& inputStream) { vector<int>* result = new vector<int>; string line; getline(inputStream,line); int startPos = 0; int endPos = (int)line.find(" ", startPos); while (startPos >= 0 ) { int element = atoi(line.substr(startPos, endPos-startPos).c_str()); result->push_back(element); if (endPos < 0) break; startPos=endPos+1; endPos = (int)line.find(" ", startPos); } return *result; } int main (int argc, const char * argv[]) { ifstream input; ofstream output; string line; input.open("/Users/sgrail/Desktop/B-small-attempt0.in.txt"); output.open("/Users/sgrail/Desktop/results.txt"); getline(input,line); int numberOfTestCases = atoi(line.c_str()); for (int i=0; i<numberOfTestCases; i++) { vector<int> numbers = getNumbersFromLine(input); //int N = numbers.at(0); int S = numbers.at(1); int p = numbers.at(2); int result = 0; int inSpecialCase = 0; for (int i=3; i<numbers.size(); i++) { int currentScore = numbers[i]; if (maxNormalCase(currentScore) >= p) result++; else if (currentScore > 1 && currentScore < 29) if (maxSpecialCase(currentScore) >= p) inSpecialCase++; } result += min(inSpecialCase, S); output << "Case #" << i+1 << ": " << result << endl; } input.close(); output.close(); return 0; }
39e49afc5d6cb6b0ed51319650c6c60ca67ae2cc
87984cd4f688e99fc83103a5598499652defa69c
/Giscad2018-V2/Inernal_V1/Utils_Internal/Utils/NSLogCollection.h
c4a145e588a1fe66e8edab6e9a9272cec9913a25
[]
no_license
2018-2019-backup/GISCAD
f9148193f05c4551dd6da57c32373c78d8de194d
d4e6f0b8620a4704bfa14dced16f290b55fd268c
refs/heads/master
2022-02-15T23:18:15.774091
2019-09-11T06:33:22
2019-09-11T06:33:22
203,347,300
3
3
null
null
null
null
UTF-8
C++
false
false
874
h
/*! @Class CNSLogCollection @Brief Maintains vector of error messages @Author Neilsoft Ltd @Date 12 June 2007 @History */ #pragma once #include <vector> #include "..\..\Include\NSDirectives.h" #include "..\..\Include\reporttypeenum.h" class CNSLogCollection { public: //methods CNSLogCollection(void); ~CNSLogCollection(void); TCHAR* GetLogAt(int iLogAt); int AddLog(TCHAR* szLogMessage); int AddLog(ErrRecord &er); size_t GetSize(); int CNSLogCollection::getNumberOfLogs(LOGTYPE enLogType, NSSTRING ErrorSeverity = _T("")); int getNumberOfLogsEx(LOGTYPE enLogType); void getLogErrorVector(std::vector<ErrRecord*> &vectLogErrRecs); void getLogInfoVector(std::vector<ErrRecord*> &vectLogErrRecs); private: //members std::vector<TCHAR*> m_vectLogMessages; std::vector<ErrRecord*> m_vectLogErrRecs; std::vector<ErrRecord*> m_vectInfoMessages; };
207bdca3b984991b9ed783d651ba0a05397bc230
a2e9639153e71dcf84d34b7349d69aa31b2eb678
/zBTLC/zBTLC/game_sa/CTaskComplexWanderGang.cpp
a35e83ff5c3fd2627df563d7ebf27a9ddf9f0225
[]
no_license
DaDj/GTA-BTLC
ade014b3d8dbb1ecce6422328be95631226cd6f4
15d60cb5d5f14291317235066d64a639fffaf3ea
refs/heads/master
2023-08-16T23:12:57.867204
2023-08-13T21:45:06
2023-08-13T21:45:06
83,485,003
4
2
null
null
null
null
UTF-8
C++
false
false
35
cpp
#include "CTaskComplexWanderGang.h"
eec4287424797df9b25ea9ee65d376dba5326eaa
d4b5ec96c0732ccf304671ea3c82eeb7536bbc2d
/src/tests_main.cpp
93a3a7b4def407463facfc7eb821b22708caeec2
[]
no_license
kam193/tkom
0e6cc5cd971a1ea002896c9d921c56685928d315
6f8951e6d9981e28144525b10e7e4701f927bbfc
refs/heads/master
2020-05-05T11:47:08.155676
2019-06-03T07:11:29
2019-06-03T07:11:29
180,003,921
0
0
null
null
null
null
UTF-8
C++
false
false
116
cpp
// Copyright 2019 Kamil Mankowski #define BOOST_TEST_MODULE tkom_tests #include <boost/test/included/unit_test.hpp>
42f675de066a131a7d701b02ca1e7fec83711bf7
e92d94f2e13a234593093858ab2e9f652584d6bf
/수강생/201502086유정호/lab2/201502086YooJungHo_5_2.cpp
2763f275aa65e22667b01736b5faf02d6a55fa0b
[]
no_license
wnsdudSoftkim/Introduction_to_computer_lab
62f2dfc213a189301887cb8041509a43f64b1d20
9bfd0b9963f9ff86670d0f3b04529233f2ad4b70
refs/heads/main
2023-05-14T23:36:29.921562
2021-06-07T13:32:48
2021-06-07T13:32:48
346,976,677
0
0
null
null
null
null
UTF-8
C++
false
false
467
cpp
/* #include <stdio.h> int main(void) { int a24, a12, min; printf("\nEnter a 24-hour time: "); scanf_s("%d:%d", &a24, &min); if (a24 > 12 && a24 <= 24) a12 = a24 - 12; else a12 = a24; printf("Equivalent 12-hour time: %d:%.2d ", a12, min); if (a24 == 24) printf("AM"); else if (a24 >= 12) printf("PM"); else printf("AM"); printf("\n\n"); return 0; } */
b452bcb1e2f3830a8d449d8e6605f9899989beac
90047daeb462598a924d76ddf4288e832e86417c
/ui/views/accessibility/ax_window_obj_wrapper.cc
0f08a3c8434892d11c5071a577d14714744b795b
[ "BSD-3-Clause" ]
permissive
massbrowser/android
99b8c21fa4552a13c06bbedd0f9c88dd4a4ad080
a9c4371682c9443d6e1d66005d4db61a24a9617c
refs/heads/master
2022-11-04T21:15:50.656802
2017-06-08T12:31:39
2017-06-08T12:31:39
93,747,579
2
2
BSD-3-Clause
2022-10-31T10:34:25
2017-06-08T12:36:07
null
UTF-8
C++
false
false
4,278
cc
// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "ui/views/accessibility/ax_window_obj_wrapper.h" #include <stddef.h> #include "base/strings/utf_string_conversions.h" #include "ui/accessibility/ax_node_data.h" #include "ui/accessibility/platform/aura_window_properties.h" #include "ui/aura/window.h" #include "ui/views/accessibility/ax_aura_obj_cache.h" #include "ui/views/widget/widget.h" namespace views { AXWindowObjWrapper::AXWindowObjWrapper(aura::Window* window) : window_(window), is_alert_(false) { window->AddObserver(this); } AXWindowObjWrapper::~AXWindowObjWrapper() { window_->RemoveObserver(this); window_ = NULL; } AXAuraObjWrapper* AXWindowObjWrapper::GetParent() { if (!window_->parent()) return NULL; return AXAuraObjCache::GetInstance()->GetOrCreate(window_->parent()); } void AXWindowObjWrapper::GetChildren( std::vector<AXAuraObjWrapper*>* out_children) { aura::Window::Windows children = window_->children(); for (size_t i = 0; i < children.size(); ++i) { if (!children[i]->IsVisible()) continue; out_children->push_back( AXAuraObjCache::GetInstance()->GetOrCreate(children[i])); } // Also consider any associated widgets as children. Widget* widget = Widget::GetWidgetForNativeView(window_); if (widget && widget->IsVisible()) out_children->push_back(AXAuraObjCache::GetInstance()->GetOrCreate(widget)); } void AXWindowObjWrapper::Serialize(ui::AXNodeData* out_node_data) { out_node_data->id = GetID(); out_node_data->role = is_alert_ ? ui::AX_ROLE_ALERT : ui::AX_ROLE_WINDOW; out_node_data->AddStringAttribute(ui::AX_ATTR_NAME, base::UTF16ToUTF8(window_->GetTitle())); out_node_data->state = 0; out_node_data->location = gfx::RectF(window_->GetBoundsInScreen()); ui::AXTreeIDRegistry::AXTreeID child_ax_tree_id = window_->GetProperty(ui::kChildAXTreeID); if (child_ax_tree_id != ui::AXTreeIDRegistry::kNoAXTreeID) { // Most often, child AX trees are parented to Views. We need to handle // the case where they're not here, but we don't want the same AX tree // to be a child of two different parents. // // To avoid this double-parenting, only add the child tree ID of this // window if the top-level window doesn't have an associated Widget. if (!window_->GetToplevelWindow() || Widget::GetWidgetForNativeView(window_->GetToplevelWindow())) { return; } out_node_data->AddIntAttribute(ui::AX_ATTR_CHILD_TREE_ID, child_ax_tree_id); } } int32_t AXWindowObjWrapper::GetID() { return AXAuraObjCache::GetInstance()->GetID(window_); } void AXWindowObjWrapper::OnWindowDestroyed(aura::Window* window) { AXAuraObjCache::GetInstance()->Remove(window, nullptr); } void AXWindowObjWrapper::OnWindowDestroying(aura::Window* window) { Widget* widget = Widget::GetWidgetForNativeView(window); if (widget) AXAuraObjCache::GetInstance()->Remove(widget); } void AXWindowObjWrapper::OnWindowHierarchyChanged( const HierarchyChangeParams& params) { if (params.phase == WindowObserver::HierarchyChangeParams::HIERARCHY_CHANGED) AXAuraObjCache::GetInstance()->Remove(params.target, params.old_parent); } void AXWindowObjWrapper::OnWindowBoundsChanged(aura::Window* window, const gfx::Rect& old_bounds, const gfx::Rect& new_bounds) { if (window != window_) return; AXAuraObjCache::GetInstance()->FireEvent(this, ui::AX_EVENT_LOCATION_CHANGED); Widget* widget = Widget::GetWidgetForNativeView(window); if (widget) { widget->GetRootView()->NotifyAccessibilityEvent( ui::AX_EVENT_LOCATION_CHANGED, true); } } void AXWindowObjWrapper::OnWindowPropertyChanged(aura::Window* window, const void* key, intptr_t old) { if (window == window_ && key == ui::kChildAXTreeID) { AXAuraObjCache::GetInstance()->FireEvent(this, ui::AX_EVENT_CHILDREN_CHANGED); } } } // namespace views
e125ecf60b956ff29c2ee4157e7fc0c06da32d95
9407b552787d3e872d8cdcfae5f86cd056042dfa
/nqueenproblem.cpp
598c6d6261fb73f75c4bd3e279c13cdc703b0d80
[]
no_license
themechanicalcoder/Data-Structure-And-Algorithms
7077c30cecdd42c8291c07b39089252d6cd672e3
3dc49f9926de10b2645e0b1c022ddbce932e208c
refs/heads/master
2021-06-19T21:12:35.973712
2020-12-18T10:58:03
2020-12-18T10:58:03
134,423,943
0
1
null
2020-03-22T11:18:56
2018-05-22T14:02:38
C++
UTF-8
C++
false
false
2,732
cpp
#define N 8 #include<stdio.h> /* A utility function to print solution */ void printSolution(int board[N][N]) { for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) printf(" %d ", board[i][j]); printf("\n"); } } /* A utility function to check if a queen can be placed on board[row][col]. Note that this function is called when "col" queens are already placed in columns from 0 to col -1. So we need to check only left side for attacking queens */ bool isSafe(int board[N][N], int row, int col) { int i, j; /* Check this row on left side */ for (i = 0; i < col; i++) if (board[row][i]) return false; /* Check upper diagonal on left side */ for (i=row, j=col; i>=0 && j>=0; i--, j--) if (board[i][j]) return false; /* Check lower diagonal on left side */ for (i=row, j=col; j>=0 && i<N; i++, j--) if (board[i][j]) return false; return true; } /* A recursive utility function to solve N Queen problem */ bool solveNQUtil(int board[N][N], int col) { /* base case: If all queens are placed then return true */ if (col >= N) return true; /* Consider this column and try placing this queen in all rows one by one */ for (int i = 0; i < N; i++) { /* Check if queen can be placed on board[i][col] */ if ( isSafe(board, i, col) ) { /* Place this queen in board[i][col] */ board[i][col] = 1; /* recur to place rest of the queens */ if ( solveNQUtil(board, col + 1) ) return true; /* If placing queen in board[i][col] doesn't lead to a solution, then remove queen from board[i][col] */ board[i][col] = 0; // BACKTRACK } } /* If queen can not be place in any row in this colum col then return false */ return false; } /* This function solves the N Queen problem using Backtracking. It mainly uses solveNQUtil() to solve the problem. It returns false if queens cannot be placed, otherwise return true and prints placement of queens in the form of 1s. Please note that there may be more than one solutions, this function prints one of the feasible solutions.*/ bool solveNQ() { int board[N][N] = { {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0} }; if ( solveNQUtil(board, 0) == false ) { printf("Solution does not exist"); return false; } printSolution(board); return true; } // driver program to test above function int main() { solveNQ(); return 0; }
a55bd15dc709c75d51752872604033dc238aefa3
87ea4e16b21a4ece2016a8ae003efda1eae99127
/Twacker.cpp
017fa3c37471de2439405499769973ebf92b4568
[]
no_license
kcheung2007/cgUI
c233c26302ba1d447274c54e5ff59b5b1ba7173d
693abd148f3be9f5127dbc06033c9e6359158ee6
refs/heads/master
2023-04-24T10:44:30.757539
2021-04-29T16:42:42
2021-04-29T16:42:42
362,882,273
0
0
null
null
null
null
WINDOWS-1250
C++
false
false
54,175
cpp
// File: twacker.c // RCS: $Header: $ // Description: Exerciser application program for Twain // Author: TWAIN Working Group // Created: Jan 15,92 // Modified: " // Language: C // Package: N/A // Status: Test tool // // (c) Copyright 1992, Hewlett-Packard Company, all rights reserved. // /* * Copyright © 1998 TWAIN Working Group: Adobe Systems Incorporated, * Canon Information Systems, Eastman Kodak Company, * Fujitsu Computer Products of America, Genoa Technology, * Hewlett-Packard Company, Intel Corporation, Kofax Image Products, * JFL Peripheral Solutions Inc., Ricoh Corporation, and Xerox Corporation. * All rights reserved. */ //---------------------------------------------------------------------- // I n c l u d e s //---------------------------------------------------------------------- // This is a TWAIN sample application. This simple application // will display .BMP files into a dynamically resized window. The handle // to the .BMP file is passed to this application via TWAIN protocol // from the underlying sample data source. // // The application was written assuming the use of MS Windows version 3.0. // It further assumes operation in Standard or Enhanced mode, no attempt // has been made to fit it into Real mode. #include "stdafx.h" #include <windows.h> // Req. for twain.h type defs and ... #include <math.h> #include <string.h> #include <stdlib.h> #include "twain.h" //#include "..\\twcommon\\twain.h" //#include "..\\twcommon\\twndebug.h" /* #ifdef WIN32 #include "res_32.h" #else #include "res_16.h" #endif */ #include "table.h" #include "dca_glue.h" // for function prototypes of glue code #include "dca_type.h" // contains function protos for this module #include "dca_acq.h" // contains buffered glue code function prototypes #include "dca_app.h" #include "special.h" #include "twacker.h" #include "captest.h" // SDH - 01/30/95: NULL under C with this compiler is void* not 0 which causes a // compiler warning. Rather than change every line, we kludge this here. #ifdef NULL #undef NULL #endif #define NULL 0 //---------------------------------------------------------------------- // V a r i a b l e s //---------------------------------------------------------------------- // Global variables HWND hMainWnd = NULL; // main app window handle static HGLOBAL _ghDIB = NULL; // handle to the current DIB static HBITMAP hbm = NULL; // holder handle to bit map passed from Source static HPALETTE hDibPal = NULL; // handle to palette char MainTitle[40]; BOOL CapSupportedCaps = FALSE; //BOOL done = FALSE; int nPosition = 0; /* Keep the scrollbar position */ BOOL bSelection = TRUE; /* To know the scrollbar in use TRUE for VSCROLL */ POINT Point = {0,0}; /* Coordinate for the upper-left corner */ POINT PtV = {0,0}, PtH = {0,0}; RECT Rect, rc; SCROLLINFO sbInfoV, sbInfoH; BOOL bHideV = FALSE; BOOL bHideH = FALSE; BOOL g_bSpecialMenu = FALSE; //---------------------------------------------------------------------- // F u n c t i o n s //---------------------------------------------------------------------- ///////////////////////////////////////////////////////////////////////// // FUNCTION: WinMain // // ARGS: hInstance handle to current instance // hPrevInstance handle to previous instance, if any // lpszCmdLine ptr to the command line string // CmdShow flag passed in from command line // // RETURNS: wParam // // NOTES: This is the main windows procedure. // int PASCAL WinMain (HANDLE hInstance, HANDLE hPrevInstance, LPSTR lpszCmdLine, int CmdShow) { MSG msg; OFSTRUCT of; memset(&msg, 0, sizeof(MSG)); memset(&of, 0, sizeof(OFSTRUCT)); ASSERT(hInstance); ASSERT(lpszCmdLine); // erase the twacker.log file OpenFile("c:\\twacker.log",&of,OF_DELETE); OpenFile("c:\\twsrc.log",&of,OF_DELETE); // NOTE: this allows multiple instances at the same time if (!InitTWMain(hInstance)) { return (FALSE); } if (!InitInstance(hInstance, CmdShow)) { return (FALSE); } // Initialize 3D engine //Ctl3dRegister(hInstance); //Ctl3dAutoSubclass(hInstance); // The main loop of the program. Get a Message; if it's not an // accelerator key, translate it and dispatch it to the application. #ifndef LOWOVERHEAD while (GetMessage((LPMSG)&msg, NULL, 0, 0)) { if (!ProcessTWMessage ((LPMSG)&msg, hMainWnd)) { TranslateMessage ((LPMSG)&msg); DispatchMessage ((LPMSG)&msg); } } #else while (GetMessage((LPMSG)&msg, NULL, 0, 0)) { if ((!TWIsDSOpen()) || (!ProcessTWMessage ((LPMSG)&msg, hMainWnd))) { TranslateMessage ((LPMSG)&msg); DispatchMessage ((LPMSG)&msg); } } #endif return (msg.wParam); } // WinMain ////////////////////////////////////////////////////////////////////////// // FUNCTION: InitTWMain // // ARGS: hInstance handle to current instance // // RETURNS: TRUE/FALSE, status of class registration // // NOTES: This function intializes and registers the class used by our // main window. // BOOL InitTWMain(HANDLE hInstance) { WNDCLASS wc; memset(&wc, 0, sizeof(WNDCLASS)); ASSERT(hInstance); // Set up application's main window wc.style = NULL; // no style bits wc.lpfnWndProc = (WNDPROC)TW_MainWndProc; // name of window proc wc.cbClsExtra = 0; // no extra bits wc.cbWndExtra = 0; wc.hInstance = hInstance; // handle to cur instance wc.hIcon = LoadIcon( hInstance, "TW_APP_ICO"); // load resources wc.hCursor = LoadCursor(NULL, IDC_ARROW); // load mouse icon wc.hbrBackground = GetStockObject(WHITE_BRUSH); // use white backgnd wc.lpszMenuName = NULL; // no menu wc.lpszClassName = "TW_App_MainWnd"; // class named return (RegisterClass(&wc)); } /////////////////////////////////////////////////////////////////////////////// // FUNCTION: InitInstance // // ARGS: hInstance handle to current instance // CmdShow flag from command line used for window visiblity // // RETURNS: TRUE, successful initialization // // NOTES: 1). Create main window // 2). initialize applications menus // 3). register application particulars with the glue code module // BOOL InitInstance(HANDLE hInstance, int CmdShow) { HWND hWnd = NULL; HMENU hMenu = NULL; TW_IDENTITY AppIdentity; TW_STR64 WindowTitle; TW_STR32 WindowHandle; memset(&AppIdentity, 0, sizeof(TW_IDENTITY)); memset(WindowTitle, 0, sizeof(TW_STR64)); memset(WindowHandle, 0, sizeof(TW_STR32)); ASSERT(hInstance); // Save the instance handle in static variable, which will be used in // many subsequence calls from this application to Windows. hInst = hInstance; hWait = LoadCursor(NULL, IDC_WAIT); hReady = LoadCursor(NULL, IDC_ARROW); // change the title if set through running parameters memset(WindowTitle,'\0',sizeof(WindowTitle)); if (MainTitle[0] != '\0') { memcpy(WindowTitle,MainTitle,strlen(MainTitle)); } else { LoadString(hInstance, IDS_WINDOWTITLE, WindowTitle, sizeof(WindowTitle)); } hWnd = CreateWindow("TW_App_MainWnd", WindowTitle, WS_VSCROLL | WS_HSCROLL | WS_OVERLAPPEDWINDOW, 0, 0, 500, 350, NULL, NULL, hInstance, NULL); // Save a copy of the main window handle globally hMainWnd = hWnd; GetWindowText(hWnd, WindowTitle, sizeof(TW_STR64)); wsprintf(WindowHandle, ""); lstrcat(WindowTitle, WindowHandle); SetWindowText(hWnd, WindowTitle); // all versions of twacker will share an ini file in the Windows directory // if fails, set to a reasonable default value if (GetWindowsDirectory(IniFile, sizeof(IniFile)) == 0) { ShowRC_CC(hWnd,0,0,0,"Unable to determine Windows directory", "Application Error"); lstrcpy(IniFile,"c:\\windows"); } lstrcat(IniFile,"\\twacker.ini"); // Add a menu to the window hMenu = LoadMenu (hInstance, "TW_APP_MENU"); SetMenu (hWnd, hMenu); if (!hWnd) { return (FALSE); } // Set up the information about your application which you want to pass to // the SM in this call. // // Move all these text strings off to a resource fill for a real application. // They are here for easier readablilty for the student. //TWAIN initialization AppIdentity.Id = 0; // init to 0, but Source Manager will assign real value AppIdentity.Version.MajorNum = 1; AppIdentity.Version.MinorNum = 703; AppIdentity.Version.Language = TWLG_USA; AppIdentity.Version.Country = TWCY_USA; #ifdef WIN32 lstrcpy (AppIdentity.Version.Info, "TWAIN_32 Twacker 1.7.0.3 01/18/1999"); lstrcpy (AppIdentity.ProductName, "TWACKER_32"); #else lstrcpy (AppIdentity.Version.Info, "TWAIN Twacker 1.7.0.3 01/18/1999"); lstrcpy (AppIdentity.ProductName, "TWACKER_16"); #endif AppIdentity.ProtocolMajor = 1;//TWON_PROTOCOLMAJOR; AppIdentity.ProtocolMinor = 7;//TWON_PROTOCOLMINOR; AppIdentity.SupportedGroups = DG_IMAGE | DG_CONTROL; lstrcpy (AppIdentity.Manufacturer, "TWAIN Working Group"); lstrcpy (AppIdentity.ProductFamily, "TWAIN Toolkit"); // pass app particulars to glue code TWInitialize (&AppIdentity, hWnd); SetMessageLevel(ML_ERROR); SetWindowPos (hWnd, (HWND)NULL,0,0,400,300,SWP_NOMOVE|SWP_NOZORDER); ShowWindow (hWnd, CmdShow); UpdateWindow (hWnd); return (TRUE); } ///////////////////////////////////////////////////////////////////////////////////// // FUNCTION: TW_MainWndProc // // ARGS: hWnd handle to main app window // iMessage windows message // wParam 1st windows parm (message specific information) // lParam 2nd windows parm // // RETURNS: 0L, indicates success // // NOTES: This routine services messages from windows event queue // 1). messages serviced: // - WM_CLOSE clean up after App, Source and Source Manager // - WM_ENDSESSION as above // - WM_PALETTECHANGING // - WM_PALETTECHANGED be aware of others changing palette // to redraw your bitmap // - WM_PAINT support painting of select bitmap in a window // - WM_COMMAND decode App menu items // - TW_APP_AQUIRE get input from current Source // - TW_APP_SELECT_SOURCE select/view available Source's // - TW_APP_QUIT exit the App, and graceful close // - TW_APP_ABOUT display App about box // // Note: use of the keyword _export on TW_MainWndProc causes a Borland // compiler warning message, 'Suspicious pointer conversion' // LRESULT FAR PASCAL TW_MainWndProc (HWND hWnd, UINT iMessage, WPARAM wParam, LPARAM lParam) { PAINTSTRUCT ps; HDC hDC = NULL, hMemDC = NULL; BITMAP bm; FARPROC lpProcAbout = NULL; // pointer to the "About" function FARPROC lpProcAuto = NULL; int ret = 0; static int FirstDraw = 0; // flag used to control window redraw TW_UINT16 wmId = 0; TW_UINT16 wmEvent = 0; #ifdef WIN32 wmId = LOWORD(wParam); wmEvent = HIWORD (wParam); #else wmId = wParam; wmEvent = HIWORD (lParam); #endif memset(&ps, 0, sizeof(PAINTSTRUCT)); memset(&bm, 0, sizeof(BITMAP)); ASSERT(hWnd); switch (iMessage) { //----------------------------------------------------------------- case WM_CLOSE: case WM_ENDSESSION: // Always try to take SM and Source down with you if(CloseApplication(hWnd)) { CleanKillApp(); DestroyWindow(hMainWnd); } break; case WM_DESTROY: TWIsDSEnabled(); break; //----------------------------------------------------------------- case WM_PALETTECHANGED: InvalidateRect (hWnd, NULL, FALSE); break; //case WM_SYSCOLORCHANGE: // Ctl3dColorChange(); // break; //----------------------------------------------------------------- case PM_XFERDONE: LogMessage("PM_XFERDONE\r\n"); // Get rid of old image first, because this App only deals with one CleanUpApp (); // get private message, hbm in wParam, from DCA_ACQ.C convert from // DCA_ACQ.C returns a DIB, so change to DDB for sample App if (wParam != NULL) { _ghDIB = (HGLOBAL)wParam; hbm = FixUp (hWnd, (HANDLE)wParam); // Test for valid handle if (hbm == NULL) { if (MessageLevel() >= ML_ERROR) { ShowRC_CC(hWnd, 0, 0, 0,"Handle to BitMap Invalid","PM_XFERDONE"); } } FirstDraw = TRUE; InvalidateRect(hWnd,NULL,TRUE); } break; //----------------------------------------------------------------- case WM_PAINT: { #ifdef _WIN32 int AddHeight = 0, AddWidth = 0; #endif GetWindowRect(hWnd, &Rect); hDC = BeginPaint(hWnd, &ps); if (hbm) { hMemDC = CreateCompatibleDC(hDC); /* * setup correct palette */ if (hDibPal) { SelectPalette (hDC, hDibPal, FALSE); SelectPalette (hMemDC, hDibPal, FALSE); RealizePalette (hDC); } GetObject(hbm, sizeof(BITMAP), (LPSTR) &bm); if (FirstDraw==TRUE) { LogMessage("Painting object first time\r\n"); SetWindowPos (hWnd, (HWND)NULL, Rect.left, Rect.top, Rect.right,Rect.bottom, SWP_NOMOVE | SWP_NOZORDER); // flag to adjust size only when first drawn ValidateRect (hWnd, NULL); FirstDraw = FALSE; } SelectObject(hMemDC, hbm); #ifdef _WIN32 /* * True is the vertical scroll bar action */ if (bSelection) { BitBlt(hDC, -Point.x, -sbInfoV.nPos, bm.bmWidth, bm.bmHeight, hMemDC, 0, 0, SRCCOPY); } /* * False is the horizontal scroll bar action */ else { BitBlt(hDC, -sbInfoH.nPos, -Point.y, bm.bmWidth, bm.bmHeight, hMemDC, 0, 0, SRCCOPY); } DrawScrollBar(hWnd, &sbInfoV, SB_VERT, bm); DrawScrollBar(hWnd, &sbInfoH, SB_HORZ, bm); #else //_WIN32 /* * True is the vertical scroll bar action */ if (bSelection) { BitBlt(hDC, -Point.x, -nPosition, bm.bmWidth, bm.bmHeight, hMemDC, 0, 0, SRCCOPY); } /* * False is the horizontal scroll bar action */ else { BitBlt(hDC, -nPosition, -Point.y, bm.bmWidth, bm.bmHeight, hMemDC, 0, 0, SRCCOPY); } SetScrollRange(hWnd, SB_VERT, 0, bm.bmHeight, FALSE); SetScrollRange(hWnd, SB_HORZ, 0, bm.bmWidth, FALSE); #endif //_WIN32 DeleteDC(hMemDC); } else { ShowScrollBar(hWnd, SB_VERT, FALSE); ShowScrollBar(hWnd, SB_HORZ, FALSE); } EndPaint(hWnd, &ps); } break; //----------------------------------------------------------------- case WM_SIZING: { LPRECT lprc = (LPRECT)lParam; LONG Width = 0; LONG Height = 0; int AddHeight = 0, AddWidth = 0; if (hbm) { GetWindowRect(hWnd, &Rect); GetObject(hbm, sizeof(BITMAP), (LPSTR)&bm); } else { bm.bmHeight = 0; bm.bmWidth = 0; } AddWidth = GetSystemMetrics(SM_CXVSCROLL); AddWidth += (2 * (GetSystemMetrics(SM_CYFRAME))); AddHeight = GetSystemMetrics(SM_CYMENU); AddHeight += GetSystemMetrics(SM_CYHSCROLL); AddHeight += GetSystemMetrics(SM_CYCAPTION); AddHeight += (2 * (GetSystemMetrics(SM_CXFRAME))); Height = Rect.top + bm.bmHeight; Width = Rect.left + bm.bmWidth; /* * Vertical scroll bar */ if (bm.bmWidth > 400) { if (lprc->right > Width) { if (lprc->bottom > Height) { AddWidth -= GetSystemMetrics(SM_CXVSCROLL); AddHeight -= GetSystemMetrics(SM_CYHSCROLL); } bHideV = TRUE; lprc->right = Width + AddWidth; } else if(lprc->right < Rect.left + 400) { bHideV = TRUE; lprc->right = Rect.left + 400; } else { bHideV = FALSE; } } else { bHideV = TRUE; lprc->right = Rect.left + 400; } if(bHideV == FALSE) { SetScrollInfo(hWnd, SB_VERT, &sbInfoV, TRUE); ShowScrollBar(hWnd, SB_VERT, TRUE); } else { ShowScrollBar(hWnd, SB_VERT, FALSE); } /* * Horizontal scroll bar */ if(bm.bmHeight > 300) { if(lprc->bottom > Height) { bHideH = TRUE; lprc->bottom = Height + AddHeight; } else if(lprc->bottom < Rect.top + 300) { bHideH = TRUE; lprc->bottom = Rect.top + 300; } else { bHideH = FALSE; } } else { bHideH = TRUE; lprc->bottom = Rect.top + 300; } if(bHideH == FALSE) { SetScrollInfo(hWnd, SB_HORZ, &sbInfoH, TRUE); ShowScrollBar(hWnd, SB_HORZ, TRUE); } else { ShowScrollBar(hWnd, SB_HORZ, FALSE); } } break; //----------------------------------------------------------------- /* * Generate the vertical scroll bar codes. */ case WM_VSCROLL: bSelection = TRUE; OnScrollBar(hWnd, SB_VERT, LOWORD(wParam), HIWORD(wParam), &sbInfoV); #ifdef _WIN32 InvalidateRect(hWnd, FALSE, FALSE); #else //_WIN32 InvalidateRect(hWnd, &rc, FALSE); #endif //_WIN32 break; //----------------------------------------------------------------- /* * Generate the Horizontal scroll bar codes. */ case WM_HSCROLL: bSelection = FALSE; OnScrollBar(hWnd, SB_HORZ, LOWORD(wParam), HIWORD(wParam), &sbInfoH); #ifdef _WIN32 InvalidateRect(hWnd, FALSE, FALSE); #else //_WIN32 InvalidateRect(hWnd, &rc, FALSE); #endif //_WIN32 break; //----------------------------------------------------------------- /* * Generate the key down codes. */ case WM_KEYDOWN: OnKeyDown(hWnd, LOWORD(wParam)); #ifdef _WIN32 InvalidateRect(hWnd, FALSE, FALSE); #else //_WIN32 InvalidateRect(hWnd, &rc, FALSE); #endif //_WIN32 break; //----------------------------------------------------------------- case WM_COMMAND: switch (wmId) { //----------------------------------------------------------------- case TW_APP_ACQUIRE: { TW_INT16 Flag = 0; HMENU hmenu = GetMenu(hWnd); //Setup dsID for default Source if (!TWIsDSOpen()) { dsID.Id = 0; dsID.ProductName[0] = 0; appID.Id = 0; } // 1 Disable/CloseDS/CloseDSM // 3 Do Not Disable - only if ShowUI=TRUE Flag = (!(GetMenuState(hmenu, TW_APP_SHOW, MF_BYCOMMAND) & MF_CHECKED) || (GetMenuState(hmenu, TW_APP_DISABLE_AFTER, MF_BYCOMMAND) & MF_CHECKED)) ? 1 : 3; if (TWAcquire(hWnd,GetMenuState(hmenu, TW_APP_SHOW, MF_BYCOMMAND) & MF_CHECKED,Flag)) { CheckSpecialMenu(hWnd, TW_APP_ENABLE); LogMessage("Acquire OK\r\n"); } else { LogMessage("Acquire returned false\r\n"); //InvalidateRect(NULL,NULL,FALSE); } break; } //----------------------------------------------------------------- case TW_APP_SETUP: { TW_INT16 Flag = 0; HMENU hmenu = GetMenu(hWnd); /* * Setup dsID for default Source */ if (!TWIsDSOpen()) { dsID.Id = 0; dsID.ProductName[0] = 0; appID.Id = 0; } /* * 1 Disable/CloseDS/CloseDSM * 3 Do Not Disable - only if ShowUI=TRUE */ Flag = (!(GetMenuState(hmenu, TW_APP_SHOW, MF_BYCOMMAND) & MF_CHECKED) || (GetMenuState(hmenu, TW_APP_DISABLE_AFTER, MF_BYCOMMAND) & MF_CHECKED)) ? 1 : 3; if (TWSetup(hWnd, Flag)) { CheckSpecialMenu(hWnd, TW_APP_ENABLE); LogMessage("Setup OK\r\n"); } else { LogMessage("Setup returned false\r\n"); } break; } //----------------------------------------------------------------- case TW_APP_SELECT_SOURCE: // SM userselect, or standard SM based user interface to Source's // - open dsm // - show user the data sources found by the SM // allow user to pick a particular Source // - close the SM if (TWOpenDSM () == TRUE) { TWSelectDS (); TWCloseDSM (NULL); if (!TWIsDSMOpen()) { CheckSpecialMenu(hWnd, TW_APP_CLOSESM); } } break; //----------------------------------------------------------------- /* * For Save the Bitmap image */ case TW_APP_SAVE: SaveBitmap(hWnd, _ghDIB); break; //----------------------------------------------------------------- case TW_APP_QUIT: // The Source asks to be closed when parent is killed but message is never // processed by our message loop. if(CloseApplication(hWnd)) { CleanKillApp(); DestroyWindow(hMainWnd); } break; //----------------------------------------------------------------- case TW_APP_OPENSM: { HMENU hmenu = GetMenu(hWnd); SetCursor(hWait); if (!TWIsDSMOpen()) { if (TWOpenDSM()) { GreyMenu (TRUE); CheckSpecialMenu(hWnd, TW_APP_OPENSM); } } else { if (MessageLevel() >= ML_ERROR) { ShowRC_CC(hWnd, 0, 0, 0, "Source manager already open\r\n", "Sequence Error"); } } SetCursor(hReady); } break; //----------------------------------------------------------------- case TW_APP_OPENDS: { SetCursor(hWait); if (!TWIsDSOpen()) { if (TWOpenDS()) { GreyMenu (TRUE); CheckSpecialMenu(hWnd, TW_APP_OPENDS); } } else { if (MessageLevel() >= ML_ERROR) { ShowRC_CC(hWnd, 0, 0, 0, "Source already open\r\n", "Sequence Error"); } } SetCursor(hReady); } break; //----------------------------------------------------------------- case TW_APP_SEND: { SendTwain(hWnd); if(TWIsDSMOpen() && TWIsDSOpen()) { CheckSpecialMenu(hWnd, TW_APP_SEND); } } break; //----------------------------------------------------------------- case TW_APP_ENABLE: { HMENU hmenu = GetMenu(hWnd); BOOL bMenuState = (BOOL)GetMenuState(hmenu,TW_APP_SHOW,MF_BYCOMMAND) & MF_CHECKED; if(TWEnableDS((TW_BOOL)bMenuState)) { CheckSpecialMenu(hWnd, TW_APP_ENABLE); //AcqFlag = 0 Do Not Accept MSG_XFERREADY // 1 Disable/CloseDS/CloseDSM // 2 Disable Only // 3 Do Not Disable - only if ShowUI=TRUE // SDH - 01/30/95 - Correct 32-bit compiler warning. // SetAcqFlag( // (!(GetMenuState(hmenu, TW_APP_SHOW, MF_BYCOMMAND) & MF_CHECKED) // || // (GetMenuState(hmenu, TW_APP_DISABLE_AFTER, MF_BYCOMMAND) & MF_CHECKED)) // ? 2 : 3); SetAcqFlag((TW_INT16) ((!(GetMenuState(hmenu, TW_APP_SHOW, MF_BYCOMMAND) & MF_CHECKED) || (GetMenuState(hmenu, TW_APP_DISABLE_AFTER, MF_BYCOMMAND) & MF_CHECKED)) ? 2 : 3)); g_bSpecialMenu = TRUE; } } break; //----------------------------------------------------------------- case TW_APP_TRANSFER: { HMENU hmenu = GetMenu(hWnd); SetCursor(hWait); if (TWIsDSEnabled()) { if (MessageLevel() >= ML_ERROR) { ShowRC_CC(hWnd, 0, 0, 0, "Cannot Setup for Transfer\nSource already enabled", "TWAIN Error"); } } else { if (!TWIsDSMOpen()) { if (MessageLevel() >= ML_ERROR) { ShowRC_CC(hWnd, 0, 0, 0, "Cannot Transfer\nSource Manager not Open", "TWAIN Error"); } } else { if (!TWIsDSOpen()) { if (MessageLevel() >= ML_ERROR) { ShowRC_CC(hWnd, 0, 0, 0, "Cannot Transfer\nSource not Open", "TWAIN Error"); } } else { CheckSpecialMenu(hWnd, TW_APP_TRANSFER); //Transfer mechnism is read from File Menu // Delete the following line if xfermech is to be set // on the Send Menu if (TWXferMech(hWnd) == TWRC_SUCCESS) { //Do not check Autofeed on File menu // if settings are to be done through Send Menu if (TWAutofeedMenu(hWnd) == TWRC_SUCCESS) { if (TWEnableDS((TW_BOOL)(GetMenuState(hmenu, TW_APP_SHOW, MF_BYCOMMAND) & MF_CHECKED))) { //Success // 2 Disable // 3 Do Not Disable - only if ShowUI=TRUE // SDH - 01/30/95 - Correct 32-bit compiler warning. // SetAcqFlag( // (!(GetMenuState(hmenu, TW_APP_SHOW,MF_BYCOMMAND)&MF_CHECKED) // || // (GetMenuState(hmenu,TW_APP_DISABLE_AFTER,MF_BYCOMMAND)&MF_CHECKED)) // ? 2 : 3); SetAcqFlag((TW_INT16) ((!(GetMenuState(hmenu, TW_APP_SHOW,MF_BYCOMMAND)&MF_CHECKED) || (GetMenuState(hmenu,TW_APP_DISABLE_AFTER,MF_BYCOMMAND)&MF_CHECKED)) ? 2 : 3)); } } } } } } g_bSpecialMenu = TRUE; SetCursor(hReady); } break; //----------------------------------------------------------------- case TW_APP_DISABLE: { SetCursor(hWait); if (TWDisableDS()) { CheckSpecialMenu(hWnd, TW_APP_DISABLE); } SetCursor(hReady); g_bSpecialMenu = FALSE; } break; //----------------------------------------------------------------- case TW_APP_CLOSEDS: { HMENU hmenu = GetMenu(hWnd); SetCursor(hWait); if (TWCloseDS()) { dsID.Id = 0; CheckSpecialMenu(hWnd, TW_APP_CLOSEDS); GreyMenu (TRUE); } SetCursor(hReady); g_bSpecialMenu = FALSE; } break; //----------------------------------------------------------------- case TW_APP_CLOSESM: { HMENU hmenu = GetMenu(hWnd); SetCursor(hWait); if (TWCloseDSM(NULL)) { CheckSpecialMenu(hWnd, TW_APP_CLOSESM); GreyMenu (FALSE); } SetCursor(hReady); g_bSpecialMenu = FALSE; } break; //----------------------------------------------------------------- case TW_APP_BUFFER: case TW_APP_FILE: case TW_APP_NATIVE: { HMENU hmenu = GetMenu(hWnd); CheckMenuItem(hmenu,TW_APP_NATIVE,MF_BYCOMMAND|MF_UNCHECKED); CheckMenuItem(hmenu,TW_APP_FILE,MF_BYCOMMAND|MF_UNCHECKED); CheckMenuItem(hmenu,TW_APP_BUFFER,MF_BYCOMMAND|MF_UNCHECKED); CheckMenuItem(hmenu,wParam,MF_BYCOMMAND|MF_CHECKED); } break; //----------------------------------------------------------------- case TW_APP_SHOW: { HMENU hmenu = GetMenu(hWnd); TW_INT16 flag = 0; flag = GetMenuState(hmenu, TW_APP_SHOW, MF_BYCOMMAND) & MF_CHECKED; CheckMenuItem(hmenu, TW_APP_SHOW, MF_BYCOMMAND | (flag)?MF_UNCHECKED:MF_CHECKED); } break; //----------------------------------------------------------------- case TW_APP_MSG_NONE: { HMENU hmenu = GetMenu(hWnd); CheckMenuItem(hmenu,TW_APP_MSG_NONE,MF_BYCOMMAND|MF_CHECKED); CheckMenuItem(hmenu,TW_APP_MSG_ERROR,MF_BYCOMMAND|MF_UNCHECKED); CheckMenuItem(hmenu,TW_APP_MSG_INFO,MF_BYCOMMAND|MF_UNCHECKED); CheckMenuItem(hmenu,TW_APP_MSG_FULL,MF_BYCOMMAND|MF_UNCHECKED); SetMessageLevel(ML_NONE); } break; //----------------------------------------------------------------- case TW_APP_MSG_ERROR: { HMENU hmenu = GetMenu(hWnd); CheckMenuItem(hmenu,TW_APP_MSG_NONE,MF_BYCOMMAND|MF_UNCHECKED); CheckMenuItem(hmenu,TW_APP_MSG_ERROR,MF_BYCOMMAND|MF_CHECKED); CheckMenuItem(hmenu,TW_APP_MSG_INFO,MF_BYCOMMAND|MF_UNCHECKED); CheckMenuItem(hmenu,TW_APP_MSG_FULL,MF_BYCOMMAND|MF_UNCHECKED); SetMessageLevel(ML_ERROR); } break; //----------------------------------------------------------------- case TW_APP_MSG_INFO: { HMENU hmenu = GetMenu(hWnd); CheckMenuItem(hmenu,TW_APP_MSG_NONE,MF_BYCOMMAND|MF_UNCHECKED); CheckMenuItem(hmenu,TW_APP_MSG_ERROR,MF_BYCOMMAND|MF_UNCHECKED); CheckMenuItem(hmenu,TW_APP_MSG_INFO,MF_BYCOMMAND|MF_CHECKED); CheckMenuItem(hmenu,TW_APP_MSG_FULL,MF_BYCOMMAND|MF_UNCHECKED); SetMessageLevel(ML_INFO); } break; //----------------------------------------------------------------- case TW_APP_MSG_FULL: { HMENU hmenu = GetMenu(hWnd); CheckMenuItem(hmenu,TW_APP_MSG_NONE,MF_BYCOMMAND|MF_UNCHECKED); CheckMenuItem(hmenu,TW_APP_MSG_ERROR,MF_BYCOMMAND|MF_UNCHECKED); CheckMenuItem(hmenu,TW_APP_MSG_INFO,MF_BYCOMMAND|MF_UNCHECKED); CheckMenuItem(hmenu,TW_APP_MSG_FULL,MF_BYCOMMAND|MF_CHECKED); SetMessageLevel(ML_FULL); } break; //----------------------------------------------------------------- case TW_APP_AUTOFEED: { HMENU hmenu = GetMenu(hWnd); TW_INT16 flag = 0; flag = GetMenuState(hmenu, TW_APP_AUTOFEED, MF_BYCOMMAND) & MF_CHECKED; CheckMenuItem(hmenu, TW_APP_AUTOFEED, MF_BYCOMMAND | (flag)?MF_UNCHECKED:MF_CHECKED); } break; //----------------------------------------------------------------- case TW_APP_DISABLE_AFTER: { HMENU hmenu = GetMenu(hWnd); TW_INT16 flag = 0; flag = GetMenuState(hmenu, TW_APP_DISABLE_AFTER, MF_BYCOMMAND) & MF_CHECKED; CheckMenuItem(hmenu, TW_APP_DISABLE_AFTER, MF_BYCOMMAND | (flag)?MF_UNCHECKED:MF_CHECKED); } break; //----------------------------------------------------------------- case TW_APP_ABOUT: lpProcAbout = MakeProcInstance((FARPROC)AboutDlgProc, hInst); DialogBox (hInst, "TW_APP_ABOUTBOX", hWnd, lpProcAbout); FreeProcInstance(lpProcAbout); break; //----------------------------------------------------------------- default: break; } break; default: return DefWindowProc (hWnd, iMessage, wParam, lParam); } return 0L ; } /* * Function: DrawScrollBar * Author: Nancy Létourneau / J.F.L. Peripheral Solutions Inc. / TWAIN Working Group * Date: May 29/1998 * Input: * hWnd - handle to main app window * si - pointer to a SCROLLINFO structure * nScroll_Id - Type of scroll bar * bm - Current bitmap * Output: none * Comment: * This function is call in the WM_PAINT message and it draw the * scroll bar. */ void DrawScrollBar(HWND hWnd, SCROLLINFO* si, int nScroll_Id, BITMAP bm) { BOOL Hide = FALSE; int AddSize = 0; ASSERT(hWnd); if (nScroll_Id == SB_VERT) { si->nMax = bm.bmHeight; AddSize = GetSystemMetrics(SM_CYMENU); AddSize += GetSystemMetrics(SM_CYCAPTION); AddSize += GetSystemMetrics(SM_CXFRAME); AddSize += 1; if(bHideV == FALSE) { AddSize += GetSystemMetrics(SM_CYHSCROLL); } si->nPage = (Rect.bottom - Rect.top) - (bm.bmHeight / Rect.bottom + AddSize); } else { si->nMax = bm.bmWidth; AddSize = GetSystemMetrics(SM_CYFRAME); AddSize += 1; if (bHideH == FALSE) { AddSize += GetSystemMetrics(SM_CXVSCROLL); } si->nPage = (Rect.right - Rect.left) - (bm.bmWidth / Rect.right + AddSize); } si->cbSize = sizeof(SCROLLINFO); si->fMask = SIF_ALL; SetScrollInfo(hWnd, nScroll_Id, si, TRUE); if (nScroll_Id == SB_VERT) { if((Rect.bottom - Rect.top) > bm.bmHeight) { Hide = TRUE; } } else { if((Rect.right - Rect.left) > bm.bmWidth) { Hide = TRUE; } } if(Hide == FALSE) { SetScrollInfo(hWnd, nScroll_Id, si, TRUE); ShowScrollBar(hWnd, nScroll_Id, TRUE); } else { ShowScrollBar(hWnd, nScroll_Id, FALSE); } return; } /* * Function: SaveBitmap * Author: Nancy Létourneau / J.F.L. Peripheral Solutions Inc. / TWAIN Working Group * Date: June 1st/1998 * Input: * hWnd - handle to main app window * Output: none * Comment: * This function save the bitmap in a file. */ void SaveBitmap(HWND hWnd, HGLOBAL _hDIB) { /* * Declared locals */ static OPENFILENAME ofn; char szDirName[256]; char szFile[256]; char szFileTitle[256]; char chReplace = '|'; char szFilter[256]; BITMAPFILEHEADER bfh; BITMAPINFOHEADER *pBIH = NULL; HANDLE hf = NULL; UINT i = 0, cbString = 0; /* * Initialize all structures */ memset(&ofn, 0, sizeof(OPENFILENAME)); memset(szDirName, 0, sizeof(char[256])); memset(szFile, 0, sizeof(char[256])); memset(szFileTitle, 0, sizeof(char[256])); memset(szFilter, 0, sizeof(char[256])); memset(&bfh, 0, sizeof(BITMAPFILEHEADER)); /* * We are expecting a valid HWND */ ASSERT(hWnd); if(_hDIB) { /* * Make sure only .bmp file extensions are possible */ GetCurrentDirectory(sizeof(szDirName), szDirName); szFile[0] = '\0'; cbString = LoadString(hInst, IDS_FILTERSTRING, szFilter, sizeof(szFilter)); for(i = 0;szFilter[i] != '\0';i++) { if(szFilter[i] == chReplace) { szFilter[i] = '\0'; } } /* * Fill in the open file structure */ memset(&ofn, 0, sizeof(OPENFILENAME)); ofn.lStructSize = sizeof(OPENFILENAME); ofn.hwndOwner = hWnd; ofn.hInstance = NULL; ofn.lpstrFilter = szFilter; ofn.lpstrCustomFilter = (LPSTR)NULL; ofn.nFilterIndex = 1; ofn.lpstrFile = szFile; ofn.nMaxFile = sizeof(szFile); ofn.lpstrFileTitle = szFileTitle; ofn.nMaxFileTitle = sizeof(szFileTitle); ofn.lpstrInitialDir = szDirName; ofn.lpstrTitle = (LPSTR)NULL; ofn.Flags = OFN_SHOWHELP|OFN_OVERWRITEPROMPT; ofn.nFileOffset = NULL; ofn.nFileExtension = NULL; ofn.lpstrDefExt = (LPSTR)"bmp"; ofn.lCustData = 0L; ofn.lpfnHook = NULL; ofn.lpTemplateName = (LPSTR)NULL; /* * Get the user to provide the destination name */ GetSaveFileName(&ofn); hf = CreateFile(ofn.lpstrFile, GENERIC_WRITE, 0, (LPSECURITY_ATTRIBUTES)NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, (HANDLE)NULL); if(hf) { /* * Get a pointer to the beginning of the DIB */ pBIH = (BITMAPINFOHEADER*)GlobalLock(_hDIB); if(pBIH) { DWORD dwBytesWritten = 0l; /* * Fill in the Bitmap File Header */ bfh.bfType = ( (WORD) ('M' << 8) | 'B'); /* * Calculate the size of the bitmap including the palette */ bfh.bfSize = sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER) + ((((pBIH->biWidth * pBIH->biBitCount + 31)/32) * 4) * pBIH->biHeight) + pBIH->biClrUsed * sizeof(RGBQUAD); bfh.bfReserved1 = 0; bfh.bfReserved2 = 0; /* * Offset to actual bits is after palette */ bfh.bfOffBits = sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER) + pBIH->biClrUsed * sizeof(RGBQUAD); ASSERT(bfh.bfSize > sizeof(BITMAPFILEHEADER)); /* * Write the results */ WriteFile(hf, &bfh, sizeof(BITMAPFILEHEADER), &dwBytesWritten, NULL); WriteFile(hf, pBIH, bfh.bfSize-sizeof(BITMAPFILEHEADER), &dwBytesWritten, NULL); /* * Done now */ GlobalUnlock(_hDIB); } CloseHandle(hf); } } return; } /* * Function: CloseApplication * Author: Nancy Létourneau / J.F.L. Peripheral Solutions Inc. / TWAIN Working Group * Date: May 25/1998 * Input: * hWnd - handle to main app window * Output: * TRUE if successful closing * Comment: * Close the application but make sure that the Source and the * Source Manager already close. */ BOOL CloseApplication(HWND hWnd) { int Message = 0; ASSERT(hWnd); /* * if the source is enable */ if (TWIsDSEnabled()) { Message = MessageBox (NULL, "Disable and close the Source\n\rand unload and close the Source Manager?", "Close message", MB_OKCANCEL); if (Message == IDOK) { if (TWDisableDS()) { if (TWCloseDS()) { if (TWCloseDSM(NULL)) { CheckSpecialMenu(hWnd, TW_APP_CLOSESM); } } } return TRUE; } else { return FALSE; } } /* * if the source is open */ if (TWIsDSOpen()) { Message = MessageBox (NULL, "Close the Source and unload \n\rand close the Source Manager?", "Close message", MB_OKCANCEL); if (Message == IDOK) { if (TWCloseDS()) { if (TWCloseDSM(NULL)) { CheckSpecialMenu(hWnd, TW_APP_CLOSESM); } } return TRUE; } else { return FALSE; } } /* * if the source manager is open */ if (TWIsDSMOpen()) { Message = MessageBox (NULL, "Unload and close the Source Manager?", "Close message", MB_OKCANCEL); if (Message == IDOK) { if (TWCloseDSM(NULL)) { CheckSpecialMenu(hWnd, TW_APP_CLOSESM); } return TRUE; } else { return FALSE; } } /* * if nothing is open */ if (!TWIsDSEnabled() & !TWIsDSOpen() & !TWIsDSMOpen()) { return TRUE; } } /* * Function: InitTwainCombo * Author: TWAIN Working Group * Input: * hDlg - Handle for the Dialog * Id - Id for Combo box reference. * pTable - Contain the new list of items for each combo box. * nSizeTable - Maximum of items in each list. * Output: * Return 1 when all is set. * Comments: * Sets the combo box values for the special menu dialog. */ TW_INT16 InitTwainCombo(HWND hDlg, TW_INT16 Id, pTABLEENTRY pTable, int nSizeTable) { TW_INT16 result = 0; int i = 0; ASSERT(hDlg); ASSERT(pTable); /* * Reset old content, prepare to replace with new list */ SendDlgItemMessage(hDlg, Id, CB_RESETCONTENT, 0, 0); for (i = 0; i < nSizeTable; i++) { int nIndex = SendDlgItemMessage(hDlg, Id, CB_ADDSTRING , 0, (LPARAM)(pTABLEENTRY)pTable[i].pszItemName); if(nIndex >= 0) { /* * Store reference to the Table Entry associated with this string */ SendDlgItemMessage(hDlg, Id, CB_SETITEMDATA, (WPARAM)nIndex, (LPARAM)&pTable[i]); } #ifdef _DEBUG else { TRACE("Serious problem adding item %s, to Combo box.\n", (pTABLEENTRY)pTable[i].pszItemName); } #endif //_DEBUG } SendDlgItemMessage(hDlg, Id, CB_SETCURSEL, 0, 0L); result = 1; return result; } ///////////////////////////////////////////////////////////////////////////// // FUNCTION: CleanUpApp // // ARGS: none // // RETURNS: none // // NOTES: 1). delete any bit maps laying around // 2). delete any palettes laying around // VOID CleanUpApp (VOID) { /* * Free any previous DIB image */ if(_ghDIB) { GlobalFree(_ghDIB); _ghDIB = NULL; } if (hbm) { DeleteObject(hbm); } hbm = NULL; if (hDibPal) { DeleteObject(hDibPal); } hDibPal = NULL; return; } ///////////////////////////////////////////////////////////////////////////// // FUNCTION: CleanKillApp // // ARGS: none // // RETURNS: none // // NOTES: 1). delete any bit maps laying around // 2). post window quit message // VOID CleanKillApp (VOID) { CleanUpApp(); PostQuitMessage(0); return; } ///////////////////////////////////////////////////////////////////////////// // FUNCTION: DibNumColors // // ARGS: pv pointer to bitmap data // // RETURNS: number of colors, 0, 2, 16, 256, in the DIB // // NOTES: // WORD DibNumColors (VOID FAR *pv) { int Bits = 0; LPBITMAPINFOHEADER lpbi = NULL; LPBITMAPCOREHEADER lpbc = NULL; ASSERT(pv); lpbi = ((LPBITMAPINFOHEADER)pv); lpbc = ((LPBITMAPCOREHEADER)pv); // With the BITMAPINFO format headers, the size of the palette // is in biClrUsed, whereas in the BITMAPCORE - style headers, it // is dependent on the bits per pixel ( = 2 raised to the power of // bits/pixel). if (lpbi->biSize != sizeof(BITMAPCOREHEADER)) { if (lpbi->biClrUsed != 0) { return (WORD)lpbi->biClrUsed; } Bits = lpbi->biBitCount; } else { Bits = lpbc->bcBitCount; } switch (Bits) { case 1: return 2; case 4: return 16; case 8: return 256; default: // A 24 bitcount DIB has no color table return 0; } } ///////////////////////////////////////////////////////////////////////////// // FUNCTION: FixUp -- Creates a device independent bitmap and frees the bmp // handle memory. // // ARGS: hDib handle to DIB // // RETURNS: hBitMap handle to a DDB // HBITMAP FixUp(HWND hWnd, HANDLE hDib) { LPBITMAPINFOHEADER lpDib = NULL, lpBi = NULL; LPSTR lpBits = NULL; DWORD dwColorTableSize = 0; HBITMAP hBitMap = NULL; HDC hDC = NULL; ASSERT(hWnd); ASSERT(hDib); if (hDib == NULL) { return(NULL); } if ((lpDib = (LPBITMAPINFOHEADER) GlobalLock(hDib))==NULL) { if (MessageLevel() >= ML_ERROR) { ShowRC_CC(hWnd, 0, 0, 0, "Could Not Lock Bitmap Memory", "FixUp in TWACKER.C"); } return(NULL); } lpBi = lpDib; // Calculate the color table size, then point past the BITMAPINFOHEADER // and color table, to the byte array of bitmap bits. dwColorTableSize = (DWORD)(DibNumColors (lpDib) * sizeof(RGBQUAD)); lpBits = (LPSTR)lpDib + lpBi->biSize + dwColorTableSize; // Create a logical palette based on the colors in the DIB header, // and realize it hDC = GetDC(hMainWnd); if (hDibPal = CreateBIPalette (lpBi)) { SelectPalette (hDC, hDibPal, FALSE); RealizePalette (hDC); } // Microsoft confirmed a defect in CreateDIBitmap whereas the function // failed with handles to 1Meg or larger 1 color bitmaps. The workaround // is to create a device dependent bitmap whenever a 1 color bitmap // is detected. if (lpDib->biBitCount == 1) { // create a device dependent monochrome bitmap hBitMap = CreateBitmap((int)lpDib->biWidth,(int)lpDib->biHeight,1,1,lpBits); if(hBitMap) { SetDIBits(hDC,hBitMap,0,(UINT)lpDib->biHeight,lpBits,(LPBITMAPINFO)lpDib,DIB_RGB_COLORS); } } else { // Create a device-independent bitmap from the BMP hBitMap = CreateDIBitmap (hDC, lpDib, (LONG)CBM_INIT, (LPSTR)lpBits, (LPBITMAPINFO)lpDib, DIB_RGB_COLORS); } GlobalUnlock(hDib); ReleaseDC (hMainWnd, hDC); // GlobalUnlock(hDib); // Return handle to device-dependent bitmap return(hBitMap); } ///////////////////////////////////////////////////////////////////////////// // CreateBIPalette // // ARGS: lpbi pointer to a BITMAPINFO structure // // RETURNS: hPalette handle to the created palette // // NOTES: Given a Pointer to a BITMAPINFO struct will create a // GDI palette object from the color table. // HPALETTE CreateBIPalette (LPBITMAPINFOHEADER lpbi) { HGLOBAL hPal = NULL; LOGPALETTE *pPal = NULL; HPALETTE hPalette = NULL; WORD nNumColors = 0; BYTE Red = 0; BYTE Green = 0; BYTE Blue = 0; WORD i = 0; RGBQUAD FAR *pRgb = NULL; ASSERT(lpbi); if (!lpbi) { return NULL; } if (lpbi->biSize != sizeof(BITMAPINFOHEADER)) { return NULL; } // Get a pointer to the color table and the number of colors in it pRgb = (RGBQUAD FAR *)((LPSTR)lpbi + (WORD)lpbi->biSize); nNumColors = DibNumColors(lpbi); if (nNumColors) { // Allocate for the logical palette structure // SDH - 02/01/95 - For compatability with the Large model... // pPal = (LOGPALETTE*)LocalAlloc(LPTR,sizeof(LOGPALETTE) + nNumColors * // sizeof(PALETTEENTRY)); hPal = GlobalAlloc(GPTR,sizeof(LOGPALETTE) + nNumColors * sizeof(PALETTEENTRY)); pPal = (LOGPALETTE*)(GlobalLock (hPal)); if (!pPal) { return NULL; } pPal->palNumEntries = nNumColors; pPal->palVersion = PALVERSION; // Fill in the palette entries from the DIB color table and // create a logical color palette. for (i = 0; i < nNumColors; i++) { pPal->palPalEntry[i].peRed = pRgb[i].rgbRed; pPal->palPalEntry[i].peGreen = pRgb[i].rgbGreen; pPal->palPalEntry[i].peBlue = pRgb[i].rgbBlue; pPal->palPalEntry[i].peFlags = (BYTE)0; } hPalette = CreatePalette(pPal); GlobalUnlock(hPal); GlobalFree(hPal); } else if (lpbi->biBitCount == 24) { // A 24 bitcount DIB has no color table entries so, set // the number of to the maximum value (256). nNumColors = MAXPALETTE; hPal = GlobalAlloc(GPTR,sizeof(LOGPALETTE) + nNumColors * sizeof(PALETTEENTRY)); pPal = (LOGPALETTE*)GlobalLock (hPal); if (!pPal) { return NULL; } pPal->palNumEntries = nNumColors; pPal->palVersion = PALVERSION; Red = Green = Blue = 0; // Generate 256 (= 8*8*4) RGB combinations to fill // the palette entries. for (i = 0; i < pPal->palNumEntries; i++) { pPal->palPalEntry[i].peRed = Red; pPal->palPalEntry[i].peGreen = Green; pPal->palPalEntry[i].peBlue = Blue; pPal->palPalEntry[i].peFlags = (BYTE)0; if (!(Red += 32)) { if (!(Green += 32)) { Blue += 64; } } } hPalette = CreatePalette(pPal); GlobalUnlock(hPal); GlobalFree(hPal); } return hPalette; } ///////////////////////////////////////////////////////////////////////////// // CheckSpecialMenu -- Checks the item in the specials main window menu corresponding // to the current state. // // ARGS: The Menu Item to check on the Special Menu // All others will be unchecked // // RETURNS: VOID // VOID CheckSpecialMenu(HWND hWndofApp, TW_INT16 CkMenu) { HMENU hmenu = GetMenu(hWndofApp); ASSERT(hWndofApp); CheckMenuItem(hmenu,TW_APP_OPENSM,MF_BYCOMMAND|MF_UNCHECKED); CheckMenuItem(hmenu,TW_APP_OPENDS,MF_BYCOMMAND|MF_UNCHECKED); CheckMenuItem(hmenu,TW_APP_SEND,MF_BYCOMMAND|MF_UNCHECKED); CheckMenuItem(hmenu,TW_APP_ENABLE,MF_BYCOMMAND|MF_UNCHECKED); CheckMenuItem(hmenu,TW_APP_TRANSFER,MF_BYCOMMAND|MF_UNCHECKED); CheckMenuItem(hmenu,TW_APP_DISABLE,MF_BYCOMMAND|MF_UNCHECKED); CheckMenuItem(hmenu,TW_APP_CLOSEDS,MF_BYCOMMAND|MF_UNCHECKED); CheckMenuItem(hmenu,TW_APP_CLOSESM,MF_BYCOMMAND|MF_UNCHECKED); CheckMenuItem(hmenu,CkMenu,MF_BYCOMMAND|MF_CHECKED); return; } /////////////////////////////////////////////////////////////////////////// // CheckIfAcquire -- Checks the main menu items for acquire types based on // the attribute passed in. This is done to keep the SET Capability call in // sync with the RUN Acquire command. SET Capability ICAP_XFERMECH can be // used in place of the SET ____Xfer call. // void CheckIfAcquire(char attribute[]) { HMENU hmenu = NULL; UINT type = 99; hmenu = GetMenu(hMainWnd); if (memcmp(attribute,"TWSX_FILE",sizeof("TWSX_FILE"))==0) { type = TW_APP_FILE; } else if (memcmp(attribute,"TWSX_NATIVE",sizeof("TWSX_NATIVE"))==0) { type = TW_APP_NATIVE; } else if (memcmp(attribute,"TWSX_MEMORY",sizeof("TWSX_MEMORY"))==0) { type = TW_APP_BUFFER; } if (type != 99) { CheckMenuItem(hmenu,TW_APP_NATIVE,MF_BYCOMMAND|MF_UNCHECKED); CheckMenuItem(hmenu,TW_APP_FILE,MF_BYCOMMAND|MF_UNCHECKED); CheckMenuItem(hmenu,TW_APP_BUFFER,MF_BYCOMMAND|MF_UNCHECKED); CheckMenuItem(hmenu,type,MF_BYCOMMAND|MF_CHECKED); } return; } /* * Function: OnScrollBar * Author: Nancy Létourneau / J.F.L. Peripheral Solutions Inc. / TWAIN Working Group * Date: March 1998 * Input: hWnd - Handle to window with scroll bar. * nScroll_Id - Type of scroll bar. * code - Scroll bar value. * Pos - Scroll box position. * Output: * Comments: Intercept the scrollbar code, depend what the user press. */ void OnScrollBar(HWND hWnd, int nScroll_Id, UINT code, int Pos, SCROLLINFO *sbInfo) { int nTmp = 0; int nPageSize = 0; ASSERT(hWnd); /* * To keep the coordinate of the upper-left corner. * Put the value of the coordinate in a tempory variable */ if (nScroll_Id == SB_VERT) { nTmp = Point.y; } else { nTmp = Point.x; } #ifdef _WIN32 { int AddSize = 0; GetScrollInfo(hWnd, nScroll_Id, sbInfo); nPageSize = sbInfo->nPage; switch(code) { /* * When you press the "HOME" key. */ case SB_TOP: sbInfo->nPos = sbInfo->nMin; nTmp = sbInfo->nMin; break; /* * When you press the "END" key. */ case SB_BOTTOM: sbInfo->nPos = sbInfo->nMax; nTmp = sbInfo->nMax; break; case SB_LINEUP: if ((int)sbInfo->nPos > 0) { sbInfo->nPos -= 1; nTmp -= 1; } break; case SB_LINEDOWN: if ((int)sbInfo->nPos < sbInfo->nMax) { sbInfo->nPos += 1; nTmp += 1; } break; case SB_PAGEUP: if ((UINT)sbInfo->nPos < sbInfo->nPage) { nPageSize = sbInfo->nPos; } sbInfo->nPos -= nPageSize; nTmp -= nPageSize; break; case SB_PAGEDOWN: if ((UINT)sbInfo->nPos > sbInfo->nMax - sbInfo->nPage) { nPageSize = sbInfo->nMax - sbInfo->nPage; } sbInfo->nPos += nPageSize; nTmp += nPageSize; break; case SB_THUMBTRACK: sbInfo->nPos = sbInfo->nTrackPos; nTmp = sbInfo->nTrackPos; break; case SB_ENDSCROLL: return; } /* * Put back the value in the good coordinate. */ if (nScroll_Id == SB_VERT) { if(code == SB_PAGEUP || code == SB_PAGEDOWN) { AddSize = GetSystemMetrics(SM_CYMENU); AddSize += GetSystemMetrics(SM_CYCAPTION); AddSize += GetSystemMetrics(SM_CXFRAME); if(bHideV == FALSE) { AddSize += GetSystemMetrics(SM_CYHSCROLL); } if(sbInfo->nPos > sbInfo->nMax - Rect.bottom) { Point.y = sbInfo->nMax - Rect.bottom + AddSize; } else { Point.y = nTmp; } } else { Point.y = nTmp; } } else { if(code == SB_PAGEUP || code == SB_PAGEDOWN) { AddSize = GetSystemMetrics(SM_CYFRAME); if (bHideH == FALSE) { AddSize += GetSystemMetrics(SM_CXVSCROLL); } if(sbInfo->nPos > sbInfo->nMax - Rect.right) { Point.x = sbInfo->nMax - Rect.right + AddSize; } else { Point.x = nTmp; } } else { Point.x = nTmp; } } SetScrollInfo(hWnd, nScroll_Id, sbInfo, TRUE); } #else //_WIN32 { int nTemp = 0; int nScrPos = 0; int nDiff = 0; int nMax = 0; intnMin = 0; nPosition = GetScrollPos(hWnd, nScroll_Id); GetScrollRange(hWnd, nScroll_Id, &nMin, &nMax); switch(code) { /* * When you press the "HOME" key. */ case SB_TOP: nPosition = nMin; Point.y = nMin; Point.x = nMin; nScrPos = nMax; nTmp = nMin; break; /* * When you press the "END" key. */ case SB_BOTTOM: nPosition = nMax; Point.y = nMax; Point.x = nMax; nScrPos = nMax; nTmp = nMax; break; case SB_LINEUP: if ((int)nPosition > 0) { nPosition -= 1; nTmp -= 1; nScrPos = 1; nDiff -= 1; } break; case SB_LINEDOWN: if ((int)nPosition < nMax) { nPosition += 1; nTmp += 1; nScrPos = -1; nDiff += 1; } break; case SB_PAGEUP: if ((int)nPosition > 0) { nPosition -= nPageSize; nTmp -= nPageSize; nScrPos = nPageSize; nDiff -= nPageSize; } break; case SB_PAGEDOWN: if ((int)nPosition < nMax) { nPosition += nPageSize; nTmp += nPageSize; nScrPos = -nPageSize; nDiff += nPageSize; } break; case SB_THUMBTRACK: nTemp = nPosition; nPosition = Pos; nScrPos = (nTemp - nPosition); nDiff = -(nTemp - nPosition); break; case SB_THUMBPOSITION: nPosition = Pos; nTmp = Pos; break; } /* * Put back the value in the good coordinate. */ if (nScroll_Id == SB_VERT) { Point.y = nTmp; } else { Point.x = nTmp; } SetScrollPos(hWnd, nScroll_Id, nPosition, TRUE); /* * Condition for the vertical scroll */ if (nScroll_Id == SB_VERT) { if (nDiff > 0) { rc.left = Rect.left; rc.top = Rect.bottom - nDiff; rc.right = Rect.right; rc.bottom = Rect.bottom; } else { rc.left = Rect.left; rc.top = Rect.top; rc.right = Rect.right; rc.bottom = Rect.top + nDiff; } ScrollWindow(hWnd, 0, nScrPos, NULL, NULL); } /* * Condition for the horizontal scroll */ else { if (nDiff > 0) { rc.left = Rect.right - nDiff; rc.top = Rect.top; rc.right = Rect.right; rc.bottom = Rect.bottom; } else { rc.left = Rect.left; rc.top = Rect.top; rc.right = Rect.left + nDiff; rc.bottom = Rect.bottom; } ScrollWindow(hWnd, nScrPos, 0, NULL, NULL); } } #endif //_WIN32 return; } /* * Function: OnKeyDown * Author: Nancy Létourneau / J.F.L. Peripheral Solutions Inc. / TWAIN Working Group * Date: March 1998 * Input: hWnd - Handle to window with scroll bar. * vk - Key data. * Output: * Comments: Intercept the key down woh go with the scrollbar. */ void OnKeyDown(HWND hWnd, UINT vk) { ASSERT(hWnd); switch(vk) { case VK_HOME: SendMessage(hWnd, WM_VSCROLL, SB_TOP, 0L); SendMessage(hWnd, WM_HSCROLL, SB_TOP, 0L); break; case VK_END: SendMessage(hWnd, WM_VSCROLL, SB_BOTTOM, 0L); SendMessage(hWnd, WM_HSCROLL, SB_BOTTOM, 0L); break; case VK_DOWN: SendMessage(hWnd, WM_VSCROLL, SB_LINEDOWN, 0L); break; case VK_UP: SendMessage(hWnd, WM_VSCROLL, SB_LINEUP, 0L); break; case VK_PRIOR: SendMessage(hWnd, WM_VSCROLL, SB_PAGEUP, 0L); break; case VK_NEXT: SendMessage(hWnd, WM_VSCROLL, SB_PAGEDOWN, 0L); break; case VK_LEFT: SendMessage(hWnd, WM_HSCROLL, SB_LINEUP, 0L); break; case VK_RIGHT: SendMessage(hWnd, WM_HSCROLL, SB_LINEDOWN, 0L); break; } }
[ "GTGA@MERCY" ]
GTGA@MERCY
65509996ef83a4454cb3bec3b12062b2bc1735c8
e2a0a3aef77e4620c5811854db8322ffe5e28f33
/piscine_cpp/d05/ex02/Form.hpp
08797b268e3f7963a362c8df545fe33185b6216c
[]
no_license
davidmimouni/42
de5236ead969fdfe7fa7337e559b93edcdcf053a
4928af759738399f04ad374baff780f25b12d70c
refs/heads/master
2020-03-30T04:02:38.456559
2016-04-17T21:30:19
2016-04-17T21:30:19
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,971
hpp
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* Form.hpp :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: tdurand <[email protected]> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/04/11 13:58:36 by tdurand #+# #+# */ /* Updated: 2016/04/11 13:58:37 by tdurand ### ########.fr */ /* */ /* ************************************************************************** */ #ifndef FORM_H # define FORM_H #include <string> #include <stdexcept> #include "Bureaucrat.hpp" class Bureaucrat; class Form { public: class GradeTooHighException : public std::exception { public: GradeTooHighException( void ); GradeTooHighException( GradeTooHighException const & src); virtual ~GradeTooHighException( void ) throw(); GradeTooHighException & operator=( GradeTooHighException const & rhs); virtual const char * what() const throw(); }; class GradeTooLowException : public std::exception { public: GradeTooLowException( void ); GradeTooLowException( GradeTooLowException const & src); virtual ~GradeTooLowException( void ) throw(); GradeTooLowException & operator=( GradeTooLowException const & rhs); virtual const char * what() const throw(); }; class NotSignedException : public std::exception { public: NotSignedException( void ); NotSignedException( NotSignedException const & src); virtual ~NotSignedException( void ) throw(); NotSignedException & operator=( NotSignedException const & rhs); virtual const char * what() const throw(); }; Form( Form const & src); virtual ~Form( void ); Form & operator=( Form const & rhs); std::string getName() const; int getMinSign() const; int getMinExec() const; bool getSigned() const; std::string getTarget() const; void beSigned(Bureaucrat const & rhs); virtual void execute(Bureaucrat const & executor) const = 0; protected: Form( void ); Form( std::string n, int ms, int me, std::string t ); void checkExec(Bureaucrat const & rhs) const; void setTarget(std::string t); void setSigned(bool s); private: std::string const _name; int const _minSign; int const _minExec; bool _signed; std::string _target; }; std::ostream & operator<<( std::ostream & o, Form const & rhs); #endif
38043c23fd3a9aad5ab8a32bd348bd2e01343877
43a54d76227b48d851a11cc30bbe4212f59e1154
/cwp/include/tencentcloud/cwp/v20180228/model/DescribeOpenPortTaskStatusRequest.h
5598ecfc94eced0513fd342161d4930acc076f0a
[ "Apache-2.0" ]
permissive
make1122/tencentcloud-sdk-cpp
175ce4d143c90d7ea06f2034dabdb348697a6c1c
2af6954b2ee6c9c9f61489472b800c8ce00fb949
refs/heads/master
2023-06-04T03:18:47.169750
2021-06-18T03:00:01
2021-06-18T03:00:01
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,442
h
/* * Copyright (c) 2017-2019 THL A29 Limited, a Tencent company. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef TENCENTCLOUD_CWP_V20180228_MODEL_DESCRIBEOPENPORTTASKSTATUSREQUEST_H_ #define TENCENTCLOUD_CWP_V20180228_MODEL_DESCRIBEOPENPORTTASKSTATUSREQUEST_H_ #include <string> #include <vector> #include <map> #include <tencentcloud/core/AbstractModel.h> namespace TencentCloud { namespace Cwp { namespace V20180228 { namespace Model { /** * DescribeOpenPortTaskStatus请求参数结构体 */ class DescribeOpenPortTaskStatusRequest : public AbstractModel { public: DescribeOpenPortTaskStatusRequest(); ~DescribeOpenPortTaskStatusRequest() = default; std::string ToJsonString() const; /** * 获取云镜客户端唯一Uuid。 * @return Uuid 云镜客户端唯一Uuid。 */ std::string GetUuid() const; /** * 设置云镜客户端唯一Uuid。 * @param Uuid 云镜客户端唯一Uuid。 */ void SetUuid(const std::string& _uuid); /** * 判断参数 Uuid 是否已赋值 * @return Uuid 是否已赋值 */ bool UuidHasBeenSet() const; private: /** * 云镜客户端唯一Uuid。 */ std::string m_uuid; bool m_uuidHasBeenSet; }; } } } } #endif // !TENCENTCLOUD_CWP_V20180228_MODEL_DESCRIBEOPENPORTTASKSTATUSREQUEST_H_
0e93ad424369da1eac9336c5950218b19be47c0b
440f814f122cfec91152f7889f1f72e2865686ce
/src/database_server/protocol/storage_mail_read_types.h
c83519563f38b4dd1f8c231627c569689a08aac4
[]
no_license
hackerlank/buzz-server
af329efc839634d19686be2fbeb700b6562493b9
f76de1d9718b31c95c0627fd728aba89c641eb1c
refs/heads/master
2020-06-12T11:56:06.469620
2015-12-05T08:03:25
2015-12-05T08:03:25
null
0
0
null
null
null
null
UTF-8
C++
false
true
3,299
h
/** * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ #ifndef storage_mail_read_TYPES_H #define storage_mail_read_TYPES_H #include <thrift/Thrift.h> #include <thrift/TApplicationException.h> #include <thrift/protocol/TProtocol.h> #include <thrift/transport/TTransport.h> #include "mail_types.h" namespace database { namespace protocol { struct MailReadField { enum type { CONTEXT = 0, ITEM1 = 1, ITEM1_NUM = 2, ITEM2 = 3, ITEM2_NUM = 4, ITEM3 = 5, ITEM3_NUM = 6, ITEM4 = 7, ITEM4_NUM = 8, ITEM5 = 9, ITEM5_NUM = 10, GOLD = 11, FREEDOM_DOLLARS = 12, MAX = 13 }; }; extern const std::map<int, const char*> _MailReadField_VALUES_TO_NAMES; class StorageReadMailRequest { public: static const char* ascii_fingerprint; // = "9C2A05F173B50306037BDE9AE30E1B99"; static const uint8_t binary_fingerprint[16]; // = {0x9C,0x2A,0x05,0xF1,0x73,0xB5,0x03,0x06,0x03,0x7B,0xDE,0x9A,0xE3,0x0E,0x1B,0x99}; StorageReadMailRequest() : mail_id_(0), id_(0) { } virtual ~StorageReadMailRequest() throw() {} int32_t mail_id_; int64_t id_; void __set_mail_id_(const int32_t val) { mail_id_ = val; } void __set_id_(const int64_t val) { id_ = val; } bool operator == (const StorageReadMailRequest & rhs) const { if (!(mail_id_ == rhs.mail_id_)) return false; if (!(id_ == rhs.id_)) return false; return true; } bool operator != (const StorageReadMailRequest &rhs) const { return !(*this == rhs); } bool operator < (const StorageReadMailRequest & ) const; uint32_t read(::apache::thrift::protocol::TProtocol* iprot); uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; }; void swap(StorageReadMailRequest &a, StorageReadMailRequest &b); class StorageReadMailResponse { public: static const char* ascii_fingerprint; // = "6FDCE32D599F88A07698BD7083300048"; static const uint8_t binary_fingerprint[16]; // = {0x6F,0xDC,0xE3,0x2D,0x59,0x9F,0x88,0xA0,0x76,0x98,0xBD,0x70,0x83,0x30,0x00,0x48}; StorageReadMailResponse() : context_(), id_(0), mail_id_(0) { } virtual ~StorageReadMailResponse() throw() {} ::entity::MailAffix affix_; std::string context_; int64_t id_; int32_t mail_id_; void __set_affix_(const ::entity::MailAffix& val) { affix_ = val; } void __set_context_(const std::string& val) { context_ = val; } void __set_id_(const int64_t val) { id_ = val; } void __set_mail_id_(const int32_t val) { mail_id_ = val; } bool operator == (const StorageReadMailResponse & rhs) const { if (!(affix_ == rhs.affix_)) return false; if (!(context_ == rhs.context_)) return false; if (!(id_ == rhs.id_)) return false; if (!(mail_id_ == rhs.mail_id_)) return false; return true; } bool operator != (const StorageReadMailResponse &rhs) const { return !(*this == rhs); } bool operator < (const StorageReadMailResponse & ) const; uint32_t read(::apache::thrift::protocol::TProtocol* iprot); uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; }; void swap(StorageReadMailResponse &a, StorageReadMailResponse &b); }} // namespace #endif
7fab50cf5140d6688438875e10d6637400a98fbf
761b60becb9597d61b2412aa6fac77b6724188be
/GenerateTree/PrimTree.cpp
7aa53d22507c0b857430dc533ad910d950b262e4
[]
no_license
rammiah/Algorithm
8db34e5049d12e655b58dcb9e29de35ff43ce1ca
280ef329c39fc610575c3bbbceae9b85cb11bac9
refs/heads/master
2022-12-13T17:48:53.923618
2022-12-01T17:08:22
2022-12-01T17:08:22
87,947,258
0
0
null
null
null
null
UTF-8
C++
false
false
2,076
cpp
#include <iostream> #include <fstream> #include <vector> #include <limits.h> std::vector<std::vector<float>> graph; // store the edges std::vector<std::pair<int, int>> tree; void input_graph(const std::string file_name) { std::fstream in; in.open(file_name, std::ios_base::in); int v_count = 0, e_count = 0; in >> v_count >> e_count; graph = std::vector<std::vector<float>>(v_count, std::vector<float>(v_count, -1)); // used = std::vector<bool>(v_count, false); int v1, v2; float distance = 0; for (int i = 0; i < e_count; ++i) { in >> v1 >> v2 >> distance; graph[v1][v2] = graph[v2][v1] = distance; } in.close(); } float prim_tree() { // stop when tree.size == v_count - 1 int v_count = graph.size(); std::vector<bool> used(v_count, false); // start with v 0 int v = 0; used[0] = true; int min = 0; int to_add = 0; float cost = 0; tree.clear(); while (tree.size() < v_count - 1) { min = INT_MAX; for (int i = 0; i < v_count; ++i) { // v = i; if (used[i]) { for (int j = 0; j < v_count; ++j) { if (!used[j] && graph[i][j] > 0) { if (graph[i][j] < min) { min = graph[i][j]; v = i; to_add = j; } } } } } used[to_add] = true; cost += graph[v][to_add]; tree.push_back(std::make_pair(v, to_add)); } return cost; } int main(int argc, char *argv[]) { if (argc < 2) { std::cout << "No file name input" << std::endl; exit(EXIT_SUCCESS); } std::string file_name = argv[1]; input_graph(file_name); float cost = prim_tree(); std::cout << "cost = " << cost << std::endl; for (const std::pair<int, int> &t : tree) { std::cout << t.first << "->" << t.second << ":" << graph[t.first][t.second] << std::endl; } return 0; }
2cb2c3fe6cd88a80c7ef25614e2ffcc920dab373
fa532549805b18f852889a265a85bfdc4c85b848
/ui_GameSettingWindow.h
37510ebc6ed7165b7e10c3e24a6a2635b8d01bf3
[]
no_license
KONY128/Snake-Game
175cbe9534b1c8a74671c31930528e080f1f56b4
5f08a1031a1eeae485ca17634e7fe78c1eae4b36
refs/heads/master
2023-01-05T19:12:14.475736
2020-11-06T05:00:48
2020-11-06T05:00:48
216,344,499
12
1
null
null
null
null
UTF-8
C++
false
false
19,726
h
/******************************************************************************** ** Form generated from reading UI file 'GameSettingWindow.ui' ** ** Created by: Qt User Interface Compiler version 5.12.3 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ #ifndef UI_GAMESETTINGWINDOW_H #define UI_GAMESETTINGWINDOW_H #include <QtCore/QVariant> #include <QtGui/QIcon> #include <QtWidgets/QApplication> #include <QtWidgets/QCheckBox> #include <QtWidgets/QHBoxLayout> #include <QtWidgets/QLabel> #include <QtWidgets/QPushButton> #include <QtWidgets/QVBoxLayout> #include <QtWidgets/QWidget> QT_BEGIN_NAMESPACE class Ui_GameSettingWindow { public: QVBoxLayout *verticalLayout; QWidget *shadowWidget; QPushButton *StartGameBtn; QPushButton *BackToMenuBtn; QWidget *horizontalWidget; QHBoxLayout *horizontalLayout; QLabel *labelMaxCol; QPushButton *btnColUp; QPushButton *btnColDown; QCheckBox *checkBoxSP; QWidget *horizontalWidget_2; QHBoxLayout *horizontalLayout_2; QLabel *labelMaxRow; QPushButton *btnRowUp; QPushButton *btnRowDown; QWidget *horizontalWidget_3; QHBoxLayout *horizontalLayout_3; QPushButton *btnWallSetLeft; QLabel *labelWallSet; QPushButton *btnWallSetRight; QWidget *horizontalWidget_4; QHBoxLayout *horizontalLayout_4; QPushButton *btnPlayerSetLeft; QLabel *labelPlayerSet; QPushButton *btnPlayerSetRight; QCheckBox *checkBoxHT; QWidget *horizontalWidget_5; QHBoxLayout *horizontalLayout_5; QLabel *labelGameSpeed; QPushButton *btnSpeedUp; QPushButton *btnSpeedDown; QCheckBox *checkBoxTS; QLabel *labelGameSpeed_2; void setupUi(QWidget *GameSettingWindow) { if (GameSettingWindow->objectName().isEmpty()) GameSettingWindow->setObjectName(QString::fromUtf8("GameSettingWindow")); GameSettingWindow->resize(800, 600); GameSettingWindow->setMinimumSize(QSize(800, 600)); GameSettingWindow->setMaximumSize(QSize(1280, 800)); verticalLayout = new QVBoxLayout(GameSettingWindow); verticalLayout->setSpacing(6); verticalLayout->setContentsMargins(11, 11, 11, 11); verticalLayout->setObjectName(QString::fromUtf8("verticalLayout")); shadowWidget = new QWidget(GameSettingWindow); shadowWidget->setObjectName(QString::fromUtf8("shadowWidget")); shadowWidget->setMinimumSize(QSize(0, 0)); shadowWidget->setMaximumSize(QSize(16777213, 16777215)); shadowWidget->setStyleSheet(QString::fromUtf8("QWidget\n" "{\n" " background-color: rgb(255, 255, 255);\n" "}")); StartGameBtn = new QPushButton(shadowWidget); StartGameBtn->setObjectName(QString::fromUtf8("StartGameBtn")); StartGameBtn->setGeometry(QRect(340, 500, 160, 40)); StartGameBtn->setMinimumSize(QSize(160, 40)); StartGameBtn->setMaximumSize(QSize(160, 40)); QFont font; font.setFamily(QString::fromUtf8("Adobe \351\273\221\344\275\223 Std R")); font.setPointSize(15); font.setBold(true); font.setWeight(75); StartGameBtn->setFont(font); StartGameBtn->setStyleSheet(QString::fromUtf8("QPushButton\n" "{\n" " border:none;\n" " background-color: rgb(255, 255, 255);\n" "}\n" "QPushButton:hover\n" "{\n" " border: 2px solid rgb(170, 255, 255);\n" "}")); BackToMenuBtn = new QPushButton(shadowWidget); BackToMenuBtn->setObjectName(QString::fromUtf8("BackToMenuBtn")); BackToMenuBtn->setGeometry(QRect(340, 430, 160, 40)); BackToMenuBtn->setMinimumSize(QSize(160, 40)); BackToMenuBtn->setMaximumSize(QSize(160, 40)); BackToMenuBtn->setFont(font); BackToMenuBtn->setStyleSheet(QString::fromUtf8("QPushButton\n" "{\n" " border:none;\n" " background-color: rgb(255, 255, 255);\n" "}\n" "QPushButton:hover\n" "{\n" " border: 2px solid rgb(170, 255, 255);\n" "}")); horizontalWidget = new QWidget(shadowWidget); horizontalWidget->setObjectName(QString::fromUtf8("horizontalWidget")); horizontalWidget->setGeometry(QRect(30, 40, 350, 50)); horizontalWidget->setMinimumSize(QSize(350, 50)); horizontalWidget->setMaximumSize(QSize(350, 50)); horizontalLayout = new QHBoxLayout(horizontalWidget); horizontalLayout->setSpacing(5); horizontalLayout->setContentsMargins(11, 11, 11, 11); horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout")); horizontalLayout->setContentsMargins(10, 0, 10, 0); labelMaxCol = new QLabel(horizontalWidget); labelMaxCol->setObjectName(QString::fromUtf8("labelMaxCol")); QFont font1; font1.setFamily(QString::fromUtf8("Adobe \345\256\213\344\275\223 Std L")); font1.setPointSize(12); labelMaxCol->setFont(font1); horizontalLayout->addWidget(labelMaxCol, 0, Qt::AlignHCenter); btnColUp = new QPushButton(horizontalWidget); btnColUp->setObjectName(QString::fromUtf8("btnColUp")); btnColUp->setMinimumSize(QSize(44, 44)); btnColUp->setMaximumSize(QSize(44, 44)); btnColUp->setStyleSheet(QString::fromUtf8("QPushButton\n" "{\n" " border: none;\n" " background-color: rgb(255, 255, 255);\n" "}\n" "\n" "QPushButton:hover\n" "{\n" " border: 4px solid rgb(170, 255, 255);\n" "}")); QIcon icon; icon.addFile(QString::fromUtf8(":/Image/button/up"), QSize(), QIcon::Normal, QIcon::Off); btnColUp->setIcon(icon); btnColUp->setIconSize(QSize(40, 40)); horizontalLayout->addWidget(btnColUp); btnColDown = new QPushButton(horizontalWidget); btnColDown->setObjectName(QString::fromUtf8("btnColDown")); btnColDown->setMinimumSize(QSize(44, 44)); btnColDown->setMaximumSize(QSize(44, 44)); btnColDown->setStyleSheet(QString::fromUtf8("QPushButton\n" "{\n" " border: none;\n" " background-color: rgb(255, 255, 255);\n" "}\n" "\n" "QPushButton:hover\n" "{\n" " border: 4px solid rgb(170, 255, 255);\n" "}")); QIcon icon1; icon1.addFile(QString::fromUtf8(":/Image/button/down"), QSize(), QIcon::Normal, QIcon::Off); btnColDown->setIcon(icon1); btnColDown->setIconSize(QSize(40, 40)); horizontalLayout->addWidget(btnColDown); checkBoxSP = new QCheckBox(shadowWidget); checkBoxSP->setObjectName(QString::fromUtf8("checkBoxSP")); checkBoxSP->setGeometry(QRect(60, 280, 170, 40)); checkBoxSP->setMinimumSize(QSize(170, 40)); checkBoxSP->setMaximumSize(QSize(170, 40)); checkBoxSP->setFont(font1); QIcon icon2; icon2.addFile(QString::fromUtf8(":/Image/food/purplePotion"), QSize(), QIcon::Normal, QIcon::Off); checkBoxSP->setIcon(icon2); checkBoxSP->setChecked(true); checkBoxSP->setTristate(false); horizontalWidget_2 = new QWidget(shadowWidget); horizontalWidget_2->setObjectName(QString::fromUtf8("horizontalWidget_2")); horizontalWidget_2->setGeometry(QRect(30, 110, 350, 50)); horizontalWidget_2->setMinimumSize(QSize(350, 50)); horizontalWidget_2->setMaximumSize(QSize(350, 50)); horizontalLayout_2 = new QHBoxLayout(horizontalWidget_2); horizontalLayout_2->setSpacing(5); horizontalLayout_2->setContentsMargins(11, 11, 11, 11); horizontalLayout_2->setObjectName(QString::fromUtf8("horizontalLayout_2")); horizontalLayout_2->setContentsMargins(10, 0, 10, 0); labelMaxRow = new QLabel(horizontalWidget_2); labelMaxRow->setObjectName(QString::fromUtf8("labelMaxRow")); labelMaxRow->setFont(font1); horizontalLayout_2->addWidget(labelMaxRow, 0, Qt::AlignHCenter); btnRowUp = new QPushButton(horizontalWidget_2); btnRowUp->setObjectName(QString::fromUtf8("btnRowUp")); btnRowUp->setMinimumSize(QSize(44, 44)); btnRowUp->setMaximumSize(QSize(44, 44)); btnRowUp->setStyleSheet(QString::fromUtf8("QPushButton\n" "{\n" " border: none;\n" " background-color: rgb(255, 255, 255);\n" "}\n" "\n" "QPushButton:hover\n" "{\n" " border: 4px solid rgb(170, 255, 255);\n" "}")); btnRowUp->setIcon(icon); btnRowUp->setIconSize(QSize(40, 40)); horizontalLayout_2->addWidget(btnRowUp); btnRowDown = new QPushButton(horizontalWidget_2); btnRowDown->setObjectName(QString::fromUtf8("btnRowDown")); btnRowDown->setMinimumSize(QSize(44, 44)); btnRowDown->setMaximumSize(QSize(44, 44)); btnRowDown->setStyleSheet(QString::fromUtf8("QPushButton\n" "{\n" " border: none;\n" " background-color: rgb(255, 255, 255);\n" "}\n" "\n" "QPushButton:hover\n" "{\n" " border: 4px solid rgb(170, 255, 255);\n" "}")); btnRowDown->setIcon(icon1); btnRowDown->setIconSize(QSize(40, 40)); horizontalLayout_2->addWidget(btnRowDown); horizontalWidget_3 = new QWidget(shadowWidget); horizontalWidget_3->setObjectName(QString::fromUtf8("horizontalWidget_3")); horizontalWidget_3->setGeometry(QRect(410, 40, 350, 50)); horizontalWidget_3->setMinimumSize(QSize(350, 50)); horizontalWidget_3->setMaximumSize(QSize(350, 50)); horizontalLayout_3 = new QHBoxLayout(horizontalWidget_3); horizontalLayout_3->setSpacing(5); horizontalLayout_3->setContentsMargins(11, 11, 11, 11); horizontalLayout_3->setObjectName(QString::fromUtf8("horizontalLayout_3")); horizontalLayout_3->setContentsMargins(30, 0, 30, 0); btnWallSetLeft = new QPushButton(horizontalWidget_3); btnWallSetLeft->setObjectName(QString::fromUtf8("btnWallSetLeft")); btnWallSetLeft->setMinimumSize(QSize(44, 44)); btnWallSetLeft->setMaximumSize(QSize(44, 44)); btnWallSetLeft->setStyleSheet(QString::fromUtf8("QPushButton\n" "{\n" " border: none;\n" " background-color: rgb(255, 255, 255);\n" "}\n" "\n" "QPushButton:hover\n" "{\n" " border: 4px solid rgb(170, 255, 255);\n" "}")); QIcon icon3; icon3.addFile(QString::fromUtf8(":/Image/button/left"), QSize(), QIcon::Normal, QIcon::Off); btnWallSetLeft->setIcon(icon3); btnWallSetLeft->setIconSize(QSize(40, 40)); horizontalLayout_3->addWidget(btnWallSetLeft); labelWallSet = new QLabel(horizontalWidget_3); labelWallSet->setObjectName(QString::fromUtf8("labelWallSet")); labelWallSet->setFont(font1); horizontalLayout_3->addWidget(labelWallSet, 0, Qt::AlignHCenter); btnWallSetRight = new QPushButton(horizontalWidget_3); btnWallSetRight->setObjectName(QString::fromUtf8("btnWallSetRight")); btnWallSetRight->setMinimumSize(QSize(44, 44)); btnWallSetRight->setMaximumSize(QSize(44, 44)); btnWallSetRight->setStyleSheet(QString::fromUtf8("QPushButton\n" "{\n" " border: none;\n" " background-color: rgb(255, 255, 255);\n" "}\n" "\n" "QPushButton:hover\n" "{\n" " border: 4px solid rgb(170, 255, 255);\n" "}")); QIcon icon4; icon4.addFile(QString::fromUtf8(":/Image/button/right"), QSize(), QIcon::Normal, QIcon::Off); btnWallSetRight->setIcon(icon4); btnWallSetRight->setIconSize(QSize(40, 40)); horizontalLayout_3->addWidget(btnWallSetRight); horizontalWidget_4 = new QWidget(shadowWidget); horizontalWidget_4->setObjectName(QString::fromUtf8("horizontalWidget_4")); horizontalWidget_4->setGeometry(QRect(410, 110, 350, 50)); horizontalWidget_4->setMinimumSize(QSize(350, 50)); horizontalWidget_4->setMaximumSize(QSize(350, 50)); horizontalLayout_4 = new QHBoxLayout(horizontalWidget_4); horizontalLayout_4->setSpacing(5); horizontalLayout_4->setContentsMargins(11, 11, 11, 11); horizontalLayout_4->setObjectName(QString::fromUtf8("horizontalLayout_4")); horizontalLayout_4->setContentsMargins(30, 0, 30, 0); btnPlayerSetLeft = new QPushButton(horizontalWidget_4); btnPlayerSetLeft->setObjectName(QString::fromUtf8("btnPlayerSetLeft")); btnPlayerSetLeft->setMinimumSize(QSize(44, 44)); btnPlayerSetLeft->setMaximumSize(QSize(44, 44)); btnPlayerSetLeft->setStyleSheet(QString::fromUtf8("QPushButton\n" "{\n" " border: none;\n" " background-color: rgb(255, 255, 255);\n" "}\n" "\n" "QPushButton:hover\n" "{\n" " border: 4px solid rgb(170, 255, 255);\n" "}")); btnPlayerSetLeft->setIcon(icon3); btnPlayerSetLeft->setIconSize(QSize(40, 40)); horizontalLayout_4->addWidget(btnPlayerSetLeft); labelPlayerSet = new QLabel(horizontalWidget_4); labelPlayerSet->setObjectName(QString::fromUtf8("labelPlayerSet")); labelPlayerSet->setFont(font1); horizontalLayout_4->addWidget(labelPlayerSet, 0, Qt::AlignHCenter); btnPlayerSetRight = new QPushButton(horizontalWidget_4); btnPlayerSetRight->setObjectName(QString::fromUtf8("btnPlayerSetRight")); btnPlayerSetRight->setMinimumSize(QSize(44, 44)); btnPlayerSetRight->setMaximumSize(QSize(44, 44)); btnPlayerSetRight->setStyleSheet(QString::fromUtf8("QPushButton\n" "{\n" " border: none;\n" " background-color: rgb(255, 255, 255);\n" "}\n" "\n" "QPushButton:hover\n" "{\n" " border: 4px solid rgb(170, 255, 255);\n" "}")); btnPlayerSetRight->setIcon(icon4); btnPlayerSetRight->setIconSize(QSize(40, 40)); horizontalLayout_4->addWidget(btnPlayerSetRight); checkBoxHT = new QCheckBox(shadowWidget); checkBoxHT->setObjectName(QString::fromUtf8("checkBoxHT")); checkBoxHT->setGeometry(QRect(60, 340, 170, 40)); checkBoxHT->setMinimumSize(QSize(170, 40)); checkBoxHT->setMaximumSize(QSize(170, 40)); checkBoxHT->setFont(font1); QIcon icon5; icon5.addFile(QString::fromUtf8(":/Image/wall"), QSize(), QIcon::Normal, QIcon::Off); checkBoxHT->setIcon(icon5); checkBoxHT->setTristate(false); horizontalWidget_5 = new QWidget(shadowWidget); horizontalWidget_5->setObjectName(QString::fromUtf8("horizontalWidget_5")); horizontalWidget_5->setGeometry(QRect(30, 190, 350, 50)); horizontalWidget_5->setMinimumSize(QSize(350, 50)); horizontalWidget_5->setMaximumSize(QSize(350, 50)); horizontalLayout_5 = new QHBoxLayout(horizontalWidget_5); horizontalLayout_5->setSpacing(5); horizontalLayout_5->setContentsMargins(11, 11, 11, 11); horizontalLayout_5->setObjectName(QString::fromUtf8("horizontalLayout_5")); horizontalLayout_5->setContentsMargins(10, 0, 10, 0); labelGameSpeed = new QLabel(horizontalWidget_5); labelGameSpeed->setObjectName(QString::fromUtf8("labelGameSpeed")); labelGameSpeed->setFont(font1); horizontalLayout_5->addWidget(labelGameSpeed, 0, Qt::AlignHCenter); btnSpeedUp = new QPushButton(horizontalWidget_5); btnSpeedUp->setObjectName(QString::fromUtf8("btnSpeedUp")); btnSpeedUp->setMinimumSize(QSize(44, 44)); btnSpeedUp->setMaximumSize(QSize(44, 44)); btnSpeedUp->setStyleSheet(QString::fromUtf8("QPushButton\n" "{\n" " border: none;\n" " background-color: rgb(255, 255, 255);\n" "}\n" "\n" "QPushButton:hover\n" "{\n" " border: 4px solid rgb(170, 255, 255);\n" "}")); btnSpeedUp->setIcon(icon); btnSpeedUp->setIconSize(QSize(40, 40)); horizontalLayout_5->addWidget(btnSpeedUp); btnSpeedDown = new QPushButton(horizontalWidget_5); btnSpeedDown->setObjectName(QString::fromUtf8("btnSpeedDown")); btnSpeedDown->setMinimumSize(QSize(44, 44)); btnSpeedDown->setMaximumSize(QSize(44, 44)); btnSpeedDown->setStyleSheet(QString::fromUtf8("QPushButton\n" "{\n" " border: none;\n" " background-color: rgb(255, 255, 255);\n" "}\n" "\n" "QPushButton:hover\n" "{\n" " border: 4px solid rgb(170, 255, 255);\n" "}")); btnSpeedDown->setIcon(icon1); btnSpeedDown->setIconSize(QSize(40, 40)); horizontalLayout_5->addWidget(btnSpeedDown); checkBoxTS = new QCheckBox(shadowWidget); checkBoxTS->setObjectName(QString::fromUtf8("checkBoxTS")); checkBoxTS->setGeometry(QRect(60, 400, 170, 40)); checkBoxTS->setMinimumSize(QSize(170, 40)); checkBoxTS->setMaximumSize(QSize(170, 40)); checkBoxTS->setFont(font1); QIcon icon6; icon6.addFile(QString::fromUtf8(":/Image/food/poo"), QSize(), QIcon::Normal, QIcon::Off); checkBoxTS->setIcon(icon6); checkBoxTS->setChecked(true); checkBoxTS->setTristate(false); labelGameSpeed_2 = new QLabel(shadowWidget); labelGameSpeed_2->setObjectName(QString::fromUtf8("labelGameSpeed_2")); labelGameSpeed_2->setGeometry(QRect(630, 550, 151, 21)); QFont font2; font2.setFamily(QString::fromUtf8("Adobe \351\273\221\344\275\223 Std R")); font2.setPointSize(12); font2.setBold(true); font2.setItalic(true); font2.setUnderline(true); font2.setWeight(75); labelGameSpeed_2->setFont(font2); labelGameSpeed_2->setStyleSheet(QString::fromUtf8("QLabel:hover{\n" "color: rgb(72, 72, 218);\n" "}")); verticalLayout->addWidget(shadowWidget); retranslateUi(GameSettingWindow); QMetaObject::connectSlotsByName(GameSettingWindow); } // setupUi void retranslateUi(QWidget *GameSettingWindow) { GameSettingWindow->setWindowTitle(QApplication::translate("GameSettingWindow", "GameSettingWindow", nullptr)); StartGameBtn->setText(QApplication::translate("GameSettingWindow", "Start Game", nullptr)); BackToMenuBtn->setText(QApplication::translate("GameSettingWindow", "Back", nullptr)); labelMaxCol->setText(QApplication::translate("GameSettingWindow", "Max Col", nullptr)); btnColUp->setText(QString()); btnColDown->setText(QString()); #ifndef QT_NO_STATUSTIP checkBoxSP->setStatusTip(QApplication::translate("GameSettingWindow", "status test", nullptr)); #endif // QT_NO_STATUSTIP #ifndef QT_NO_WHATSTHIS checkBoxSP->setWhatsThis(QApplication::translate("GameSettingWindow", "this is super potion", nullptr)); #endif // QT_NO_WHATSTHIS checkBoxSP->setText(QApplication::translate("GameSettingWindow", "Super Potions", nullptr)); labelMaxRow->setText(QApplication::translate("GameSettingWindow", "Max Row", nullptr)); btnRowUp->setText(QString()); btnRowDown->setText(QString()); btnWallSetLeft->setText(QString()); labelWallSet->setText(QApplication::translate("GameSettingWindow", "Wall Set", nullptr)); btnWallSetRight->setText(QString()); btnPlayerSetLeft->setText(QString()); labelPlayerSet->setText(QApplication::translate("GameSettingWindow", "Player Set", nullptr)); btnPlayerSetRight->setText(QString()); checkBoxHT->setText(QApplication::translate("GameSettingWindow", "Harsh Terrain", nullptr)); labelGameSpeed->setText(QApplication::translate("GameSettingWindow", "Game Speed", nullptr)); btnSpeedUp->setText(QString()); btnSpeedDown->setText(QString()); checkBoxTS->setText(QApplication::translate("GameSettingWindow", "Trash", nullptr)); labelGameSpeed_2->setText(QApplication::translate("GameSettingWindow", "Made By KONY", nullptr)); } // retranslateUi }; namespace Ui { class GameSettingWindow: public Ui_GameSettingWindow {}; } // namespace Ui QT_END_NAMESPACE #endif // UI_GAMESETTINGWINDOW_H
e6492078d76f56e6926b5ed3fa5d7a8c015287ce
ea273a0d5a4f56a1da8b6366e8e1e3712a9efd47
/External/Renderer/acl/rtm/impl/type_args.h
929b848cb76774862b632cf91fe5176be54ab0cd
[ "MIT" ]
permissive
cofenberg/unrimp
c31eb36ebde09db70173a154be518925ba192d9a
3d4717d0742a5bc466321905278e0110330df070
refs/heads/master
2022-05-27T05:20:48.463362
2022-05-21T08:15:15
2022-05-21T08:15:15
7,425,818
213
22
null
null
null
null
UTF-8
C++
false
false
16,543
h
#pragma once //////////////////////////////////////////////////////////////////////////////// // The MIT License (MIT) // // Copyright (c) 2018 Nicholas Frechette & Realtime Math contributors // // 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. //////////////////////////////////////////////////////////////////////////////// #include "rtm/types.h" #include "rtm/impl/compiler_utils.h" namespace rtm { ////////////////////////////////////////////////////////////////////////// // Register passing typedefs ////////////////////////////////////////////////////////////////////////// #if defined(RTM_USE_VECTORCALL) // On x64 with __vectorcall, the first 6x vector4f/quatf arguments can be passed by value in a register, // everything else afterwards is passed by const&. They can also be returned by register. using vector4f_arg0 = const vector4f; using vector4f_arg1 = const vector4f; using vector4f_arg2 = const vector4f; using vector4f_arg3 = const vector4f; using vector4f_arg4 = const vector4f; using vector4f_arg5 = const vector4f; using vector4f_arg6 = const vector4f&; using vector4f_arg7 = const vector4f&; using vector4f_argn = const vector4f&; using quatf_arg0 = const quatf; using quatf_arg1 = const quatf; using quatf_arg2 = const quatf; using quatf_arg3 = const quatf; using quatf_arg4 = const quatf; using quatf_arg5 = const quatf; using quatf_arg6 = const quatf&; using quatf_arg7 = const quatf&; using quatf_argn = const quatf&; using scalarf_arg0 = const scalarf; using scalarf_arg1 = const scalarf; using scalarf_arg2 = const scalarf; using scalarf_arg3 = const scalarf; using scalarf_arg4 = const scalarf; using scalarf_arg5 = const scalarf; using scalarf_arg6 = const scalarf&; using scalarf_arg7 = const scalarf&; using scalarf_argn = const scalarf&; using mask4f_arg0 = const mask4f; using mask4f_arg1 = const mask4f; using mask4f_arg2 = const mask4f; using mask4f_arg3 = const mask4f; using mask4f_arg4 = const mask4f; using mask4f_arg5 = const mask4f; using mask4f_arg6 = const mask4f&; using mask4f_arg7 = const mask4f&; using mask4f_argn = const mask4f&; using mask4i_arg0 = const mask4i; using mask4i_arg1 = const mask4i; using mask4i_arg2 = const mask4i; using mask4i_arg3 = const mask4i; using mask4i_arg4 = const mask4i; using mask4i_arg5 = const mask4i; using mask4i_arg6 = const mask4i&; using mask4i_arg7 = const mask4i&; using mask4i_argn = const mask4i&; // With __vectorcall, vector aggregates are also passed by register and they can use up to 4 registers. using qvvf_arg0 = const qvvf; using qvvf_arg1 = const qvvf; using qvvf_argn = const qvvf&; using matrix3x3f_arg0 = const matrix3x3f; using matrix3x3f_arg1 = const matrix3x3f&; using matrix3x3f_argn = const matrix3x3f&; using matrix3x4f_arg0 = const matrix3x4f; using matrix3x4f_arg1 = const matrix3x4f&; using matrix3x4f_argn = const matrix3x4f&; using matrix4x4f_arg0 = const matrix4x4f; using matrix4x4f_arg1 = const matrix4x4f&; using matrix4x4f_argn = const matrix4x4f&; #elif defined(RTM_NEON64_INTRINSICS) // On ARM64 NEON, the first 8x vector4f/quatf arguments can be passed by value in a register, // everything else afterwards is passed by const&. They can also be returned by register. using vector4f_arg0 = const vector4f; using vector4f_arg1 = const vector4f; using vector4f_arg2 = const vector4f; using vector4f_arg3 = const vector4f; using vector4f_arg4 = const vector4f; using vector4f_arg5 = const vector4f; using vector4f_arg6 = const vector4f; using vector4f_arg7 = const vector4f; using vector4f_argn = const vector4f&; using quatf_arg0 = const quatf; using quatf_arg1 = const quatf; using quatf_arg2 = const quatf; using quatf_arg3 = const quatf; using quatf_arg4 = const quatf; using quatf_arg5 = const quatf; using quatf_arg6 = const quatf; using quatf_arg7 = const quatf; using quatf_argn = const quatf&; using scalarf_arg0 = const scalarf; using scalarf_arg1 = const scalarf; using scalarf_arg2 = const scalarf; using scalarf_arg3 = const scalarf; using scalarf_arg4 = const scalarf; using scalarf_arg5 = const scalarf; using scalarf_arg6 = const scalarf; using scalarf_arg7 = const scalarf; using scalarf_argn = const scalarf; using mask4f_arg0 = const mask4f; using mask4f_arg1 = const mask4f; using mask4f_arg2 = const mask4f; using mask4f_arg3 = const mask4f; using mask4f_arg4 = const mask4f; using mask4f_arg5 = const mask4f; using mask4f_arg6 = const mask4f; using mask4f_arg7 = const mask4f; using mask4f_argn = const mask4f&; using mask4i_arg0 = const mask4i; using mask4i_arg1 = const mask4i; using mask4i_arg2 = const mask4i; using mask4i_arg3 = const mask4i; using mask4i_arg4 = const mask4i; using mask4i_arg5 = const mask4i; using mask4i_arg6 = const mask4i; using mask4i_arg7 = const mask4i; using mask4i_argn = const mask4i&; // With ARM64 NEON, vector aggregates are also passed by register but the whole aggregate // must fit in the number of registers available (e.g. we can pass 2x qvvf but not 3x). // A qvvf can also be returned by register. using qvvf_arg0 = const qvvf; using qvvf_arg1 = const qvvf; using qvvf_argn = const qvvf&; using matrix3x3f_arg0 = const matrix3x3f; using matrix3x3f_arg1 = const matrix3x3f; using matrix3x3f_argn = const matrix3x3f&; using matrix3x4f_arg0 = const matrix3x4f; using matrix3x4f_arg1 = const matrix3x4f; using matrix3x4f_argn = const matrix3x4f&; using matrix4x4f_arg0 = const matrix4x4f; using matrix4x4f_arg1 = const matrix4x4f; using matrix4x4f_argn = const matrix4x4f&; #elif defined(RTM_NEON_INTRINSICS) // On ARM NEON, the first 4x vector4f/quatf arguments can be passed by value in a register, // everything else afterwards is passed by const&. They can also be returned by register. using vector4f_arg0 = const vector4f; using vector4f_arg1 = const vector4f; using vector4f_arg2 = const vector4f; using vector4f_arg3 = const vector4f; using vector4f_arg4 = const vector4f&; using vector4f_arg5 = const vector4f&; using vector4f_arg6 = const vector4f&; using vector4f_arg7 = const vector4f&; using vector4f_argn = const vector4f&; using quatf_arg0 = const quatf; using quatf_arg1 = const quatf; using quatf_arg2 = const quatf; using quatf_arg3 = const quatf; using quatf_arg4 = const quatf&; using quatf_arg5 = const quatf&; using quatf_arg6 = const quatf&; using quatf_arg7 = const quatf&; using quatf_argn = const quatf&; using scalarf_arg0 = const scalarf; using scalarf_arg1 = const scalarf; using scalarf_arg2 = const scalarf; using scalarf_arg3 = const scalarf; using scalarf_arg4 = const scalarf; using scalarf_arg5 = const scalarf; using scalarf_arg6 = const scalarf; using scalarf_arg7 = const scalarf; using scalarf_argn = const scalarf; using mask4f_arg0 = const mask4f; using mask4f_arg1 = const mask4f; using mask4f_arg2 = const mask4f; using mask4f_arg3 = const mask4f; using mask4f_arg4 = const mask4f&; using mask4f_arg5 = const mask4f&; using mask4f_arg6 = const mask4f&; using mask4f_arg7 = const mask4f&; using mask4f_argn = const mask4f&; using mask4i_arg0 = const mask4i; using mask4i_arg1 = const mask4i; using mask4i_arg2 = const mask4i; using mask4i_arg3 = const mask4i; using mask4i_arg4 = const mask4i&; using mask4i_arg5 = const mask4i&; using mask4i_arg6 = const mask4i&; using mask4i_arg7 = const mask4i&; using mask4i_argn = const mask4i&; // ARM NEON does not support passing aggregates by register. using qvvf_arg0 = const qvvf&; using qvvf_arg1 = const qvvf&; using qvvf_argn = const qvvf&; using matrix3x3f_arg0 = const matrix3x3f&; using matrix3x3f_arg1 = const matrix3x3f&; using matrix3x3f_argn = const matrix3x3f&; using matrix3x4f_arg0 = const matrix3x4f&; using matrix3x4f_arg1 = const matrix3x4f&; using matrix3x4f_argn = const matrix3x4f&; using matrix4x4f_arg0 = const matrix4x4f&; using matrix4x4f_arg1 = const matrix4x4f&; using matrix4x4f_argn = const matrix4x4f&; #elif defined(__x86_64__) && defined(RTM_COMPILER_GCC) // On x64 with gcc, the first 8x vector4f/quatf arguments can be passed by value in a register, // everything else afterwards is passed by const&. They can also be returned by register. using vector4f_arg0 = const vector4f; using vector4f_arg1 = const vector4f; using vector4f_arg2 = const vector4f; using vector4f_arg3 = const vector4f; using vector4f_arg4 = const vector4f; using vector4f_arg5 = const vector4f; using vector4f_arg6 = const vector4f; using vector4f_arg7 = const vector4f; using vector4f_argn = const vector4f&; using quatf_arg0 = const quatf; using quatf_arg1 = const quatf; using quatf_arg2 = const quatf; using quatf_arg3 = const quatf; using quatf_arg4 = const quatf; using quatf_arg5 = const quatf; using quatf_arg6 = const quatf; using quatf_arg7 = const quatf; using quatf_argn = const quatf&; using scalarf_arg0 = const scalarf; using scalarf_arg1 = const scalarf; using scalarf_arg2 = const scalarf; using scalarf_arg3 = const scalarf; using scalarf_arg4 = const scalarf; using scalarf_arg5 = const scalarf; using scalarf_arg6 = const scalarf; using scalarf_arg7 = const scalarf; using scalarf_argn = const scalarf&; using mask4f_arg0 = const mask4f; using mask4f_arg1 = const mask4f; using mask4f_arg2 = const mask4f; using mask4f_arg3 = const mask4f; using mask4f_arg4 = const mask4f; using mask4f_arg5 = const mask4f; using mask4f_arg6 = const mask4f; using mask4f_arg7 = const mask4f; using mask4f_argn = const mask4f&; using mask4i_arg0 = const mask4i; using mask4i_arg1 = const mask4i; using mask4i_arg2 = const mask4i; using mask4i_arg3 = const mask4i; using mask4i_arg4 = const mask4i; using mask4i_arg5 = const mask4i; using mask4i_arg6 = const mask4i; using mask4i_arg7 = const mask4i; using mask4i_argn = const mask4i&; // gcc does not appear to support passing and returning aggregates by register using qvvf_arg0 = const qvvf&; using qvvf_arg1 = const qvvf&; using qvvf_argn = const qvvf&; using matrix3x3f_arg0 = const matrix3x3f&; using matrix3x3f_arg1 = const matrix3x3f&; using matrix3x3f_argn = const matrix3x3f&; using matrix3x4f_arg0 = const matrix3x4f&; using matrix3x4f_arg1 = const matrix3x4f&; using matrix3x4f_argn = const matrix3x4f&; using matrix4x4f_arg0 = const matrix4x4f&; using matrix4x4f_arg1 = const matrix4x4f&; using matrix4x4f_argn = const matrix4x4f&; #elif defined(__x86_64__) && defined(RTM_COMPILER_CLANG) // On x64 with clang, the first 8x vector4f/quatf arguments can be passed by value in a register, // everything else afterwards is passed by const&. They can also be returned by register. using vector4f_arg0 = const vector4f; using vector4f_arg1 = const vector4f; using vector4f_arg2 = const vector4f; using vector4f_arg3 = const vector4f; using vector4f_arg4 = const vector4f; using vector4f_arg5 = const vector4f; using vector4f_arg6 = const vector4f; using vector4f_arg7 = const vector4f; using vector4f_argn = const vector4f&; using quatf_arg0 = const quatf; using quatf_arg1 = const quatf; using quatf_arg2 = const quatf; using quatf_arg3 = const quatf; using quatf_arg4 = const quatf; using quatf_arg5 = const quatf; using quatf_arg6 = const quatf; using quatf_arg7 = const quatf; using quatf_argn = const quatf&; using scalarf_arg0 = const scalarf; using scalarf_arg1 = const scalarf; using scalarf_arg2 = const scalarf; using scalarf_arg3 = const scalarf; using scalarf_arg4 = const scalarf; using scalarf_arg5 = const scalarf; using scalarf_arg6 = const scalarf; using scalarf_arg7 = const scalarf; using scalarf_argn = const scalarf&; using mask4f_arg0 = const mask4f; using mask4f_arg1 = const mask4f; using mask4f_arg2 = const mask4f; using mask4f_arg3 = const mask4f; using mask4f_arg4 = const mask4f; using mask4f_arg5 = const mask4f; using mask4f_arg6 = const mask4f; using mask4f_arg7 = const mask4f; using mask4f_argn = const mask4f&; using mask4i_arg0 = const mask4i; using mask4i_arg1 = const mask4i; using mask4i_arg2 = const mask4i; using mask4i_arg3 = const mask4i; using mask4i_arg4 = const mask4i; using mask4i_arg5 = const mask4i; using mask4i_arg6 = const mask4i; using mask4i_arg7 = const mask4i; using mask4i_argn = const mask4i&; // We could pass up to 2 full qvvf types by register and the rotation/translation of // the third but aggregates are not returned by register. // TODO: Measure the impact of this because it could potentially degrade performance // if multiple qvv_mul(..) are called, forcing the return value to be written and read back // before the next function call can be made. It might be faster regardless as the compiler // might be able to insert other instructions in between. using qvvf_arg0 = const qvvf&; using qvvf_arg1 = const qvvf&; using qvvf_argn = const qvvf&; using matrix3x3f_arg0 = const matrix3x3f&; using matrix3x3f_arg1 = const matrix3x3f&; using matrix3x3f_argn = const matrix3x3f&; using matrix3x4f_arg0 = const matrix3x4f&; using matrix3x4f_arg1 = const matrix3x4f&; using matrix3x4f_argn = const matrix3x4f&; using matrix4x4f_arg0 = const matrix4x4f&; using matrix4x4f_arg1 = const matrix4x4f&; using matrix4x4f_argn = const matrix4x4f&; #else // On every other platform, everything is passed by const& using vector4f_arg0 = const vector4f&; using vector4f_arg1 = const vector4f&; using vector4f_arg2 = const vector4f&; using vector4f_arg3 = const vector4f&; using vector4f_arg4 = const vector4f&; using vector4f_arg5 = const vector4f&; using vector4f_arg6 = const vector4f&; using vector4f_arg7 = const vector4f&; using vector4f_argn = const vector4f&; using quatf_arg0 = const quatf&; using quatf_arg1 = const quatf&; using quatf_arg2 = const quatf&; using quatf_arg3 = const quatf&; using quatf_arg4 = const quatf&; using quatf_arg5 = const quatf&; using quatf_arg6 = const quatf&; using quatf_arg7 = const quatf&; using quatf_argn = const quatf&; using scalarf_arg0 = const scalarf; using scalarf_arg1 = const scalarf; using scalarf_arg2 = const scalarf; using scalarf_arg3 = const scalarf; using scalarf_arg4 = const scalarf; using scalarf_arg5 = const scalarf; using scalarf_arg6 = const scalarf; using scalarf_arg7 = const scalarf; using scalarf_argn = const scalarf; using mask4f_arg0 = const mask4f&; using mask4f_arg1 = const mask4f&; using mask4f_arg2 = const mask4f&; using mask4f_arg3 = const mask4f&; using mask4f_arg4 = const mask4f&; using mask4f_arg5 = const mask4f&; using mask4f_arg6 = const mask4f&; using mask4f_arg7 = const mask4f&; using mask4f_argn = const mask4f&; using mask4i_arg0 = const mask4i&; using mask4i_arg1 = const mask4i&; using mask4i_arg2 = const mask4i&; using mask4i_arg3 = const mask4i&; using mask4i_arg4 = const mask4i&; using mask4i_arg5 = const mask4i&; using mask4i_arg6 = const mask4i&; using mask4i_arg7 = const mask4i&; using mask4i_argn = const mask4i&; using qvvf_arg0 = const qvvf&; using qvvf_arg1 = const qvvf&; using qvvf_argn = const qvvf&; using matrix3x3f_arg0 = const matrix3x3f&; using matrix3x3f_arg1 = const matrix3x3f&; using matrix3x3f_argn = const matrix3x3f&; using matrix3x4f_arg0 = const matrix3x4f&; using matrix3x4f_arg1 = const matrix3x4f&; using matrix3x4f_argn = const matrix3x4f&; using matrix4x4f_arg0 = const matrix4x4f&; using matrix4x4f_arg1 = const matrix4x4f&; using matrix4x4f_argn = const matrix4x4f&; #endif }
5e708746bee4df069179cc402d1cf96b7031d64e
d998115bcc7c8e4cf67b241d43ca77503a2d9c20
/cs225git/mp_intro/cs225/HSLAPixel.cpp
f96516f9523abe30eabfdabdb7d0136cda26a2a3
[]
no_license
wennan-er/CS225
0683aab8dfca6c116ae484629ddc95147e933afa
0472a154ae82ecb0a4658f78fd03dd6e71d2cebe
refs/heads/master
2021-02-04T10:20:54.214491
2020-02-27T12:02:06
2020-02-27T12:02:06
null
0
0
null
null
null
null
UTF-8
C++
false
false
646
cpp
/** * @file HSLAPixel.cpp * Implementation of the HSLAPixel class for use in with the PNG library. * * @author CS 225: Data Structures * @version 2018r1-lab1 */ #include "HSLAPixel.h" #include <cmath> #include <iostream> using namespace std; namespace cs225 { HSLAPixel::HSLAPixel(){ h = 0; s = 0; l = 1; a = 1.0; } HSLAPixel::HSLAPixel(double hue, double saturation, double luminance){ h = hue; s = saturation; l = luminance; a = 1.0; } HSLAPixel::HSLAPixel(double hue, double saturation, double luminance, double alpha){ h = hue; s = saturation; l = luminance; a = alpha; } }
6dcf8991041fe5e52f11ddc7d6c888654aea09a1
47610aa612655d17c2d2e88116bff8ce8ebc0a26
/include/analysis/PandaXSensitiveDetector.hh
bc2a9ca248c71eb1ed500ea24f4556634b8b4206
[]
no_license
Catofes/BambooMC
6aa154f6ad0a4a305300eef2ff3d26735c4404a4
42ab135729ed4ec7d0c90050043a1bce6a9deacb
refs/heads/main
2020-05-21T19:10:36.629301
2016-09-11T01:20:41
2016-09-11T01:20:41
62,614,871
0
0
null
null
null
null
UTF-8
C++
false
false
1,015
hh
#ifndef PANDAXSENSITIVEDETECTOR_H #define PANDAXSENSITIVEDETECTOR_H #include <G4VSensitiveDetector.hh> #include <map> #include <string> #include "analysis/PandaXEnergyDepositionHit.hh" #include "analysis/PandaXFlatSurfaceFluxHit.hh" class G4Step; class G4HCofThisEvent; class G4TouchableHistory; class G4Box; class PandaXSensitiveDetector : public G4VSensitiveDetector { public: PandaXSensitiveDetector (const G4String &name, bool enableEnergyDeposition = true, bool enableFlatSurfaceFlux = false); ~PandaXSensitiveDetector (); virtual void Initialize(G4HCofThisEvent *); virtual void EndOfEvent (G4HCofThisEvent *); protected: virtual G4bool ProcessHits(G4Step *aStep, G4TouchableHistory *roHist); private: int determineBoxSurface(G4Step *aStep, G4Box * boxSolid); bool _recordEnergyDeposition; bool _recordFlatSurfaceFlux; PandaXEnergyDepositionHitsCollection * _eDHitsCollection; PandaXFlatSurfaceFluxHitsCollection * _fsFluxHitsCollection; }; #endif // PANDAXSENSITIVEDETECTOR_H
746c29e0cd44b3d93808f4fc6d92976b3b98cfb7
ee70d00848d82cc01892f7b8caf586ea468d16a3
/Dynamic Programming/Intermidate/Unbounded_Knapsack/TopDown.cpp
e8ae8027450af17c2261775ec6df074b1d34da91
[]
no_license
Ketan-Suthar/Algorithms
9ba843e8c576bdf94196de5593cc7eecde375858
06f0c59fb7814f94c1280997acabc9500ac09a20
refs/heads/master
2021-07-06T23:32:40.412054
2021-01-15T18:57:15
2021-01-15T18:57:15
217,904,774
8
0
null
null
null
null
UTF-8
C++
false
false
799
cpp
#include <bits/stdc++.h> using namespace std; #define SIZE 1000 long int fun(int values[], int weights[], int n, int cap) { int topdown[SIZE+1][SIZE+1] = {{0}}; for (int i = 1; i < n+1; ++i) for (int j = 1; j < cap+1; ++j) { if(weights[i-1] > j) topdown[i][j] = topdown[i-1][j]; else topdown[i][j] = max(values[i-1] + topdown[i][j - weights[i-1]], topdown[i-1][j]); } return topdown[n][cap]; } int main() { //code int t; cin >> t; while(t--) { int n, capacity; cin >> n >> capacity; int values[SIZE+1], weights[SIZE+1]; for(int i=0; i<n; i++) cin >> values[i]; for(int i=0; i<n; i++) cin >> weights[i]; cout << fun(values, weights, n, capacity) << "\n"; } return 0; }
f1cc5edfe6b2c0997da055503633b94469ce4a6d
88659e6ef9fcf3b46aa3a5f5e5ca45fdcf29ae48
/external/mio/mio.hpp
39de1e4fb4b02ad232755a3419775ea89b97eea7
[]
no_license
mgrech/minecraft-compression-benchmarks
8513c1dd0bcae3b96da7e32039f94991e075c6da
5155f5cf7f19e0112d8f4e89bc45eba31c0f908a
refs/heads/main
2023-02-21T19:18:10.631952
2021-01-26T00:34:06
2021-01-26T00:34:06
329,059,386
1
0
null
null
null
null
UTF-8
C++
false
false
58,680
hpp
/* Copyright 2017 https://github.com/mandreyel * * 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. */ #ifndef MIO_MMAP_HEADER #define MIO_MMAP_HEADER // #include "mio/page.hpp" /* Copyright 2017 https://github.com/mandreyel * * 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. */ #ifndef MIO_PAGE_HEADER #define MIO_PAGE_HEADER #ifdef _WIN32 # include <windows.h> #else # include <unistd.h> #endif namespace mio { /** * This is used by `basic_mmap` to determine whether to create a read-only or * a read-write memory mapping. */ enum class access_mode { read, write }; /** * Determines the operating system's page allocation granularity. * * On the first call to this function, it invokes the operating system specific syscall * to determine the page size, caches the value, and returns it. Any subsequent call to * this function serves the cached value, so no further syscalls are made. */ inline size_t page_size() { static const size_t page_size = [] { #ifdef _WIN32 SYSTEM_INFO SystemInfo; GetSystemInfo(&SystemInfo); return SystemInfo.dwAllocationGranularity; #else return sysconf(_SC_PAGE_SIZE); #endif }(); return page_size; } /** * Alligns `offset` to the operating's system page size such that it subtracts the * difference until the nearest page boundary before `offset`, or does nothing if * `offset` is already page aligned. */ inline size_t make_offset_page_aligned(size_t offset) noexcept { const size_t page_size_ = page_size(); // Use integer division to round down to the nearest page alignment. return offset / page_size_ * page_size_; } } // namespace mio #endif // MIO_PAGE_HEADER #include <iterator> #include <string> #include <system_error> #include <cstdint> #ifdef _WIN32 # ifndef WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN # endif // WIN32_LEAN_AND_MEAN # include <windows.h> #else // ifdef _WIN32 # define INVALID_HANDLE_VALUE -1 #endif // ifdef _WIN32 namespace mio { // This value may be provided as the `length` parameter to the constructor or // `map`, in which case a memory mapping of the entire file is created. enum { map_entire_file = 0 }; #ifdef _WIN32 using file_handle_type = HANDLE; #else using file_handle_type = int; #endif // This value represents an invalid file handle type. This can be used to // determine whether `basic_mmap::file_handle` is valid, for example. const static file_handle_type invalid_handle = INVALID_HANDLE_VALUE; template<access_mode AccessMode, typename ByteT> struct basic_mmap { using value_type = ByteT; using size_type = size_t; using reference = value_type&; using const_reference = const value_type&; using pointer = value_type*; using const_pointer = const value_type*; using difference_type = std::ptrdiff_t; using iterator = pointer; using const_iterator = const_pointer; using reverse_iterator = std::reverse_iterator<iterator>; using const_reverse_iterator = std::reverse_iterator<const_iterator>; using iterator_category = std::random_access_iterator_tag; using handle_type = file_handle_type; static_assert(sizeof(ByteT) == sizeof(char), "ByteT must be the same size as char."); private: // Points to the first requested byte, and not to the actual start of the mapping. pointer data_ = nullptr; // Length--in bytes--requested by user (which may not be the length of the // full mapping) and the length of the full mapping. size_type length_ = 0; size_type mapped_length_ = 0; // Letting user map a file using both an existing file handle and a path // introcudes some complexity (see `is_handle_internal_`). // On POSIX, we only need a file handle to create a mapping, while on // Windows systems the file handle is necessary to retrieve a file mapping // handle, but any subsequent operations on the mapped region must be done // through the latter. handle_type file_handle_ = INVALID_HANDLE_VALUE; #ifdef _WIN32 handle_type file_mapping_handle_ = INVALID_HANDLE_VALUE; #endif // Letting user map a file using both an existing file handle and a path // introcudes some complexity in that we must not close the file handle if // user provided it, but we must close it if we obtained it using the // provided path. For this reason, this flag is used to determine when to // close `file_handle_`. bool is_handle_internal_; public: /** * The default constructed mmap object is in a non-mapped state, that is, * any operation that attempts to access nonexistent underlying data will * result in undefined behaviour/segmentation faults. */ basic_mmap() = default; #ifdef __cpp_exceptions /** * The same as invoking the `map` function, except any error that may occur * while establishing the mapping is wrapped in a `std::system_error` and is * thrown. */ template<typename String> basic_mmap(const String& path, const size_type offset = 0, const size_type length = map_entire_file) { std::error_code error; map(path, offset, length, error); if(error) { throw std::system_error(error); } } /** * The same as invoking the `map` function, except any error that may occur * while establishing the mapping is wrapped in a `std::system_error` and is * thrown. */ basic_mmap(const handle_type handle, const size_type offset = 0, const size_type length = map_entire_file) { std::error_code error; map(handle, offset, length, error); if(error) { throw std::system_error(error); } } #endif // __cpp_exceptions /** * `basic_mmap` has single-ownership semantics, so transferring ownership * may only be accomplished by moving the object. */ basic_mmap(const basic_mmap&) = delete; basic_mmap(basic_mmap&&); basic_mmap& operator=(const basic_mmap&) = delete; basic_mmap& operator=(basic_mmap&&); /** * If this is a read-write mapping, the destructor invokes sync. Regardless * of the access mode, unmap is invoked as a final step. */ ~basic_mmap(); /** * On UNIX systems 'file_handle' and 'mapping_handle' are the same. On Windows, * however, a mapped region of a file gets its own handle, which is returned by * 'mapping_handle'. */ handle_type file_handle() const noexcept { return file_handle_; } handle_type mapping_handle() const noexcept; /** Returns whether a valid memory mapping has been created. */ bool is_open() const noexcept { return file_handle_ != invalid_handle; } /** * Returns true if no mapping was established, that is, conceptually the * same as though the length that was mapped was 0. This function is * provided so that this class has Container semantics. */ bool empty() const noexcept { return length() == 0; } /** Returns true if a mapping was established. */ bool is_mapped() const noexcept; /** * `size` and `length` both return the logical length, i.e. the number of bytes * user requested to be mapped, while `mapped_length` returns the actual number of * bytes that were mapped which is a multiple of the underlying operating system's * page allocation granularity. */ size_type size() const noexcept { return length(); } size_type length() const noexcept { return length_; } size_type mapped_length() const noexcept { return mapped_length_; } /** Returns the offset relative to the start of the mapping. */ size_type mapping_offset() const noexcept { return mapped_length_ - length_; } /** * Returns a pointer to the first requested byte, or `nullptr` if no memory mapping * exists. */ template< access_mode A = AccessMode, typename = typename std::enable_if<A == access_mode::write>::type > pointer data() noexcept { return data_; } const_pointer data() const noexcept { return data_; } /** * Returns an iterator to the first requested byte, if a valid memory mapping * exists, otherwise this function call is undefined behaviour. */ template< access_mode A = AccessMode, typename = typename std::enable_if<A == access_mode::write>::type > iterator begin() noexcept { return data(); } const_iterator begin() const noexcept { return data(); } const_iterator cbegin() const noexcept { return data(); } /** * Returns an iterator one past the last requested byte, if a valid memory mapping * exists, otherwise this function call is undefined behaviour. */ template< access_mode A = AccessMode, typename = typename std::enable_if<A == access_mode::write>::type > iterator end() noexcept { return data() + length(); } const_iterator end() const noexcept { return data() + length(); } const_iterator cend() const noexcept { return data() + length(); } /** * Returns a reverse iterator to the last memory mapped byte, if a valid * memory mapping exists, otherwise this function call is undefined * behaviour. */ template< access_mode A = AccessMode, typename = typename std::enable_if<A == access_mode::write>::type > reverse_iterator rbegin() noexcept { return reverse_iterator(end()); } const_reverse_iterator rbegin() const noexcept { return const_reverse_iterator(end()); } const_reverse_iterator crbegin() const noexcept { return const_reverse_iterator(end()); } /** * Returns a reverse iterator past the first mapped byte, if a valid memory * mapping exists, otherwise this function call is undefined behaviour. */ template< access_mode A = AccessMode, typename = typename std::enable_if<A == access_mode::write>::type > reverse_iterator rend() noexcept { return reverse_iterator(begin()); } const_reverse_iterator rend() const noexcept { return const_reverse_iterator(begin()); } const_reverse_iterator crend() const noexcept { return const_reverse_iterator(begin()); } /** * Returns a reference to the `i`th byte from the first requested byte (as returned * by `data`). If this is invoked when no valid memory mapping has been created * prior to this call, undefined behaviour ensues. */ reference operator[](const size_type i) noexcept { return data_[i]; } const_reference operator[](const size_type i) const noexcept { return data_[i]; } /** * Establishes a memory mapping with AccessMode. If the mapping is unsuccesful, the * reason is reported via `error` and the object remains in a state as if this * function hadn't been called. * * `path`, which must be a path to an existing file, is used to retrieve a file * handle (which is closed when the object destructs or `unmap` is called), which is * then used to memory map the requested region. Upon failure, `error` is set to * indicate the reason and the object remains in an unmapped state. * * `offset` is the number of bytes, relative to the start of the file, where the * mapping should begin. When specifying it, there is no need to worry about * providing a value that is aligned with the operating system's page allocation * granularity. This is adjusted by the implementation such that the first requested * byte (as returned by `data` or `begin`), so long as `offset` is valid, will be at * `offset` from the start of the file. * * `length` is the number of bytes to map. It may be `map_entire_file`, in which * case a mapping of the entire file is created. */ template<typename String> void map(const String& path, const size_type offset, const size_type length, std::error_code& error); /** * Establishes a memory mapping with AccessMode. If the mapping is unsuccesful, the * reason is reported via `error` and the object remains in a state as if this * function hadn't been called. * * `path`, which must be a path to an existing file, is used to retrieve a file * handle (which is closed when the object destructs or `unmap` is called), which is * then used to memory map the requested region. Upon failure, `error` is set to * indicate the reason and the object remains in an unmapped state. * * The entire file is mapped. */ template<typename String> void map(const String& path, std::error_code& error) { map(path, 0, map_entire_file, error); } /** * Establishes a memory mapping with AccessMode. If the mapping is * unsuccesful, the reason is reported via `error` and the object remains in * a state as if this function hadn't been called. * * `handle`, which must be a valid file handle, which is used to memory map the * requested region. Upon failure, `error` is set to indicate the reason and the * object remains in an unmapped state. * * `offset` is the number of bytes, relative to the start of the file, where the * mapping should begin. When specifying it, there is no need to worry about * providing a value that is aligned with the operating system's page allocation * granularity. This is adjusted by the implementation such that the first requested * byte (as returned by `data` or `begin`), so long as `offset` is valid, will be at * `offset` from the start of the file. * * `length` is the number of bytes to map. It may be `map_entire_file`, in which * case a mapping of the entire file is created. */ void map(const handle_type handle, const size_type offset, const size_type length, std::error_code& error); /** * Establishes a memory mapping with AccessMode. If the mapping is * unsuccesful, the reason is reported via `error` and the object remains in * a state as if this function hadn't been called. * * `handle`, which must be a valid file handle, which is used to memory map the * requested region. Upon failure, `error` is set to indicate the reason and the * object remains in an unmapped state. * * The entire file is mapped. */ void map(const handle_type handle, std::error_code& error) { map(handle, 0, map_entire_file, error); } /** * If a valid memory mapping has been created prior to this call, this call * instructs the kernel to unmap the memory region and disassociate this object * from the file. * * The file handle associated with the file that is mapped is only closed if the * mapping was created using a file path. If, on the other hand, an existing * file handle was used to create the mapping, the file handle is not closed. */ void unmap(); void swap(basic_mmap& other); /** Flushes the memory mapped page to disk. Errors are reported via `error`. */ template<access_mode A = AccessMode> typename std::enable_if<A == access_mode::write, void>::type sync(std::error_code& error); /** * All operators compare the address of the first byte and size of the two mapped * regions. */ private: template< access_mode A = AccessMode, typename = typename std::enable_if<A == access_mode::write>::type > pointer get_mapping_start() noexcept { return !data() ? nullptr : data() - mapping_offset(); } const_pointer get_mapping_start() const noexcept { return !data() ? nullptr : data() - mapping_offset(); } /** * The destructor syncs changes to disk if `AccessMode` is `write`, but not * if it's `read`, but since the destructor cannot be templated, we need to * do SFINAE in a dedicated function, where one syncs and the other is a noop. */ template<access_mode A = AccessMode> typename std::enable_if<A == access_mode::write, void>::type conditional_sync(); template<access_mode A = AccessMode> typename std::enable_if<A == access_mode::read, void>::type conditional_sync(); }; template<access_mode AccessMode, typename ByteT> bool operator==(const basic_mmap<AccessMode, ByteT>& a, const basic_mmap<AccessMode, ByteT>& b); template<access_mode AccessMode, typename ByteT> bool operator!=(const basic_mmap<AccessMode, ByteT>& a, const basic_mmap<AccessMode, ByteT>& b); template<access_mode AccessMode, typename ByteT> bool operator<(const basic_mmap<AccessMode, ByteT>& a, const basic_mmap<AccessMode, ByteT>& b); template<access_mode AccessMode, typename ByteT> bool operator<=(const basic_mmap<AccessMode, ByteT>& a, const basic_mmap<AccessMode, ByteT>& b); template<access_mode AccessMode, typename ByteT> bool operator>(const basic_mmap<AccessMode, ByteT>& a, const basic_mmap<AccessMode, ByteT>& b); template<access_mode AccessMode, typename ByteT> bool operator>=(const basic_mmap<AccessMode, ByteT>& a, const basic_mmap<AccessMode, ByteT>& b); /** * This is the basis for all read-only mmap objects and should be preferred over * directly using `basic_mmap`. */ template<typename ByteT> using basic_mmap_source = basic_mmap<access_mode::read, ByteT>; /** * This is the basis for all read-write mmap objects and should be preferred over * directly using `basic_mmap`. */ template<typename ByteT> using basic_mmap_sink = basic_mmap<access_mode::write, ByteT>; /** * These aliases cover the most common use cases, both representing a raw byte stream * (either with a char or an unsigned char/uint8_t). */ using mmap_source = basic_mmap_source<char>; using ummap_source = basic_mmap_source<unsigned char>; using mmap_sink = basic_mmap_sink<char>; using ummap_sink = basic_mmap_sink<unsigned char>; /** * Convenience factory method that constructs a mapping for any `basic_mmap` or * `basic_mmap` type. */ template< typename MMap, typename MappingToken > MMap make_mmap(const MappingToken& token, int64_t offset, int64_t length, std::error_code& error) { MMap mmap; mmap.map(token, offset, length, error); return mmap; } /** * Convenience factory method. * * MappingToken may be a String (`std::string`, `std::string_view`, `const char*`, * `std::filesystem::path`, `std::vector<char>`, or similar), or a * `mmap_source::handle_type`. */ template<typename MappingToken> mmap_source make_mmap_source(const MappingToken& token, mmap_source::size_type offset, mmap_source::size_type length, std::error_code& error) { return make_mmap<mmap_source>(token, offset, length, error); } template<typename MappingToken> mmap_source make_mmap_source(const MappingToken& token, std::error_code& error) { return make_mmap_source(token, 0, map_entire_file, error); } /** * Convenience factory method. * * MappingToken may be a String (`std::string`, `std::string_view`, `const char*`, * `std::filesystem::path`, `std::vector<char>`, or similar), or a * `mmap_sink::handle_type`. */ template<typename MappingToken> mmap_sink make_mmap_sink(const MappingToken& token, mmap_sink::size_type offset, mmap_sink::size_type length, std::error_code& error) { return make_mmap<mmap_sink>(token, offset, length, error); } template<typename MappingToken> mmap_sink make_mmap_sink(const MappingToken& token, std::error_code& error) { return make_mmap_sink(token, 0, map_entire_file, error); } } // namespace mio // #include "detail/mmap.ipp" /* Copyright 2017 https://github.com/mandreyel * * 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. */ #ifndef MIO_BASIC_MMAP_IMPL #define MIO_BASIC_MMAP_IMPL // #include "mio/mmap.hpp" // #include "mio/page.hpp" // #include "mio/detail/string_util.hpp" /* Copyright 2017 https://github.com/mandreyel * * 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. */ #ifndef MIO_STRING_UTIL_HEADER #define MIO_STRING_UTIL_HEADER #include <type_traits> namespace mio { namespace detail { template< typename S, typename C = typename std::decay<S>::type, typename = decltype(std::declval<C>().data()), typename = typename std::enable_if< std::is_same<typename C::value_type, char>::value #ifdef _WIN32 || std::is_same<typename C::value_type, wchar_t>::value #endif >::type > struct char_type_helper { using type = typename C::value_type; }; template<class T> struct char_type { using type = typename char_type_helper<T>::type; }; // TODO: can we avoid this brute force approach? template<> struct char_type<char*> { using type = char; }; template<> struct char_type<const char*> { using type = char; }; template<size_t N> struct char_type<char[N]> { using type = char; }; template<size_t N> struct char_type<const char[N]> { using type = char; }; #ifdef _WIN32 template<> struct char_type<wchar_t*> { using type = wchar_t; }; template<> struct char_type<const wchar_t*> { using type = wchar_t; }; template<size_t N> struct char_type<wchar_t[N]> { using type = wchar_t; }; template<size_t N> struct char_type<const wchar_t[N]> { using type = wchar_t; }; #endif // _WIN32 template<typename CharT, typename S> struct is_c_str_helper { static constexpr bool value = std::is_same< CharT*, // TODO: I'm so sorry for this... Can this be made cleaner? typename std::add_pointer< typename std::remove_cv< typename std::remove_pointer< typename std::decay< S >::type >::type >::type >::type >::value; }; template<typename S> struct is_c_str { static constexpr bool value = is_c_str_helper<char, S>::value; }; #ifdef _WIN32 template<typename S> struct is_c_wstr { static constexpr bool value = is_c_str_helper<wchar_t, S>::value; }; #endif // _WIN32 template<typename S> struct is_c_str_or_c_wstr { static constexpr bool value = is_c_str<S>::value #ifdef _WIN32 || is_c_wstr<S>::value #endif ; }; template< typename String, typename = decltype(std::declval<String>().data()), typename = typename std::enable_if<!is_c_str_or_c_wstr<String>::value>::type > const typename char_type<String>::type* c_str(const String& path) { return path.data(); } template< typename String, typename = decltype(std::declval<String>().empty()), typename = typename std::enable_if<!is_c_str_or_c_wstr<String>::value>::type > bool empty(const String& path) { return path.empty(); } template< typename String, typename = typename std::enable_if<is_c_str_or_c_wstr<String>::value>::type > const typename char_type<String>::type* c_str(String path) { return path; } template< typename String, typename = typename std::enable_if<is_c_str_or_c_wstr<String>::value>::type > bool empty(String path) { return !path || (*path == 0); } } // namespace detail } // namespace mio #endif // MIO_STRING_UTIL_HEADER #include <algorithm> #ifndef _WIN32 # include <unistd.h> # include <fcntl.h> # include <sys/mman.h> # include <sys/stat.h> #endif namespace mio { namespace detail { #ifdef _WIN32 namespace win { /** Returns the 4 upper bytes of an 8-byte integer. */ inline DWORD int64_high(int64_t n) noexcept { return n >> 32; } /** Returns the 4 lower bytes of an 8-byte integer. */ inline DWORD int64_low(int64_t n) noexcept { return n & 0xffffffff; } std::wstring s_2_ws(const std::string& s) { if (s.empty()) return{}; const auto s_length = static_cast<int>(s.length()); auto buf = std::vector<wchar_t>(s_length); const auto wide_char_count = MultiByteToWideChar(CP_UTF8, 0, s.c_str(), s_length, buf.data(), s_length); return std::wstring(buf.data(), wide_char_count); } template< typename String, typename = typename std::enable_if< std::is_same<typename char_type<String>::type, char>::value >::type > file_handle_type open_file_helper(const String& path, const access_mode mode) { return ::CreateFileW(s_2_ws(path).c_str(), mode == access_mode::read ? GENERIC_READ : GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0); } template<typename String> typename std::enable_if< std::is_same<typename char_type<String>::type, wchar_t>::value, file_handle_type >::type open_file_helper(const String& path, const access_mode mode) { return ::CreateFileW(c_str(path), mode == access_mode::read ? GENERIC_READ : GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0); } } // win #endif // _WIN32 /** * Returns the last platform specific system error (errno on POSIX and * GetLastError on Win) as a `std::error_code`. */ inline std::error_code last_error() noexcept { std::error_code error; #ifdef _WIN32 error.assign(GetLastError(), std::system_category()); #else error.assign(errno, std::system_category()); #endif return error; } template<typename String> file_handle_type open_file(const String& path, const access_mode mode, std::error_code& error) { error.clear(); if(detail::empty(path)) { error = std::make_error_code(std::errc::invalid_argument); return invalid_handle; } #ifdef _WIN32 const auto handle = win::open_file_helper(path, mode); #else // POSIX const auto handle = ::open(c_str(path), mode == access_mode::read ? O_RDONLY : O_RDWR); #endif if(handle == invalid_handle) { error = detail::last_error(); } return handle; } inline size_t query_file_size(file_handle_type handle, std::error_code& error) { error.clear(); #ifdef _WIN32 LARGE_INTEGER file_size; if(::GetFileSizeEx(handle, &file_size) == 0) { error = detail::last_error(); return 0; } return static_cast<int64_t>(file_size.QuadPart); #else // POSIX struct stat sbuf; if(::fstat(handle, &sbuf) == -1) { error = detail::last_error(); return 0; } return sbuf.st_size; #endif } struct mmap_context { char* data; int64_t length; int64_t mapped_length; #ifdef _WIN32 file_handle_type file_mapping_handle; #endif }; inline mmap_context memory_map(const file_handle_type file_handle, const int64_t offset, const int64_t length, const access_mode mode, std::error_code& error) { const int64_t aligned_offset = make_offset_page_aligned(offset); const int64_t length_to_map = offset - aligned_offset + length; #ifdef _WIN32 const int64_t max_file_size = offset + length; const auto file_mapping_handle = ::CreateFileMapping( file_handle, 0, mode == access_mode::read ? PAGE_READONLY : PAGE_READWRITE, win::int64_high(max_file_size), win::int64_low(max_file_size), 0); if(file_mapping_handle == invalid_handle) { error = detail::last_error(); return {}; } char* mapping_start = static_cast<char*>(::MapViewOfFile( file_mapping_handle, mode == access_mode::read ? FILE_MAP_READ : FILE_MAP_WRITE, win::int64_high(aligned_offset), win::int64_low(aligned_offset), length_to_map)); if(mapping_start == nullptr) { // Close file handle if mapping it failed. ::CloseHandle(file_mapping_handle); error = detail::last_error(); return {}; } #else // POSIX char* mapping_start = static_cast<char*>(::mmap( 0, // Don't give hint as to where to map. length_to_map, mode == access_mode::read ? PROT_READ : PROT_WRITE, MAP_SHARED, file_handle, aligned_offset)); if(mapping_start == MAP_FAILED) { error = detail::last_error(); return {}; } #endif mmap_context ctx; ctx.data = mapping_start + offset - aligned_offset; ctx.length = length; ctx.mapped_length = length_to_map; #ifdef _WIN32 ctx.file_mapping_handle = file_mapping_handle; #endif return ctx; } } // namespace detail // -- basic_mmap -- template<access_mode AccessMode, typename ByteT> basic_mmap<AccessMode, ByteT>::~basic_mmap() { conditional_sync(); unmap(); } template<access_mode AccessMode, typename ByteT> basic_mmap<AccessMode, ByteT>::basic_mmap(basic_mmap&& other) : data_(std::move(other.data_)) , length_(std::move(other.length_)) , mapped_length_(std::move(other.mapped_length_)) , file_handle_(std::move(other.file_handle_)) #ifdef _WIN32 , file_mapping_handle_(std::move(other.file_mapping_handle_)) #endif , is_handle_internal_(std::move(other.is_handle_internal_)) { other.data_ = nullptr; other.length_ = other.mapped_length_ = 0; other.file_handle_ = invalid_handle; #ifdef _WIN32 other.file_mapping_handle_ = invalid_handle; #endif } template<access_mode AccessMode, typename ByteT> basic_mmap<AccessMode, ByteT>& basic_mmap<AccessMode, ByteT>::operator=(basic_mmap&& other) { if(this != &other) { // First the existing mapping needs to be removed. unmap(); data_ = std::move(other.data_); length_ = std::move(other.length_); mapped_length_ = std::move(other.mapped_length_); file_handle_ = std::move(other.file_handle_); #ifdef _WIN32 file_mapping_handle_ = std::move(other.file_mapping_handle_); #endif is_handle_internal_ = std::move(other.is_handle_internal_); // The moved from basic_mmap's fields need to be reset, because // otherwise other's destructor will unmap the same mapping that was // just moved into this. other.data_ = nullptr; other.length_ = other.mapped_length_ = 0; other.file_handle_ = invalid_handle; #ifdef _WIN32 other.file_mapping_handle_ = invalid_handle; #endif other.is_handle_internal_ = false; } return *this; } template<access_mode AccessMode, typename ByteT> typename basic_mmap<AccessMode, ByteT>::handle_type basic_mmap<AccessMode, ByteT>::mapping_handle() const noexcept { #ifdef _WIN32 return file_mapping_handle_; #else return file_handle_; #endif } template<access_mode AccessMode, typename ByteT> template<typename String> void basic_mmap<AccessMode, ByteT>::map(const String& path, const size_type offset, const size_type length, std::error_code& error) { error.clear(); if(detail::empty(path)) { error = std::make_error_code(std::errc::invalid_argument); return; } const auto handle = detail::open_file(path, AccessMode, error); if(error) { return; } map(handle, offset, length, error); // This MUST be after the call to map, as that sets this to true. if(!error) { is_handle_internal_ = true; } } template<access_mode AccessMode, typename ByteT> void basic_mmap<AccessMode, ByteT>::map(const handle_type handle, const size_type offset, const size_type length, std::error_code& error) { error.clear(); if(handle == invalid_handle) { error = std::make_error_code(std::errc::bad_file_descriptor); return; } const auto file_size = detail::query_file_size(handle, error); if(error) { return; } if(offset + length > file_size) { error = std::make_error_code(std::errc::invalid_argument); return; } const auto ctx = detail::memory_map(handle, offset, length == map_entire_file ? (file_size - offset) : length, AccessMode, error); if(!error) { // We must unmap the previous mapping that may have existed prior to this call. // Note that this must only be invoked after a new mapping has been created in // order to provide the strong guarantee that, should the new mapping fail, the // `map` function leaves this instance in a state as though the function had // never been invoked. unmap(); file_handle_ = handle; is_handle_internal_ = false; data_ = reinterpret_cast<pointer>(ctx.data); length_ = ctx.length; mapped_length_ = ctx.mapped_length; #ifdef _WIN32 file_mapping_handle_ = ctx.file_mapping_handle; #endif } } template<access_mode AccessMode, typename ByteT> template<access_mode A> typename std::enable_if<A == access_mode::write, void>::type basic_mmap<AccessMode, ByteT>::sync(std::error_code& error) { error.clear(); if(!is_open()) { error = std::make_error_code(std::errc::bad_file_descriptor); return; } if(data()) { #ifdef _WIN32 if(::FlushViewOfFile(get_mapping_start(), mapped_length_) == 0 || ::FlushFileBuffers(file_handle_) == 0) #else // POSIX if(::msync(get_mapping_start(), mapped_length_, MS_SYNC) != 0) #endif { error = detail::last_error(); return; } } #ifdef _WIN32 if(::FlushFileBuffers(file_handle_) == 0) { error = detail::last_error(); } #endif } template<access_mode AccessMode, typename ByteT> void basic_mmap<AccessMode, ByteT>::unmap() { if(!is_open()) { return; } // TODO do we care about errors here? #ifdef _WIN32 if(is_mapped()) { ::UnmapViewOfFile(get_mapping_start()); ::CloseHandle(file_mapping_handle_); } #else // POSIX if(data_) { ::munmap(const_cast<pointer>(get_mapping_start()), mapped_length_); } #endif // If `file_handle_` was obtained by our opening it (when map is called with // a path, rather than an existing file handle), we need to close it, // otherwise it must not be closed as it may still be used outside this // instance. if(is_handle_internal_) { #ifdef _WIN32 ::CloseHandle(file_handle_); #else // POSIX ::close(file_handle_); #endif } // Reset fields to their default values. data_ = nullptr; length_ = mapped_length_ = 0; file_handle_ = invalid_handle; #ifdef _WIN32 file_mapping_handle_ = invalid_handle; #endif } template<access_mode AccessMode, typename ByteT> bool basic_mmap<AccessMode, ByteT>::is_mapped() const noexcept { #ifdef _WIN32 return file_mapping_handle_ != invalid_handle; #else // POSIX return is_open(); #endif } template<access_mode AccessMode, typename ByteT> void basic_mmap<AccessMode, ByteT>::swap(basic_mmap& other) { if(this != &other) { using std::swap; swap(data_, other.data_); swap(file_handle_, other.file_handle_); #ifdef _WIN32 swap(file_mapping_handle_, other.file_mapping_handle_); #endif swap(length_, other.length_); swap(mapped_length_, other.mapped_length_); swap(is_handle_internal_, other.is_handle_internal_); } } template<access_mode AccessMode, typename ByteT> template<access_mode A> typename std::enable_if<A == access_mode::write, void>::type basic_mmap<AccessMode, ByteT>::conditional_sync() { // This is invoked from the destructor, so not much we can do about // failures here. std::error_code ec; sync(ec); } template<access_mode AccessMode, typename ByteT> template<access_mode A> typename std::enable_if<A == access_mode::read, void>::type basic_mmap<AccessMode, ByteT>::conditional_sync() { // noop } template<access_mode AccessMode, typename ByteT> bool operator==(const basic_mmap<AccessMode, ByteT>& a, const basic_mmap<AccessMode, ByteT>& b) { return a.data() == b.data() && a.size() == b.size(); } template<access_mode AccessMode, typename ByteT> bool operator!=(const basic_mmap<AccessMode, ByteT>& a, const basic_mmap<AccessMode, ByteT>& b) { return !(a == b); } template<access_mode AccessMode, typename ByteT> bool operator<(const basic_mmap<AccessMode, ByteT>& a, const basic_mmap<AccessMode, ByteT>& b) { if(a.data() == b.data()) { return a.size() < b.size(); } return a.data() < b.data(); } template<access_mode AccessMode, typename ByteT> bool operator<=(const basic_mmap<AccessMode, ByteT>& a, const basic_mmap<AccessMode, ByteT>& b) { return !(a > b); } template<access_mode AccessMode, typename ByteT> bool operator>(const basic_mmap<AccessMode, ByteT>& a, const basic_mmap<AccessMode, ByteT>& b) { if(a.data() == b.data()) { return a.size() > b.size(); } return a.data() > b.data(); } template<access_mode AccessMode, typename ByteT> bool operator>=(const basic_mmap<AccessMode, ByteT>& a, const basic_mmap<AccessMode, ByteT>& b) { return !(a < b); } } // namespace mio #endif // MIO_BASIC_MMAP_IMPL #endif // MIO_MMAP_HEADER /* Copyright 2017 https://github.com/mandreyel * * 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. */ #ifndef MIO_PAGE_HEADER #define MIO_PAGE_HEADER #ifdef _WIN32 # include <windows.h> #else # include <unistd.h> #endif namespace mio { /** * This is used by `basic_mmap` to determine whether to create a read-only or * a read-write memory mapping. */ enum class access_mode { read, write }; /** * Determines the operating system's page allocation granularity. * * On the first call to this function, it invokes the operating system specific syscall * to determine the page size, caches the value, and returns it. Any subsequent call to * this function serves the cached value, so no further syscalls are made. */ inline size_t page_size() { static const size_t page_size = [] { #ifdef _WIN32 SYSTEM_INFO SystemInfo; GetSystemInfo(&SystemInfo); return SystemInfo.dwAllocationGranularity; #else return sysconf(_SC_PAGE_SIZE); #endif }(); return page_size; } /** * Alligns `offset` to the operating's system page size such that it subtracts the * difference until the nearest page boundary before `offset`, or does nothing if * `offset` is already page aligned. */ inline size_t make_offset_page_aligned(size_t offset) noexcept { const size_t page_size_ = page_size(); // Use integer division to round down to the nearest page alignment. return offset / page_size_ * page_size_; } } // namespace mio #endif // MIO_PAGE_HEADER /* Copyright 2017 https://github.com/mandreyel * * 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. */ #ifndef MIO_SHARED_MMAP_HEADER #define MIO_SHARED_MMAP_HEADER // #include "mio/mmap.hpp" #include <system_error> // std::error_code #include <memory> // std::shared_ptr namespace mio { /** * Exposes (nearly) the same interface as `basic_mmap`, but endowes it with * `std::shared_ptr` semantics. * * This is not the default behaviour of `basic_mmap` to avoid allocating on the heap if * shared semantics are not required. */ template< access_mode AccessMode, typename ByteT > class basic_shared_mmap { using impl_type = basic_mmap<AccessMode, ByteT>; std::shared_ptr<impl_type> pimpl_; public: using value_type = typename impl_type::value_type; using size_type = typename impl_type::size_type; using reference = typename impl_type::reference; using const_reference = typename impl_type::const_reference; using pointer = typename impl_type::pointer; using const_pointer = typename impl_type::const_pointer; using difference_type = typename impl_type::difference_type; using iterator = typename impl_type::iterator; using const_iterator = typename impl_type::const_iterator; using reverse_iterator = typename impl_type::reverse_iterator; using const_reverse_iterator = typename impl_type::const_reverse_iterator; using iterator_category = typename impl_type::iterator_category; using handle_type = typename impl_type::handle_type; using mmap_type = impl_type; basic_shared_mmap() = default; basic_shared_mmap(const basic_shared_mmap&) = default; basic_shared_mmap& operator=(const basic_shared_mmap&) = default; basic_shared_mmap(basic_shared_mmap&&) = default; basic_shared_mmap& operator=(basic_shared_mmap&&) = default; /** Takes ownership of an existing mmap object. */ basic_shared_mmap(mmap_type&& mmap) : pimpl_(std::make_shared<mmap_type>(std::move(mmap))) {} /** Takes ownership of an existing mmap object. */ basic_shared_mmap& operator=(mmap_type&& mmap) { pimpl_ = std::make_shared<mmap_type>(std::move(mmap)); return *this; } /** Initializes this object with an already established shared mmap. */ basic_shared_mmap(std::shared_ptr<mmap_type> mmap) : pimpl_(std::move(mmap)) {} /** Initializes this object with an already established shared mmap. */ basic_shared_mmap& operator=(std::shared_ptr<mmap_type> mmap) { pimpl_ = std::move(mmap); return *this; } #ifdef __cpp_exceptions /** * The same as invoking the `map` function, except any error that may occur * while establishing the mapping is wrapped in a `std::system_error` and is * thrown. */ template<typename String> basic_shared_mmap(const String& path, const size_type offset = 0, const size_type length = map_entire_file) { std::error_code error; map(path, offset, length, error); if(error) { throw std::system_error(error); } } /** * The same as invoking the `map` function, except any error that may occur * while establishing the mapping is wrapped in a `std::system_error` and is * thrown. */ basic_shared_mmap(const handle_type handle, const size_type offset = 0, const size_type length = map_entire_file) { std::error_code error; map(handle, offset, length, error); if(error) { throw std::system_error(error); } } #endif // __cpp_exceptions /** * If this is a read-write mapping and the last reference to the mapping, * the destructor invokes sync. Regardless of the access mode, unmap is * invoked as a final step. */ ~basic_shared_mmap() = default; /** Returns the underlying `std::shared_ptr` instance that holds the mmap. */ std::shared_ptr<mmap_type> get_shared_ptr() { return pimpl_; } /** * On UNIX systems 'file_handle' and 'mapping_handle' are the same. On Windows, * however, a mapped region of a file gets its own handle, which is returned by * 'mapping_handle'. */ handle_type file_handle() const noexcept { return pimpl_ ? pimpl_->file_handle() : invalid_handle; } handle_type mapping_handle() const noexcept { return pimpl_ ? pimpl_->mapping_handle() : invalid_handle; } /** Returns whether a valid memory mapping has been created. */ bool is_open() const noexcept { return pimpl_ && pimpl_->is_open(); } /** * Returns true if no mapping was established, that is, conceptually the * same as though the length that was mapped was 0. This function is * provided so that this class has Container semantics. */ bool empty() const noexcept { return !pimpl_ || pimpl_->empty(); } /** * `size` and `length` both return the logical length, i.e. the number of bytes * user requested to be mapped, while `mapped_length` returns the actual number of * bytes that were mapped which is a multiple of the underlying operating system's * page allocation granularity. */ size_type size() const noexcept { return pimpl_ ? pimpl_->length() : 0; } size_type length() const noexcept { return pimpl_ ? pimpl_->length() : 0; } size_type mapped_length() const noexcept { return pimpl_ ? pimpl_->mapped_length() : 0; } /** * Returns a pointer to the first requested byte, or `nullptr` if no memory mapping * exists. */ template< access_mode A = AccessMode, typename = typename std::enable_if<A == access_mode::write>::type > pointer data() noexcept { return pimpl_->data(); } const_pointer data() const noexcept { return pimpl_ ? pimpl_->data() : nullptr; } /** * Returns an iterator to the first requested byte, if a valid memory mapping * exists, otherwise this function call is undefined behaviour. */ iterator begin() noexcept { return pimpl_->begin(); } const_iterator begin() const noexcept { return pimpl_->begin(); } const_iterator cbegin() const noexcept { return pimpl_->cbegin(); } /** * Returns an iterator one past the last requested byte, if a valid memory mapping * exists, otherwise this function call is undefined behaviour. */ template< access_mode A = AccessMode, typename = typename std::enable_if<A == access_mode::write>::type > iterator end() noexcept { return pimpl_->end(); } const_iterator end() const noexcept { return pimpl_->end(); } const_iterator cend() const noexcept { return pimpl_->cend(); } /** * Returns a reverse iterator to the last memory mapped byte, if a valid * memory mapping exists, otherwise this function call is undefined * behaviour. */ template< access_mode A = AccessMode, typename = typename std::enable_if<A == access_mode::write>::type > reverse_iterator rbegin() noexcept { return pimpl_->rbegin(); } const_reverse_iterator rbegin() const noexcept { return pimpl_->rbegin(); } const_reverse_iterator crbegin() const noexcept { return pimpl_->crbegin(); } /** * Returns a reverse iterator past the first mapped byte, if a valid memory * mapping exists, otherwise this function call is undefined behaviour. */ template< access_mode A = AccessMode, typename = typename std::enable_if<A == access_mode::write>::type > reverse_iterator rend() noexcept { return pimpl_->rend(); } const_reverse_iterator rend() const noexcept { return pimpl_->rend(); } const_reverse_iterator crend() const noexcept { return pimpl_->crend(); } /** * Returns a reference to the `i`th byte from the first requested byte (as returned * by `data`). If this is invoked when no valid memory mapping has been created * prior to this call, undefined behaviour ensues. */ reference operator[](const size_type i) noexcept { return (*pimpl_)[i]; } const_reference operator[](const size_type i) const noexcept { return (*pimpl_)[i]; } /** * Establishes a memory mapping with AccessMode. If the mapping is unsuccesful, the * reason is reported via `error` and the object remains in a state as if this * function hadn't been called. * * `path`, which must be a path to an existing file, is used to retrieve a file * handle (which is closed when the object destructs or `unmap` is called), which is * then used to memory map the requested region. Upon failure, `error` is set to * indicate the reason and the object remains in an unmapped state. * * `offset` is the number of bytes, relative to the start of the file, where the * mapping should begin. When specifying it, there is no need to worry about * providing a value that is aligned with the operating system's page allocation * granularity. This is adjusted by the implementation such that the first requested * byte (as returned by `data` or `begin`), so long as `offset` is valid, will be at * `offset` from the start of the file. * * `length` is the number of bytes to map. It may be `map_entire_file`, in which * case a mapping of the entire file is created. */ template<typename String> void map(const String& path, const size_type offset, const size_type length, std::error_code& error) { map_impl(path, offset, length, error); } /** * Establishes a memory mapping with AccessMode. If the mapping is unsuccesful, the * reason is reported via `error` and the object remains in a state as if this * function hadn't been called. * * `path`, which must be a path to an existing file, is used to retrieve a file * handle (which is closed when the object destructs or `unmap` is called), which is * then used to memory map the requested region. Upon failure, `error` is set to * indicate the reason and the object remains in an unmapped state. * * The entire file is mapped. */ template<typename String> void map(const String& path, std::error_code& error) { map_impl(path, 0, map_entire_file, error); } /** * Establishes a memory mapping with AccessMode. If the mapping is unsuccesful, the * reason is reported via `error` and the object remains in a state as if this * function hadn't been called. * * `handle`, which must be a valid file handle, which is used to memory map the * requested region. Upon failure, `error` is set to indicate the reason and the * object remains in an unmapped state. * * `offset` is the number of bytes, relative to the start of the file, where the * mapping should begin. When specifying it, there is no need to worry about * providing a value that is aligned with the operating system's page allocation * granularity. This is adjusted by the implementation such that the first requested * byte (as returned by `data` or `begin`), so long as `offset` is valid, will be at * `offset` from the start of the file. * * `length` is the number of bytes to map. It may be `map_entire_file`, in which * case a mapping of the entire file is created. */ void map(const handle_type handle, const size_type offset, const size_type length, std::error_code& error) { map_impl(handle, offset, length, error); } /** * Establishes a memory mapping with AccessMode. If the mapping is unsuccesful, the * reason is reported via `error` and the object remains in a state as if this * function hadn't been called. * * `handle`, which must be a valid file handle, which is used to memory map the * requested region. Upon failure, `error` is set to indicate the reason and the * object remains in an unmapped state. * * The entire file is mapped. */ void map(const handle_type handle, std::error_code& error) { map_impl(handle, 0, map_entire_file, error); } /** * If a valid memory mapping has been created prior to this call, this call * instructs the kernel to unmap the memory region and disassociate this object * from the file. * * The file handle associated with the file that is mapped is only closed if the * mapping was created using a file path. If, on the other hand, an existing * file handle was used to create the mapping, the file handle is not closed. */ void unmap() { if(pimpl_) pimpl_->unmap(); } void swap(basic_shared_mmap& other) { pimpl_.swap(other.pimpl_); } /** Flushes the memory mapped page to disk. Errors are reported via `error`. */ template< access_mode A = AccessMode, typename = typename std::enable_if<A == access_mode::write>::type > void sync(std::error_code& error) { if(pimpl_) pimpl_->sync(error); } /** All operators compare the underlying `basic_mmap`'s addresses. */ friend bool operator==(const basic_shared_mmap& a, const basic_shared_mmap& b) { return a.pimpl_ == b.pimpl_; } friend bool operator!=(const basic_shared_mmap& a, const basic_shared_mmap& b) { return !(a == b); } friend bool operator<(const basic_shared_mmap& a, const basic_shared_mmap& b) { return a.pimpl_ < b.pimpl_; } friend bool operator<=(const basic_shared_mmap& a, const basic_shared_mmap& b) { return a.pimpl_ <= b.pimpl_; } friend bool operator>(const basic_shared_mmap& a, const basic_shared_mmap& b) { return a.pimpl_ > b.pimpl_; } friend bool operator>=(const basic_shared_mmap& a, const basic_shared_mmap& b) { return a.pimpl_ >= b.pimpl_; } private: template<typename MappingToken> void map_impl(const MappingToken& token, const size_type offset, const size_type length, std::error_code& error) { if(!pimpl_) { mmap_type mmap = make_mmap<mmap_type>(token, offset, length, error); if(error) { return; } pimpl_ = std::make_shared<mmap_type>(std::move(mmap)); } else { pimpl_->map(token, offset, length, error); } } }; /** * This is the basis for all read-only mmap objects and should be preferred over * directly using basic_shared_mmap. */ template<typename ByteT> using basic_shared_mmap_source = basic_shared_mmap<access_mode::read, ByteT>; /** * This is the basis for all read-write mmap objects and should be preferred over * directly using basic_shared_mmap. */ template<typename ByteT> using basic_shared_mmap_sink = basic_shared_mmap<access_mode::write, ByteT>; /** * These aliases cover the most common use cases, both representing a raw byte stream * (either with a char or an unsigned char/uint8_t). */ using shared_mmap_source = basic_shared_mmap_source<char>; using shared_ummap_source = basic_shared_mmap_source<unsigned char>; using shared_mmap_sink = basic_shared_mmap_sink<char>; using shared_ummap_sink = basic_shared_mmap_sink<unsigned char>; } // namespace mio #endif // MIO_SHARED_MMAP_HEADER
4099e9f77c9203513e3618b9c5f04881fdd60f88
9f075f47ecb22f95985add4224ae84357ce8e03c
/lib_engine/src/particle/particle_types.h
709e1ca227d65280065ab86aae5acd29485dd686
[ "Zlib" ]
permissive
ApiO/pgtech
5b2a2688a43f3fe839cf5ce732766a51108b9563
e7c03ea1a269a96fca27b60a417cf4a5759d40ba
refs/heads/master
2020-05-24T18:21:53.067826
2019-05-18T22:37:25
2019-05-18T22:37:25
187,404,856
0
0
null
null
null
null
UTF-8
C++
false
false
1,097
h
#pragma once #include <runtime/collection_types.h> #include <engine/pge_types.h> // (color & vectors) #include <data/particle.h> #include "pose.h" // http://bitsquid.blogspot.fr/2012_06_01_archive.html // http://bitsquid.blogspot.fr/2010/02/blob-and-i.html // http://www.bitsquid.se/files/lua_api.html#particles namespace pge { struct ParticleCache { u32 vao, vertices, tex_coords; u32 texture; }; struct ParticleEmitter { bool active; bool hot; u32 sequence; f64 accu_spawn; f64 accu_despawn; Pose pose; u32 num_particles; u32 max_particles; glm::vec3 *positions; glm::vec3 *velocities; glm::vec3 *scales; glm::vec4 *colors; glm::vec4 color_factor; glm::vec3 scale_factor; const ParticleResource *res; }; struct ParticleSystem { ParticleSystem(Allocator &a); IdLookupTable<ParticleEmitter> emitters; Hash<ParticleCache> rendered_emitters; u32 poses_texture; u32 colors_texture; }; }
[ "Drio@localhost" ]
Drio@localhost
bf196deb5ea05fe9c17d475f8b59c9776a15723d
88ae8695987ada722184307301e221e1ba3cc2fa
/ash/display/display_color_manager_unittest.cc
ef5329e4a9410980d4d255330fd15f82eed36533
[ "BSD-3-Clause" ]
permissive
iridium-browser/iridium-browser
71d9c5ff76e014e6900b825f67389ab0ccd01329
5ee297f53dc7f8e70183031cff62f37b0f19d25f
refs/heads/master
2023-08-03T16:44:16.844552
2023-07-20T15:17:00
2023-07-23T16:09:30
220,016,632
341
40
BSD-3-Clause
2021-08-13T13:54:45
2019-11-06T14:32:31
null
UTF-8
C++
false
false
21,218
cc
// Copyright 2015 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "ash/display/display_color_manager.h" #include <memory> #include "ash/constants/ash_paths.h" #include "base/files/file_util.h" #include "base/memory/raw_ptr.h" #include "base/path_service.h" #include "base/run_loop.h" #include "base/strings/pattern.h" #include "base/test/scoped_path_override.h" #include "base/test/task_environment.h" #include "components/quirks/quirks_manager.h" #include "net/url_request/url_request_context_getter.h" #include "testing/gtest/include/gtest/gtest.h" #include "ui/display/fake/fake_display_snapshot.h" #include "ui/display/manager/test/action_logger_util.h" #include "ui/display/manager/test/test_native_display_delegate.h" namespace ash { namespace { constexpr gfx::Size kDisplaySize(1024, 768); const char kResetGammaAction[] = "*set_gamma_correction(id=123)"; const char kSetGammaAction[] = "*set_gamma_correction(id=123,gamma[0]*gamma[255]=???????????\?)"; const char kSetFullCTMAction[] = "set_color_matrix(id=123,ctm[0]*ctm[8]*)," "set_gamma_correction(id=123,degamma[0]*gamma[0]*)"; class DisplayColorManagerForTest : public DisplayColorManager { public: explicit DisplayColorManagerForTest( display::DisplayConfigurator* configurator) : DisplayColorManager(configurator) {} DisplayColorManagerForTest(const DisplayColorManagerForTest&) = delete; DisplayColorManagerForTest& operator=(const DisplayColorManagerForTest&) = delete; void SetOnFinishedForTest(base::OnceClosure on_finished_for_test) { on_finished_for_test_ = std::move(on_finished_for_test); } private: void FinishLoadCalibrationForDisplay(int64_t display_id, int64_t product_id, bool has_color_correction_matrix, display::DisplayConnectionType type, const base::FilePath& path, bool file_downloaded) override { DisplayColorManager::FinishLoadCalibrationForDisplay( display_id, product_id, has_color_correction_matrix, type, path, file_downloaded); // If path is empty, there is no icc file, and the DCM's work is done. if (path.empty() && on_finished_for_test_) { std::move(on_finished_for_test_).Run(); on_finished_for_test_.Reset(); } } void UpdateCalibrationData( int64_t display_id, int64_t product_id, std::unique_ptr<ColorCalibrationData> data) override { DisplayColorManager::UpdateCalibrationData(display_id, product_id, std::move(data)); if (on_finished_for_test_) { std::move(on_finished_for_test_).Run(); on_finished_for_test_.Reset(); } } base::OnceClosure on_finished_for_test_; }; // Implementation of QuirksManager::Delegate to fake chrome-restricted parts. class QuirksManagerDelegateTestImpl : public quirks::QuirksManager::Delegate { public: QuirksManagerDelegateTestImpl(base::FilePath color_path) : color_path_(color_path) {} QuirksManagerDelegateTestImpl(const QuirksManagerDelegateTestImpl&) = delete; QuirksManagerDelegateTestImpl& operator=( const QuirksManagerDelegateTestImpl&) = delete; // Unused by these tests. std::string GetApiKey() const override { return std::string(); } base::FilePath GetDisplayProfileDirectory() const override { return color_path_; } bool DevicePolicyEnabled() const override { return true; } private: ~QuirksManagerDelegateTestImpl() override = default; base::FilePath color_path_; }; } // namespace class DisplayColorManagerTest : public testing::Test { public: void SetUp() override { log_ = std::make_unique<display::test::ActionLogger>(); native_display_delegate_ = new display::test::TestNativeDisplayDelegate(log_.get()); configurator_.SetDelegateForTesting( std::unique_ptr<display::NativeDisplayDelegate>( native_display_delegate_)); color_manager_ = std::make_unique<DisplayColorManagerForTest>(&configurator_); EXPECT_TRUE(base::PathService::Get(base::DIR_SOURCE_ROOT, &color_path_)); color_path_ = color_path_.Append(FILE_PATH_LITERAL("ash")) .Append(FILE_PATH_LITERAL("display")) .Append(FILE_PATH_LITERAL("test_data")); path_override_ = std::make_unique<base::ScopedPathOverride>( DIR_DEVICE_DISPLAY_PROFILES, color_path_); quirks::QuirksManager::Initialize( std::unique_ptr<quirks::QuirksManager::Delegate>( new QuirksManagerDelegateTestImpl(color_path_)), nullptr, nullptr); } void TearDown() override { quirks::QuirksManager::Shutdown(); } void WaitOnColorCalibration() { base::RunLoop run_loop; color_manager_->SetOnFinishedForTest(run_loop.QuitClosure()); run_loop.Run(); } DisplayColorManagerTest() : test_api_(&configurator_) {} DisplayColorManagerTest(const DisplayColorManagerTest&) = delete; DisplayColorManagerTest& operator=(const DisplayColorManagerTest&) = delete; ~DisplayColorManagerTest() override = default; protected: base::test::TaskEnvironment task_environment_; std::unique_ptr<base::ScopedPathOverride> path_override_; base::FilePath color_path_; std::unique_ptr<display::test::ActionLogger> log_; display::DisplayConfigurator configurator_; display::DisplayConfigurator::TestApi test_api_; raw_ptr<display::test::TestNativeDisplayDelegate, ExperimentalAsh> native_display_delegate_; // not owned std::unique_ptr<DisplayColorManagerForTest> color_manager_; }; TEST_F(DisplayColorManagerTest, VCGTOnly) { std::unique_ptr<display::DisplaySnapshot> snapshot = display::FakeDisplaySnapshot::Builder() .SetId(123) .SetNativeMode(kDisplaySize) .SetCurrentMode(kDisplaySize) .SetType(display::DISPLAY_CONNECTION_TYPE_INTERNAL) .SetHasColorCorrectionMatrix(false) .SetProductCode(0x06af5c10) .Build(); std::vector<display::DisplaySnapshot*> outputs({snapshot.get()}); native_display_delegate_->set_outputs(outputs); configurator_.OnConfigurationChanged(); EXPECT_TRUE(test_api_.TriggerConfigureTimeout()); // Clear initial configuration log. log_->GetActionsAndClear(); WaitOnColorCalibration(); EXPECT_TRUE(base::MatchPattern(log_->GetActionsAndClear(), kSetGammaAction)); } TEST_F(DisplayColorManagerTest, VCGTOnlyWithPlatformCTM) { std::unique_ptr<display::DisplaySnapshot> snapshot = display::FakeDisplaySnapshot::Builder() .SetId(123) .SetNativeMode(kDisplaySize) .SetCurrentMode(kDisplaySize) .SetType(display::DISPLAY_CONNECTION_TYPE_INTERNAL) .SetHasColorCorrectionMatrix(true) .SetProductCode(0x06af5c10) .Build(); std::vector<display::DisplaySnapshot*> outputs({snapshot.get()}); native_display_delegate_->set_outputs(outputs); log_->GetActionsAndClear(); configurator_.OnConfigurationChanged(); EXPECT_TRUE(test_api_.TriggerConfigureTimeout()); // Clear initial configuration log. log_->GetActionsAndClear(); WaitOnColorCalibration(); EXPECT_TRUE(base::MatchPattern(log_->GetActionsAndClear(), kSetGammaAction)); } TEST_F(DisplayColorManagerTest, FullWithPlatformCTM) { std::unique_ptr<display::DisplaySnapshot> snapshot = display::FakeDisplaySnapshot::Builder() .SetId(123) .SetNativeMode(kDisplaySize) .SetCurrentMode(kDisplaySize) .SetType(display::DISPLAY_CONNECTION_TYPE_INTERNAL) .SetHasColorCorrectionMatrix(true) .SetProductCode(0x4c834a42) .Build(); std::vector<display::DisplaySnapshot*> outputs({snapshot.get()}); native_display_delegate_->set_outputs(outputs); configurator_.OnConfigurationChanged(); EXPECT_TRUE(test_api_.TriggerConfigureTimeout()); // Clear initial configuration log. log_->GetActionsAndClear(); WaitOnColorCalibration(); EXPECT_TRUE( base::MatchPattern(log_->GetActionsAndClear(), kSetFullCTMAction)); } TEST_F(DisplayColorManagerTest, SetDisplayColorMatrixNoCTMSupport) { constexpr int64_t kDisplayId = 123; std::unique_ptr<display::DisplaySnapshot> snapshot = display::FakeDisplaySnapshot::Builder() .SetId(kDisplayId) .SetNativeMode(kDisplaySize) .SetCurrentMode(kDisplaySize) .SetType(display::DISPLAY_CONNECTION_TYPE_INTERNAL) .SetHasColorCorrectionMatrix(false) .SetProductCode(0x4c834a42) .Build(); std::vector<display::DisplaySnapshot*> outputs({snapshot.get()}); native_display_delegate_->set_outputs(outputs); configurator_.OnConfigurationChanged(); EXPECT_TRUE(test_api_.TriggerConfigureTimeout()); WaitOnColorCalibration(); // DisplayColorManager::ResetDisplayColorCalibration() will be called since // this display has no CTM support. const std::string& actions = log_->GetActionsAndClear(); EXPECT_TRUE(base::MatchPattern(actions, kResetGammaAction)); // Hardware doesn't support CTM, so CTM shouldn't be configured. EXPECT_FALSE(base::MatchPattern(actions, "*set_color_matrix*")); // Attempt to set a color matrix. SkM44 matrix; matrix.setRC(1, 1, 0.7); matrix.setRC(2, 2, 0.3); EXPECT_FALSE(color_manager_->SetDisplayColorMatrix(kDisplayId, matrix)); EXPECT_EQ(color_manager_->displays_ctm_support(), DisplayColorManager::DisplayCtmSupport::kNone); EXPECT_STREQ("", log_->GetActionsAndClear().c_str()); } TEST_F(DisplayColorManagerTest, SetDisplayColorMatrixWithCTMSupportNoCalibration) { constexpr int64_t kDisplayId = 123; std::unique_ptr<display::DisplaySnapshot> snapshot = display::FakeDisplaySnapshot::Builder() .SetId(kDisplayId) .SetNativeMode(kDisplaySize) .SetCurrentMode(kDisplaySize) .SetType(display::DISPLAY_CONNECTION_TYPE_INTERNAL) .SetHasColorCorrectionMatrix(true) .SetProductCode(0x0) // Non-existent product code. .Build(); std::vector<display::DisplaySnapshot*> outputs({snapshot.get()}); native_display_delegate_->set_outputs(outputs); configurator_.OnConfigurationChanged(); EXPECT_TRUE(test_api_.TriggerConfigureTimeout()); // No need to wait for calibration here, this display doesn't have an icc // file. log_->GetActionsAndClear(); // Attempt to set a color matrix. SkM44 matrix; matrix.setRC(1, 1, 0.7); matrix.setRC(2, 2, 0.3); EXPECT_TRUE(color_manager_->SetDisplayColorMatrix(kDisplayId, matrix)); EXPECT_EQ(color_manager_->displays_ctm_support(), DisplayColorManager::DisplayCtmSupport::kAll); // This display has no color calibration data. Gamma/degamma won't be // affected. Color matrix is applied as is. EXPECT_TRUE(base::MatchPattern( log_->GetActionsAndClear(), "set_color_matrix(id=123,ctm[0]=1*ctm[4]=0.7*ctm[8]=0.3*)")); // Reconfiguring with the same displays snapshots will reapply the matrix. native_display_delegate_->set_outputs(outputs); configurator_.OnConfigurationChanged(); EXPECT_TRUE(test_api_.TriggerConfigureTimeout()); EXPECT_TRUE(base::MatchPattern( log_->GetActionsAndClear(), "*set_color_matrix(id=123,ctm[0]=1*ctm[4]=0.7*ctm[8]=0.3*)")); } TEST_F(DisplayColorManagerTest, SetDisplayColorMatrixWithMixedCTMSupport) { constexpr int64_t kDisplayWithCtmId = 123; std::unique_ptr<display::DisplaySnapshot> snapshot1 = display::FakeDisplaySnapshot::Builder() .SetId(kDisplayWithCtmId) .SetNativeMode(kDisplaySize) .SetCurrentMode(kDisplaySize) .SetType(display::DISPLAY_CONNECTION_TYPE_INTERNAL) .SetHasColorCorrectionMatrix(true) .SetProductCode(0x0) // Non-existent product code. .Build(); constexpr int64_t kDisplayNoCtmId = 456; std::unique_ptr<display::DisplaySnapshot> snapshot2 = display::FakeDisplaySnapshot::Builder() .SetId(kDisplayNoCtmId) .SetNativeMode(kDisplaySize) .SetCurrentMode(kDisplaySize) .SetType(display::DISPLAY_CONNECTION_TYPE_HDMI) .SetHasColorCorrectionMatrix(false) .SetProductCode(0x0) // Non-existent product code. .Build(); std::vector<display::DisplaySnapshot*> outputs( {snapshot1.get(), snapshot2.get()}); native_display_delegate_->set_outputs(outputs); configurator_.OnConfigurationChanged(); EXPECT_TRUE(test_api_.TriggerConfigureTimeout()); // No need to wait for calibration here, these displays don't have icc files. log_->GetActionsAndClear(); EXPECT_EQ(color_manager_->displays_ctm_support(), DisplayColorManager::DisplayCtmSupport::kMixed); // Attempt to set a color matrix. SkM44 matrix; matrix.setRC(1, 1, 0.7); matrix.setRC(2, 2, 0.3); EXPECT_TRUE(color_manager_->SetDisplayColorMatrix(kDisplayWithCtmId, matrix)); // This display has no color calibration data. Gamma/degamma won't be // affected. Color matrix is applied as is. EXPECT_TRUE(base::MatchPattern( log_->GetActionsAndClear(), "set_color_matrix(id=123,ctm[0]=1*ctm[4]=0.7*ctm[8]=0.3*)")); // No matrix will be applied to this display. EXPECT_FALSE(color_manager_->SetDisplayColorMatrix(kDisplayNoCtmId, matrix)); EXPECT_STREQ("", log_->GetActionsAndClear().c_str()); } TEST_F(DisplayColorManagerTest, SetDisplayColorMatrixWithCTMSupportWithCalibration) { constexpr int64_t kDisplayId = 123; std::unique_ptr<display::DisplaySnapshot> snapshot = display::FakeDisplaySnapshot::Builder() .SetId(kDisplayId) .SetNativeMode(kDisplaySize) .SetCurrentMode(kDisplaySize) .SetType(display::DISPLAY_CONNECTION_TYPE_INTERNAL) .SetHasColorCorrectionMatrix(true) .SetProductCode(0x4c834a42) .Build(); std::vector<display::DisplaySnapshot*> outputs({snapshot.get()}); native_display_delegate_->set_outputs(outputs); configurator_.OnConfigurationChanged(); EXPECT_TRUE(test_api_.TriggerConfigureTimeout()); WaitOnColorCalibration(); log_->GetActionsAndClear(); // Attempt to set a color matrix. SkM44 matrix; matrix.setRC(1, 1, 0.7); matrix.setRC(2, 2, 0.3); EXPECT_TRUE(color_manager_->SetDisplayColorMatrix(kDisplayId, matrix)); EXPECT_EQ(color_manager_->displays_ctm_support(), DisplayColorManager::DisplayCtmSupport::kAll); // The applied matrix is the combination of this color matrix and the color // calibration matrix. Gamma/degamma won't be affected. EXPECT_TRUE(base::MatchPattern( log_->GetActionsAndClear(), "set_color_matrix(id=123,ctm[0]=0.01*ctm[4]=0.5*ctm[8]=0.04*)")); // Reconfiguring with the same displays snapshots will reapply the same // product matrix as well as gamma/degamma from the calibration data. native_display_delegate_->set_outputs(outputs); configurator_.OnConfigurationChanged(); EXPECT_TRUE(test_api_.TriggerConfigureTimeout()); EXPECT_TRUE(base::MatchPattern( log_->GetActionsAndClear(), "*set_color_matrix(id=123,ctm[0]=0.01*ctm[4]=0.5*ctm[8]=0.04*)," "set_gamma_correction(id=123,degamma[0]*gamma[0]*)")); } TEST_F(DisplayColorManagerTest, FullWithoutPlatformCTM) { std::unique_ptr<display::DisplaySnapshot> snapshot = display::FakeDisplaySnapshot::Builder() .SetId(123) .SetNativeMode(kDisplaySize) .SetCurrentMode(kDisplaySize) .SetType(display::DISPLAY_CONNECTION_TYPE_INTERNAL) .SetHasColorCorrectionMatrix(false) .SetProductCode(0x4c834a42) .Build(); std::vector<display::DisplaySnapshot*> outputs({snapshot.get()}); native_display_delegate_->set_outputs(outputs); configurator_.OnConfigurationChanged(); EXPECT_TRUE(test_api_.TriggerConfigureTimeout()); // Clear initial configuration log. log_->GetActionsAndClear(); WaitOnColorCalibration(); EXPECT_TRUE( base::MatchPattern(log_->GetActionsAndClear(), kResetGammaAction)); } TEST_F(DisplayColorManagerTest, NoMatchProductID) { std::unique_ptr<display::DisplaySnapshot> snapshot = display::FakeDisplaySnapshot::Builder() .SetId(123) .SetNativeMode(kDisplaySize) .SetCurrentMode(kDisplaySize) .SetType(display::DISPLAY_CONNECTION_TYPE_INTERNAL) .SetHasColorCorrectionMatrix(false) .SetProductCode(0) .Build(); std::vector<display::DisplaySnapshot*> outputs({snapshot.get()}); native_display_delegate_->set_outputs(outputs); configurator_.OnConfigurationChanged(); EXPECT_TRUE(test_api_.TriggerConfigureTimeout()); // DisplayColorManager::ResetDisplayColorCalibration() will be called since // the product code is invalid. EXPECT_TRUE( base::MatchPattern(log_->GetActionsAndClear(), kResetGammaAction)); // NOTE: If product_code == 0, there is no thread switching in Quirks or // Display code, so we shouldn't call WaitOnColorCalibration(). EXPECT_STREQ("", log_->GetActionsAndClear().c_str()); } TEST_F(DisplayColorManagerTest, NoVCGT) { std::unique_ptr<display::DisplaySnapshot> snapshot = display::FakeDisplaySnapshot::Builder() .SetId(123) .SetNativeMode(kDisplaySize) .SetCurrentMode(kDisplaySize) .SetType(display::DISPLAY_CONNECTION_TYPE_INTERNAL) .SetHasColorCorrectionMatrix(false) .SetProductCode(0x0dae3211) .Build(); std::vector<display::DisplaySnapshot*> outputs({snapshot.get()}); native_display_delegate_->set_outputs(outputs); configurator_.OnConfigurationChanged(); EXPECT_TRUE(test_api_.TriggerConfigureTimeout()); // Clear initial configuration log. log_->GetActionsAndClear(); WaitOnColorCalibration(); // DisplayColorManager::ResetDisplayColorCalibration() will be called since // there is no vcgt table. EXPECT_TRUE( base::MatchPattern(log_->GetActionsAndClear(), kResetGammaAction)); } TEST_F(DisplayColorManagerTest, VpdCalibration) { // Set the VPD-written ICC data of |product_id| to be the contents in // |icc_path|. int64_t product_id = 0x0; // No matching product ID, so no Quirks ICC. const base::FilePath& icc_path = color_path_.Append("06af5c10.icc"); auto vpd_dir_override = std::make_unique<base::ScopedPathOverride>( DIR_DEVICE_DISPLAY_PROFILES_VPD); base::FilePath vpd_dir; EXPECT_TRUE( base::PathService::Get(DIR_DEVICE_DISPLAY_PROFILES_VPD, &vpd_dir)); EXPECT_TRUE(base::CopyFile(icc_path, vpd_dir.Append(quirks::IdToFileName(product_id)))); std::unique_ptr<display::DisplaySnapshot> snapshot = display::FakeDisplaySnapshot::Builder() .SetId(123) .SetNativeMode(kDisplaySize) .SetCurrentMode(kDisplaySize) .SetType(display::DISPLAY_CONNECTION_TYPE_INTERNAL) .SetHasColorCorrectionMatrix(false) .SetProductCode(product_id) .Build(); std::vector<display::DisplaySnapshot*> outputs({snapshot.get()}); native_display_delegate_->set_outputs(outputs); configurator_.OnConfigurationChanged(); EXPECT_TRUE(test_api_.TriggerConfigureTimeout()); // Clear initial configuration log. log_->GetActionsAndClear(); WaitOnColorCalibration(); // There is no calibration for this product in Quirks, so confirm that the // VPD-written data is applied. EXPECT_TRUE(base::MatchPattern(log_->GetActionsAndClear(), kSetGammaAction)); } TEST_F(DisplayColorManagerTest, VpdCalibrationWithQuirks) { // Set the VPD-written ICC data of |product_id| to be the contents in // |icc_path|. int64_t product_id = 0x06af5c10; const base::FilePath& icc_path = color_path_.Append("4c834a42.icc"); auto vpd_dir_override = std::make_unique<base::ScopedPathOverride>( DIR_DEVICE_DISPLAY_PROFILES_VPD); base::FilePath vpd_dir; EXPECT_TRUE( base::PathService::Get(DIR_DEVICE_DISPLAY_PROFILES_VPD, &vpd_dir)); EXPECT_TRUE(base::CopyFile(icc_path, vpd_dir.Append(quirks::IdToFileName(product_id)))); std::unique_ptr<display::DisplaySnapshot> snapshot = display::FakeDisplaySnapshot::Builder() .SetId(123) .SetNativeMode(kDisplaySize) .SetCurrentMode(kDisplaySize) .SetType(display::DISPLAY_CONNECTION_TYPE_INTERNAL) .SetHasColorCorrectionMatrix(false) .SetProductCode(product_id) .Build(); std::vector<display::DisplaySnapshot*> outputs({snapshot.get()}); native_display_delegate_->set_outputs(outputs); configurator_.OnConfigurationChanged(); EXPECT_TRUE(test_api_.TriggerConfigureTimeout()); // Clear initial configuration log. log_->GetActionsAndClear(); WaitOnColorCalibration(); // The VPD-written ICC has no vcgt table and would call // DisplayColorManager::ResetDisplayColorCalibration(). // Confirm that the Quirks-fetched ICC, which does, is what is applied. EXPECT_TRUE(base::MatchPattern(log_->GetActionsAndClear(), kSetGammaAction)); } } // namespace ash
9feefbcbe12d04c2b49d1a9c7d4a9f0dcc10fc26
eeba09a4305f72620606911a9d68bd9f5fb6e615
/dep/vngfx/.svn/pristine/9f/9feefbcbe12d04c2b49d1a9c7d4a9f0dcc10fc26.svn-base
dcf5b7339d8e9e33d75df8a9913cb80cbab55a96
[]
no_license
signorinotang/tools
40aea96b8d0062569047cf5683da2856a412c574
9314db0d6535abf57c0efdd40aaf9273a5f4abc0
refs/heads/master
2016-09-05T21:55:12.756494
2014-07-03T02:36:51
2014-07-03T02:36:51
21,447,410
0
1
null
null
null
null
UTF-8
C++
false
false
2,777
// // vnUIRoot.h // vngfx // // Created by Wayne on 13-12-18. // Copyright (c) 2013 viichi.com. All rights reserved. // #ifndef vngfx_vnUIRoot_h #define vngfx_vnUIRoot_h #include "vnUIRenderer.h" #include "vnSingleton.h" #include <vector> _vn_begin class UIElement; class _vn_gfx_api UIRoot : public Singleton<UIRoot> { public: class MouseEventHook { public: virtual void hookMouseLeftDown(UIElement *target, const vector2f &pos) {} virtual void hookMouseLeftUp(UIElement *target, const vector2f &pos) {} virtual void hookMouseRightDown(UIElement *target, const vector2f &pos) {} virtual void hookMouseRightUp(UIElement *target, const vector2f &pos) {} virtual void hookMouseWheel(const UIElement *target, const vector2f &pos, const vector2f &delta) {} }; UIRoot(); ~UIRoot(); void update(f32 deltaTime); void render(); void setRootElement(UIElement *root, bool grab = true); UIElement * getRootElement(); const vector2f & getViewSize(); void setViewSize(const vector2f &size); void hookMouseEvent(MouseEventHook *hook); void unhookMouseEvent(MouseEventHook *hook); bool dispath_mouseLeftDown(const vector2f &pos); bool dispath_mouseLeftUp(const vector2f &pos); bool dispath_mouseRightDown(const vector2f &pos); bool dispath_mouseRightUp(const vector2f &pos); bool dispath_mouseWheel(const vector2f &pos, const vector2f &delta); void dispath_keyDown(c32 chr, bool repeat); void dispath_keyUp(c32 chr); void dispath_textInsert(const str32 &text); void dispath_textMark(const str32 &text, u32 caretPos); void dispath_textUnmark(); void dispath_textNewLine(); void dispath_textDeleteBackward(); void dispath_textDeleteForward(); void dispath_textMoveUp(); void dispath_textMoveDown(); void dispath_textMoveLeft(); void dispath_textMoveRight(); void reset(); void captureMouse(UIElement *element); void releaseMouse(UIElement *element); void requireFocus(UIElement *element); void releaseFocus(UIElement *element); void _notify_disappeared(UIElement *element); private: UIRenderer m_renderer; UIElement *m_root; UIElement *m_focus; UIElement *m_hover; UIElement *m_capture; vector2f m_viewSize; typedef std::vector<MouseEventHook *> MouseEventHooks; MouseEventHooks m_mouseEventHooks; void _updateMouse(); void _sendMouseLeftDown(UIElement *target, const vector2f &pos); void _sendMouseLeftUp(UIElement *target, const vector2f &pos); void _sendMouseRightDown(UIElement *target, const vector2f &pos); void _sendMouseRightUp(UIElement *target, const vector2f &pos); void _sendMouseWheel(UIElement *target, const vector2f &pos, const vector2f &delta); }; _vn_end #endif
a68cdc00cf8456c2fe9e0535ddf99ce6a0f98975
711996316965f8193995fadfda0228ae2dcf7c61
/include/Configuration.h
035c73f529a83172f2f7c465ad4d0fe058a47ced
[]
no_license
wilczogon/EmotionDetector
6be329ebf6d3e158e8acca18f3190330ef324619
bd1c99935499b6bc2806edee1d7aec27a20be9c3
refs/heads/master
2020-12-25T17:00:15.612864
2017-03-08T06:52:47
2017-03-08T06:52:47
49,028,845
0
0
null
null
null
null
UTF-8
C++
false
false
570
h
#ifndef CONFIGURATION_H #define CONFIGURATION_H #include <iostream> #include <fstream> class Configuration { public: Configuration(std::string dataSavePath = NULL, bool talkative = false); virtual ~Configuration(); bool saveVisualizationData(); std::string getDataSavePath(); std::string getRunId(); bool isTalkative(); std::ofstream* open(std::string contentId); protected: private: std::string dataSavePath; std::string runId; bool talkative; }; #endif // CONFIGURATION_H
29b757ae6a33742891d9f95982d0f392cb560bcd
aaf9293c9b82385286e3e49c56e7aaf00da16466
/material.h
d5d019cbfcde7d499b33be98689ae64abc49cacd
[]
no_license
yyuezhi/UIUC_CS_419_Assignement
b33fd25506884f271e9bc29a168a7cf74a6adb50
94505063c2a0f3a8504f6283ba0709bdba48dc10
refs/heads/main
2023-04-16T00:11:03.571553
2021-04-07T16:10:47
2021-04-07T16:10:47
348,393,943
0
0
null
null
null
null
UTF-8
C++
false
false
4,658
h
#ifndef MATERIAL_H #define MATERIAL_H #include "rtweekend.h" #include "texture.h" #include "onb.h" #include "pdf.h" struct hit_record; class material { public: virtual color emitted(const ray& r_in, const hit_record& rec, double u, double v, const point3& p) const{ return color(0,0,0); } virtual bool scatter( const ray& r_in, const hit_record& rec, color& albedo, ray& scattered, double& pdf ) const { return false; } virtual double scattering_pdf( const ray& r_in, const hit_record& rec, const ray& scattered ) const { return 0; } }; class lambertian : public material { public: lambertian(const color& a) : albedo(make_shared<solid_color>(a)) {} lambertian(shared_ptr<texture> a) : albedo(a) {} virtual bool scatter( const ray& r_in, const hit_record& rec, color& alb, ray& scattered, double& pdf ) const override { onb uvw; uvw.build_from_w(rec.normal); auto scatter_direction = uvw.local(random_cosine_direction()); // Catch degenerate scatter direction if (scatter_direction.near_zero()) scatter_direction = rec.normal; scattered = ray(rec.p, unit_vector(scatter_direction)); alb = albedo->value(rec.u, rec.v, rec.p); pdf = 0.5 / pi; return true; } double scattering_pdf( const ray& r_in, const hit_record& rec, const ray& scattered ) const { auto cosine = dot(rec.normal, unit_vector(scattered.direction())); return cosine < 0 ? 0 : cosine/pi; } public: shared_ptr<texture> albedo; }; // class metal : public material { // public: // metal(const color& a, double f) : albedo(a), fuzz(f < 1 ? f : 1) {} // metal(const color& a) : albedo(a) {} // virtual bool scatter( // const ray& r_in, const hit_record& rec, color& attenuation, ray& scattered // ) const override { // vec3 reflected = reflect(unit_vector(r_in.direction()), rec.normal); // scattered = ray(rec.p, reflected + fuzz*random_in_unit_sphere()); // attenuation = albedo; // return (dot(scattered.direction(), rec.normal) > 0); // } // public: // color albedo; // double fuzz; // }; // class dielectric : public material { // public: // dielectric(double index_of_refraction) : ir(index_of_refraction) {} // virtual bool scatter( // const ray& r_in, const hit_record& rec, color& attenuation, ray& scattered // ) const override { // attenuation = color(1.0, 1.0, 1.0); // double refraction_ratio = rec.front_face ? (1.0/ir) : ir; // vec3 unit_direction = unit_vector(r_in.direction()); // double cos_theta = fmin(dot(-unit_direction, rec.normal), 1.0); // double sin_theta = sqrt(1.0 - cos_theta*cos_theta); // bool cannot_refract = refraction_ratio * sin_theta > 1.0; // vec3 direction; // if (cannot_refract || reflectance(cos_theta, refraction_ratio) > random_double()) // direction = reflect(unit_direction, rec.normal); // else // direction = refract(unit_direction, rec.normal, refraction_ratio); // scattered = ray(rec.p, direction); // return true; // } // public: // double ir; // Index of Refraction // private: // static double reflectance(double cosine, double ref_idx) { // // Use Schlick's approximation for reflectance. // auto r0 = (1-ref_idx) / (1+ref_idx); // r0 = r0*r0; // return r0 + (1-r0)*pow((1 - cosine),5); // } // }; class diffuse_light : public material { public: diffuse_light(shared_ptr<texture> a) : emit(a) {} diffuse_light(color c) : emit(make_shared<solid_color>(c)) {} virtual bool scatter( const ray& r_in, const hit_record& rec, color& alb, ray& scattered, double& pdf ) const override { return false; } virtual color emitted(const ray& r_in, const hit_record& rec, double u, double v, const point3& p) const override { if (rec.front_face) return emit->value(u, v, p); else return color(0,0,0); } public: shared_ptr<texture> emit; }; #endif
e9558f5e7df4c74feb1c775b23e70d53ef44939a
6c77cf237697f252d48b287ae60ccf61b3220044
/aws-cpp-sdk-acm-pca/source/model/ValidityPeriodType.cpp
a80b50bad2e5c82b5d2c46dcb70e9c1facbb78fc
[ "MIT", "Apache-2.0", "JSON" ]
permissive
Gohan/aws-sdk-cpp
9a9672de05a96b89d82180a217ccb280537b9e8e
51aa785289d9a76ac27f026d169ddf71ec2d0686
refs/heads/master
2020-03-26T18:48:43.043121
2018-11-09T08:44:41
2018-11-09T08:44:41
145,232,234
1
0
Apache-2.0
2018-08-30T13:42:27
2018-08-18T15:42:39
C++
UTF-8
C++
false
false
3,247
cpp
/* * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ #include <aws/acm-pca/model/ValidityPeriodType.h> #include <aws/core/utils/HashingUtils.h> #include <aws/core/Globals.h> #include <aws/core/utils/EnumParseOverflowContainer.h> using namespace Aws::Utils; namespace Aws { namespace ACMPCA { namespace Model { namespace ValidityPeriodTypeMapper { static const int END_DATE_HASH = HashingUtils::HashString("END_DATE"); static const int ABSOLUTE_HASH = HashingUtils::HashString("ABSOLUTE"); static const int DAYS_HASH = HashingUtils::HashString("DAYS"); static const int MONTHS_HASH = HashingUtils::HashString("MONTHS"); static const int YEARS_HASH = HashingUtils::HashString("YEARS"); ValidityPeriodType GetValidityPeriodTypeForName(const Aws::String& name) { int hashCode = HashingUtils::HashString(name.c_str()); if (hashCode == END_DATE_HASH) { return ValidityPeriodType::END_DATE; } else if (hashCode == ABSOLUTE_HASH) { return ValidityPeriodType::ABSOLUTE; } else if (hashCode == DAYS_HASH) { return ValidityPeriodType::DAYS; } else if (hashCode == MONTHS_HASH) { return ValidityPeriodType::MONTHS; } else if (hashCode == YEARS_HASH) { return ValidityPeriodType::YEARS; } EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { overflowContainer->StoreOverflow(hashCode, name); return static_cast<ValidityPeriodType>(hashCode); } return ValidityPeriodType::NOT_SET; } Aws::String GetNameForValidityPeriodType(ValidityPeriodType enumValue) { switch(enumValue) { case ValidityPeriodType::END_DATE: return "END_DATE"; case ValidityPeriodType::ABSOLUTE: return "ABSOLUTE"; case ValidityPeriodType::DAYS: return "DAYS"; case ValidityPeriodType::MONTHS: return "MONTHS"; case ValidityPeriodType::YEARS: return "YEARS"; default: EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue)); } return ""; } } } // namespace ValidityPeriodTypeMapper } // namespace Model } // namespace ACMPCA } // namespace Aws
43f726dce09c2849c47ee853dd95322720467f78
5bc025297c258c3df414033630f9fe5ca166103d
/200~299/200. Number of Islands.cpp
40dea56ac6b05f899694673765ee5030d90d0ad7
[]
no_license
zylzjucn/Leetcode
b234dddf7d63ae7453658796bf18d7c942a0d849
fea193405eae9f60a46e15606d9d6097d1f0ca80
refs/heads/master
2021-07-17T14:41:26.497530
2021-05-23T04:25:57
2021-05-23T04:25:57
125,817,039
0
0
null
null
null
null
UTF-8
C++
false
false
739
cpp
class Solution { public: int numIslands(vector<vector<char>>& grid) { int m = grid.size(); if (m == 0) return 0; int n = grid[0].size(), i = 0, j = 0, count = 0; for (i = 0; i < m; i++) for (j = 0; j < n; j++) if (grid[i][j]=='1') { dfs(grid, i, j); count++; } return count; } void dfs(vector<vector<char>>& grid, int i, int j) { if (i >= grid.size() || i < 0 || j >= grid[0].size() || j < 0 || grid[i][j]!='1') return; grid[i][j] = '0'; dfs(grid, i - 1, j); dfs(grid, i + 1, j); dfs(grid, i, j - 1); dfs(grid, i, j + 1); } };
3388a7541cdaa7c6b4aedbbb6930fc06ed998775
5ac118793c4cad4265d9eb325e90bcf789236f56
/include/PainelDetector/painel_detector.h
800f7db53daf8e8574b290bdeee03441d4e06cfd
[]
no_license
igormaurell/instruments_visualizer
0d93c0ff91e65589f2f4617798b866549d7dbb08
ad5caab83504cdcd9cbd2f14a183aba592776a08
refs/heads/master
2020-04-07T04:14:27.131586
2018-11-29T10:50:51
2018-11-29T10:50:51
158,046,485
0
0
null
null
null
null
UTF-8
C++
false
false
790
h
#include <algorithm> #include <vector> #include <string> #include <opencv2/opencv.hpp> #include "CircleDetector/circle_detector.h" class PainelDetector { public: PainelDetector(); int circuits_number; double min_radius; double max_radius; bool upper_state; std::vector<int> on_color_hsv; std::vector<int> on_color_thresh; std::vector<int> off_color_hsv; std::vector<int> off_color_thresh; int led_on_v; int led_on_thresh; int closing_kernel_size; //CircleDetector circle_detector; void calculateCircles(const cv::Mat& image, std::vector<cv::Vec3f>& circles, std::string type); std::vector<std::pair<cv::Vec3f, uint8_t> > detect(const cv::Mat &image); };
d4962bbce670ba1ebbd65adb403deed404b41f52
723175a9420efaf6a26aea9dd4e813be8cd8e46a
/include/GTGE/Core/SortedVector.hpp
8443ac8f6f921230032cf1e88d9b7f40cc889bfb
[ "BSL-1.0", "BSD-2-Clause", "Zlib", "MIT" ]
permissive
asdlei99/GTGameEngine
94bb1a19fb3761832cb815b248c40beb57947616
380d1e01774fe6bc2940979e4e5983deef0bf082
refs/heads/master
2022-03-25T10:33:58.551508
2016-12-30T08:55:00
2016-12-30T08:55:00
null
0
0
null
null
null
null
UTF-8
C++
false
false
13,287
hpp
// Copyright (C) 2011 - 2014 David Reid. See included LICENCE file. #ifndef GT_SortedVector #define GT_SortedVector #include "stdlib.hpp" #include <cstring> // For memcpy(). namespace GT { /// Class representing a sorted vector, in ascending order. /// /// This vector can contain multiple items of the same value. template <typename T> class SortedVector { public: /// Default constructor. SortedVector() : count(0), bufferSize(1), buffer(static_cast<T*>(malloc(bufferSize * sizeof(T)))) { } /// Copy constructor. SortedVector(const SortedVector &other) : count(other.count), bufferSize(other.count), buffer(static_cast<T*>(malloc(bufferSize * sizeof(T)))) { for (size_t i = 0; i < other.count; ++i) { new (this->buffer + i) T(other[i]); } } /// Constructor. SortedVector(size_t bufferSize) : count(0), bufferSize(bufferSize), buffer(static_cast<T*>(malloc(bufferSize * sizeof(T)))) { } /// Destructor. ~SortedVector() { for (size_t i = 0; i < this->count; ++i) { this->buffer[i].~T(); } free(this->buffer); } /// Inserts a value into the vector. /// /// @param value [in] The value to insert into the vector. void Insert(const T &value) { // We need to find the insertion point. We always insert after any existing items of the same value. size_t insertionPoint = this->FindInsertionPoint(value); // If there is not enough room for the item, we need to allocate a new buffer. if (this->count == this->bufferSize) { // We need to allocate a new buffer, leaving a space at the insertion point. auto newBufferSize = Max(static_cast<size_t>(1), this->count * 2); auto oldBuffer = this->buffer; auto newBuffer = static_cast<T*>(malloc(newBufferSize * sizeof(T))); // Left of insertion point... for (size_t i = 0; i < insertionPoint; ++i) { new (newBuffer + i) T(oldBuffer[i]); oldBuffer[i].~T(); } // Right of insertion point... for (size_t i = insertionPoint; i < this->count; ++i) { new (newBuffer + i + 1) T(oldBuffer[i]); oldBuffer[i].~T(); } this->buffer = newBuffer; this->bufferSize = newBufferSize; // Finally, the old buffer needs to be deleted. Destructors were already called in the loops above. free(oldBuffer); } else { // We just move everything after the insertion point upwards by 1. for (size_t i = this->count; i > insertionPoint; --i) { new (this->buffer + i) T(this->buffer[i - 1]); this->buffer[i - 1].~T(); } } new (this->buffer + insertionPoint) T(value); ++this->count; } /// Removes the first occurance of the given value. /// /// @param value [in] The value of the item to remove. void RemoveFirstOccuranceOf(const T &value) { this->RemoveAt(this->FindFirst(value)); } /// Removes every item of the given value. /// /// @param value [in] The value of the items to remove. void RemoveAll(const T &value) { this->RemoveRange(this->FindFirst(value), this->FindLast(value)); } /// Removes the item at the given index. void RemoveAt(size_t index) { // The Find*() functions will return -1 if they don't exist, thus we will do an explicit check here. if (index != static_cast<size_t>(-1)) { assert(index < this->count); // We first need to destruct the item being removed. this->buffer[index].~T(); // Now we just move everything after it downwards. for (size_t i = index; i < this->count - 1; ++i) { new (this->buffer + i) T(this->buffer[i + 1]); this->buffer[i + 1].~T(); } --this->count; } } /// Removes a range of items by index. /// /// @param startIndex [in] The first index in the range to remove. /// @param endIndex [in] The last index in the range to remove. /// /// @remarks /// Both <startIndex> and <endIndex> is inclusive. void RemoveRange(size_t startIndex, size_t endIndex) { if (startIndex != static_cast<size_t>(-1) && endIndex != static_cast<size_t>(-1)) { assert(startIndex < this->count); assert(endIndex < this->count); assert(startIndex < endIndex); size_t range = endIndex - startIndex + 1; // First we need to destruct the items being removed. for (size_t i = startIndex; i <= endIndex; ++i) { this->buffer[i].~T(); } // Now we move everything downwards. for (size_t i = startIndex; i < this->count - range; ++i) { new (this->buffer + i) T(this->buffer[i + range]); this->buffer[i + range].~T(); } this->count -= range; } } /// Finds the index of an item of the given value. /// /// @param value [in] The value of the item to search for. /// /// @return The index of the item, or -1 if the item is not found. /// /// @remarks /// There can be multiple items of the same value in the list. The specific item returned from this method is undefined. Use FindFirst() // or FindLast() to retrieve the first and last of the items respectively. size_t Find(const T &value) { size_t result; if (this->Find(value, result)) { return result; } else { return static_cast<size_t>(-1); } } /// Retrieves the index of the first item with the given value. /// /// @param value [in] The value to search for. /// /// @return The index of the first item of the given value, or -1 if the item is not found. size_t FindFirst(const T &value) { size_t i = this->Find(value); if (i != static_cast<size_t>(-1) && i > 0) { // We iterate backwards until we find the first item that is not equal to value. for ( ; i > 0; --i) { if (!(this->buffer[i - 1] == value)) { return i; } } } return i; } /// Retrieves the index of the last item with the given value. /// /// @param value [in] The value to search for. /// /// @return The index of the last item of the given value, or -1 if the item is not found. size_t FindLast(const T &value) { size_t i = this->Find(value); if (i != static_cast<size_t>(-1) && i < this->count - 1) { for (i = i + 1; i < this->count; ++i) { if (!(this->buffer[i] == value)) { return i - 1; } } } return i; } /// Finds the insertion point of the given value. /// /// @param value [in] The value whose insertion point is being found. /// /// @return The index where the given value can be placed. size_t FindInsertionPoint(const T &value) { size_t result; if (this->Find(value, result)) { // We want to insert at the end of any items with the same value. To do this, we just keep scanning forward until // we find the first item without. for (result = result + 1; result < this->count; ++result) { if (this->buffer[result] != value) { return result; } } } return result; } /// Generic function for finding a value. /// /// @param value [in] The value to search for. /// @param index [out] A reference to the variable that will receive the result. /// /// @return True if the value at the returned index is equal to <value> bool Find(const T &value, size_t &index) { if (this->count > 0) { // It's just so much easier using signed values here... ptrdiff_t low = 0; ptrdiff_t high = static_cast<ptrdiff_t>(this->count - 1); // <-- Safe cast as per the the check above. ptrdiff_t mid = 0; ptrdiff_t offset = 0; // This will either be 0 or 1 and is added to the index if we don't find an exact value. while (low <= high) { mid = (low + high) / 2; // This will be floored. if (value < this->buffer[mid]) { high = mid - 1; offset = 0; } else if (value > this->buffer[mid]) { low = mid + 1; offset = 1; } else { index = static_cast<size_t>(mid); return true; } } // If we have made it here, we weren't exact. index = static_cast<size_t>(mid + offset); } else { index = 0; } return false; } /// Determines whether or not the given item exists. /// /// @param value [in] The value of the item to check for. bool Exists(const T &value) { size_t devnull; return this->Find(value, devnull); } /// Empties the vector. /// /// @remarks /// This runs in linear time because of destructors. I'm assuming compilers will optimize it out for basic types. void Clear() { for (size_t i = 0U; i < this->count; ++i) { this->buffer[i].~T(); } this->count = 0; } /// Retrieves a reference to the item at the given index. /// /// @param index [in] The index of the item to retrieve. template <typename U> T & Get(U index) { assert(static_cast<size_t>(index) < this->count); return this->buffer[index]; } template <typename U> const T & Get(U index) const { assert(static_cast<size_t>(index) < this->count); return this->buffer[index]; } /////////////////////////////////////////////////////////////// // Operators. /// Assignment operator. SortedVector & operator=(const SortedVector &other) { if (this != &other) { this->Clear(); if (this->bufferSize < other.bufferSize) { this->bufferSize = other.bufferSize; free(this->buffer); this->buffer = static_cast<T*>(malloc(this->bufferSize * sizeof(T))); } for (size_t i = 0; i < other.count; ++i) { new (this->buffer + i) T(other.buffer[i]); } this->count = other.count; } } /// Accessor operator. template <typename U> T & operator[](U index) { return this->Get(index); } template <typename U> const T & operator[](U index) const { return this->Get(index); } /////////////////////////////////////////////////////////////// // Attributes. /// The number of items in the vector. size_t count; /// The size of the allocated array for the vector. This is not the number of items and will always /// be >= 'count'. size_t bufferSize; /// The buffer containing the the vector contents. T* buffer; }; } #endif
faf12e71a23e9548873fb7a9ad3482ea9c557b72
beda62f6f4a8ab7f5c9c3a66cc3d7ef5a1d21f78
/faceDetect/include/Base64.h
0b63807c605f8b20e8173978577abf3d47fe7b7e
[]
no_license
radtek/c-
2295287d5757120fa07f17f6a34b0bb293c1e1d3
d0715068462c29d7b4a01ac8905ae76d207db16d
refs/heads/master
2020-11-24T22:20:43.658511
2018-09-19T02:04:26
2018-09-19T02:04:26
null
0
0
null
null
null
null
GB18030
C++
false
false
488
h
#include <string> using namespace std; class Base64 { public: /*编码 DataByte [in]输入的数据长度,以字节为单位 */ string Encode(const unsigned char* Data,int DataByte); /*解码 DataByte [in]输入的数据长度,以字节为单位 OutByte [out]输出的数据长度,以字节为单位,请不要通过返回值计算 输出数据的长度 */ string Decode(const char* Data,int DataByte,int& OutByte); };
9d53b9329a3623f04ec2731a2c9158b3a405a8f9
5261689e7c9114dfd89786358edc0a35e69ab57f
/cc-fctrl2.cpp
201e6e5db99eb2d871ad9253673ca70671e33c90
[]
no_license
shobhitkrsks/cp
bec5f36d5a8ff9684321099dc3244284f517ab43
e551af079b4c1a4c1803b555ab9d3eec194910c5
refs/heads/master
2023-06-06T19:52:31.999545
2021-07-05T18:57:52
2021-07-05T18:57:52
248,814,534
0
0
null
null
null
null
UTF-8
C++
false
false
733
cpp
#include <iostream> using namespace std; int main() { int t; cin>>t; while(t--) { int n; cin>>n; int k=n; int ar[200]; int m=0; while(k!=0) { ar[m++]=k%10; k/=10; } for(int i=2;i<n;i++) { int carry=0; for(int j=0;j<m;j++) { int temp=ar[j]*i+carry; ar[j]=temp%10; carry=temp/10; } while(carry!=0) { ar[m++]=carry%10; carry/=10; } } for(int i=m-1;i>=0;i--) cout<<ar[i]; cout<<endl; } return 0; }
51248acfdb8b4fc2d65d8970fa062c46cf971512
ed2d4c6dbdec9bb501b515e25b620917c6d0704e
/controllers/joystick/catkin_ws/devel/include/nodes/display_image_loadRequest.h
dc6a28bf2d0928c4a355cd78194c6591a87d6bdc
[]
no_license
pvarthol/aristeia1
c069db900c9ce7d0bbcddfd284a74c2b67447354
2da2796673d801c01e5ddeeaccd1f1dcbab2e535
refs/heads/master
2020-05-21T11:42:29.247546
2015-07-13T16:59:20
2015-07-13T16:59:20
39,025,834
0
0
null
null
null
null
UTF-8
C++
false
false
5,405
h
// Generated by gencpp from file nodes/display_image_loadRequest.msg // DO NOT EDIT! #ifndef NODES_MESSAGE_DISPLAY_IMAGE_LOADREQUEST_H #define NODES_MESSAGE_DISPLAY_IMAGE_LOADREQUEST_H #include <string> #include <vector> #include <map> #include <ros/types.h> #include <ros/serialization.h> #include <ros/builtin_message_traits.h> #include <ros/message_operations.h> namespace nodes { template <class ContainerAllocator> struct display_image_loadRequest_ { typedef display_image_loadRequest_<ContainerAllocator> Type; display_image_loadRequest_() : filename() { } display_image_loadRequest_(const ContainerAllocator& _alloc) : filename(_alloc) { } typedef std::basic_string<char, std::char_traits<char>, typename ContainerAllocator::template rebind<char>::other > _filename_type; _filename_type filename; typedef boost::shared_ptr< ::nodes::display_image_loadRequest_<ContainerAllocator> > Ptr; typedef boost::shared_ptr< ::nodes::display_image_loadRequest_<ContainerAllocator> const> ConstPtr; }; // struct display_image_loadRequest_ typedef ::nodes::display_image_loadRequest_<std::allocator<void> > display_image_loadRequest; typedef boost::shared_ptr< ::nodes::display_image_loadRequest > display_image_loadRequestPtr; typedef boost::shared_ptr< ::nodes::display_image_loadRequest const> display_image_loadRequestConstPtr; // constants requiring out of line definition template<typename ContainerAllocator> std::ostream& operator<<(std::ostream& s, const ::nodes::display_image_loadRequest_<ContainerAllocator> & v) { ros::message_operations::Printer< ::nodes::display_image_loadRequest_<ContainerAllocator> >::stream(s, "", v); return s; } } // namespace nodes namespace ros { namespace message_traits { // BOOLTRAITS {'IsFixedSize': False, 'IsMessage': True, 'HasHeader': False} // {'nodes': ['/home/legged/tns_ros1/controllers/joystick/catkin_ws/src/nodes/msg'], 'std_msgs': ['/opt/ros/indigo/share/std_msgs/cmake/../msg']} // !!!!!!!!!!! ['__class__', '__delattr__', '__dict__', '__doc__', '__eq__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_parsed_fields', 'constants', 'fields', 'full_name', 'has_header', 'header_present', 'names', 'package', 'parsed_fields', 'short_name', 'text', 'types'] template <class ContainerAllocator> struct IsFixedSize< ::nodes::display_image_loadRequest_<ContainerAllocator> > : FalseType { }; template <class ContainerAllocator> struct IsFixedSize< ::nodes::display_image_loadRequest_<ContainerAllocator> const> : FalseType { }; template <class ContainerAllocator> struct IsMessage< ::nodes::display_image_loadRequest_<ContainerAllocator> > : TrueType { }; template <class ContainerAllocator> struct IsMessage< ::nodes::display_image_loadRequest_<ContainerAllocator> const> : TrueType { }; template <class ContainerAllocator> struct HasHeader< ::nodes::display_image_loadRequest_<ContainerAllocator> > : FalseType { }; template <class ContainerAllocator> struct HasHeader< ::nodes::display_image_loadRequest_<ContainerAllocator> const> : FalseType { }; template<class ContainerAllocator> struct MD5Sum< ::nodes::display_image_loadRequest_<ContainerAllocator> > { static const char* value() { return "030824f52a0628ead956fb9d67e66ae9"; } static const char* value(const ::nodes::display_image_loadRequest_<ContainerAllocator>&) { return value(); } static const uint64_t static_value1 = 0x030824f52a0628eaULL; static const uint64_t static_value2 = 0xd956fb9d67e66ae9ULL; }; template<class ContainerAllocator> struct DataType< ::nodes::display_image_loadRequest_<ContainerAllocator> > { static const char* value() { return "nodes/display_image_loadRequest"; } static const char* value(const ::nodes::display_image_loadRequest_<ContainerAllocator>&) { return value(); } }; template<class ContainerAllocator> struct Definition< ::nodes::display_image_loadRequest_<ContainerAllocator> > { static const char* value() { return "string filename\n\ "; } static const char* value(const ::nodes::display_image_loadRequest_<ContainerAllocator>&) { return value(); } }; } // namespace message_traits } // namespace ros namespace ros { namespace serialization { template<class ContainerAllocator> struct Serializer< ::nodes::display_image_loadRequest_<ContainerAllocator> > { template<typename Stream, typename T> inline static void allInOne(Stream& stream, T m) { stream.next(m.filename); } ROS_DECLARE_ALLINONE_SERIALIZER; }; // struct display_image_loadRequest_ } // namespace serialization } // namespace ros namespace ros { namespace message_operations { template<class ContainerAllocator> struct Printer< ::nodes::display_image_loadRequest_<ContainerAllocator> > { template<typename Stream> static void stream(Stream& s, const std::string& indent, const ::nodes::display_image_loadRequest_<ContainerAllocator>& v) { s << indent << "filename: "; Printer<std::basic_string<char, std::char_traits<char>, typename ContainerAllocator::template rebind<char>::other > >::stream(s, indent + " ", v.filename); } }; } // namespace message_operations } // namespace ros #endif // NODES_MESSAGE_DISPLAY_IMAGE_LOADREQUEST_H
05cee93e11d5a2e2434c4e2ceacad37aecca8847
2b57249ad3597ee398160e25809deb267b82dc4c
/Aether/game/entity/components/collisionComponent.hpp
85a44c3853220cbdfdfd45fcb654d2f134ea1d9b
[]
no_license
ianw3214/aetherpath
391e9da40bacf2245eae82c925b40d2ca7ee191b
b6586c59099c01f42d8c827204e4bf9bd5e8d323
refs/heads/master
2022-12-16T02:26:17.678101
2020-09-16T00:34:07
2020-09-16T00:34:07
256,650,685
0
0
null
null
null
null
UTF-8
C++
false
false
1,611
hpp
#pragma once #include "oasis.h" #include "game/entity/component.hpp" #include "nlohmann/json.hpp" using json = nlohmann::json; //////////////////////////////////////////////////////////////// struct Shape { enum class Type { INVALID = -1, RECT, CIRCLE }; Type m_type; float m_offsetX; float m_offsetY; union { struct { float m_radius; }; struct { float m_width; float m_height; }; }; static Shape GenerateRect(float width, float height, float offsetX = 0.f, float offsetY = 0.f); static Shape GenerateCircle(float radius, float offsetX = 0.f, float offsetY = 0.f); static Shape LoadFromJson(const json& data); }; //////////////////////////////////////////////////////////////// class CollisionComponent : public Component { public: CollisionComponent(Ref<Entity> entity, Shape shape = {Shape::Type::INVALID}); // Collision components don't need to actually update anything because // collisions are handled by an external systems // virtual void Update(float delta) override; inline bool IsValid() const { return m_shape.m_type != Shape::Type::INVALID; } const Shape& GetShape() const { return m_shape; } // Collision calculations bool Colliding(float x, float y) const; bool Colliding(float x, float y, const Shape& shape) const; private: Shape m_shape; public: // Serialization static std::string GetID() { return "collision"; } static CollisionComponent* LoadFromJson(const json& data, Ref<Entity> entity); };
31304566449e5f836fd14f268a692af6d35852cc
a7544dbcb7f8bfdfac6961466cea861aeb7392f5
/dp/atcoder dp/f.cpp
0f65af788656560cbc335de10dcec2d1b8608af9
[]
no_license
rahulmala007/Compy
7359f2095a3d0c8d6188533fe86c3330cf700092
a7f248a26bb6462cf22d6a2766ca54b546e73097
refs/heads/master
2022-11-19T13:36:03.630329
2020-07-16T21:03:09
2020-07-16T21:03:09
276,660,657
1
0
null
null
null
null
UTF-8
C++
false
false
2,365
cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define pf push_front #define fi first #define se second #define si size() #define bk back() #define popb pop_back() #define fastio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL) #define endl "\n" #define lb lower_bound #define ub upper_bound #define emp empty() #define beg begin() #define en end() #define ump unordered_map #define forl(i,a,n) for(int i=a;i<n;i++) #define rfor(i,n,a) for(int i=n;i>=a;i--) #define fore(i,a,n) for(int i=a;i<=n;i++) #define len length() int main() { string s,t; cin>>s>>t; int n=s.len; int m=t.len; int dp[n][m]; forl(i,0,n) forl(j,0,m) dp[i][j]=0; //dp[i][j]------ means consider s(0..i) and t(0...j) // if s(i)==t(j) then check (i-1,j-1)+1,(i-1,j),(i,j-1) //else check (i-1,j) and (i,j-1) int maxn=n+1; int maxm=m+1; forl(i,0,n){ if(s[i]==t[0]) { maxn=i; break; } } forl(i,0,m){ if(t[i]==s[0]) { maxm=i; break; } } forl(i,maxn,n) { dp[i][0]=1; } forl(i,maxm,m) { dp[0][i]=1; } forl(i,1,n) { forl(j,1,m) { if(s[i]==t[j]) dp[i][j]=max(dp[i-1][j-1]+1,max(dp[i-1][j],dp[i][j-1])); else{ dp[i][j]=max(dp[i-1][j],dp[i][j-1]); } } } //cout<<dp[n-1][m-1]<<endl; int i=n-1,j=m-1; vector<char>v; //heree check which condition was folowed and track the dp transitions while(i>=0 && j>=0) { if(i==0){ if(dp[i][j])v.pb(s[i]); break; } if(j==0) { if(dp[i][j])v.pb(t[j]); break; } if(s[i]==t[j]) { if(dp[i-1][j-1]+1==max(dp[i-1][j-1]+1,max(dp[i-1][j],dp[i][j-1]))) { v.pb(s[i]); i--; j--; }else if(dp[i-1][j]==max(dp[i-1][j-1]+1,max(dp[i-1][j],dp[i][j-1]))) { i--; }else j--; } else { if(dp[i-1][j]==max(dp[i-1][j],dp[i][j-1])) { i--; }else j--; } } rfor(i,v.si-1,0) cout<<v[i]; cout<<endl; }
71f143855dc0cbc6da02a97662458e74970afac6
3ad968797a01a4e4b9a87e2200eeb3fb47bf269a
/Advanced MFC Programming/Chap3/3.1/Sdi/Spw/MainFrm.h
4010ecfc162048af730c0312f96f88b2b5888bd6
[]
no_license
LittleDrogon/MFC-Examples
403641a1ae9b90e67fe242da3af6d9285698f10b
1d8b5d19033409cd89da3aba3ec1695802c89a7a
refs/heads/main
2023-03-20T22:53:02.590825
2020-12-31T09:56:37
2020-12-31T09:56:37
null
0
0
null
null
null
null
UTF-8
C++
false
false
969
h
#if !defined(AFX_MAINFRM_H__D3F202A9_FC3A_11D0_9C9A_444553540000__INCLUDED_) #define AFX_MAINFRM_H__D3F202A9_FC3A_11D0_9C9A_444553540000__INCLUDED_ #if _MSC_VER >= 1000 #pragma once #endif class CMainFrame : public CFrameWnd { protected: CMainFrame(); DECLARE_DYNCREATE(CMainFrame) public: //{{AFX_VIRTUAL(CMainFrame) public: virtual BOOL PreCreateWindow(CREATESTRUCT& cs); protected: virtual BOOL OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext); //}}AFX_VIRTUAL public: virtual ~CMainFrame(); #ifdef _DEBUG virtual void AssertValid() const; virtual void Dump(CDumpContext& dc) const; #endif protected: CStatusBar m_wndStatusBar; CToolBar m_wndToolBar; CSplitterWnd m_wndSpMain; CSplitterWnd m_wndSpSub; //{{AFX_MSG(CMainFrame) afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); //}}AFX_MSG DECLARE_MESSAGE_MAP() }; //{{AFX_INSERT_LOCATION}} #endif // !defined(AFX_MAINFRM_H__D3F202A9_FC3A_11D0_9C9A_444553540000__INCLUDED_)
52c586567251a1374276535abeae31863a43ed2f
cecfda84e25466259d3ef091953c3ac7b44dc1fc
/UVa Online Judge/volume004/407 Gears on a Board/program.cpp
159936b72423beec7f69fda14d19b0a467f24592
[]
no_license
metaphysis/Code
8e3c3610484a8b5ca0bb116bc499a064dda55966
d144f4026872aae45b38562457464497728ae0d6
refs/heads/master
2023-07-26T12:44:21.932839
2023-07-12T13:39:41
2023-07-12T13:39:41
53,327,611
231
57
null
null
null
null
UTF-8
C++
false
false
4,374
cpp
// Gears on a Board // UVa ID: 407 // Verdict: Accepted // Submission Date: 2016-08-06 // UVa Run Time: 0.000s // // 版权所有(C)2016,邱秋。metaphysis # yeah dot net #include <bits/stdc++.h> using namespace std; const double epsilon = 1e-6; struct gear { int index; double x, y, gir, gor; bool is_rotate_left; double velocity; }; struct adjacent { int index; bool ir_touched, or_touched; }; int cases = 0, ng; vector<gear> gears; vector<vector<adjacent>> edges; void run() { cout << "Simulation #" << ++cases << '\n'; edges.assign(ng, vector<adjacent>()); for (int i = 0; i < ng; i++) for (int j = i + 1; j < ng; j++) { adjacent edge; edge.index = j, edge.ir_touched = false, edge.or_touched = false; double d = sqrt(pow(gears[i].x - gears[j].x, 2) + pow(gears[i].y - gears[j].y, 2)); if (d < gears[i].gir + gears[j].gir - epsilon || d < gears[i].gor + gears[j].gor - epsilon) { cout << "Error -- Overlapping Gears\n\n"; return; } if (fabs(d - gears[i].gir - gears[j].gir) < epsilon) edge.ir_touched = true; if (fabs(d - gears[i].gor - gears[j].gor) < epsilon) edge.or_touched = true; if (edge.ir_touched || edge.or_touched) { edges[i].push_back(edge); edge.index = i; edges[j].push_back(edge); } } vector<bool> visited(ng, false); queue<int> unvisited; unvisited.push(0); visited[0] = true; while (unvisited.empty() == false) { int current = unvisited.front(); unvisited.pop(); bool is_rotate_left = !gears[current].is_rotate_left; for (auto edge : edges[current]) { double final_velocity, ir_velocity = -1.0, or_velocity = -1.0; if (edge.ir_touched) { ir_velocity = gears[current].gir / gears[edge.index].gir * gears[current].velocity; final_velocity = ir_velocity; } if (edge.or_touched) { or_velocity = gears[current].gor / gears[edge.index].gor * gears[current].velocity; final_velocity = or_velocity; } if (ir_velocity > 0 && or_velocity > 0 && fabs(ir_velocity - or_velocity) > epsilon) { cout << "Error -- Conflicting Gear Rotation\n\n"; return; } if (visited[edge.index] == false) { gears[edge.index].is_rotate_left = is_rotate_left; gears[edge.index].velocity = final_velocity; visited[edge.index] = true; unvisited.push(edge.index); } else { if (gears[edge.index].is_rotate_left != is_rotate_left || fabs(gears[edge.index].velocity - final_velocity) > epsilon) { cout << "Error -- Conflicting Gear Rotation\n\n"; return; } } } } for (int i = 1; i < ng; i++) { cout << ' ' << i << ": "; if (fabs(gears[i].velocity) < epsilon) { cout << "Warning -- Idle Gear\n"; continue; } cout << (gears[i].is_rotate_left ? 'L' : 'R'); cout << ' ' << fixed << setprecision(2) << gears[i].velocity; cout << '\n'; } cout << '\n'; } int main(int argc, char *argv[]) { cin.tie(0); cout.tie(0); ios::sync_with_stdio(false); double x, y, gir, gor, velocity; gear motor; while (cin >> motor.x >> motor.y >> motor.gir >> motor.gor >> motor.velocity >> ng) { gears.clear(); motor.is_rotate_left = motor.velocity < 0; motor.velocity = fabs(motor.velocity); gears.push_back(motor); for (int i = 1; i <= ng; i++) { cin >> x >> y >> gir >> gor; gears.push_back((gear){i, x, y, gir, gor, false, 0.0}); } ng++; run(); } return 0; }
e67912a9cf1279e51224db73fd698d8b22ceac18
4b12cc5b3c486afa4285f266568fa4d16c70152e
/nfpvr/ProgramOptions.cpp
55786219d50dbf09348fcbc3194e495ebd437f7d
[]
no_license
15831944/nfpvr
704950c669931f163550d9f41da77fd64bc9f192
27c30bca8a65d7e383eb09c4c1cacc784c48c87d
refs/heads/master
2023-03-16T22:33:15.264716
2015-08-28T12:03:58
2015-08-28T12:03:58
null
0
0
null
null
null
null
UTF-8
C++
false
false
487
cpp
#include "ProgramOptions.h" int ProgramOptions::DEFAULT_UDP_PORT = 50000; ProgramOptions::ProgramOptions() { _bufferOutput = false; _help = false; _handleAudio = true; _handleVideo = true; _readRaw = false; _receiveThread = false; _verbose = false; _version = false; _writeMpeg = true; _writeRaw = false; _udpPort = DEFAULT_UDP_PORT; _writeRawFilename = 0; _readRawFilename = 0; _outputDirectory = 0; }
[ "Jonathan.Fillion@540bb0b6-3e47-0410-ac65-37213380c7e5" ]
Jonathan.Fillion@540bb0b6-3e47-0410-ac65-37213380c7e5