repo_name
stringlengths
4
116
path
stringlengths
4
379
size
stringlengths
1
7
content
stringlengths
3
1.05M
license
stringclasses
15 values
Norrlandsit/d8
sites/default/files/php/twig/1#97#41#236ce43242c3a3dbc1cc5ee3e3413f61a8f0f63377202153f269935d959b/f8a04e7ea1688d37c62d50f6515d20d1612798d9b93594cb82b31999dbcd0f06.php
1178
<?php /* core/modules/system/templates/datetime-form.html.twig */ class __TwigTemplate_9741236ce43242c3a3dbc1cc5ee3e3413f61a8f0f63377202153f269935d959b extends Twig_Template { public function __construct(Twig_Environment $env) { parent::__construct($env); $this->parent = false; $this->blocks = array( ); } protected function doDisplay(array $context, array $blocks = array()) { // line 15 echo "<div"; echo twig_drupal_escape_filter($this->env, $this->getAttribute((isset($context["attributes"]) ? $context["attributes"] : null), "addClass", array(0 => "container-inline"), "method"), "html", null, true); echo "> "; // line 16 echo twig_drupal_escape_filter($this->env, (isset($context["content"]) ? $context["content"] : null), "html", null, true); echo " </div> "; } public function getTemplateName() { return "core/modules/system/templates/datetime-form.html.twig"; } public function isTraitable() { return false; } public function getDebugInfo() { return array ( 24 => 16, 19 => 15,); } }
gpl-2.0
iammyr/Benchmark
src/main/java/org/owasp/benchmark/testcode/BenchmarkTest02526.java
2878
/** * OWASP Benchmark Project v1.1 * * This file is part of the Open Web Application Security Project (OWASP) * Benchmark Project. For details, please see * <a href="https://www.owasp.org/index.php/Benchmark">https://www.owasp.org/index.php/Benchmark</a>. * * The Benchmark is free software: you can redistribute it and/or modify it under the terms * of the GNU General Public License as published by the Free Software Foundation, version 2. * * The Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details * * @author Nick Sanidas <a href="https://www.aspectsecurity.com">Aspect Security</a> * @created 2015 */ package org.owasp.benchmark.testcode; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @WebServlet("/BenchmarkTest02526") public class BenchmarkTest02526 extends HttpServlet { private static final long serialVersionUID = 1L; @Override public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doPost(request, response); } @Override public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String param = ""; java.util.Enumeration<String> headers = request.getHeaders("foo"); if (headers.hasMoreElements()) { param = headers.nextElement(); // just grab first element } String bar; String guess = "ABC"; char switchTarget = guess.charAt(2); // Simple case statement that assigns param to bar on conditions 'A' or 'C' switch (switchTarget) { case 'A': bar = param; break; case 'B': bar = "bobs_your_uncle"; break; case 'C': case 'D': bar = param; break; default: bar = "bobs_your_uncle"; break; } java.util.List<String> argList = new java.util.ArrayList<String>(); String osName = System.getProperty("os.name"); if (osName.indexOf("Windows") != -1) { argList.add("cmd.exe"); argList.add("/c"); } else { argList.add("sh"); argList.add("-c"); } argList.add("echo"); argList.add(bar); ProcessBuilder pb = new ProcessBuilder(); pb.command(argList); try { Process p = pb.start(); org.owasp.benchmark.helpers.Utils.printOSCommandResults(p); } catch (IOException e) { System.out.println("Problem executing cmdi - java.lang.ProcessBuilder(java.util.List) Test Case"); throw new ServletException(e); } } }
gpl-2.0
sergey-donchenko/adplus
project/app/views/category/list/items.blade.php
1270
<div class="modal-backdrop fade in"></div> @foreach( $aCategories as $cItem) <div class="directory-block col-sm-4 col-xs-6{{isset($sContainerClass) ? ' ' . $sContainerClass : ''}}"> <div class="row"> <div class="col-sm-3">{{ HTML::image( '/app/image/category/30,30/' . ($cItem->icon_image ? $cItem->icon_image : '-'), $cItem->name, array('class' => 'img-rounded')) }}</div> <div class="col-sm-9"> @if( !(isset($bHideTitle) && $bHideTitle === true) ) <h4>{{ $cItem->name }}</h4> @endif <p> @if ( $cItem->children_count > 0 ) @foreach( $cItem->getChildrenAttribute() as $index => $cSubItem) @if ( $index >= 5 && !( isset($bShowAll) && $bShowAll === true ) ) <p><a href="#" class="category-item hasChildren" attr-id="{{ $cItem->id }}" attr-parent-id="0" title="{{ $cItem->name }}">more >></a></p> <?php break;?> @endif <a href="" class="category-item {{ $cSubItem->getCssClassAttribute() }}" attr-id="{{ $cSubItem->id }}" attr-parent-id="{{ $cSubItem->parent_id }}" title="{{ $cSubItem->name }}"> {{ $cSubItem->name }} @if ( $cSubItem->children_count > 0 ) *** @endif </a> @endforeach @endif </p> </div> </div> </div> @endforeach
gpl-2.0
bablukid/cagette
frontend/cagette-neo/dist/vo/place.d.ts
256
export interface PlaceVo { id: number; name: string; address1?: string; address2?: string; city?: string; zipCode?: string; lat?: number; lng?: number; } export declare const parsePlaceVo: (data: any) => PlaceVo;
gpl-2.0
jamielaff/als_resourcing
templates/uber/acm/hero/tmpl/style-5.php
2702
<?php $heroStyle = $helper->get('hero-style'); $heroTextPos = $helper->get('hero-content-position'); $heroTextAlign = $helper->get('hero-text-align'); $heroHeading = $helper->get('hero-heading'); $heroHeadingSize= $helper->get('hero-heading-size'); $heroIntro = $helper->get('hero-intro'); $btnFirstText = $helper->get('hero-btn1-text'); $btnFirstLink = $helper->get('hero-btn1-link'); $btnFirstClass = $helper->get('hero-btn1-class'); $btnSecondText = $helper->get('hero-btn2-text'); $btnSecondLink = $helper->get('hero-btn2-link'); $heroBg = $helper->get('hero-bg'); $heroImg = $helper->get('hero-img'); ?> <div class="section-inner <?php echo $helper->get('block-extra-class'); ?>"> <div class="acm-hero style-5 <?php echo ($heroStyle .' '. $heroTextPos. ' '. $heroTextAlign); ?> <?php if( trim($heroHeading) ) echo ' show-intro'; ?>" style="background: url(<?php echo trim($heroBg); ?>) no-repeat center top;"> <div class="container"> <div class="hero-content <?php if( trim($heroImg)) : ?>row<?php endif; ?>"> <?php if( trim($heroImg)) : ?> <div class="col-sm-4"> <div class="hero-img"> <img src="<?php echo $heroImg; ?>" alt="<?php echo $heroHeading; ?>" /> </div> </div> <?php endif; ?> <?php if( trim($heroHeading) || trim($heroIntro) || trim($btnFirstText) || trim($btnSecondText) ) : ?> <div class="<?php if( trim($heroImg)) : ?> col-sm-8 <?php endif; ?>"> <?php if( trim($heroHeading)) : ?> <div class="hero-heading <?php echo $heroHeadingSize; ?>"> <?php echo $heroHeading; ?> </div> <?php endif; ?> <?php if( trim($heroIntro)) : ?> <div class="hero-intro"> <?php echo $heroIntro; ?> </div> <?php endif; ?> <?php if( trim($btnFirstText) || trim($btnSecondText) ) : ?> <div class="hero-btn-actions"> <?php if(trim($btnFirstText)): ?> <a href="<?php echo trim($btnFirstLink); ?>" title="<?php echo trim($btnFirstText); ?>" class="btn <?php echo trim($btnFirstClass); ?>"><?php echo trim($btnFirstText); ?><i class="fa fa-angle-right"></i></a> <?php endif; ?> <?php if(trim($btnSecondText)): ?> <a href="<?php echo trim($btnSecondLink); ?>" title="<?php echo trim($btnSecondText); ?>" class="btn"><?php echo trim($btnSecondText); ?><i class="fa fa-angle-right"></i></a> <?php endif; ?> </div> <?php endif; ?> </div> <?php endif; ?> </div> </div> </div> </div>
gpl-2.0
paul-chambers/netgear-r7800
git_home/net-cgi.git/www/language/Russian.js
54382
//BRS_01_checkNet.html bh_internet_checking="Проверка подключения к Интернету; подождите ..." //BRS_02_genieHelp.html bh_config_net_connection="Настройка подключения к Интернету" bh_connection_further_action="Соединение с Интернетом еще не установлено." bh_want_genie_help="Использовать NETGEAR genie?" bh_yes_mark=" Да " bh_no_genie_help="Нет, я хочу настроить подключение к Интернету самостоятельно." bh_no_genie_help_confirm="Настройка подключения к Интернету требует знаний в области сетевых технологий. Вы уверены?" bh_have_saved_copy="<b>Сохраненные настройки роутера.</b> Я собираюсь загрузить сохраненные настройки конфигурации роутера." bh_next_mark=" Далее " bh_need_genie_help="<b>Да.</b> Я разрешаю программе NETGEAR genie определить надлежащие настройки для моей среды и автоматически настроить мой роутер." bh_no_need_genie_help="<b>Нет.</b> Я собираюсь вручную ввести настройки конфигурации с помощью мастера NETGEAR genie." //BRS_03A_detcInetType.html bh_detecting_connection="Обнаружение подключения к Интернету" bh_plz_wait_process="Этот процесс может занять одну-две минуты; подождите..." //BRS_03A_A_noWan.html bh_no_cable="Кабель Ethernet не подключен к порту сети Интернет на роутере" bh_wizard_setup_nowan_check="Убедитесь, что кабель надежно подключен к порту широкополосного модема и порту сети Интернет роутера." bh_click_try_again="После проверки кабеля Ethernet нажмите <b>Повторить попытку</b>." bh_try_again="Повторить попытку" bh_try_skip="skip" //BRS_03A_B_pppoe.html bh_pppoe_connection="Обнаружено подключение к Интернету по протоколу PPPoE" bh_enter_info_below="Введите необходимые сведения ниже." bh_pppoe_login_name="Имя пользователя" bh_ddns_passwd="Пароль" //BRS_03A_B_pppoe_reenter.html bh_ISP_namePasswd_error="Неверное имя пользователя и/или пароль интернет-провайдера" bh_enter_info_again="Введите необходимые сведения еще раз." //BRS_03A_C_pptp.html bh_pptp_login_name="Вход в систему" bh_pptp_connection="Обнаружено подключение к Интернету по протоколу PPTP" bh_basic_pptp_servip="Адрес сервера" bh_sta_routes_gtwip="IP-адрес шлюза" bh_basic_pptp_connection_id="ID/Имя подключения" //BRS_03A_F_l2tp.html bh_l2tp_connection="Обнаружено подключение к Интернету по протоколу L2TP" //BRS_03A_D_bigpond.html bh_bpa_connection="Обнаружено подключение к Интернету с использованием BigPond" bh_basic_bpa_auth_serv="Сервер аутентификации" bh_basic_pppoe_idle="Время бездействия перед отключением (в минутах)" //BRS_03A_E_IP_problem_staticIP.html bh_no_internet_ip="Обнаружена проблема при подключении к Интернету" bh_no_internet_ip2="Обнаружена проблема при подключении к Интернету – IP-адрес" bh_no_internet_ip3="Обнаружена проблема при подключении к Интернету – MAC-адрес" bh_if_have_static_ip="Ваш интернет-провайдер (ISP) назначил вам фиксированный (статический) IP-адрес?; Это <b>очень редкая</b> специальная опция. " bh_yes_correct="Да. Мой интернет-провайдер назначил мне фиксированный (статический) IP-адрес." bh_not_have_static_ip="Нет, я не получил фиксированный (статический) IP-адрес от интернет-провайдера." bh_do_not_know="Я не знаю. " bh_select_option="Выберите опцию и нажмите <b>Далее</b> для продолжения процедуры." bh_select_an_option="Сначала выберите опцию." //BRS_03A_E_IP_problem_staticIP_A_inputIP.html bh_fix_ip_setting="Настройки фиксированного IP-адреса в Интернет" bh_enter_ip_setting="Введите фиксированный IP-адрес, назначенный интернет-провайдером, затем нажмите <b>Далее</b> для продолжения процедуры." bh_info_mark_ip="IP-адрес" //var bh_info_mark_ip="Мой IP-адрес" bh_info_mark_mask="Маска подсети" bh_constatus_defgtw="Шлюз по умолчанию" bh_preferred_dns="Предпочтительный сервер DNS" bh_alternate_dns="Альтернативный сервер DNS" bh_basic_int_third_dns="Третий DNS" //BRS_03A_E_IP_problem.html bh_genie_cannot_find_ip="Наиболее вероятные причины:" bh_genie_cannot_find_ip_reason1="1.  На этапе подключения кабеля Питание не было выполнено выключение и повторное включение питания модема." bh_genie_cannot_find_ip_reason1_desc="Чтобы решить эту проблему, выключите и снова включите питание модема. Чтобы выключить и снова включить питание модема, имеющего резервную батарею, необходимо извлечь и снова установить батарею. После выключения и повторного включения необходимо подождать 2 минуты до полного запуска модема." bh_genie_cannot_find_ip_reason2="2.  Желтый кабель Ethernet подключен ненадежно или подключен не к тому разъему." bh_genie_cannot_find_ip_reason2_desc="Чтобы решить эту проблему, убедитесь, что желтый кабель Ethernet надежно подключен к порту широкополосного модема и порту сети Интернет роутера." bh_select_no_IP_option="Выберите одну из опций, представленных ниже, и нажмите <b>Далее</b> для продолжения процедуры:" bh_select_no_IP_option1="Я отключил и снова подключил питание модема и подождал 2 минуты." bh_select_no_IP_option2="Я исправил неполадку с кабелем Ethernet." bh_select_no_IP_option3="Ничего из перечисленного." //BRS_03A_E_IP_problem_staticIP_B_macClone.html bh_use_pc_mac="Если вы ранее подключались к Интернету с использованием компьютера или другого роутера, NETGEAR genie может использовать MAC-адрес этого устройства." bh_mac_in_product_label="MAC-адрес – это уникальный номер. MAC-адрес компьютера или роутера указан на этикетке продукта." bh_enter_mac="Введите MAC-адрес в это поле." bh_mac_format="(формат AABBCCDDEEFF)" //BRS_03B_haveBackupFile.html bh_settings_restoration="Восстановление настроек роутера " bh_browser_file="Перейдите к файлу резервного копирования настроек роутера (сохраненному ранее) и нажмите <b>Далее</b> для продолжения процедуры." bh_back_mark="Назад " bh_browse_mark="Обзор" //BRS_03B_haveBackupFile_fileRestore.html bh_settings_restoring="Восстановление настроек роутера" bh_plz_waite_restore="Этот процесс может занять несколько минут; подождите ..." //BRS_04_applySettings.html bh_apply_connection="Применение настроек подключения к Интернету" bh_plz_waite_apply_connection="Этот процесс может занять одну-две минуты; подождите..." //BRS_05_networkIssue.html bh_netword_issue="Проблема при подключении к сети" bh_cannot_connect_internet="Pоутер не может подключиться к Интернету с текущими настройками." bh_plz_reveiw_items="Проверьте выполнение следующих шагов:" bh_cable_connection="- Проверьте правильность подключения кабелей. См. инструкции в Руководстве по установке роутера." bh_modem_power_properly="- Убедитесь, что питание широкополосного модема было выключено и снова включено в соответствии с инструкциями. В случае модема с аварийным батарейным питанием извлеките и снова установите батарею для перезапуска модема." bh_try_again_or_manual_config="Повторить попытку использования NETGEAR genie?" bh_I_want_manual_config="Нет. Я хочу настроить подключение к Интернету самостоятельно." bh_manual_config_connection="Я хочу настроить подключение к Интернету самостоятельно" //BRS_success.html bh_congratulations="Поздравляем!" bh_connect_success_1="Соединение с Интернетом установлено." bh_connect_success_2="Данный роутер предварительно настроен для использования уникального имени Wi-Fi сети (SSID) и " bh_network_key="сетевого ключа (пароля)" bh_rollover_help_text="Ваш роутер предварительно настроен для использования системы безопасности беспроводного соединения WPA2-PSK, которая позволяет защитить сеть от несанкционированного доступа. Чтобы подключиться к беспроводной сети, необходимо ввести сетевой ключ (пароль). Эти предварительные настройки являются уникальными для данного устройства (так же, как и серийный номер).  При необходимости можно изменить их позже на экране Настройки беспров. сети в веб-интерфейсе роутера." bh_success_no_wireless_security_1 ="На этом роутере не включена система безопасности беспроводной сети. NETGEAR настоятельно рекомендует " bh_success_no_wireless_security_2 ="нажать здесь," bh_success_no_wireless_security_3 =" включить защиту, чтобы обезопасить свою сеть." bh_wirless_name="Имя беспроводной сети (SSID)" bh_wireless="Wi-Fi сеть" bh_wpa_wpa2_passpharse="Сетевой ключ (пароль)" bh_save_settings="Сохранить настройки" bh_print_this="Распечатать" bh_take_to_internet="Перейти в Интернет" bh_plz_wait_moment="Подождите..." //the string for not_support_print is temporary. bh_not_support_print="Компьютер не обеспечивает поддержку принтера." //already exist bh_login_name_null="Поле 'Имя пользователя' не может быть пустым." bh_password_error="Недопустимый пароль" bh_idle_time_null="Введите продолжительность паузы.\n" bh_invalid_idle_time="Недопустимое время ожидания перед отключением. Введите верное значение.\n" bh_invalid_myip="Недопустимый Мой IP-адрес. Повторите попытку или оставьте поле незаполненным." bh_invalid_gateway="Недопустимый IP-адрес шлюза. Повторите попытку!" bh_bpa_invalid_serv_name="Недействительный IP-адрес сервера аутентификации." bh_invalid_servip_length="Этикетки могут содержать не более 63 символов.\n" bh_invalid_ip="Недопустимый IP-адрес. Повторите попытку!" bh_invalid_mask="Недопустимая маска сети. Повторите попытку!\n" bh_same_subnet_ip_gtw="IP-адрес и IP-адрес шлюза должны находиться в одной подсети!\n" bh_same_lan_wan_subnet="IP-адреса локальной сети и Интернет-порта не должны находиться в одной подсети!\n" bh_filename_null="Введите имя файла!" bh_not_correct_file="Назначьте правильный файл. Формат файла –*." bh_ask_for_restore="Предупреждение!\nПри восстановлении параметров с помощью файла настройки все текущие параметры будут утеряны.\nПродолжить?" bh_invalid_primary_dns="Недопустимый предпочитаемый DNS-адрес. Повторите попытку!\n" bh_invalid_second_dns="Недопустимый альтернативный DNS-адрес. Повторите попытку!\n" hb_invalid_third_dns="Недопустимый третичный DNS-адрес. Повторите попытку ввода" bh_dns_must_specified="Необходимо указать адрес DNS" bh_invalid_mac="Недопустимый MAC-адрес" bh_failure_head="Ошибка" bh_few_second="Эта страница автоматически вернется на предыдущую страницу через несколько секунд..." bh_important="Важное обновление" bh_wanlan_conflict_info="Для предотвращения конфликта с Интернет-провайдером IP-адрес роутера был обновлен на " bh_continue_mark="Продолжить" bh_same_server_wan_ip="Мой IP-адрес не должен совпадать с адресом сервера!" //WIZ_sel_3g_adsl.htm bh_connection_mode="Выберите режим подключения" bh_ethernet_connection="Всегда использовать проводное соединение" bh_mobile_broadband_connection="Всегда использовать мобильное широкополосное соединение" bh_multi_wan_connection="Режим Failover" //config_3g_wait_page.htm bh_umts_3g_mode="Определение мобильного USB-модема" //detect_succ_hsdpa.htm bh_detect_hsdpa_msg="Введите конфигурацию поставщика услуг" bh_detect_hsdpa_msg1="Выберите <strong>Интернет-провайдер</strong> и нажмите <strong>Далее</strong>." bh_detect_hsdpa_msg2="Если ваш интернет-провайдер мобильной широкополосной сети не указан в раскрывающемся списке, выберите другого провайдера." bh_country_3g="Страна" bh_basic_intserv_provider="Тип подключения" bh_access_number_3g="Номер доступа" //country list bh_coun_austrilia="Австралия" bh_coun_austria="Австрия" bh_coun_belgium="Бельгия" bh_coun_brazil="Бразилия" bh_coun_chile="Чили" bh_coun_china="Китай" bh_coun_finland="Финляндия" bh_coun_germany="Германия" bh_coun_hk="Гонконг" bh_coun_italy="Италия" bh_coun_netherlands="Нидерланды" bh_coun_newzealand="Новая Зеландия" bh_coun_norway="Норвегия" bh_coun_peru="Перу" bh_coun_russia="Россия" bh_coun_singapore="Сингапур" bh_coun_south_africa="ЮАР" bh_coun_sweden="Швеция" bh_coun_tw="Тайвань" bh_coun_uk="UK" bh_coun_usa="США" //detect_not.htm bh_unable_detect_msg="Не удалось обнаружить модем" bh_unable_detect_msg1="Адаптер мобильного широкополосного USB-модема не обнаружен." bh_want_try_again="Повторить попытку использования NETGEAR genie?" //detect_no_sim.htm bh_detect_not_simcard="SIM-карта не обнаружена" bh_detect_not_simcard_msg1="Проблема может заключаться в следующем"//problem_prompt bh_detect_not_simcard_msg2="SIM-карта не обнаружена"//135 bh_detect_not_simcard_msg3="Убедитесь, что SIM-карта установлена и правильно расположена." bh_detect_not_simcard_msg4="SIM-карта отклонена." bh_detect_not_simcard_msg5="Убедитесь, что SIM-карта является действительной." bh_quit_mark="Прекратить" //BRS_00_01_check_ap.html bh_check_ap="Проверка сети на наличие необходимой информации для правильной настройки роутера." //BRS_00_02_ap_select.html bh_router_mode="Режим роутера" bh_ap_mode="Режим точки доступа" bh_router_doc="Router mode gives you two different networks:The existing network from the original router,and another network from your new NETGER router.All router functions are available." bh_ap_doc="This mode keeps the existing network from the original router only.Not all of the NETGEAR router's router's features are available in Access Point mode." bh_ap_learn="Подробнее" bh_ap_learn_more="Подробнее" bh_learn_tile="The following router features are not available if you choose Access Point" bh_learn_mode="mode:" bh_learn1="Setup wizard" bh_learn2="Parental control" bh_learn3="Qos" bh_learn4="Block sites" bh_learn5="Block services" bh_learn6="Port forwarding" bh_learn7="Port triggering" bh_learn8="DDNS" bh_learn9="Static route" bh_learn11="IPv6" bh_learn12="UPnp" bh_learn13="Traffic meter" bh_learn14="Remote management" bh_learn15="Guest network" //ap waning page bh_ap_warn="ПРЕДУПРЕЖДЕНИЕ" bh_ap_warn_doc="Your router is about to setup to Access Piont Mode. You may experience short network interruption due to your router and client will need to obtain new IP address from your existing Router,If you lost network connection,you may mannually connect to router again by visiting" bh_ap_link="www.routerlogin.net" bh_ap_select_title="В вашей сети обнаружен роутер или шлюз" bh_ap_select_doc="Ваш роутер NETGEAR подключен к сети, к которой уже подключен другой роутер. Если другой роутер необходимо отставить подключенным, Genie рекомендует использовать режим точки доступа для роутера NETGEAR. В режиме точки доступа роутер NETGEAR можно использовать для подключения к сети, в то время как другой роутер продолжает выполнять те же сетевые задачи, что и раньше." bh_ap_select_question="Включить режим точки доступа для этого устройства" bh_ap_select_item_1="Да (рекомендуется)" bh_ap_select_item_2="Нет, использовать как роутер в режиме по умолчанию" //BRS_00_03_ap_setup.html bh_ap_setup_title="Чтобы добавить данный роутер в сеть в режиме точки доступа, выполните следующие действия" bh_ap_setup_type_select="IP-адрес этого нового устройства" bh_ap_setup_type_item1="Получить динамический IP-адрес от имеющегося роутера" bh_ap_setup_type_item2="Использовать фиксированный IP-адрес (не рекомендуется)" bh_ap_setup_note="Примечание. После нажатия кнопки 'Далее' этому роутеру будет назначен новый IP-адрес. После этого ваш браузер может отключиться от сети. Для того чтобы подключиться к роутеру, закройте окно и снова запустите браузер." bh_ip_subnet_mask="IP-маска подсети" bh_primary_dns="Предпочитаемый DNS-сервер" bh_secondary_dns="Альтернативный DNS-сервер" //warning bh_wps_in_progress="Выполняется процесс WPS, примените изменения позже." //BRS_00_04_ap_wait.html bh_ap_wait_title="Применение настроек подключения к Интернету" bh_ap_wait_note="Этот процесс может занять одну-две минуты; подождите..." //BRS_no_simcard.html bh_no_simcard="Действительная SIM-карта не обнаружена" bh_not_simcard_msg1="Убедитесь, что SIM-карта является действительной." bh_not_device_msg1="Please check that the device is valid." //BRS_enter_pin.html bh_enter_pincode="Please enter PIN code for SIM Card" bh_enter_pin_msg="Please contact your Service Provider if you do not know your PIN Code" //BRS_enter_puk.html bh_enter_pukcode="Please enter PUK code for SIM Card" bh_enter_puk_msg="Please contact your Service Provider if you do not know your PUK Code" //BRS_no_coverage.html bh_no_coverage="Вне зоны покрытия сети" bh_no_coverage_msg1="Mobile signal not detected." bh_no_coverage_msg2="Please check that the antennas are securely connected to the router." //download genie and readyshare backup_computer="To backup your Mac Computer, please use Time Machine software." mac_genie="NETGEAR Mac genie для настольных систем" wait_process="Выполняется обработка вашего запроса…" not_download="Невозможно загрузить" and="и" readshare="Netgear ReadySHARE Vault" now="сейчас" install_later="загрузите и установите позже." install_start="Для начала установки нажмите кнопку Выполнить" //download bh_download_apps="Загружаются следующие приложения роутера:" bh_genie_app="<b>Приложение genie.</b> С помощью персональной инструментальной панели можно наблюдать за домашней сетью, управлять ею и устранять неполадки сети." bh_rs_vault_app="<b>Приложение ReadySHARE Vault (только для компьютеров под управлением Windows).</b> Включить непрерывное автоматическое резервное копирование данных с компьютера под управлением Windows на USB-накопитель, подключенный к роутеру." bh_exit_mark="Выход" bh_previous="Назад" bh_processing="Processing your request..." bh_downloading="Выполняется загрузка…" bh_dl_all1="По окончании загрузки установите приложения genie и ReadySHARE Vault." bh_dl_all2="После установки приложений genie и ReadySHARE Vault нажмите кнопку 'Далее', чтобы завершить настройку роутера." bh_dl_genie1="Установить приложение genie после завершения загрузки." bh_dl_genie2="Нажмите кнопку 'Далее' после установки приложения genie, чтобы выполнить настройку роутера." bh_dl_vault1="Установить приложение ReadySHARE Vault после завершения загрузки." bh_dl_vault2="Нажмите кнопку 'Далее' после установки приложения ReadySHARE Vault, чтобы выполнить настройку роутера." //firmware checking and update bh_wait_upg_head="Мастер обновления микропрограммного обеспечения" bh_cancel_mark="Отмена" bh_wait_new_version="Обнаружена новая версия микропрограммного обеспечения. Загрузить новую версию сейчас?" bh_current_firmware="Текущая версия" bh_new_firmware="Новая версия микрокода" bh_current_language="Текущая версия языка интерфейса пользователя" bh_new_language="Новая версия языка интерфейса пользователя" bh_greendl_upgrade_version_cur="Текущая версия NETGEAR Downloader" bh_greendl_upgrade_version_new="Новая версия NETGEAR Downloader" bh_no_mark=" Нет " bh_downloading_ver="Сейчас роутер производит загрузку новой версии. Подождите..." bh_download_confile_fail="Не удается загрузить микрокод с сервера NETGEAR. Проверьте подключения к Интернету." bh_upg_md5_check_error="Ошибка при проверке MD5." bh_firmware_check="Проверка версии микрокода" bh_no_new_version="Новая версия микрокода отсутствует." bh_wait_cancel="Обновление микропрограммы прервано." bh_auto_fail_no_internet="Выполните подключение к Интернет-порту и повторите попытку" bh_greendl_upgrade_version_waiting="Pоутер устанавливает более новую версию приложения NETGEAR Downloader. Подождите…" bh_greendl_upgrade_name="Обновить Загрузчик NETGEAR" bh_wait_update_lang="Подождите, язык интерфейса пользователя будет изменен" bh_auto_upg_nowan_head="Нет подключения к Интернету" bh_ml_failDownload="Pоутеру не удается загрузить требующуюся таблицу языков, повторите попытку позже." bh_ml_noInternet="Pоутер не подключен к Интернету, он не может загрузить файл указанного языка с веб-сайта NETGEAR. Если вы не настроили интернет-порт роутера, воспользуйтесь для этого установочным компакт-диском или же вручную подключите роутер к Интернету и снова попытайтесь использовать эту функцию." bh_ok_mark="OK" bh_update_head="Обновление параметров" bh_upgrade_str_1="Примечание. Обновление микропрограммного обеспечения займет около " bh_upgrade_str_2=" минут. <br>Не отключайте электропитание и не нажимайте кнопку сброса." //ap mode detection //BRS_00_02_ap_select.html bh_help_me_choose="Помощь в выборе" bh_help_me_content="genie задаст вам несколько вопросов и предложит оптимальный для вас режим работы." bh_let_me_choose="Самостоятельный выбор" bh_let_me_choose_tips="Режим можно изменить в любой момент, еще раз запустив мастер установки." bh_mode_illustration="Нажмите здесь для просмотра иллюстрации." bh_router_description="Данный режим позволяет использовать роутер NETGEAR <a href='router_function.html' target='_blank'>в режиме роутера.</a> Роутер NETGEAR будет настроен как обычный роутер WiFi, установленный в сети после существующего роутера или шлюза. В данном режиме требуется, чтобы все устройства были подключены к новому роутеру NETGEAR, а не к существующему шлюзу." bh_ap_description="Данный режим подходит для простой настройки, если устройства уже подключены к существующему роутеру или шлюзу или если вы используете новый роутер NETGEAR для расширения зоны покрытия WiFi. Некоторые <a href='router_function.html' target='_blank'>функции роутера</a> недоступны в режиме точки доступа." bh_select_tips="Возможно, вы устанавливаете роутер NETGEAR в сети после существующего роутера или шлюза WiFi интернет-провайдера. Можно также выбрать установку роутера в различных режимах работы." bh_select_router_or_ap="Если вы хотите выбрать режим самостоятельно, необходимо установить переключатель в положение 'Режим роутера' или 'Режим точки доступа'." //BRS_ap_detect_01_01.html bh_current_network="Текущая сеть" bh_help_choose_page1_str="genie обнаружил, что для интернет-подключения используется шлюз. Если требуется использовать все функции нового роутера, NETGEAR рекомендует режим роутера. Ответьте на несколько вопросов genie, чтобы проверить, подходит ли вам данный режим роутера." //BRS_ap_detect_01_02.html bh_help_choose_page2_str="Используете ли вы в настоящее время <a href='router_function.html' target='_blank'>расширенные функции</a>, такие как <a href='port_forwording.html' target='_blank'>переадресация портов</a> (иногда называется перенаправлением портов) на существующем шлюзе? Данные функции обычно используются опытными пользователями." bh_select_yes_or_no="Необходимо выбрать кнопку переключателя 'Да' или 'Нет'." //BRS_ap_detect_01_03.html bh_help_choose_page3_str1="Чтобы режим роутера работал правильно, нужно подключить все WiFi-устройства и проводные устройства к роутеру NETGEAR, кроме предоставленного вашим интернет-провайдером оборудования (такого как телевизионная приставка или беспроводные телефоны с подключением к вашему шлюзу)." bh_help_choose_page3_str2="Можете ли вы отключить все другие устройства (проводные и беспроводные) от существующего шлюза и подключить их снова к роутеру NETGEAR?" //BRS_ap_detect_01_03_note.html bh_ap_note="Примечание" bh_ap_note_str="Для нового роутера NETGEAR будет настроен режим точки доступа. Возможно кратковременное прерывание сетевого подключения, поскольку новый роутер NETGEAR и клиент должны получить новый IP-адрес от существующего роутера. Если сетевое соединение потеряно, снова подключите новый роутер NETGEAR вручную, посетив веб-сайт <a href='http://www.routerlogin.net' target='_blank'><u>www.routerlogin.net</u></a>" //BRS_ap_detect_01_04.html bh_wl_setting_finish="Настройки беспроводной сети данного роутера были изменены. С использованием следующего имени беспроводной сети (SSID) и сетевого ключа (пароля) выполните повторное подключение устройства к роутеру, затем для завершения процесса установки нажмите представленную ниже кнопку <b>Готово</b>." bh_wl_ssid_name="Имя беспроводной сети (SSID) 2,4 ГГц:" bh_wl_password="Ключ беспроводной сети (пароль)" bh_wl_password_2="Пароль беспроводной сети (сетевой ключ) 2,4 ГГц: " bh_wla_ssid_name="Имя беспроводной сети (SSID) 5 ГГц: " bh_wla_password_2="Пароль беспроводной сети (сетевой ключ) 5 ГГц: " bh_wl_finish_warning="ПРЕДУПРЕЖДЕНИЕ. Не нажимайте кнопку <b>Готово</b> до того, как вы снова подключите устройство к роутеру." //BRS_ap_detect_01_ap_01.html bh_ap_suggest_str_1="NETGEAR рекомендует настроить новый роутер в режиме точки доступа, поскольку он не требует изменения конфигурации вашего шлюза." bh_ap_suggest_str_2="Если вы опытный пользователь и знаете, как настроить шлюз для поддержки некоторых из этих расширенных функций, нажмите кнопку <b>Назад</b> и настройте роутер NETGEAR в режиме роутера." //BRS_ap_detect_01_ap_02.html bh_ap_mode_short="Режим точки доступа" bh_ap_mode_tips="Чтобы избежать помех WiFi, которые могут ухудшить производительность сети WiFi, NETGEAR рекомендует отключить функцию WiFi существующего шлюза" bh_mode_query="Можете ли вы отключить функцию WiFi существующего шлюза?" bh_mode_yes_tips="Скопируйте текущие настройки WiFi из существующего шлюза и введите их здесь. Затем отключите функцию WiFi существующего шлюза." bh_mode_no_tips="Чтобы предотвратить подключение WiFi-устройств к существующему шлюзу, используйте следующее имя (SSID) и пароль (сетевой ключ) для подключения всех WiFi-устройств к этому роутеру." ssid_null="Заполните имя SSID!" ssid_not_allowed="Недопустимый для SSID символ" notallowpassps="Пароль содержит от 8 до 63 ASCII-символов или ровно 64 шестнадцатеричных цифры. К шестнадцатеричным относятся следующие символы: 0, 1, 2, ..., 8, 9, A, B, C, D, E, F." passphrase_short8="Недостаточная длина пароля. Пароль должен содержать минимум 8 символов." passphrase_long63="Пароль слишком длинный. Длина пароля не должна превышать 63 символа." //BRS_ap_detect_01_router_01.html bh_router_suggest_str_1="NETGEAR рекомендует настроить для нового роутера режим роутера." bh_router_suggest_str_2="Режим роутера позволяет использовать все расширенные функции роутера NETGEAR. Для изменения режима всегда можно снова запустить мастер настройки." //BRS_ap_detect_01_router_02.html bh_router_tips="<p>NETGEAR рекомендует отключить функцию WiFi существующего шлюза, чтобы избежать следующих проблем:</p><ul><li>Случайное подключение к существующему шлюзу вместо нового роутера NETGEAR</li><li>Помехи между новым роутером NETGEAR и сетью WiFi существующего шлюза</li></ul>" //BRS_ap_detect_learn.html bh_router="Роутер" bh_learn_more_title="Сравнение роутера и точки доступа" bh_learn_more_str_1="genie обнаружил, что вы пытаетесь установить новый роутер NETGEAR после другого шлюза, например DSL-шлюза или кабельного шлюза интернет-провайдера. Обычно шлюз обеспечивает также поддержку функции WiFi или Voice over Internet (VoIP). Можно также установить для роутера NETGEAR два различных режима работы." bh_learn_more_str_2="В данном режиме новый роутер NETGEAR работает как обычный роутер WiFi и создает отдельную сеть WiFi после вашего шлюза. Для получения всех преимуществ расширенных функций данного роутера NETGEAR рекомендует использовать режим роутера. Если выбран режим роутера, к существующему шлюзу можно подключить только ваш новый роутер NETGEAR. Необходимо подключить все ваши устройства к новому роутеру NETGEAR. Если существующий шлюз поддерживает функцию WiFi, отключите ее." bh_learn_more_str_3="<p><b>Access Point</b></p><p>If you want to use the new router to get better WiFi performance beyond what you have with your existing gateway, access point mode is the easiest way to do that. NETGEAR recommends that you disable the WiFi function on your existing gateway, if it has WiFi functionality. With this mode, you can connect wired devices to the gateway and connect wired and WiFi devices to your new NETGEAR router. In this mode, by default, the new router's IP address is assigned by your gateway dynamically and is unlikely to be 192.168.1.1. However, you can still use the URL <a href='http://www.routerlogin.net' target='_blank'>http://www.routerlogin.net</a> to access the router's management GUI from a device connected to the router. Some <a href='router_function.html' target='_blank'>router functions</a> are not available in this mode, and you must use router mode if you want to use those functions.</p>" bh_learn_more_str_4="В данном режиме по умолчанию IP-адрес нового роутера назначается шлюзом динамически, и маловероятно, что он будет иметь адрес 192.168.1.1. Однако с использованием URL-адреса <a href='http://www.routerlogin.net' target='_blank'>http://www.routerlogin.net</a> можно по-прежнему получить доступ к графическому интерфейсу управления роутера с подключенного к роутеру устройства. Некоторые <a href='router_function.html' target='_blank'>функции роутера</a> недоступны в этом режиме. Для использования этих функций необходимо использовать режим роутера." //port_forwording.html bh_port_forwarding="Переадресация порта" bh_port_forwarding_content="Переадресация портов (иногда называется перенаправлением портов) предоставляет возможность доступа к домашней сети из Интернета. Если у вас дома имеется устройство (например, веб-сервер), к которому другие пользователи подключаются удаленно с помощью зарегистрированного имени хоста (обычно посредством службы динамической DNS) или IP-адреса, возможно, функция переадресации портов включена. Если вы никогда не слышали о такой функции (даже при наличии дома удаленного доступа к устройству), скорее всего, вы не используете данную функцию." //router_function.html bh_router_function="Функции роутера" bh_rouer_function_str_1="<p>Если выбран режим точки доступа, недоступны следующие функции роутера:</p><p><ul><li style='height:20px' class='textRow centerTd2'>Гостевая сеть</li><li style='height:20px' class='textRow centerTd2'>Родительский контроль</li><li style='height:20px' class='textRow centerTd2'>QoS</li><li style='height:20px' class='textRow centerTd2'>Контроль доступа</li><li style='height:20px' class='textRow centerTd2'>Счетчик трафика</li><li style='height:20px' class='textRow centerTd2'>Блокировка веб-сайтов</li><li style='height:20px' class='textRow centerTd2'>Блокировка сервисов</li><li style='height:20px' class='textRow centerTd2'>Статический маршрут</li></ul></p>" bh_router_adv_function="Расширенные функции" bh_router_function_str_2="<p>Следующие функции роутера доступны только в режиме роутера, но требуют настройки существующего шлюза:</p><p><ul><li style='height:20px' class='textRow centerTd2'>Переадресация портов</li><li style='height:20px' class='textRow centerTd2'>Инициирование портов</li><li style='height:20px' class='textRow centerTd2'>IPv6</li><li style='height:20px' class='textRow centerTd2'>UPnP/IGD</li><li style='height:20px' class='textRow centerTd2'>Удаленное управление</li><li style='height:20px' class='textRow centerTd2'>Прекращение действия VPN</li></ul></p>" bh_warning_info="Необходимо указать, можете ли вы отключить функцию WiFi шлюза." bh_pppoe_identi="идентификатор соединения" bh_pppoe_online="номер T-Online" bh_pppoe_suffix="суффикс сопользователя" bh_use_vlanid="Использовать VLANID" bh_eanble_iptv="Enable IPTV support" bh_full_scan1="Мастер выполняет полное сканирование параметров PVC/протокола, подождите..." bh_full_scan2="Это займет приблизительно 1-6 минут" bh_quick_scan="Мастер выполняет быстрое сканирование параметров PVC/протокола, подождите..." bh_genie_cannot_find_ip_reason3="2. Кабель DSL/Ethernet подключен ненадежно или подключен не к тому разъему." bh_genie_cannot_find_ip_reason_desc3="Чтобы решить эту проблему, убедитесь, что кабель DSL/Ethernet надежно подключен к порту широкополосного модема и порту сети Интернет роутера." bh_genie_cannot_find_ip_option2="Я устранил неполадку с кабелем DSL/Ethernet." bh_country_select="Выберите страну" bh_isp_select="Выберите интернет-провайдера" bh_isp="Тип подключения" bh_quick_failed="Выполнить полное сканирование мастером установки, чтобы найти параметры PVC/протокола?" bh_quick_failed_slect1="Да. (Это займет приблизительно 1-6 минут)" bh_quick_failed_slect2="Нет. Я хочу настроить роутер самостоятельно." bh_country="Страна" bh_issue_cont1="Если для подключения к Интернету требуются данные для входа в систему, перейдите на страницу входа, нажав на представленную ниже ссылку, а затем введите данные для входа." bh_issue_cont2="Если для подключения к Интернету данные для входа в систему не требуются, проверьте следующее." bh_Australia="Австралия" bh_Austria="Австрия" bh_Belgium="Бельгия" bh_Brazil="Бразилия" bh_Canada="Канада" bh_China="China" bh_Czech="Чехия" bh_Denmark="Denmark" bh_Finland="Финляндия" bh_France="Франция" bh_Germany="Германия" bh_HongKong="HongKong" bh_Hungary="Венгрия" bh_India="Индия" bh_Indonesia="Индонезия" bh_Italy="Италия" bh_Malaysia="Малайзия" bh_Netherlands="Нидерланды" bh_New_Zealand="Новая Зеландия" bh_Philippine="Филиппины" bh_Poland="Польша" bh_Portugal="Португалия" bh_Russia="Россия" bh_Saudi_Arabia="Saudi Arabia" bh_Singapore="Сингапур" bh_Spain="Spain" bh_Sweden="Швеция" bh_Switzerland="Швейцария" bh_Thailand="Таиланд" bh_Turkey="Turkey" bh_UK="UK" bh_USA="США" bh_Vietnam="Vietnam" bh_Other="Другие" bh_dsl_no_cable="Кабель DSL/Ethernet не подключен к порту 'DSL/Интернет' на роутере" bh_dsl_detecting_connection="Кабель DSL: убедитесь, что кабель надежно подключен к настенной телефонной розетке и к порту DSL роутера." bh_inet_detecting_connection="Интернет-кабель: убедитесь, что кабель надежно подключен к порту Ethernet широкополосного модема и порту сети Интернет." bh_dsl_click_try_again="После проверки кабеля DSL/Ethernet нажмите <b>Повторить попытку</b>." bh_pppoa_connection="Обнаружено подключение к Интернету по протоколу PPPoA" bh_ppp_neg_failed="PPP Negotiation Failed" bh_ppp_neg_info="If your DSL line needs to enable the VLAN function, select the <b>Use VLAN ID</b> check box and enter the VLAN ID in the field." bh_use_vlan="Use VLAN ID" bh_use_mac="MAC Clone (xx:xx:xx:xx:xx:xx)" bh_dhcp_head="Обнаружено интернет-подключение по DHCP" bh_dhcp_client_id="Client Identifier String (option 61)" dsl_cdless_bridge1="(Bridge mode," dsl_cdless_bridge2="please connect your IPTV device to LAN4 port)" dsl_bridge_warning="At least one port MUST be chosen for bridge mode!" bh_dsl_bridge="Bridge Mode" bh_dsl_bridge_con="(If select Bridge Mode,the LAN4 port will be configured as IPTV port,you can select max.3 LAN ports for 3 IPTV devices to connect to.LAN1 is reserved for wired internet)" bh_dsl_bridge_lan4="Enable IPTV on LAN4" bh_dsl_bridge_lan3="Enable IPTV on LAN3" bh_dsl_bridge_lan2="Enable IPTV on LAN2" bh_ppp_readycloud_query="При регистрации роутера в ReadyCLOUD режим подключения этого роутера к Интернету изменится с 'Dial on Demand' (Набор по требованию) на 'Always On' (Постоянное подключение). Это необходимо для обеспечения удаленного доступа ReadyCLOUD к подключенному устройству хранения данных USB. Продолжить?" bh_ppp_readycloud_warning_1="При регистрации роутера в ReadyCLOUD необходимо изменить режим подключения этого роутера к Интернету с 'Dial on Demand' (Набор по требованию) на 'Always On' (Постоянное подключение) для обеспечения удаленного доступа ReadyCLOUD к подключенному USB-устройству хранения данных. Для этого перейдите на страницу 'Internet Setup' (Параметры Интернета)." bh_ppp_readycloud_warning_2="Ваш роутер или шлюз не подключены к Интернету. Подключение к Интернету необходимо для регистрации роутера или шлюза в ReadyCLOUD. Подключите роутер или шлюз к Интернету и повторите попытку." bh_admin_account="Настройки учетной записи администратора" bh_account_discription="Пароль администратора используется для входа в веб-интерфейс роутера. Для обеспечения безопасности сети измените пароль администратора." bh_new_password="Новый пароль" bh_passwd_repas="Подтвердите новый пароль" bh_security_question_1="Контрольный вопрос №1" bh_security_question_2="Контрольный вопрос №2" bh_select_a_question="Выберите вопрос" bh_answer="Ответ" bh_quest1_1="Как назывался первый продукт NETGEAR, который вы приобрели?" bh_quest1_2="Как называлась первая школа, в которой вы учились?" bh_quest1_3="Как зовут вашу старшую сестру?" bh_quest1_4="Как зовут вашего старшего брата?" bh_quest1_5="В каком городе вы родились?" bh_quest1_6="Как зовут вашу бабушку?" bh_quest1_7="Как зовут вашего дедушку?" bh_quest1_8="В каком году (ГГГГ) вы окончили институт?" bh_quest1_9="Как зовут вашего первого работодателя?" bh_quest2_1="Как зовут вашу младшую сестру?" bh_quest2_2="Как зовут вашего младшего брата?" bh_quest2_3="Какое отчество у вашего отца?" bh_quest2_4="Какое отчество у вашей матери?" bh_quest2_5="Как звали вашего первого начальника?" bh_quest2_6="В каком городе родилась ваша мать?" bh_quest2_7="В каком городе родился ваш отец?" bh_quest2_8="Как зовут вашего лучшего друга?" bh_required_information="* - обязательное для заполнения поле" bh_pwd_error="The admin password must have a minimum of six characters and contain at least one number and one letter." bh_max_pwd_len="Maximum password length is 32 characters!" bh_pwd_no_match="Введенные пароли не совпадают, повторите попытку:" bh_select_quest="Выберите вопрос." bh_enter_answer="Введите ответ для каждого вопроса." bh_invalid_answer="Каждый ответ должен содержать минимум 1 и максимум 64 алфавитно-цифровых символа, допускается использование пробелов." bh_router_admin="Настройки администратора роутера:" bh_admin_user_name="Имя администратора:" bh_new_admin_passwd="Новый пароль администратора:" bh_passwd_not_blank="Введите пароль!"
gpl-2.0
oat-sa/qti-sdk
test/qtismtest/data/storage/php/PhpArgumentTest.php
2314
<?php namespace qtismtest\data\storage\php; use InvalidArgumentException; use qtism\data\storage\php\PhpArgument; use qtism\data\storage\php\PhpVariable; use qtismtest\QtiSmTestCase; use stdClass; /** * Class PhpArgumentTest */ class PhpArgumentTest extends QtiSmTestCase { public function testPhpArgument() { // Test a variable reference. $arg = new PhpArgument(new PhpVariable('test')); $this::assertInstanceOf(PhpArgument::class, $arg); $this::assertInstanceOf(PhpVariable::class, $arg->getValue()); $this::assertTrue($arg->isVariableReference()); $this::assertFalse($arg->isScalar()); // Test a null value (considered to be scalar in this context). $arg = new PhpArgument(null); $this::assertInstanceOf(PhpArgument::class, $arg); $this::assertNull($arg->getValue()); $this::assertFalse($arg->isVariableReference()); $this::assertTrue($arg->isScalar()); // Test a string value. $str = "Hello World!\nThis is me!"; $arg = new PhpArgument($str); $this::assertInstanceOf(PhpArgument::class, $arg); $this::assertEquals($str, $arg->getValue()); $this::assertFalse($arg->isVariableReference()); $this::assertTrue($arg->isScalar()); // Test a boolean value. $arg = new PhpArgument(false); $this::assertInstanceOf(PhpArgument::class, $arg); $this::assertFalse($arg->getValue()); $this::assertFalse($arg->isVariableReference()); $this::assertTrue($arg->isScalar()); // Test an integer value. $arg = new PhpArgument(-23); $this::assertInstanceOf(PhpArgument::class, $arg); $this::assertEquals(-23, $arg->getValue()); $this::assertFalse($arg->isVariableReference()); $this::assertTrue($arg->isScalar()); // Test a float value. $arg = new PhpArgument(-23.3); $this::assertInstanceOf(PhpArgument::class, $arg); $this::assertEquals(-23.3, $arg->getValue()); $this::assertFalse($arg->isVariableReference()); $this::assertTrue($arg->isScalar()); } public function testObject() { $this->expectException(InvalidArgumentException::class); $arg = new PhpArgument(new stdClass()); } }
gpl-2.0
wp-media/wp-rocket-helpers
_deprecated/wp-rocket-compat-premium-seo-pack/wp-rocket-compat-premium-seo-pack.php
1581
<?php /** * Plugin Name: WP Rocket | Unload PSP Styles * Description: Premium SEO Pack (PSP) loads styles and scripts on all WordPress admin pages which makes WP Rocket’s settings page unusable. This helper plugin unloads PSP styles just on WP Rocket’s settings page. * Plugin URI: https://github.com/wp-media/wp-rocket-helpers/tree/master/compatibility/wp-rocket-compat-premium-seo-pack/ * Author: WP Rocket Support Team * Author URI: http://wp-rocket.me/ * License: GNU General Public License v2 or later * License URI: http://www.gnu.org/licenses/gpl-2.0.html * * Copyright SAS WP MEDIA 2018 */ namespace WP_Rocket\Helpers\compat\premium_seo_pack; // Standard plugin security, keep this line in place. defined( 'ABSPATH' ) or die(); /** * Maybe dequeue PSP admin stylesheet. * * @author Arun Basil Lal * @author Caspar Hübinger */ function maybe_unload_psp_styles( ) { if ( ! function_exists( 'get_rocket_option' ) ) { return false; } // Determine screen ID, we may be in white-label mode! $current_screen = get_current_screen(); $rocket_wl_name = get_rocket_option( 'wl_plugin_name', null ); $wp_rocket_screen_id = isset( $rocket_wl_name ) ? 'settings_page_' . sanitize_key( $rocket_wl_name ) : 'settings_page_wprocket'; // Retun on all pages but WP Rocket settings page. if ( $wp_rocket_screen_id !== $current_screen->base ) { return false; } // Dequeueing this style unfreezes WP Rocket. wp_dequeue_style( 'psp-main-style' ); } add_action( 'admin_print_styles', __NAMESPACE__ . '\maybe_unload_psp_styles', 11 );
gpl-2.0
olek1984/dremboard
wp-content/plugins/invite-anyone/group-invites/group-invites.php
19928
<?php /* Load JS necessary for group invitation pages */ function invite_anyone_add_js() { global $bp; if ( $bp->current_action == BP_INVITE_ANYONE_SLUG || ( isset( $bp->action_variables[1] ) && $bp->action_variables[1] == BP_INVITE_ANYONE_SLUG ) ) { $min = '-min'; if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) { $min = ''; } wp_enqueue_script( 'invite-anyone-autocomplete-js', plugins_url() . "/invite-anyone/group-invites/jquery.autocomplete/jquery.autocomplete$min.js", array( 'jquery' ) ); wp_register_script( 'invite-anyone-js', plugins_url() . '/invite-anyone/group-invites/group-invites-js.js', array( 'invite-anyone-autocomplete-js' ) ); wp_enqueue_script( 'invite-anyone-js' ); // Add words that we need to use in JS to the end of the page // so they can be translated and still used. $params = apply_filters( 'ia_get_js_strings', array( 'unsent_invites' => __( 'Click &ldquo;Send Invites&rdquo; to finish sending your new invitations.', 'invite-anyone' ), ) ); wp_localize_script( 'invite-anyone-js', 'IA_js_strings', $params ); } } add_action( 'wp_head', 'invite_anyone_add_js', 1 ); function invite_anyone_add_group_invite_css() { global $bp; if ( $bp->current_action == BP_INVITE_ANYONE_SLUG || ( isset( $bp->action_variables[1] ) && $bp->action_variables[1] == BP_INVITE_ANYONE_SLUG ) ) { $style_url = plugins_url() . '/invite-anyone/group-invites/group-invites-css.css'; $style_file = WP_PLUGIN_DIR . '/invite-anyone/group-invites/group-invites-css.css'; if (file_exists($style_file)) { wp_register_style('invite-anyone-group-invites-style', $style_url); wp_enqueue_style('invite-anyone-group-invites-style'); } } } add_action( 'wp_print_styles', 'invite_anyone_add_group_invite_css' ); function invite_anyone_add_old_css() { $plugins_url = plugins_url(); ?> <style type="text/css"> li a#nav-invite-anyone { padding: 0.55em 3.1em 0.55em 0px !important; margin-right: 10px; background: url(<?php echo $plugins_url . '/invite-anyone/invite-anyone/invite_bullet.gif'; ?>) no-repeat 89% 52%; } </style> <?php } class BP_Invite_Anyone extends BP_Group_Extension { var $enable_nav_item = true; var $enable_create_step = true; var $enable_edit_item = false; function bp_invite_anyone() { global $bp; $this->has_caps = true; /* Group API Extension Properties */ $this->name = __( 'Send Invites', 'buddypress' ); $this->slug = BP_INVITE_ANYONE_SLUG; /* Set as early in the order as possible */ $this->create_step_position = 42; $this->nav_item_position = 71; /* Generic check access */ if ( $this->has_caps == false ) { $this->enable_create_step = false; $this->enable_edit_step = false; } $this->enable_nav_item = $this->enable_nav_item(); $this->enable_create_step = $this->enable_create_step(); } function display() { global $bp; if ( BP_INVITE_ANYONE_SLUG == $bp->current_action && isset( $bp->action_variables[0] ) && 'send' == $bp->action_variables[0] ) { if ( !check_admin_referer( 'groups_send_invites', '_wpnonce_send_invites' ) ) return false; // Send the invites. groups_send_invites( $bp->loggedin_user->id, $bp->groups->current_group->id ); do_action( 'groups_screen_group_invite', $bp->groups->current_group->id ); // Hack to imitate bp_core_add_message, since bp_core_redirect is giving me such hell echo '<div id="message" class="updated"><p>' . __( 'Group invites sent.', 'buddypress' ) . '</p></div>'; } invite_anyone_create_screen_content('invite'); } function create_screen( $group_id = null ) { global $bp; /* If we're not at this step, go bye bye */ if ( !bp_is_group_creation_step( $this->slug ) ) return false; invite_anyone_create_screen_content( 'create' ); wp_nonce_field( 'groups_create_save_' . $this->slug ); } function create_screen_save( $group_id = null ) { global $bp; /* Always check the referer */ check_admin_referer( 'groups_create_save_' . $this->slug ); /* Set method and save */ if ( bp_group_has_invites() ) $this->has_invites = true; $this->method = 'create'; $this->save(); } function save() { global $bp; /* Set error redirect based on save method */ if ( $this->method == 'create' ) $redirect_url = $bp->loggedin_user->domain . $bp->groups->slug . '/create/step/' . $this->slug; else $redirect_url = bp_get_group_permalink( $bp->groups->current_group ) . '/admin/' . $this->slug; groups_send_invites( $bp->loggedin_user->id, $bp->groups->current_group->id ); if ( $this->has_invites ) bp_core_add_message( __('Group invites sent.', 'buddypress') ); else bp_core_add_message( __('Group created successfully.', 'buddypress') ); } /** * Should the group creation step be included? * * @since 1.2 */ public function enable_create_step() { $options = invite_anyone_options(); return ! empty( $options['group_invites_enable_create_step'] ) && $options['group_invites_enable_create_step'] === 'yes'; } function enable_nav_item() { global $bp; // Group-specific settings always override if ( ! bp_groups_user_can_send_invites() ) { return false; } if ( invite_anyone_group_invite_access_test() == 'anyone' ) return true; else return false; } function widget_display() {} } bp_register_group_extension( 'BP_Invite_Anyone' ); function invite_anyone_catch_group_invites() { global $bp; if ( BP_INVITE_ANYONE_SLUG == $bp->current_action && isset( $bp->action_variables[0] ) && 'send' == $bp->action_variables[0] ) { if ( !check_admin_referer( 'groups_send_invites', '_wpnonce_send_invites' ) ) return false; // Send the invites. groups_send_invites( $bp->loggedin_user->id, $bp->groups->current_group->id ); bp_core_add_message( __('Group invites sent.', 'buddypress') ); do_action( 'groups_screen_group_invite', $bp->groups->current_group->id ); bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) . BP_INVITE_ANYONE_SLUG ); } } add_action( 'wp', 'invite_anyone_catch_group_invites', 1 ); function invite_anyone_create_screen_content( $event ) { if ( !$template = function_exists( 'bp_locate_template' ) ? bp_locate_template( 'groups/single/invite-anyone.php', true ) : locate_template( 'groups/single/invite-anyone.php', true ) ) { include_once( 'templates/invite-anyone.php' ); } } /* Creates the list of members on the Sent Invite screen */ function bp_new_group_invite_member_list() { echo bp_get_new_group_invite_member_list(); } function bp_get_new_group_invite_member_list( $args = '' ) { global $bp; $defaults = array( 'group_id' => false, 'separator' => 'li' ); $r = wp_parse_args( $args, $defaults ); extract( $r, EXTR_SKIP ); if ( !$group_id ) $group_id = isset( $bp->groups->new_group_id ) ? $bp->groups->new_group_id : $bp->groups->current_group->id; $items = array(); $friends = get_members_invite_list( $bp->loggedin_user->id, $group_id ); if ( $friends ) { $invites = groups_get_invites_for_group( $bp->loggedin_user->id, $group_id ); for ( $i = 0; $i < count( $friends ); $i++ ) { $checked = ''; if ( $invites ) { if ( in_array( $friends[$i]['id'], $invites ) ) { $checked = ' checked="checked"'; } } $items[] = '<' . $separator . '><input' . $checked . ' type="checkbox" name="friends[]" id="f-' . $friends[$i]['id'] . '" value="' . esc_html( $friends[$i]['id'] ) . '" /> ' . $friends[$i]['full_name'] . '</' . $separator . '>'; } } return implode( "\n", (array)$items ); } /** * Fetch a list of site members eligible to be invited to a group. * * The list is essentially a list of everyone on the site, minus the logged in user and members * of the current group. * * @package Invite Anyone * @since 1.0 * * @param int $group_id The group_id you want to exclude * @param str $search_terms If you want to search on username/display name * @return array $users An array of located users */ function invite_anyone_invite_query( $group_id = false, $search_terms = false, $fields = 'all' ) { // Get a list of group members to be excluded from the main query $group_members = array(); $args = array( 'group_id' => $group_id, 'exclude_admins_mods' => false ); if ( $search_terms ) $args['search'] = $search_terms; if ( bp_group_has_members( $args ) ) { while ( bp_group_members() ) { bp_group_the_member(); $group_members[] = bp_get_group_member_id(); } } // Don't include the logged-in user, either $group_members[] = bp_loggedin_user_id(); $fields = 'ID' == $fields ? 'ID' : 'all'; // Now do a user query // Pass a null blog id so that the capabilities check is skipped. For BP blog_id doesn't // matter anyway $user_query = new Invite_Anyone_User_Query( array( 'blog_id' => NULL, 'exclude' => $group_members, 'search' => $search_terms, 'fields' => $fields, ) ); return $user_query->results; } /** * Extends the WP_User_Query class to make it easier for us to search across different fields * * @package Invite Anyone * @since 1.0.4 */ class Invite_Anyone_User_Query extends WP_User_Query { function __construct( $query = null ) { add_action( 'pre_user_query', array( &$this, 'filter_registered_users_only' ) ); parent::__construct( $query ); } /** * BuddyPress has different user statuses. We need to filter the user list so only registered users are shown. */ function filter_registered_users_only( $query ) { $query->query_where .= ' AND user_status = 0'; } /** * @see WP_User_Query::get_search_sql() */ function get_search_sql( $string, $cols, $wild = false ) { $string = esc_sql( $string ); // Always search all columns $cols = array( 'user_email', 'user_login', 'user_nicename', 'user_url', 'display_name' ); // Always do 'both' for trailing_wild $wild = 'both'; $searches = array(); $leading_wild = ( 'leading' == $wild || 'both' == $wild ) ? '%' : ''; $trailing_wild = ( 'trailing' == $wild || 'both' == $wild ) ? '%' : ''; foreach ( $cols as $col ) { if ( 'ID' == $col ) $searches[] = "$col = '$string'"; else $searches[] = "$col LIKE '$leading_wild" . like_escape($string) . "$trailing_wild'"; } return ' AND (' . implode(' OR ', $searches) . ') AND user_status = 0'; } } function get_members_invite_list( $user_id = false, $group_id ) { global $bp, $wpdb; if ( $users = invite_anyone_invite_query( $bp->groups->current_group->id, false, 'ID' ) ) { foreach( (array) $users as $user_id ) { $display_name = bp_core_get_user_displayname( $user_id ); if ( $display_name != '' ) { $friends[] = array( 'id' => $user_id, 'full_name' => $display_name ); } } } if ( ! isset( $friends ) ) return false; return $friends; } function invite_anyone_ajax_invite_user() { global $bp; check_ajax_referer( 'groups_invite_uninvite_user' ); if ( !$_POST['friend_id'] || !$_POST['friend_action'] || !$_POST['group_id'] ) return false; if ( 'invite' == $_POST['friend_action'] ) { if ( !groups_invite_user( array( 'user_id' => $_POST['friend_id'], 'group_id' => $_POST['group_id'] ) ) ) return false; $user = new BP_Core_User( $_POST['friend_id'] ); $group_slug = isset( $bp->groups->root_slug ) ? $bp->groups->root_slug : $bp->groups->slug; if ( bp_is_current_action( 'create' ) ) { $uninvite_url = bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/create/step/group-invites/?user_id=' . $user->id; } else { $uninvite_url = bp_get_group_permalink( groups_get_current_group() ) . 'send-invites/remove/' . $user->id; } echo '<li id="uid-' . $user->id . '">'; echo bp_core_fetch_avatar( array( 'item_id' => $user->id ) ); echo '<h4>' . bp_core_get_userlink( $user->id ) . '</h4>'; echo '<span class="activity">' . esc_html( $user->last_active ) . '</span>'; echo '<div class="action"> <a class="remove" href="' . wp_nonce_url( $uninvite_url ) . '" id="uid-' . esc_html( $user->id ) . '">' . __( 'Remove Invite', 'buddypress' ) . '</a> </div>'; echo '</li>'; } else if ( 'uninvite' == $_POST['friend_action'] ) { groups_uninvite_user( $_POST['friend_id'], $_POST['group_id'] ); } die(); } add_action( 'wp_ajax_invite_anyone_groups_invite_user', 'invite_anyone_ajax_invite_user' ); function invite_anyone_ajax_autocomplete_results() { global $bp; $return = array( 'query' => $_REQUEST['query'], 'data' => array(), 'suggestions' => array() ); $users = invite_anyone_invite_query( $bp->groups->current_group->id, $_REQUEST['query'] ); if ( $users ) { $suggestions = array(); $data = array(); foreach ( $users as $user ) { $suggestions[] = $user->display_name . ' (' . $user->user_login . ')'; $data[] = $user->ID; } $return['suggestions'] = $suggestions; $return['data'] = $data; } die( json_encode( $return ) ); } add_action( 'wp_ajax_invite_anyone_autocomplete_ajax_handler', 'invite_anyone_ajax_autocomplete_results' ); function invite_anyone_remove_group_creation_invites( $a ) { foreach ( $a as $key => $value ) { if ( $key == 'group-invites' ) { unset( $a[$key] ); } } return $a; } function invite_anyone_remove_invite_subnav() { global $bp; if ( invite_anyone_group_invite_access_test() == 'friends' ) return; if ( isset( $bp->groups->group_creation_steps['group-invites'] ) ) unset( $bp->groups->group_creation_steps['group-invites'] ); // BP 1.5 / BP 1.2 $parent_slug = isset( $bp->groups->root_slug ) && isset( $bp->groups->current_group->slug ) ? $bp->groups->current_group->slug : $bp->groups->slug; bp_core_remove_subnav_item( $parent_slug, 'send-invites' ); } add_filter( 'groups_create_group_steps', 'invite_anyone_remove_group_creation_invites', 1 ); add_action( 'bp_setup_nav', 'invite_anyone_remove_invite_subnav', 15 ); /** * Determine access setting for a group/user pair. * * @param int $group_id Group ID. Default: current group ID. * @param int $user_id User ID. Default: current user ID. */ function invite_anyone_group_invite_access_test( $group_id = 0, $user_id = 0 ) { global $current_user, $bp; if ( empty( $group_id ) ) { $group_id = bp_is_group() ? bp_get_current_group_id() : 0; } if ( empty( $group_id ) && ! bp_is_group_create() ) { return 'noone'; } if ( empty( $user_id ) ) { $user_id = bp_loggedin_user_id(); } if ( empty( $user_id ) ) { return 'noone'; } $iaoptions = invite_anyone_options(); if ( bp_is_group_create() ) { if ( empty( $iaoptions['group_invites_can_group_admin'] ) || $iaoptions['group_invites_can_group_admin'] == 'anyone' || !$iaoptions['group_invites_can_group_admin'] ) return 'anyone'; if ( $iaoptions['group_invites_can_group_admin'] == 'friends' ) return 'friends'; if ( $iaoptions['group_invites_can_group_admin'] == 'noone' ) return 'noone'; } if ( ! groups_is_user_member( $user_id, $group_id ) ) { return 'noone'; } if ( user_can( $user_id, 'bp_moderate' ) ) { if ( empty( $iaoptions['group_invites_can_admin'] ) || $iaoptions['group_invites_can_admin'] == 'anyone' || !$iaoptions['group_invites_can_admin'] ) return 'anyone'; if ( $iaoptions['group_invites_can_admin'] == 'friends' ) return 'friends'; if ( $iaoptions['group_invites_can_admin'] == 'noone' ) return 'noone'; } else if ( groups_is_user_admin( $user_id, $group_id ) ) { if ( empty( $iaoptions['group_invites_can_group_admin'] ) || $iaoptions['group_invites_can_group_admin'] == 'anyone' || !$iaoptions['group_invites_can_group_admin'] ) return 'anyone'; if ( $iaoptions['group_invites_can_group_admin'] == 'friends' ) return 'friends'; if ( $iaoptions['group_invites_can_group_admin'] == 'noone' ) return 'noone'; } else if ( groups_is_user_mod( $user_id, $group_id ) ) { if ( empty( $iaoptions['group_invites_can_group_mod'] ) || $iaoptions['group_invites_can_group_mod'] == 'anyone' || !$iaoptions['group_invites_can_group_mod'] ) return 'anyone'; if ( $iaoptions['group_invites_can_group_mod'] == 'friends' ) return 'friends'; if ( $iaoptions['group_invites_can_group_mod'] == 'noone' ) return 'noone'; } else { if ( empty( $iaoptions['group_invites_can_group_member'] ) || $iaoptions['group_invites_can_group_member'] == 'anyone' || !$iaoptions['group_invites_can_group_member'] ) return 'anyone'; if ( $iaoptions['group_invites_can_group_member'] == 'friends' ) return 'friends'; if ( $iaoptions['group_invites_can_group_member'] == 'noone' ) return 'noone'; } return 'noone'; } function invite_anyone_group_invite_form_action() { $group_url = bp_get_group_permalink( groups_get_current_group() ); echo trailingslashit( $group_url ) . trailingslashit( BP_INVITE_ANYONE_SLUG ) . trailingslashit( 'send' ); } /** * Catch the 'to' email address of sent email notifications, and hook message filter if necessary * * This function is necessary because the groups_notification_group_invites_message * filter doesn't receive easily parsable info about the invitee. * * @since 1.0.22 */ function invite_anyone_group_invite_maybe_filter_invite_message( $to ) { if ( ! bp_is_active( 'friends' ) ) { return $to; } $invited_user = get_user_by( 'email', $to ); $friendship_status = BP_Friends_Friendship::check_is_friend( bp_loggedin_user_id(), $invited_user->ID ); if ( 'is_friend' !== $friendship_status ) { add_action( 'groups_notification_group_invites_message', 'invite_anyone_group_invite_email_message', 10, 7 ); } return $to; } add_filter( 'groups_notification_group_invites_to', 'invite_anyone_group_invite_maybe_filter_invite_message' ); /** * Filter the invitation email notification text * * BP's invitation notification text assumes that the inviter and invitee are * friends. This isn't always the case with Invite Anyone. This function * detects whether a swap is necessary, and if so, makes it happen. * * @since 1.0.22 */ function invite_anyone_group_invite_email_message( $message, $group, $inviter_name, $inviter_link, $invites_link, $group_link, $settings_link ) { // Make sure the check happens again fresh next time around remove_action( 'groups_notification_group_invites_message', 'invite_anyone_group_invite_email_message', 10, 7 ); $message = sprintf( __( '%1$s has invited you to the group: "%2$s". To view your group invites visit: %3$s To view the group visit: %4$s To view %5$s\'s profile visit: %6$s --------------------- ', 'buddypress' ), $inviter_name, $group->name, $invites_link, $group_link, $inviter_name, $inviter_link ); return $message; } /** * Wrapper for wp_is_large_network() that supports non-MS. * * @since 1.1.2 */ function invite_anyone_is_large_network() { if ( function_exists( 'wp_is_large_network' ) ) { $is_large_network = wp_is_large_network( 'users' ); $count = get_user_count(); } else { global $wpdb; $count = get_transient( 'ia_user_count' ); if ( false === $count ) { $count = $wpdb->get_var( "SELECT COUNT(ID) FROM $wpdb->users WHERE user_status = '0'" ); set_transient( 'ia_user_count', $count, 60*60*24 ); } $is_large_network = $count > 10000; return apply_filters( 'invite_anyone_is_large_network', $count > 10000, $count ); } return apply_filters( 'invite_anyone_is_large_network', $is_large_network, $count ); }
gpl-2.0
chet0xhenry/GoldenCheetah
src/Statistic.cpp
9881
/* * Copyright (c) 2014 Damien Grauser * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., 51 * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <math.h> #include <float.h> #include "Statistic.h" #include <QDebug> Statistic::Statistic() : minX(0.0), maxX(0.0), minY(0.0), maxY(0.0), points(0.0), sumX(0.0), sumY(0.0), sumXsquared(0.0), sumYsquared(0.0), sumXY(0.0), a(0.0), b(0.0), c(1.0) { tab_temp.resize(1); } Statistic::Statistic(double *xdata, double *ydata, int count) : minX(0.0), maxX(0.0), minY(0.0), maxY(0.0), points(0.0), sumX(0.0), sumY(0.0), sumXsquared(0.0), sumYsquared(0.0), sumXY(0.0), a(0.0), b(0.0), c(1.0) { if (count <= 2) return; for (int i = 0; i < count; i++) { // ignore zero points //if (ydata[i] == 0.00) continue; points++; sumX += xdata[i]; sumY += ydata[i]; sumXsquared += xdata[i] * xdata[i]; sumYsquared += ydata[i] * ydata[i]; sumXY += xdata[i] * ydata[i]; if (xdata[i]>maxX) maxX = xdata[i]; else if (xdata[i]<minX) minX = xdata[i]; if (ydata[i]>maxY) maxY = ydata[i]; else if (ydata[i]<minY) minY = ydata[i]; } if (fabs( double(points) * sumXsquared - sumX * sumX) > DBL_EPSILON) { b = ( double(points) * sumXY - sumY * sumX) / ( double(points) * sumXsquared - sumX * sumX); a = (sumY - b * sumX) / double(points); c = ( double(points) * sumXY - sumY * sumX) / sqrt(( double(points) * sumXsquared - sumX * sumX) * ( double(points) * sumYsquared - sumY * sumY)); double sx = b * ( sumXY - sumX * sumY / double(points) ); double sy2 = sumYsquared - sumY * sumY / double(points); double sy = sy2 - sx; double coefD = sx / sy2; double coefC = sqrt(coefD); double stdError = sqrt(sy / double(points - 2)); qDebug() << "Statistic" << coefD << coefC << stdError << c; } } QString Statistic::label() { return QString("%1x%2%3 (%4)").arg(QString("").setNum(slope(), 'f', 3)).arg(intercept()>=0?"+":"").arg(QString("").setNum(intercept(), 'f', 1)).arg(QString("").setNum(r(), 'f', 3)); } /**************************************/ /* librairie reglin */ /* Réalisé par GONNELLA Stéphane */ /**************************************/ /* Déclaratin globale des variables */ /*********************/ /* Fonctions de test */ /*********************/ /* Fonction de test de présence d'un zéro */ int Statistic::test_zero(QVector<double> &tab,int n) { for(int i=0;i<n;i++) { if(tab[i]==0) { return i;} } return -1; } /* Fonction de test de présence d'un négatif */ int Statistic::test_negatif(QVector<double> &tab,int n) { for(int i=0;i<n;i++) { if(tab[i]<0) { return i;} } return -1; } /*********************************/ /* Fonctions de valeurs absolues */ /*********************************/ /*fonction qui retourne la valeur absolue*/ double Statistic::val_abs(double x) { if(x<0) {return -x;} else {return x;} } /********************************/ /* Fonction de recherche du max */ /********************************/ /* Fonction qui retourne celui qui est le max */ int Statistic::rmax(QVector<double> &r) { double temp=0; int ajust=0; for(int i=0;i<5;i++) { if(r[i]>temp) { temp=r[i]; ajust = i+1; } } return ajust; } /**********************/ /* Fonctions de somme */ /**********************/ /* Fonction de somme d'éléments d'un tableau d'entier */ int Statistic::somme(QVector<int> &tab,int n) { int somme=0; for (int i=0;i<n;i++) { somme=((tab[i])+(somme)); } return(somme); } /* Fonction de somme d'éléments d'un tableau de réel*/ double Statistic::somme(QVector<double> &tab,int n) { double somme=0; for (int i=0;i<n;i++) { somme=((tab[i])+(somme)); } return(somme); } /**********************************/ /* Fonctions de calcul de moyenne */ /**********************************/ /* Fonction de calcul de moyenne d'éléments d'un tableau d'entier */ double Statistic::moyenne(QVector<int> &tab,int n) { double moyenne = double(somme(tab,n))/n; return (moyenne); } /* Fonction de calcul de moyenne d'éléments d'un tableau de réel */ double Statistic::moyenne(QVector<double> &tab,int n) { double moyenne = somme(tab,n)/n; return (moyenne); } /* Fonction de calcul de moyenne d'elements d'un tableau de réel(2) */ double Statistic::moyenne2(double somme,int n) { double moyenne = somme/n; return (moyenne); } /***********************/ /* Fonction de produit */ /***********************/ /* Fonction de calcul du produit d'éléments de deux tableau ligne par ligne */ void Statistic::produittab(QVector<double> &tab1,QVector<double> &tab2,int n) { tab_temp.resize(n); //Réservation de l'espace mémoire for (int i=0;i<n;i++) { tab_temp[i]=(tab1[i]*tab2[i]); } } /***************************************/ /* Fonctions de changement de variable */ /***************************************/ /* Fonctions de calcul du ln des éléments d'un tableau de réel */ void Statistic::lntab(QVector<double> &tab,QVector<double> &tabTemp,int n) { tab_temp.resize(n); //Réservation de l'espace mémoire for (int i=0;i<n;i++) { tabTemp[i]=(log(tab[i])); } } /* Fonctions de calcul du log base 10 des éléments d'un tableau de réel */ void Statistic::logtab(QVector<double> &tab,QVector<double> &tabTemp,int n) { tab_temp.resize(n); //Réservation de l'espace mémoire for (int i=0;i<n;i++) { tabTemp[i]=(log10(tab[i])); } } /* Fonction d'inverstion des élements d'un tableau de réel */ void Statistic::invtab(QVector<double> &tab,QVector<double> &tabTemp,int n) { tab_temp.resize(n); //Réservation de l'espace mémoire for (int i=0;i<n;i++) { tabTemp[i]=(1/tab[i]); } } /********************/ /* Autres fonctions */ /********************/ /* Fonction de calcul des écarts à la moyenne */ void Statistic::ecart_a_moyenne(QVector<double> &tab,double Moyenne,int n) { tab_temp.resize(n); //Réservation de l'espace mémoire for (int i=0;i<n;i++) { tab_temp[i]=(tab[i] - Moyenne); } } /****************************/ /* Fonctions de statistique */ /****************************/ /* Fonction de calcul de la covariance */ double Statistic::covariance(QVector<double> &Xi, QVector<double> &Yi,int n) { double cov; produittab(Xi,Yi,n); cov = moyenne(tab_temp,n) - ( moyenne(Xi,n) * moyenne(Yi,n) ); return (cov); } /* Fonction de calcul de la somme des carrés des écarts a la moyenne */ double Statistic::variance(QVector<double> &val,int n) { double sce; produittab(val,val,n); sce = moyenne(tab_temp,n) - ( moyenne(val,n) * moyenne(val,n)); return (sce); } /* Fonction de calcul de l'écart-type */ double Statistic::ecarttype(QVector<double> &val,int n) { double ect= sqrt(variance(val,n)); return (ect); } /******************************************************/ /* Fonctions pour le calcul de la régression linéaire */ /* par la méthode des moindres carré */ /******************************************************/ /* Fonction de clacul de la pente (a) */ double Statistic::pente(QVector<double> &Xi,QVector<double> &Yi,int n) { double a = covariance(Xi,Yi,n)/variance(Xi,n); return (a); } /* Fonction de clacul de l'ordonnée a l'origine (b) */ double Statistic::ordonnee(QVector<double> &Xi,QVector<double> &Yi,int n) { double b = moyenne(Yi,n) - ( pente(Xi,Yi,n) * moyenne(Xi,n) ); return (b); } /* Fonction de calcul du coef de corrélation (r) */ double Statistic::corr(QVector<double> &Xi, QVector<double> &Yi,int n) { double r = covariance(Xi,Yi,n)/(ecarttype(Xi,n)*ecarttype(Yi,n)); //double r=pente(Xi,Yi,n)*pente(Xi,Yi,n)*(variance(Xi,n)/variance(Yi,n)); return (r); } /* Fonction de détermination du meilleur ajustement */ int Statistic::ajustement(QVector<double> &Xi,QVector<double> &Yi,int n) { QVector<double> r(5),lnXi(100),lnYi(100),logXi(100),logYi(100),invXi(100); //corrélation pour linéaire r[0]=val_abs(corr(Xi,Yi,n)); //corrélation pour exponetielle lntab(Yi,lnYi,n); r[1]=val_abs(corr(Xi,lnYi,n)); //corrélation pour puissance logtab(Xi,logXi,n); logtab(Yi,logYi,n); r[2]=val_abs(corr(logXi,logYi,n)); //corrélation pour inverse invtab(Xi,invXi,n); r[3]=val_abs(corr(invXi,Yi,n)); //corrélation pour logarithmique lntab(Xi,lnXi,n); r[4]=val_abs(corr(lnXi,Yi,n)); //Test du meilleur ajustement return rmax(r); } /*****************************/ /* Fin du fichier reglin.cpp */ /*****************************/
gpl-2.0
tashua314/kanji
data/class/pages/mypage/LC_Page_Mypage_MailView.php
3417
<?php /* * This file is part of EC-CUBE * * Copyright(c) 2000-2013 LOCKON CO.,LTD. All Rights Reserved. * * http://www.lockon.co.jp/ * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // {{{ requires require_once CLASS_EX_REALDIR . 'page_extends/mypage/LC_Page_AbstractMypage_Ex.php'; /** * 受注管理メール確認 のページクラス. * * @package Page * @author LOCKON CO.,LTD. * @version $Id: LC_Page_Mypage_MailView.php 22206 2013-01-07 09:10:12Z kim $ */ class LC_Page_Mypage_MailView extends LC_Page_AbstractMypage_Ex { // }}} // {{{ functions /** * Page を初期化する. * * @return void */ function init() { parent::init(); $this->httpCacheControl('nocache'); } /** * Page のプロセス. * * @return void */ function process() { parent::process(); } /** * Page のAction. * * @return void */ function action() { $objCustomer = new SC_Customer_Ex(); if (!SC_Utils_Ex::sfIsInt($_GET['send_id'])) { SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR); } $arrMailView = $this->lfGetMailView($_GET['send_id'], $objCustomer->getValue('customer_id')); if (empty($arrMailView)) { SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR); } $this->tpl_subject = $arrMailView[0]['subject']; $this->tpl_body = $arrMailView[0]['mail_body']; if (SC_Display_Ex::detectDevice() === DEVICE_TYPE_PC) { $this->setTemplate('mypage/mail_view.tpl'); } else { $this->tpl_title = 'メール履歴詳細'; $this->tpl_mainpage = 'mypage/mail_view.tpl'; } switch ($this->getMode()) { case 'getDetail': echo SC_Utils_Ex::jsonEncode($arrMailView); SC_Response_Ex::actionExit(); break; default: break; } } /** * デストラクタ. * * @return void */ function destroy() { parent::destroy(); } /** * GETで指定された受注idのメール送信内容を返す * * @param mixed $send_id * @param mixed $customer_id * @access private * @return array */ function lfGetMailView($send_id, $customer_id) { $objQuery = SC_Query_Ex::getSingletonInstance(); $col = 'subject, mail_body'; $where = 'send_id = ? AND customer_id = ?'; $arrWhereVal = array($send_id, $customer_id); return $objQuery->select($col, 'dtb_mail_history LEFT JOIN dtb_order ON dtb_mail_history.order_id = dtb_order.order_id', $where, $arrWhereVal); } }
gpl-2.0
luniki/CliqrPlugin
src/models/task_types.js
643
import Backbone from 'backbone' import _ from 'underscore' import mc from '../task-types/multiple-choice' import scales from '../task-types/scales' const TaskTypesCollection = Backbone.Collection.extend({ fetchTaskType(task) { const type = _.isObject(task) ? taskTypes.get(task.get('type')) : taskTypes.get(task) if (!type) { throw new Error(`Could not find task type: ${type}`) } const loader = type.get('loader') return loader().then(klass => { return new klass(task) }) } }) const taskTypes = new TaskTypesCollection([mc, scales]) export default taskTypes
gpl-2.0
aleax/openscada
src/moduls/daq/System/os_contr.cpp
15204
//OpenSCADA module DAQ.System file: os_contr.cpp /*************************************************************************** * Copyright (C) 2005-2019 by Roman Savochenko, <rom_as@oscada.org> * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; version 2 of the License. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #include <sys/times.h> #include <sys/time.h> #include <unistd.h> #include <signal.h> #include <fcntl.h> #include <terror.h> #include <tsys.h> #include <tmess.h> #include <ttransports.h> #include <ttypeparam.h> #include <tdaqs.h> #include "da_cpu.h" #include "da_mem.h" #include "da_uptime.h" #include "da_hddtemp.h" #include "da_sensors.h" #include "da_smart.h" #include "da_hddstat.h" #include "da_netstat.h" #include "da_ups.h" #include "da_fs.h" #include "da_qsensor.h" #include "os_contr.h" //************************************************* //* Modul info! * #define MOD_ID "System" #define MOD_NAME _("System DA") #define MOD_TYPE SDAQ_ID #define VER_TYPE SDAQ_VER #define MOD_VER "2.3.6" #define AUTHORS _("Roman Savochenko") #define DESCRIPTION _("Provides data acquisition from the OS. Supported OS Linux data sources: HDDTemp, Sensors, Uptime, Memory, CPU, UPS etc.") #define LICENSE "GPL2" //************************************************* SystemCntr::TTpContr *SystemCntr::mod; //Pointer for direct access to the module extern "C" { #ifdef MOD_INCL TModule::SAt daq_System_module( int n_mod ) #else TModule::SAt module( int n_mod ) #endif { if(n_mod == 0) return TModule::SAt(MOD_ID, MOD_TYPE, VER_TYPE); return TModule::SAt(""); } #ifdef MOD_INCL TModule *daq_System_attach( const TModule::SAt &AtMod, const string &source ) #else TModule *attach( const TModule::SAt &AtMod, const string &source ) #endif { if(AtMod == TModule::SAt(MOD_ID,MOD_TYPE,VER_TYPE)) return new SystemCntr::TTpContr(source); return NULL; } } using namespace SystemCntr; //************************************************* //* TTpContr * //************************************************* TTpContr::TTpContr( string name ) : TTypeDAQ(MOD_ID) { mod = this; modInfoMainSet(MOD_NAME, MOD_TYPE, MOD_VER, AUTHORS, DESCRIPTION, LICENSE, name); } TTpContr::~TTpContr( ) { nodeDelAll(); for(unsigned iDA = 0; iDA < mDA.size(); iDA++) delete mDA[iDA]; mDA.clear(); } void TTpContr::load_( ) { //Load parameters from command line } void TTpContr::postEnable( int flag ) { TTypeDAQ::postEnable(flag); //Init DA sources daReg(new CPU()); daReg(new Mem()); daReg(new Sensors()); daReg(new Hddtemp()); daReg(new UpTime()); daReg(new HddSmart()); daReg(new HddStat()); daReg(new NetStat()); daReg(new UPS()); daReg(new FS()); daReg(new QSensor()); //Controler's bd structure fldAdd(new TFld("AUTO_FILL",_("Auto create active data sources"),TFld::Integer,TFld::Selectable,"1","0","0;1;2;3",_("Manual;Fast sources;Slow sources;All sources"))); fldAdd(new TFld("PRM_BD",_("Table of system parameters"),TFld::String,TFld::NoFlag,"30","system")); fldAdd(new TFld("SCHEDULE",_("Acquisition schedule"),TFld::String,TFld::NoFlag,"100","1")); fldAdd(new TFld("PRIOR",_("Priority of the acquisition task"),TFld::Integer,TFld::NoFlag,"2","0","-1;199")); //Parameter type bd structure // Make enumerated string el_id,el_name,el_def; vector<string> list; daList(list); for(unsigned iLs = 0; iLs < list.size(); iLs++) { if(iLs == 0) el_def = list[iLs]; el_id += list[iLs]+";"; el_name = el_name+_(daGet(list[iLs])->name().c_str())+";"; } int t_prm = tpParmAdd("std", "PRM_BD", _("Standard")); tpPrmAt(t_prm).fldAdd(new TFld("TYPE",_("System part"),TFld::String,TFld::Selectable|TCfg::NoVal,"10",el_def.c_str(),el_id.c_str(),el_name.c_str())); tpPrmAt(t_prm).fldAdd(new TFld("SUBT" ,"",TFld::String,TFld::Selectable|TCfg::NoVal|TFld::SelfFld,"255")); tpPrmAt(t_prm).fldAdd(new TFld("ADD_PRMS",_("Additional parameters"),TFld::String,TFld::FullText|TCfg::NoVal,"100000")); } TController *TTpContr::ContrAttach( const string &name, const string &daq_db ) { return new TMdContr(name, daq_db, this); } void TTpContr::daList( vector<string> &da ) { da.clear(); for(unsigned iDA = 0; iDA < mDA.size(); iDA++) da.push_back(mDA[iDA]->id()); } void TTpContr::daReg( DA *da ) { mDA.push_back(da); } DA *TTpContr::daGet( const string &da ) { for(unsigned iDA = 0; iDA < mDA.size(); iDA++) if(mDA[iDA]->id() == da) return mDA[iDA]; return NULL; } void TTpContr::perSYSCall( unsigned int cnt ) { //Recheck auto-controllers to create parameters for new devices vector<string> clist; list(clist); for(unsigned iC = 0; iC < clist.size(); iC++) at(clist[iC]).at().devUpdate(); } //************************************************* //* TMdContr * //************************************************* TMdContr::TMdContr( string name_c, const string &daq_db, TElem *cfgelem) : TController(name_c,daq_db,cfgelem), mPrior(cfg("PRIOR").getId()), prcSt(false), callSt(false), endrunReq(false), mPer(1e9) { cfg("PRM_BD").setS("OSPrm_"+name_c); } TMdContr::~TMdContr( ) { if(startStat()) stop(); } string TMdContr::getStatus( ) { string rez = TController::getStatus(); if(startStat() && !redntUse()) { if(callSt) rez += TSYS::strMess(_("Acquisition. ")); if(period()) rez += TSYS::strMess(_("Acquisition with the period: %s. "), tm2s(1e-9*period()).c_str()); else rez += TSYS::strMess(_("Next acquisition by the cron '%s'. "), atm2s(TSYS::cron(cron()),"%d-%m-%Y %R").c_str()); rez += TSYS::strMess(_("Spent time: %s[%s]. "), tm2s(SYS->taskUtilizTm(nodePath('.',true))).c_str(), tm2s(SYS->taskUtilizTm(nodePath('.',true),true)).c_str()); } return rez; } void TMdContr::devUpdate( ) { int aFill = cfg("AUTO_FILL").getI(); if(enableStat() && aFill) { vector<string> list; mod->daList(list); for(unsigned iL = 0; iL < list.size(); iL++) if((mod->daGet(list[iL])->isSlow() && aFill&0x02) || (!mod->daGet(list[iL])->isSlow() && aFill&0x01)) mod->daGet(list[iL])->makeActiveDA(this); } } TParamContr *TMdContr::ParamAttach( const string &name, int type ) { return new TMdPrm(name,&owner().tpPrmAt(type)); } void TMdContr::load_( ) { if(!SYS->chkSelDB(DB())) throw TError(); //TController::load_(); } void TMdContr::enable_( ) { enSt = true; devUpdate(); } void TMdContr::start_( ) { //Start the request data task if(!prcSt) SYS->taskCreate(nodePath('.',true), mPrior, TMdContr::Task, this); } void TMdContr::stop_( ) { //Stop the request and calc data task if(prcSt) SYS->taskDestroy(nodePath('.',true), &endrunReq); //Set Eval for parameters ResAlloc res(enRes, true); for(unsigned iPrm = 0; iPrm < pHd.size(); iPrm++) pHd[iPrm].at().setEval(); } void TMdContr::prmEn( const string &id, bool val ) { ResAlloc res(enRes, true); unsigned iPrm; for(iPrm = 0; iPrm < pHd.size(); iPrm++) if(pHd[iPrm].at().id() == id) break; if(val && iPrm >= pHd.size()) pHd.push_back(at(id)); if(!val && iPrm < pHd.size()) pHd.erase(pHd.begin()+iPrm); } void *TMdContr::Task( void *icntr ) { TMdContr &cntr = *(TMdContr *)icntr; cntr.endrunReq = false; cntr.prcSt = true; while(!cntr.endrunReq) { if(!cntr.redntUse()) { //Update controller's data cntr.enRes.resRequestR(); cntr.callSt = true; for(unsigned iP = 0; iP < cntr.pHd.size(); iP++) try { cntr.pHd[iP].at().getVal(); } catch(TError &err) { mess_err(err.cat.c_str(), "%s", err.mess.c_str()); } cntr.callSt = false; cntr.enRes.resRelease(); } TSYS::taskSleep((int64_t)cntr.period(), cntr.period() ? "" : cntr.cron()); } cntr.prcSt = false; return NULL; } void TMdContr::cntrCmdProc( XMLNode *opt ) { //Get page info if(opt->name() == "info") { TController::cntrCmdProc(opt); ctrRemoveNode(opt,"/cntr/cfg/PERIOD"); ctrMkNode("fld",opt,-1,"/cntr/cfg/SCHEDULE",EVAL_STR,startStat()?R_R_R_:RWRWR_,"root",SDAQ_ID,3, "dest","sel_ed","sel_list",TMess::labSecCRONsel(),"help",TMess::labSecCRON()); ctrMkNode("fld",opt,-1,"/cntr/cfg/PRIOR",EVAL_STR,startStat()?R_R_R_:RWRWR_,"root",SDAQ_ID,1,"help",TMess::labTaskPrior()); return; } TController::cntrCmdProc(opt); } bool TMdContr::cfgChange( TCfg &co, const TVariant &pc ) { TController::cfgChange(co, pc); if(co.fld().name() == "SCHEDULE") mPer = TSYS::strSepParse(cron(),1,' ').empty() ? vmax(0,1e9*s2r(cron())) : 0; return true; } //************************************************* //* TMdPrm * //************************************************* TMdPrm::TMdPrm( string name, TTypeParam *tp_prm ) : TParamContr(name,tp_prm), daData(NULL), mAuto(false), mDA(NULL) { } void TMdPrm::postEnable( int flag ) { TParamContr::postEnable(flag); vector<string> list; mod->daList(list); if(list.size()) cfg("TYPE").setS(list[0]); } TMdPrm::~TMdPrm( ) { nodeDelAll(); setType(""); } TMdContr &TMdPrm::owner( ) const { return (TMdContr&)TParamContr::owner(); } void TMdPrm::enable( ) { if(enableStat()) return; cfg("TYPE").setS(cfg("TYPE").getS()); TParamContr::enable(); ((TMdContr&)owner()).prmEn(id(), true); //Put to process } void TMdPrm::disable( ) { if(!enableStat()) return; ((TMdContr&)owner()).prmEn(id(), false); //Remove from process setEval(); TParamContr::disable(); } void TMdPrm::load_( TConfig *cfg ) { if(!mAuto) TParamContr::load_(cfg); } void TMdPrm::save_( ) { if(!mAuto) TParamContr::save_(); //Save archives vector<string> aLs; vlList(aLs); for(unsigned iA = 0; iA < aLs.size(); iA++) if(!vlAt(aLs[iA]).at().arch().freeStat()) vlAt(aLs[iA]).at().arch().at().save(); } void TMdPrm::vlGet( TVal &val ) { if(val.name() == "err") { if(!owner().startStat())val.setS(_("2:Controller stopped"), 0, true); else if(!enableStat()) val.setS(_("1:Parameter disabled"), 0, true); else if(daErr.size()) val.setS(daErr, 0, true); else val.setS("0", 0, true); } } void TMdPrm::vlSet( TVal &vo, const TVariant &vl, const TVariant &pvl ) { if(!enableStat() || !owner().startStat()) { vo.setI(EVAL_INT, 0, true); return; } //Send to active reserve station if(owner().redntUse()) { if(vl == pvl) return; XMLNode req("set"); req.setAttr("path",nodePath(0,true)+"/%2fserv%2fattr")->childAdd("el")->setAttr("id",vo.name())->setText(vl.getS()); SYS->daq().at().rdStRequest(owner().workId(),req); return; } //Direct write try { if(mDA) mDA->vlSet(this, vo, vl, pvl); } catch(TError &err) { mess_err(nodePath().c_str(),_("Error writing value to attribute '%s': %s"),vo.name().c_str(),err.mess.c_str()); vo.setS(pvl.getS(), 0, true); } } void TMdPrm::getVal( ) { if(mDA) mDA->getVal(this); } void TMdPrm::setEval( ) { if(!mDA) return; vector<string> als; mDA->fldList(als); if(als.size()) { for(unsigned iA = 0; iA < als.size(); iA++) if(vlPresent(als[iA])) vlAt(als[iA]).at().setS(EVAL_STR,0,true); } else { vlList(als); for(unsigned iA = 0; iA < als.size(); iA++) if(!(als[iA] == "SHIFR" || als[iA] == "OWNER" || als[iA] == "NAME" || als[iA] == "DESCR" || als[iA] == "err")) vlAt(als[iA]).at().setS(EVAL_STR,0,true); } } void TMdPrm::vlElemAtt( TElem *ValEl ) { TValue::vlElemAtt(ValEl); } void TMdPrm::vlElemDet( TElem *ValEl ) { TValue::vlElemDet(ValEl); } void TMdPrm::vlArchMake( TVal &val ) { TParamContr::vlArchMake(val); if(val.arch().freeStat()) return; val.arch().at().setSrcMode(TVArchive::PassiveAttr); val.arch().at().setPeriod(owner().period() ? (int64_t)owner().period()/1000 : 1000000); val.arch().at().setHardGrid(true); val.arch().at().setHighResTm(true); } void TMdPrm::setType( const string &da_id ) { if(mDA && da_id == mDA->id()) return; //Free previous type if(mDA) { mDA->deInit(this); vlElemDet(mDA); mDA = NULL; } //Create new type try { if(da_id.size() && (mDA=mod->daGet(da_id))) { daErr = ""; vlElemAtt(mDA); mDA->init(this); } } catch(TError &err) { mess_err(err.cat.c_str(),"%s",err.mess.c_str() ); } } string TMdPrm::addPrm( const string &prm, const string &def ) { string rez; XMLNode prmNd; try { prmNd.load(cfg("ADD_PRMS").getS()); string sobj = TSYS::strParse(prm,0,":"), sa = TSYS::strParse(prm,1,":"); if(!sa.size()) return (rez=prmNd.attr(prm)).empty() ? def : rez; //Internal node for(unsigned i_n = 0; i_n < prmNd.childSize(); i_n++) if(prmNd.childGet(i_n)->name() == sobj) return (rez=prmNd.childGet(i_n)->attr(sa)).empty() ? def : rez; } catch(...) { } return def; } void TMdPrm::setAddPrm( const string &prm, const string &val ) { XMLNode prmNd("cfg"); try { prmNd.load(cfg("ADD_PRMS").getS()); } catch(...) { } if(addPrm(prm) != val) modif(); string sobj = TSYS::strParse(prm, 0, ":"), sa = TSYS::strParse(prm, 1, ":"); if(!sa.size()) prmNd.setAttr(prm, val); //Internal node else { unsigned i_n; for(i_n = 0; i_n < prmNd.childSize(); i_n++) if(prmNd.childGet(i_n)->name() == sobj) { prmNd.childGet(i_n)->setAttr(sa,val); break; } if(i_n >= prmNd.childSize()) prmNd.childAdd(sobj)->setAttr(sa,val); } cfg("ADD_PRMS").setS(prmNd.save(XMLNode::BrAllPast)); autoC(false); } bool TMdPrm::cfgChange( TCfg &co, const TVariant &pc ) { //Change TYPE parameter if(co.name() == "TYPE") { setType(co.getS()); return true; } if(mDA) mDA->cfgChange(co, pc); if(!autoC()) modif(); return true; } void TMdPrm::cntrCmdProc( XMLNode *opt ) { //Get page info if(opt->name() == "info") { TParamContr::cntrCmdProc(opt); ctrRemoveNode(opt,"/prm/cfg/ADD_PRMS"); if(mDA) mDA->cntrCmdProc(this, opt); return; } //Process command to page string a_path = opt->attr("path"); if(mDA && mDA->cntrCmdProc(this,opt)) ; else TParamContr::cntrCmdProc(opt); }
gpl-2.0
alexrah/namreb
modules/mod_jxtc_contactwall/mod_jxtc_contactwall.php
4576
<?php /* JoomlaXTC Contact Wall version 1.5.0 Copyright (C) 2008-2012 Monev Software LLC. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA THIS LICENSE IS NOT EXTENSIVE TO ACCOMPANYING FILES UNLESS NOTED. See COPYRIGHT.php for more information. See LICENSE.php for more information. Monev Software LLC www.joomlaxtc.com */ defined( '_JEXEC' ) or die; jimport( 'joomla.html.parameter' ); //Core calls $live_site = JURI::base(); $doc = JFactory::getDocument(); $moduleDir = 'mod_jxtc_contactwall'; $db = JFactory::getDBO(); require_once (JPATH_SITE.'/components/com_contact/helpers/route.php'); // Include the syndicate functions only once require_once 'helper.php' ; //Parameters $catid = $params->get('category_id'); $linked = $params->get('linked', 0); $image = $params->get('image', 0); $sortfield = $params->get('sortfield', 0); $sortorder = $params->get('sortorder', 1); $root = $params->get('root', 1); $template = $params->get('template',''); $moduletemplate = trim( $params->get('modulehtml','{mainarea}')); $itemtemplate = trim( $params->get('html','{description}')); $columns = $params->get('columns',1); $rows = $params->get('rows', 1); $pages = $params->get('pages', 1); $moreclone = $params->get('moreclone', 0); $moreqty = $params->get('moreqty', 0); $morecols = trim( $params->get('morecols',1)); $morelegend = trim($params->get('moretext', '')); $morelegendcolor = $params->get('morergb','cccccc'); $moretemplate = $params->get('moretemplate', ''); $maxtext = $params->get('maxtext', ''); $maxtextsuf = $params->get('maxtextsuf', '...'); $maxmisc = $params->get('maxmisc', ''); $maxmiscsuf = $params->get('maxmiscsuf', '...'); if ($template && $template != -1) { $moduletemplate=file_get_contents(JPATH_ROOT.'/modules/'.$moduleDir.'/templates/'.$template.'/module.html'); $itemtemplate=file_get_contents(JPATH_ROOT.'/modules/'.$moduleDir.'/templates/'.$template.'/element.html'); $moretemplate=file_get_contents(JPATH_ROOT.'/modules/'.$moduleDir.'/templates/'.$template.'/more.html'); if (file_exists(JPATH_ROOT.'/modules/'.$moduleDir.'/templates/'.$template.'/template.css')) { $doc->addStyleSheet($live_site.'modules/'.$moduleDir.'/templates/'.$template.'/template.css','text/css'); } } // Build Query $varaux = $columns*$rows*$pages; $varaux += $moreqty; $items = mod_jxtc_contactwallHelper::getData( $catid, $varaux, $sortfield, $sortorder, $linked, $image); if (count($items) == 0) return;// Return if empty $cloneditems = $items; require JModuleHelper::getLayoutPath($module->module, $params->get('layout', 'default')); // Build More Area if ($moreclone) { $items = $cloneditems; } $moreareahtml=''; if (count($items) > 0) { if ($morelegend) { $moreareahtml .= '<a style="color:#'.$morelegendcolor.'">'.$morelegend.'</a><br/>'; } $moreareahtml .= '<table class="jnp_more" border="0" cellpadding="0" cellspacing="0">'; $c=1;$cnt = 0; foreach ( $items as $item ) { if ($cnt++ > $moreqty) { continue; } if ($c==1) { $moreareahtml .= '<tr>'; } $itemhtml = $moretemplate; require JModuleHelper::getLayoutPath($module->module, $params->get('layout', 'default')); $moreareahtml .= '<td>'.$itemhtml.'</td>'; $c++; if ($c > $morecols) { $moreareahtml .= '</tr>'; $c=1; } } if ($c > 1) $moreareahtml .= '</tr>'; $moreareahtml .= '</table>'; } $modulehtml = str_replace( '{morearea}', $moreareahtml, $modulehtml ); JPluginHelper::importPlugin('content'); $contentconfig = JComponentHelper::getParams('com_content'); $dispatcher = JDispatcher::getInstance(); $item = new stdClass(); $item->text = $modulehtml; $results = $dispatcher->trigger('onContentPrepare', array ('com_content.article', &$item, &$contentconfig, 0 )); $modulehtml = $item->text; echo '<div id="'.$jxtc.'">'.$modulehtml.'</div>';
gpl-2.0
deztopia/safetext
controllers/default/settings.php
30989
<?php require_once ( MS_PATH_BASE . DS . 'lib' . DS . 'safetext' . DS . 'clientcontroller.php' ); /** * Web Client Controller. * * */ class SettingsController extends SafetextClientController { /** * Default Action. * * Called when no action is defined. Will display settings summary/edit form. * * @param MsView $viewObject * @return void */ public function defaultAction(&$viewObject) { // forward to the web client page if logged in, otherwise to the login page if (!$this->init($viewObject)) { $this->forward($viewObject, 'login', 'auth'); } else { //count unread messages $sql_unread = "SELECT count(is_read) as unread_msg FROM messages,participants WHERE participants.contact_id='". $this->user->getValue('id')."' AND participants.is_sender=0 AND messages.is_read=0 AND participants.message_id=messages.id"; $unread = current($this->db->query($sql_unread)); if($unread[0]['unread_msg']>0) { $unread_message = $unread[0]['unread_msg']; } else { $unread_message = 0; } // load stats for all contacts and messages for current user $folderStats = current($this->db->call("folderStats('" . $this->user->getValue('id') . "')")); //load notes $notes = current($this->db->query("SELECT notes,expiretime FROM users WHERE id='" . $this->user->getValue('id') . "'")); //load bubble color $bubble = current($this->db->query("SELECT color FROM bubble_color WHERE user_id='" . $this->user->getValue('id') . "'")); // load all registered devices $devicesArray = $this->db->call("devices('" . $this->user->getValue('id') . "')"); $devices = new SafetextModelCollection('SafetextDevice', $this->config, $this->db); $devices->load($devicesArray); // load membership levels $subscriptionLevels = $this->db->call("subscriptionLevels()"); // load groups $groups = new SafetextModelCollection('SafetextMessage', $this->config, $this->db); $groupsArray = $this->db->call("getGroupDetails('" . $this->user->getValue('id') . "')"); $groups->load($groupsArray); //title $viewObject->setTitle('Settings'); // set view data $viewObject->setValue('folderStats', $folderStats); $viewObject->setValue('unread_msg', $unread_message); $viewObject->setValue('count_group', count($groups)); $viewObject->setValue('devices', $devices); $viewObject->setValue('lifetime', $notes[0]['expiretime']); $viewObject->setValue('color', $bubble[0]['color']); $viewObject->setValue('notes', $notes[0]['notes']); $viewObject->setValue('subscription_levels', $subscriptionLevels); } } /** * Subscribe Action. * * Provides a form for user to upgrade membership * * @param MsView $viewObject * @return void */ public function subscribeAction(&$viewObject) { // forward to the web client page if logged in, otherwise to the login page if (!$this->init($viewObject)) { $this->forward($viewObject, 'login', 'auth'); } else { // load all registered devices $devicesArray = $this->db->call("devices('" . $this->user->getValue('id') . "')"); $devices = new SafetextModelCollection('SafetextDevice', $this->config, $this->db); $devices->load($devicesArray); // load membership levels $subscriptionLevels = $this->db->call("subscriptionLevels()"); //title $viewObject->setTitle('Subscribe'); // set view data $viewObject->setValue('folderStats', $folderStats); $viewObject->setValue('devices', $devices); $viewObject->setValue('subscription_levels', $subscriptionLevels); } } /** * Payment Card Details Action (JSON). * * Pulls a user's payment card details, if any is on file. Endpoint for mobile devices. * * @link https://github.com/deztopia/safetext/wiki/Payments * * @param MsView $viewObject * @return void */ public function paymentcardAction(&$viewObject) { $viewObject->setResponseType('json'); // ensure we're using https if (MS_PROTOCOL === 'https') { if (MS_REQUEST_METHOD === 'GET') { if (array_key_exists('HTTP_X_SAFETEXT_TOKEN', $_SERVER) && $_SERVER['HTTP_X_SAFETEXT_TOKEN'] !== '') { // Create a database connection to share $db = new MsDb($this->config['dbHost'], $this->config['dbUser'], $this->config['dbPass'], $this->config['dbName']); // authenticate token with stored procedure require_once ( MS_PATH_BASE . DS . 'lib' . DS . 'safetext' . DS . 'user.php' ); $user = SafetextUser::tokenToUser($_SERVER['HTTP_X_SAFETEXT_TOKEN'], $db, $this->config); if ($user instanceof SafetextUser && $user->isValid()) { $viewObject->setValue('token', $user->getRelationship('device')->token); if ($user->getRelationship('device') instanceof SafetextDevice && $user->getRelationship('device')->isValid()) { // obtain a PayPal authorization token $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $this->config['paypal']['endpoint'] . '/v1/oauth2/token'); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_USERPWD, $this->config['paypal']['clientid'] . ':' . $this->config['paypal']['secret']); curl_setopt($ch, CURLOPT_POSTFIELDS, "grant_type=client_credentials"); $result = curl_exec($ch); // process response $response = json_decode($result, true); if (!is_array($response) || !array_key_exists('access_token', $response) || $response['access_token'] === '') { $viewObject->setValue('status', 'fail'); $viewObject->setValue('data', array('message' => 'Merchant service refused to authorize')); return; // terminate the controller action } $authtoken = $response['access_token']; curl_close($ch); // check for existing payment token $paymentToken = $user->payment_token; if ($paymentToken !== '') { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $this->config['paypal']['endpoint'] . '/v1/vault/credit-card/' . $paymentToken); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_HTTPGET, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Authorization: Bearer ' . $authtoken, 'Accept: application/json', 'Content-Type: application/json' )); $result = curl_exec($ch); // process response $response = json_decode($result, true); if (!is_array($response) || !array_key_exists('state', $response) || $response['state'] !== 'ok') { $viewObject->setValue('status', 'fail'); $viewObject->setValue('data', array('message' => 'Unable to lookup your card details. You may want to try updating your payment card')); return; // terminate the controller action } $viewObject->setValue('status', 'success'); $viewObject->setValue('data', array('lastfour' => substr($response['number'], -4), 'type' => $response['type'], 'expire_month' => $response['expire_month'], 'expire_year' => $response['expire_year'])); return; } else { $viewObject->setValue('status', 'success'); $viewObject->setValue('data', array()); } } else { // invalid device $viewObject->setValue('status', 'fail'); $viewObject->setValue('data', array('message' => 'Problem trying to load device details for that token')); } } else { // invalid token $viewObject->setValue('status', 'fail'); $viewObject->setValue('data', array('message' => 'That auth token is not valid')); } } else { // no username $viewObject->setValue('status', 'fail'); $viewObject->setValue('data', array('message' => 'Missing SafeText auth token. Please log in')); } } else { // non-POST request $viewObject->setValue('status', 'fail'); $viewObject->setValue('data', array('message' => MS_REQUEST_METHOD . ' requests are not supported for this web service')); } } else { // insecure $viewObject->setValue('status', 'fail'); $viewObject->setValue('data', array('message' => 'Insecure (non-HTTPS) access denied')); } } /** * Process Payment Action (JSON). * * Sends a request to process a subscription payment. * * @link https://github.com/deztopia/safetext/wiki/Payments * * @param MsView $viewObject * @return void */ public function processpaymentAction(&$viewObject) { $viewObject->setResponseType('json'); // ensure we're using https if (MS_PROTOCOL === 'https') { if (MS_REQUEST_METHOD === 'POST') { if (array_key_exists('HTTP_X_SAFETEXT_TOKEN', $_SERVER) && $_SERVER['HTTP_X_SAFETEXT_TOKEN'] !== '') { // Create a database connection to share $db = new MsDb($this->config['dbHost'], $this->config['dbUser'], $this->config['dbPass'], $this->config['dbName']); // authenticate token with stored procedure require_once ( MS_PATH_BASE . DS . 'lib' . DS . 'safetext' . DS . 'user.php' ); $user = SafetextUser::tokenToUser($_SERVER['HTTP_X_SAFETEXT_TOKEN'], $db, $this->config); if ($user instanceof SafetextUser && $user->isValid()) { $viewObject->setValue('token', $user->getRelationship('device')->token); if ($user->getRelationship('device') instanceof SafetextDevice && $user->getRelationship('device')->isValid()) { // obtain a PayPal authorization token $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $this->config['paypal']['endpoint'] . '/v1/oauth2/token'); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_USERPWD, $this->config['paypal']['clientid'] . ':' . $this->config['paypal']['secret']); curl_setopt($ch, CURLOPT_POSTFIELDS, "grant_type=client_credentials"); $result = curl_exec($ch); // process response $response = json_decode($result, true); if (!is_array($response) || !array_key_exists('access_token', $response) || $response['access_token'] === '') { $viewObject->setValue('status', 'fail'); $viewObject->setValue('data', array('message' => 'Merchant service refused to authorize')); return; // terminate the controller action } $authtoken = $response['access_token']; curl_close($ch); // check for existing payment token $paymentToken = $user->payment_token; if ($paymentToken === '') { // no credit card on file, so we should have been passed a new one to add if (array_key_exists('cc_number', $this->params) && $this->params['cc_number'] != '') { if (array_key_exists('cc_cvv2', $this->params) && $this->params['cc_cvv2'] != '') { if (array_key_exists('name', $this->params) && $this->params['name'] != '') { if (array_key_exists('cc_type', $this->params) && $this->params['cc_type'] != '') { if (array_key_exists('cc_exp_month', $this->params) && $this->params['cc_exp_month'] != '') { if (array_key_exists('cc_exp_year', $this->params) && $this->params['cc_exp_year'] != '') { // store card in PayPal Vault, receive payment token $name = explode(' ', $this->params['name']); $data = array( 'payer_id' => $user->id, 'type' => strtolower($this->params['cc_type']), 'number' => $this->params['cc_number'], 'expire_month' => $this->params['cc_exp_month'], 'expire_year' => $this->params['cc_exp_year'], 'cvv2' => $this->params['cc_cvv2'], 'first_name' => $name[0], 'last_name' => $name[1] ); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $this->config['paypal']['endpoint'] . '/v1/vault/credit-card'); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Authorization: Bearer ' . $authtoken, 'Accept: application/json', 'Content-Type: application/json' )); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); $result = curl_exec($ch); // process response $response = json_decode($result, true); if (!is_array($response) || !array_key_exists('id', $response) || $response['id'] === '') { $viewObject->setValue('status', 'fail'); $viewObject->setValue('data', array('message' => 'Card declined')); return; // terminate the controller action } $paymentToken = $response['id']; curl_close($ch); // save some values for later calls $lastfour = substr($this->params['cc_number'], -4); $type = strtolower($this->params['cc_type']); $expire_month = $this->params['cc_exp_month']; $expire_year = $this->params['cc_exp_year']; } else { $viewObject->setValue('status', 'fail'); $viewObject->setValue('data', array('message' => 'You need to provide the card expiration year')); return; } } else { $viewObject->setValue('status', 'fail'); $viewObject->setValue('data', array('message' => 'You need to provide the card expiration month')); return; } } else { $viewObject->setValue('status', 'fail'); $viewObject->setValue('data', array('message' => 'You need to provide the card type')); return; } } else { $viewObject->setValue('status', 'fail'); $viewObject->setValue('data', array('message' => 'You need to provide the name on your payment card')); return; } } else { $viewObject->setValue('status', 'fail'); $viewObject->setValue('data', array('message' => 'You need to provide the CVV2 card code for your payment card')); return; } } else { $viewObject->setValue('status', 'fail'); $viewObject->setValue('data', array('message' => 'You need to provide a credit card number for payment')); return; } } // end no existing credit card // if we're not saving the card now, load card data from secure PayPal vault if (!isset($lastfour) || $lastfour === '') { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $this->config['paypal']['endpoint'] . '/v1/vault/credit-card/' . $paymentToken); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_HTTPGET, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Authorization: Bearer ' . $authtoken, 'Accept: application/json', 'Content-Type: application/json' )); $result = curl_exec($ch); // process response $response = json_decode($result, true); if (!is_array($response) || !array_key_exists('state', $response) || $response['state'] !== 'ok') { $viewObject->setValue('status', 'fail'); $viewObject->setValue('data', array('message' => 'Unable to lookup your card details. You may want to try updating your payment card')); return; // terminate the controller action } // save some values for later calls $lastfour = substr($response['number'], -4); $type = $response['type']; $expire_month = $response['expire_month']; $expire_year = $response['expire_year']; } // determine selected subscription options details $subscriptionLevels = $db->call("subscriptionLevels()"); $selectedSubscriptionLevel = str_replace('-r', '', $this->params['subscriptionlevel']); if (strpos($this->params['subscriptionlevel'], '-r') > 0) $recurringSubscription = '1'; else $recurringSubscription = '0'; foreach ($subscriptionLevels as $this_subscriptionLevel) { if ($this_subscriptionLevel['id'] === $selectedSubscriptionLevel) $selectedSubscription = $this_subscriptionLevel; } if (isset($selectedSubscription)) { // make initial payment $data = array( 'intent' => 'sale', 'payer' => array( 'payment_method' => 'credit_card', 'funding_instruments' => array( array( 'credit_card_token' => array( 'credit_card_id' => $paymentToken, 'payer_id' => $user->id, 'last4' => $lastfour, 'type' => $type, 'expire_month' => $expire_month, 'expire_year' => $expire_year ) ) ) ), 'transactions' => array ( array( 'amount' => array( 'total' => $selectedSubscription['cpm'], 'currency' => 'USD' ), 'description' => 'Safe-Text Membership' ) ) ); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $this->config['paypal']['endpoint'] . '/v1/payments/payment'); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Authorization: Bearer ' . $authtoken, 'Accept: application/json', 'Content-Type: application/json' )); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); $result = curl_exec($ch); // process response $response = json_decode($result, true); if (!is_array($response) || !array_key_exists('state', $response) || $response['state'] !== 'approved') { $viewObject->setValue('status', 'fail'); $viewObject->setValue('data', array('message' => 'Transaction was declined')); return; // terminate the controller action } // store payment details $db->call("putPayment('" . $response['id'] . "','" . $user->id . "','" . $selectedSubscription['cpm'] . "','" . $response['state'] . "')"); // determine new expiration date if ($user->subscription_expires === '0000-00-00') $expireDate = new DateTime(); else $expireDate = new DateTime($user->subscription_expires); $expireDate->add(new DateInterval('P' . ($selectedSubscription['months'] * 30) . 'D')); // save subscription status and payment token for user $db->call("updateSubscription('" . $user->id . "','" . $selectedSubscription['id'] . "','" . $paymentToken . "','" . $expireDate->format('Y-m-d') . "', '" . $recurringSubscription . "')"); $viewObject->setValue('status', 'success'); } else { // unable to find selected subscription $viewObject->setValue('status', 'fail'); $viewObject->setValue('data', array('message' => 'Problem trying to load the details for your selected subscription option. Please try again or contact us for assistance')); } } else { // invalid device $viewObject->setValue('status', 'fail'); $viewObject->setValue('data', array('message' => 'Problem trying to load device details for that token')); } } else { // invalid token $viewObject->setValue('status', 'fail'); $viewObject->setValue('data', array('message' => 'That auth token is not valid')); } } else { // no username $viewObject->setValue('status', 'fail'); $viewObject->setValue('data', array('message' => 'Missing SafeText auth token. Please log in')); } } else { // non-POST request $viewObject->setValue('status', 'fail'); $viewObject->setValue('data', array('message' => MS_REQUEST_METHOD . ' requests are not supported for this web service')); } } else { // insecure $viewObject->setValue('status', 'fail'); $viewObject->setValue('data', array('message' => 'Insecure (non-HTTPS) access denied')); } } /** * Payments. * * Displays a user's history of payments. * * @param MsView $viewObject * @return void */ public function paymentsAction(&$viewObject) { // forward to the web client page if logged in, otherwise to the login page if (!$this->init($viewObject)) { $this->forward($viewObject, 'login', 'auth'); } else { //count unread messages $sql_unread = "SELECT count(is_read) as unread_msg FROM messages,participants WHERE participants.contact_id='". $this->user->getValue('id')."' AND participants.is_sender=0 AND messages.is_read=0 AND participants.message_id=messages.id"; $unread = current($this->db->query($sql_unread)); if($unread[0]['unread_msg']>0) { $unread_message = $unread[0]['unread_msg']; } else { $unread_message = 0; } $folderStats = current($this->db->call("folderStats('" . $this->user->getValue('id') . "')")); // load all registered devices $payments = $this->db->call("payments('" . $this->user->getValue('id') . "')"); //title $viewObject->setTitle('Payment History'); // set view data $viewObject->setValue('folderStats', $folderStats); $viewObject->setValue('unread_msg', $unread_message); $viewObject->setValue('payments', $payments); } } /** * Card. * * Displays a form to set the payment card details. * * @param MsView $viewObject * @return void */ public function cardAction(&$viewObject) { // forward to the web client page if logged in, otherwise to the login page if (!$this->init($viewObject)) { $this->forward($viewObject, 'login', 'auth'); } else { //title $viewObject->setTitle('Update Card'); } } /** * Update Card Action (JSON). * * Sends a request to store a user's card in the PayPal vault and associate the new payment token with the user's account. * * @param MsView $viewObject * @return void */ public function updatecardAction(&$viewObject) { $viewObject->setResponseType('json'); // ensure we're using https if (MS_PROTOCOL === 'https') { if (MS_REQUEST_METHOD === 'POST') { if (array_key_exists('HTTP_X_SAFETEXT_TOKEN', $_SERVER) && $_SERVER['HTTP_X_SAFETEXT_TOKEN'] !== '') { // Create a database connection to share $db = new MsDb($this->config['dbHost'], $this->config['dbUser'], $this->config['dbPass'], $this->config['dbName']); // authenticate token with stored procedure require_once ( MS_PATH_BASE . DS . 'lib' . DS . 'safetext' . DS . 'user.php' ); $user = SafetextUser::tokenToUser($_SERVER['HTTP_X_SAFETEXT_TOKEN'], $db, $this->config); if ($user instanceof SafetextUser && $user->isValid()) { if ($user->getRelationship('device') instanceof SafetextDevice && $user->getRelationship('device')->isValid()) { // obtain a PayPal authorization token $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $this->config['paypal']['endpoint'] . '/v1/oauth2/token'); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_USERPWD, $this->config['paypal']['clientid'] . ':' . $this->config['paypal']['secret']); curl_setopt($ch, CURLOPT_POSTFIELDS, "grant_type=client_credentials"); $result = curl_exec($ch); // process response $response = json_decode($result, true); if (!is_array($response) || !array_key_exists('access_token', $response) || $response['access_token'] === '') { $viewObject->setValue('status', 'fail'); $viewObject->setValue('data', array('message' => 'Merchant service refused to authorize')); return; // terminate the controller action } $authtoken = $response['access_token']; curl_close($ch); if (array_key_exists('cc_number', $this->params) && $this->params['cc_number'] != '') { if (array_key_exists('cc_cvv2', $this->params) && $this->params['cc_cvv2'] != '') { if (array_key_exists('name', $this->params) && $this->params['name'] != '') { // store card in PayPal Vault, receive payment token $name = explode(' ', $this->params['name']); $data = array( 'payer_id' => $user->id, 'type' => strtolower($this->params['cc_type']), 'number' => $this->params['cc_number'], 'expire_month' => $this->params['cc_exp_month'], 'expire_year' => $this->params['cc_exp_year'], 'cvv2' => $this->params['cc_cvv2'], 'first_name' => $name[0], 'last_name' => $name[1] ); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $this->config['paypal']['endpoint'] . '/v1/vault/credit-card'); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Authorization: Bearer ' . $authtoken, 'Accept: application/json', 'Content-Type: application/json' )); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); $result = curl_exec($ch); // process response $response = json_decode($result, true); if (!is_array($response) || !array_key_exists('id', $response) || $response['id'] === '') { $viewObject->setValue('status', 'fail'); $viewObject->setValue('data', array('message' => 'Card declined')); return; // terminate the controller action } $paymentToken = $response['id']; curl_close($ch); // save subscription status and payment token for user $db->call("updateSubscription('" . $user->id . "','" . $user->subscription_level . "','" . $paymentToken . "','" . $user->subscription_expires . "', '" . $user->subscription_recurs . "')"); $viewObject->setValue('status', 'success'); } else { $viewObject->setValue('status', 'fail'); $viewObject->setValue('data', array('message' => 'You need to provide the name on your payment card')); return; } } else { $viewObject->setValue('status', 'fail'); $viewObject->setValue('data', array('message' => 'You need to provide the CVV2 card code for your payment card')); return; } } else { $viewObject->setValue('status', 'fail'); $viewObject->setValue('data', array('message' => 'You need to provide a credit card number for payment')); return; } } else { // invalid device $viewObject->setValue('status', 'fail'); $viewObject->setValue('data', array('message' => 'Problem trying to load device details for that token')); } } else { // invalid token $viewObject->setValue('status', 'fail'); $viewObject->setValue('data', array('message' => 'That auth token is not valid')); } } else { // no username $viewObject->setValue('status', 'fail'); $viewObject->setValue('data', array('message' => 'Missing SafeText auth token. Please log in')); } } else { // non-POST request $viewObject->setValue('status', 'fail'); $viewObject->setValue('data', array('message' => MS_REQUEST_METHOD . ' requests are not supported for this web service')); } } else { // insecure $viewObject->setValue('status', 'fail'); $viewObject->setValue('data', array('message' => 'Insecure (non-HTTPS) access denied')); } } /** * Cancel Recurring Action. * * Cancels a user's recurring subscription. * * @param MsView $viewObject * @return void */ public function cancelrecurringAction(&$viewObject) { $viewObject->setResponseType('json'); // ensure we're using https if (MS_PROTOCOL === 'https') { if (array_key_exists('HTTP_X_SAFETEXT_TOKEN', $_SERVER) && $_SERVER['HTTP_X_SAFETEXT_TOKEN'] !== '') { // Create a database connection to share $db = new MsDb($this->config['dbHost'], $this->config['dbUser'], $this->config['dbPass'], $this->config['dbName']); // authenticate token with stored procedure require_once ( MS_PATH_BASE . DS . 'lib' . DS . 'safetext' . DS . 'user.php' ); $user = SafetextUser::tokenToUser($_SERVER['HTTP_X_SAFETEXT_TOKEN'], $db, $this->config); if ($user instanceof SafetextUser && $user->isValid()) { if (MS_REQUEST_METHOD === 'POST') { // save subscription status and payment token for user $db->call("updateSubscription('" . $user->id . "','" . $user->subscription_level . "','" . $user->payment_token . "','" . $user->subscription_expires . "', '0')"); $viewObject->setValue('status', 'success'); } else { $viewObject->setValue('status', 'fail'); $viewObject->setValue('token', $user->getRelationship('device')->token); $viewObject->setValue('data', array('message' => MS_REQUEST_METHOD . ' requests are not supported for this web service')); } } else { // invalid token $viewObject->setValue('status', 'fail'); $viewObject->setValue('data', array('message' => 'That auth token is not valid')); } } else { // no token $viewObject->setValue('status', 'fail'); $viewObject->setValue('data', array('message' => 'Missing auth token')); } } else { // insecure $viewObject->setValue('status', 'fail'); $viewObject->setValue('data', array('message' => 'Insecure (non-HTTPS) access denied')); } } }
gpl-2.0
willprice/arduino-sphere-project
scripts/example_direction_finder/temboo/Library/Fitbit/Activities/GetActivityDailyGoals.py
4572
# -*- coding: utf-8 -*- ############################################################################### # # GetActivityDailyGoals # Get a user's current daily activity goals. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, # either express or implied. See the License for the specific # language governing permissions and limitations under the License. # # ############################################################################### from temboo.core.choreography import Choreography from temboo.core.choreography import InputSet from temboo.core.choreography import ResultSet from temboo.core.choreography import ChoreographyExecution import json class GetActivityDailyGoals(Choreography): def __init__(self, temboo_session): """ Create a new instance of the GetActivityDailyGoals Choreo. A TembooSession object, containing a valid set of Temboo credentials, must be supplied. """ super(GetActivityDailyGoals, self).__init__(temboo_session, '/Library/Fitbit/Activities/GetActivityDailyGoals') def new_input_set(self): return GetActivityDailyGoalsInputSet() def _make_result_set(self, result, path): return GetActivityDailyGoalsResultSet(result, path) def _make_execution(self, session, exec_id, path): return GetActivityDailyGoalsChoreographyExecution(session, exec_id, path) class GetActivityDailyGoalsInputSet(InputSet): """ An InputSet with methods appropriate for specifying the inputs to the GetActivityDailyGoals Choreo. The InputSet object is used to specify input parameters when executing this Choreo. """ def set_AccessTokenSecret(self, value): """ Set the value of the AccessTokenSecret input for this Choreo. ((required, string) The Access Token Secret retrieved during the OAuth process.) """ super(GetActivityDailyGoalsInputSet, self)._set_input('AccessTokenSecret', value) def set_AccessToken(self, value): """ Set the value of the AccessToken input for this Choreo. ((required, string) The Access Token retrieved during the OAuth process.) """ super(GetActivityDailyGoalsInputSet, self)._set_input('AccessToken', value) def set_ConsumerKey(self, value): """ Set the value of the ConsumerKey input for this Choreo. ((required, string) The Consumer Key provided by Fitbit.) """ super(GetActivityDailyGoalsInputSet, self)._set_input('ConsumerKey', value) def set_ConsumerSecret(self, value): """ Set the value of the ConsumerSecret input for this Choreo. ((required, string) The Consumer Secret provided by Fitbit.) """ super(GetActivityDailyGoalsInputSet, self)._set_input('ConsumerSecret', value) def set_ResponseFormat(self, value): """ Set the value of the ResponseFormat input for this Choreo. ((optional, string) The format that you want the response to be in: xml or json. Defaults to json.) """ super(GetActivityDailyGoalsInputSet, self)._set_input('ResponseFormat', value) def set_UserID(self, value): """ Set the value of the UserID input for this Choreo. ((optional, string) The user's encoded id. Defaults to "-" (dash) which will return data for the user associated with the token credentials provided.) """ super(GetActivityDailyGoalsInputSet, self)._set_input('UserID', value) class GetActivityDailyGoalsResultSet(ResultSet): """ A ResultSet with methods tailored to the values returned by the GetActivityDailyGoals Choreo. The ResultSet object is used to retrieve the results of a Choreo execution. """ def getJSONFromString(self, str): return json.loads(str) def get_Response(self): """ Retrieve the value for the "Response" output from this Choreo execution. (The response from Fitbit.) """ return self._output.get('Response', None) class GetActivityDailyGoalsChoreographyExecution(ChoreographyExecution): def _make_result_set(self, response, path): return GetActivityDailyGoalsResultSet(response, path)
gpl-2.0
h4ck3rm1k3/TwoNickels
src/tables/TableEntry.cpp
3880
/**************************************************************************\ * * FILE: TableEntry.cpp * * This source file is part of DIME. * Copyright (C) 1998-1999 by Systems In Motion. All rights reserved. * * This library is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License, version 2, as * published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License (the accompanying file named COPYING) for more * details. * ************************************************************************** * * If you need DIME for a non-GPL project, contact Systems In Motion * to acquire a Professional Edition License: * * Systems In Motion http://www.sim.no/ * Prof. Brochs gate 6 sales@sim.no * N-7030 Trondheim Voice: +47 22114160 * NORWAY Fax: +47 67172912 * \**************************************************************************/ /*! \class dimeTableEntry dime/tables/TableEntry.h \brief The dimeTableEntry class is the superclass for all table classes. */ #include <dime/tables/TableEntry.h> #include <dime/tables/UnknownTable.h> #include <dime/tables/LayerTable.h> #include <dime/tables/UCSTable.h> #include <dime/records/Record.h> #include <dime/Input.h> #include <dime/Output.h> #include <dime/util/MemHandler.h> #include <dime/Model.h> #include <string.h> #include <ctype.h> /*! Constructor. */ dimeTableEntry::dimeTableEntry() : dimeRecordHolder(0) // table entries are separated by group code 0 { } /*! Destructor. */ dimeTableEntry::~dimeTableEntry() { } /*! Copies the unclassified records. */ bool dimeTableEntry::copyRecords(dimeTableEntry * const table, dimeModel * const model) const { return dimeRecordHolder::copyRecords(table, model->getMemHandler()); } //! bool dimeTableEntry::write(dimeOutput * const /* file */) { // moved to preWrite() //return dimeRecordHolder::write(file); return true; } //! bool dimeTableEntry::read(dimeInput * const file) { return dimeRecordHolder::read(file); } /*! Static function that creates a table based on its name. */ dimeTableEntry * dimeTableEntry::createTableEntry(const char * const name, dimeMemHandler * const memhandler) { if (!strcmp(name, "LAYER")) { return new(memhandler) dimeLayerTable; } //if (!strcmp(name, "UCS")) // UCS is not used for the moment // return new(memhandler) dimeUCSTable; return new(memhandler) dimeUnknownTable(name, memhandler); } /*! Returns the number of records for this table. Tables overloading this function should first count the number of records they will write, then add the return value of this function to get the total number of records. */ int dimeTableEntry::countRecords() const { return dimeRecordHolder::countRecords(); } //! bool dimeTableEntry::handleRecord(const int, const dimeParam &, dimeMemHandler * const) { return false; } //! bool dimeTableEntry::isOfType(const int thetypeid) const { return thetypeid == dimeBase::dimeTableEntryType || dimeRecordHolder::isOfType(thetypeid); } //! bool dimeTableEntry::preWrite(dimeOutput * const file) { return file->writeGroupCode(0) && file->writeString(this->getTableName()) && dimeRecordHolder::write(file); } /*! \fn const char * dimeTableEntry::getTableName() const = 0 */ /*! \fn dimeTableEntry * dimeTableEntry::copy(dimeModel * const model) const = 0 */ /*! \fn int dimeTableEntry::typeId() const = 0 */
gpl-2.0
Fluorohydride/ygopro-scripts
c49407319.lua
2391
--スター・マイン function c49407319.initial_effect(c) --synchro summon aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1) c:EnableReviveLimit() c:SetSPSummonOnce(49407319) --damage local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(49407319,0)) e1:SetCategory(CATEGORY_DAMAGE) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e1:SetCode(EVENT_DESTROYED) e1:SetCondition(c49407319.damcon) e1:SetTarget(c49407319.damtg) e1:SetOperation(c49407319.damop) c:RegisterEffect(e1) --destroy local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(49407319,1)) e2:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e2:SetCode(EVENT_DESTROYED) e2:SetRange(LOCATION_MZONE) e2:SetCondition(c49407319.descon) e2:SetTarget(c49407319.destg) e2:SetOperation(c49407319.desop) c:RegisterEffect(e2) end function c49407319.damcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return c:IsPreviousControler(tp) and (c:IsReason(REASON_EFFECT) and rp==1-tp or c:IsReason(REASON_BATTLE) and Duel.GetAttacker():IsControler(1-tp)) end function c49407319.damtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,PLAYER_ALL,2000) end function c49407319.damop(e,tp,eg,ep,ev,re,r,rp) if Duel.Damage(tp,2000,REASON_EFFECT)>0 then Duel.BreakEffect() Duel.Damage(1-tp,2000,REASON_EFFECT) end end function c49407319.filter(c,tp,rp,seq) return c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_MZONE) and ((c:IsReason(REASON_EFFECT) and rp==1-tp) or (c:IsReason(REASON_BATTLE) and Duel.GetAttacker():IsControler(1-tp))) and c:GetPreviousSequence()<5 and math.abs(seq-c:GetPreviousSequence())==1 end function c49407319.descon(e,tp,eg,ep,ev,re,r,rp) local seq=e:GetHandler():GetSequence() if seq>=5 then return false end return eg:IsExists(c49407319.filter,1,nil,tp,rp,seq) end function c49407319.destg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,PLAYER_ALL,2000) end function c49407319.desop(e,tp,eg,ep,ev,re,r,rp) if e:GetHandler():IsRelateToEffect(e) and Duel.Destroy(e:GetHandler(),REASON_EFFECT)>0 and Duel.Damage(tp,2000,REASON_EFFECT)>0 then Duel.BreakEffect() Duel.Damage(1-tp,2000,REASON_EFFECT) end end
gpl-2.0
jeroendierckx/Camelot
camelot/view/controls/delegates/integerdelegate.py
2390
# ============================================================================ # # Copyright (C) 2007-2012 Conceptive Engineering bvba. All rights reserved. # www.conceptive.be / project-camelot@conceptive.be # # This file is part of the Camelot Library. # # This file may be used under the terms of the GNU General Public # License version 2.0 as published by the Free Software Foundation # and appearing in the file license.txt included in the packaging of # this file. Please review this information to ensure GNU # General Public Licensing requirements will be met. # # If you are unsure which license is appropriate for your use, please # visit www.python-camelot.com or contact project-camelot@conceptive.be # # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # For use of this library in commercial applications, please contact # project-camelot@conceptive.be # # ============================================================================ from PyQt4 import QtCore from PyQt4.QtCore import Qt from customdelegate import CustomDelegate, DocumentationMetaclass from camelot.view.controls import editors from camelot.core.utils import variant_to_pyobject from camelot.view.proxy import ValueLoading class IntegerDelegate(CustomDelegate): """Custom delegate for integer values""" __metaclass__ = DocumentationMetaclass editor = editors.IntegerEditor def __init__(self, parent=None, unicode_format = None, **kwargs): CustomDelegate.__init__(self, parent=parent, **kwargs) self.unicode_format = unicode_format self.locale = QtCore.QLocale() def paint(self, painter, option, index): painter.save() self.drawBackground(painter, option, index) value = variant_to_pyobject(index.model().data(index, Qt.EditRole)) if value in (None, ValueLoading): value_str = '' else: value_str = self.locale.toString( long(value) ) if self.unicode_format is not None: value_str = self.unicode_format(value) self.paint_text( painter, option, index, value_str, horizontal_align=Qt.AlignRight ) painter.restore()
gpl-2.0
MujeresdelasAmericas/Sitio
wp-content/plugins/coursepress/includes/templates/instructor-single.php
462
<?php // Avatar echo do_shortcode( '[course_instructor_avatar instructor_id="' . $user->ID . '"]' ); // Bio echo get_user_meta( $user->ID, 'description', true ); ?> <h2 class="h2-instructor-bio"><?php _e( 'Courses', 'cp' ); ?></h2> <?php // Course List echo do_shortcode( '[course_list instructor="' . $user->ID . '" class="course" left_class="enroll-box-left" right_class="enroll-box-right" course_class="enroll-box" title_link="yes" show_media="yes"]' ); ?>
gpl-2.0
howardjones/cacti088c
install/0_8_7b_to_0_8_7c.php
5544
<?php /* +-------------------------------------------------------------------------+ | Copyright (C) 2004-2014 The Cacti Group | | | | This program is free software; you can redistribute it and/or | | modify it under the terms of the GNU General Public License | | as published by the Free Software Foundation; either version 2 | | of the License, or (at your option) any later version. | | | | This program is distributed in the hope that it will be useful, | | but WITHOUT ANY WARRANTY; without even the implied warranty of | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | | GNU General Public License for more details. | +-------------------------------------------------------------------------+ | Cacti: The Complete RRDTool-based Graphing Solution | +-------------------------------------------------------------------------+ | This code is designed, written, and maintained by the Cacti Group. See | | about.php and/or the AUTHORS file for specific developer information. | +-------------------------------------------------------------------------+ | http://www.cacti.net/ | +-------------------------------------------------------------------------+ */ function upgrade_to_0_8_7c() { /* speed up the UI, missed in 0.8.7b upgrade, avoid failures if index already exists */ $result = db_fetch_assoc("SHOW INDEX FROM `data_local`") or die (mysql_error()); $indices = array(); foreach($result as $index => $arr) { $indices[] = $arr["Key_name"]; } if (!in_array('host_id', $indices)) { db_install_execute("0.8.7c", "ALTER TABLE `data_local` ADD INDEX `host_id`(`host_id`)"); } $result = db_fetch_assoc("SHOW INDEX FROM `host_snmp_cache`") or die (mysql_error()); $indices = array(); foreach($result as $index => $arr) { $indices[] = $arr["Key_name"]; } if (!in_array('field_name', $indices)) { db_install_execute("0.8.7c", "ALTER TABLE `host_snmp_cache` ADD INDEX `field_name`(`field_name`)"); } if (!in_array('field_value', $indices)) { db_install_execute("0.8.7c", "ALTER TABLE `host_snmp_cache` ADD INDEX `field_value`(`field_value`)"); } /* speed up graph automations some more */ db_install_execute("0.8.7c", "ALTER TABLE `data_input_fields` ADD INDEX `input_output`(`input_output`)"); /* increase the width of the settings field, but only if MySQL is >= 5 */ if (substr(db_fetch_cell("SELECT @@version"), 0, 1) >= 5) { db_install_execute("0.8.7c", "ALTER TABLE `settings` MODIFY COLUMN `value` VARCHAR(512) NOT NULL DEFAULT ''"); } /* add a default for NOT NULL columns */ db_install_execute("0.8.7c", "ALTER TABLE `data_local` MODIFY COLUMN `snmp_index` VARCHAR(255) NOT NULL DEFAULT '';"); db_install_execute("0.8.7c", "ALTER TABLE `graph_local` MODIFY COLUMN `snmp_index` VARCHAR(255) NOT NULL DEFAULT '';"); db_install_execute("0.8.7c", "ALTER TABLE `graph_templates_graph` MODIFY COLUMN `upper_limit` VARCHAR(20) NOT NULL DEFAULT '0';"); db_install_execute("0.8.7c", "ALTER TABLE `graph_templates_graph` MODIFY COLUMN `lower_limit` VARCHAR(20) NOT NULL DEFAULT '0';"); db_install_execute("0.8.7c", "ALTER TABLE `graph_templates_graph` MODIFY COLUMN `scale_log_units` CHAR(2) DEFAULT NULL;"); db_install_execute("0.8.7c", "ALTER TABLE `host` MODIFY COLUMN `availability` DECIMAL(8,5) NOT NULL DEFAULT '100.00000';"); db_install_execute("0.8.7c", "ALTER TABLE `host_snmp_cache` MODIFY COLUMN `snmp_index` VARCHAR(255) NOT NULL DEFAULT '';"); db_install_execute("0.8.7c", "ALTER TABLE `host_snmp_cache` MODIFY COLUMN `oid` TEXT NOT NULL;"); db_install_execute("0.8.7c", "ALTER TABLE `poller_item` MODIFY COLUMN `snmp_auth_protocol` VARCHAR(5) NOT NULL DEFAULT '';"); db_install_execute("0.8.7c", "ALTER TABLE `poller_item` MODIFY COLUMN `snmp_priv_passphrase` VARCHAR(200) NOT NULL DEFAULT '';"); db_install_execute("0.8.7c", "ALTER TABLE `poller_item` MODIFY COLUMN `snmp_priv_protocol` VARCHAR(6) NOT NULL DEFAULT '';"); db_install_execute("0.8.7c", "ALTER TABLE `poller_item` MODIFY COLUMN `rrd_next_step` MEDIUMINT(8) NOT NULL DEFAULT '0';"); db_install_execute("0.8.7c", "ALTER TABLE `poller_item` MODIFY COLUMN `arg1` TEXT DEFAULT NULL;"); db_install_execute("0.8.7c", "ALTER TABLE `poller_reindex` MODIFY COLUMN `arg1` VARCHAR(255) NOT NULL DEFAULT '';"); db_install_execute("0.8.7c", "ALTER TABLE `user_auth` MODIFY COLUMN `enabled` CHAR(2) NOT NULL DEFAULT 'on';"); db_install_execute("0.8.7c", "ALTER TABLE `user_log` MODIFY COLUMN `ip` VARCHAR(40) NOT NULL DEFAULT '';"); /* change size of columns to match current cacti.sql file */ db_install_execute("0.8.7c", "ALTER TABLE `poller_item` MODIFY COLUMN `rrd_step` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '300';"); db_install_execute("0.8.7c", "ALTER TABLE `poller_time` MODIFY COLUMN `pid` INT(11) UNSIGNED NOT NULL DEFAULT '0';"); /* Update deletion verification setting */ db_install_execute("0.8.7c", "UPDATE settings SET name = 'deletion_verification' WHERE name = 'remove_verification'"); /* Correct issue where rrd_next_step goes large in a positive way instead of the way it should go */ db_install_execute("0.8.7c", "ALTER TABLE `poller_item` MODIFY COLUMN `rrd_step` MEDIUMINT(8) NOT NULL DEFAULT 300"); } ?>
gpl-2.0
chrosa/AllHadronicSUSY
QCDBkgRS/test/QCDPrediction/GetRebalanceCorrectionFactor.C
4567
#include <TROOT.h> #include <TSystem.h> #include <TH1.h> #include <TH2.h> #include <TProfile.h> #include <TCanvas.h> #include <TColor.h> #include <TChain.h> #include <TPad.h> #include <TStyle.h> #include <TFile.h> #include <TPostScript.h> #include <TLegend.h> #include <TMath.h> #include <TString.h> #include <TArrayF.h> #include <TLine.h> #include <TPaveText.h> #include <iostream> #include <fstream> #include <vector> #include <string> //#include "/afs/desy.de/user/c/csander/xxl-af-cms/CMSSW_7_2_3_patch1/src/macros/PlottingUtils.C" using namespace std; void GetRebalanceCorrectionFactor() { //gROOT->ProcessLine(".L /afs/desy.de/user/c/csander/xxl-af-cms/CMSSW_7_4_6_patch1/src/macros/PlottingUtils.C+"); //SetPlotStyle(); // --- define output file for ps ---// TString pt = "pt10"; double x_min = 10.; TString outfile = "RebalanceCorrectionFactor/RebalanceCorrectionFactors_madgraph_spring15_withoutPUReweighting_" + pt; TH2F* RebCorrection_vsReco = new TH2F("RebCorrection_vsReco", "Jet pt", 1000, 0., 1000., 100, 0., 3.); TH2F* RebCorrection_vsReco_b = new TH2F("RebCorrection_vsReco_b", "Jet pt", 1000, 0., 1000., 100, 0., 3.); string root_file; // madgraph ifstream myfile ("filelists_phys14/filelist.txt"); if (myfile.is_open()) { while( myfile.good() ) { getline (myfile,root_file); cout << root_file << endl; TH2F* RebCorrection_vsReco_temp; TH2F* RebCorrection_vsReco_b_temp; TString path = root_file; TFile* input_file = TFile::Open(path, "READ"); input_file->cd("QCDfromSmearing"); gDirectory->GetObject("RebCorrection_vsReco;1", RebCorrection_vsReco_temp); RebCorrection_vsReco->Add(RebCorrection_vsReco_temp); gDirectory->GetObject("RebCorrection_vsReco_b;1", RebCorrection_vsReco_b_temp); RebCorrection_vsReco_b->Add(RebCorrection_vsReco_b_temp); input_file->Close(); } myfile.close(); } // ---------------------------------------------------- // // madgraph TH1F* correction_vsReco = new TH1F(); correction_vsReco = (TH1F*) RebCorrection_vsReco->ProjectionX(); correction_vsReco->Reset(); for (int i = 0; i <= RebCorrection_vsReco->GetXaxis()->GetNbins(); ++i) { TH1F h = *((TH1F*) RebCorrection_vsReco->ProjectionY("py", i, i)); double mean = h.GetMean(); double error = h.GetMeanError(); cout << "i: " << i << " " << "mean: " << mean << " " << "error: " << error << endl; correction_vsReco->SetBinContent(i, mean); correction_vsReco->SetBinError(i, error); } TH1F* correction_vsReco_b = new TH1F(); correction_vsReco_b = (TH1F*) RebCorrection_vsReco_b->ProjectionX(); correction_vsReco_b->Reset(); for (int i = 0; i <= RebCorrection_vsReco_b->GetXaxis()->GetNbins(); ++i) { TH1F h = *((TH1F*) RebCorrection_vsReco_b->ProjectionY("py", i, i)); double mean = h.GetMean(); double error = h.GetMeanError(); cout << "i: " << i << " " << "mean: " << mean << " " << "error: " << error << endl; correction_vsReco_b->SetBinContent(i, mean); correction_vsReco_b->SetBinError(i, error); } // ---------------------------------------------------- // TCanvas *c = new TCanvas("c", "", 800, 800); correction_vsReco->SetMinimum(0.8); correction_vsReco->SetMaximum(1.2); correction_vsReco->SetAxisRange(x_min, correction_vsReco->GetXaxis()->GetXmax()); correction_vsReco->SetXTitle("reco jet p_{T} [GeV]"); correction_vsReco->SetYTitle("reb jet p_{T} / gen jet p_{T} "); correction_vsReco->Draw(); c->Print(outfile + "_vsReco.ps"); c->Print(outfile + "_vsReco.png"); TCanvas *d = new TCanvas("d", "", 800, 800); correction_vsReco_b->SetMinimum(0.8); correction_vsReco_b->SetMaximum(1.2); correction_vsReco_b->SetAxisRange(x_min, correction_vsReco->GetXaxis()->GetXmax()); correction_vsReco_b->SetXTitle("reco b-jet p_{T} [GeV]"); correction_vsReco_b->SetYTitle("reb b-jet p_{T} / gen jet p_{T} "); correction_vsReco_b->Draw(); d->Print(outfile + "_vsReco_b.ps"); d->Print(outfile + "_vsReco_b.png"); // ---------------------------------------------------- // TFile* RebalanceCorrection = new TFile(outfile + ".root", "RECREATE"); correction_vsReco->Write(); correction_vsReco_b->Write(); RebCorrection_vsReco->Write(); RebCorrection_vsReco_b->Write(); RebalanceCorrection->Write(); }
gpl-2.0
fin-nick/fj
src/jimm/modules/fs/FileNode.java
2137
/* * FileNode.java * * Created on 7 Февраль 2008 г., 20:26 * * To change this template, choose Tools | Template Manager * and open the template in the editor. */ // #sijapp cond.if modules_FILES="true"# package jimm.modules.fs; import DrawControls.icons.*; import DrawControls.text.ListItem; import DrawControls.tree.TreeNode; import DrawControls.icons.Icon; import DrawControls.icons.ImageList; import javax.microedition.lcdui.Font; import jimm.comm.Sortable; import jimm.ui.base.*; /** * * @author vladimir */ public class FileNode implements Sortable { final private String path; final private String filename; private long size = -1; /** Creates a new instance of FileNode */ public FileNode(String path, String filename) { this.path = path; this.filename = filename; } public String getText() { return filename; } public int getNodeWeight() { if (isParentDir()) { return 0; } if (isDir()) { return 10; } return 20; } public boolean isDir() { return filename.endsWith("/"); } public boolean isParentDir() { return filename.equals(FileSystem.PARENT_DIRECTORY); } public boolean isDisk() { return path.equals(FileSystem.ROOT_DIRECTORY); } public boolean isFile() { return !isDir(); } public long size() { if (!isDisk() && !isFile()) { return 0; } if (-1 == size) { try { FileSystem fs = FileSystem.getInstance(); fs.openFile(getFullName()); size = isFile() ? fs.fileSize() : fs.totalSize(); fs.close(); } catch (Exception e) { return 0; } } return size; } public String getFullName() { if (isParentDir()) { int d = path.lastIndexOf('/', path.length() - 2); return (d != -1) ? path.substring(0, d + 1) : FileSystem.ROOT_DIRECTORY; } return path + filename; } } // #sijapp cond.end#
gpl-2.0
kuwox/wwwfranar
administrator/components/com_virtuemart/languages/admin/thai.php
51866
<?php if( !defined( '_VALID_MOS' ) && !defined( '_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' ); /** * @version : thai.php 1071 2007-12-03 08:42:28Z thepisu $ * @package VirtueMart * @subpackage languages * @copyright Copyright (C) 2004-2008 soeren - All rights reserved. * @translator Akarawuth Tamrareang JoomlaCorner.com * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php * VirtueMart is free software. This version may have been modified pursuant * to the GNU General Public License, and as distributed it includes or * is derivative of works licensed under the GNU General Public License or * other free or open source software licenses. * See /administrator/components/com_virtuemart/COPYRIGHT.php for copyright notices and details. * * http://virtuemart.net */ global $VM_LANG; $langvars = array ( 'CHARSET' => 'UTF-8', 'PHPSHOP_USER_LIST_LBL' => 'ผู้ใช้งาน', 'PHPSHOP_USER_LIST_USERNAME' => 'ชื่อผู้ใช้', 'PHPSHOP_USER_LIST_FULL_NAME' => 'ชื่อเต็ม', 'PHPSHOP_USER_LIST_GROUP' => 'กลุ่ม', 'PHPSHOP_USER_FORM_LBL' => 'เพิ่ม / แก้ไขรายละเอียดผู้ใช้งาน', 'PHPSHOP_USER_FORM_PERMS' => 'การกำหนดสิทธิ์', 'PHPSHOP_USER_FORM_CUSTOMER_NUMBER' => 'หมายเลข/IDลูกค้า ', 'PHPSHOP_MODULE_LIST_LBL' => 'โมดูล', 'PHPSHOP_MODULE_LIST_NAME' => 'ชื่อโมดูล', 'PHPSHOP_MODULE_LIST_PERMS' => 'ผู้มีสิทธิ์ใช้งาน', 'PHPSHOP_MODULE_LIST_FUNCTIONS' => 'ฟังก์ชั่น', 'PHPSHOP_MODULE_FORM_LBL' => 'รายละเอียดโมดูล', 'PHPSHOP_MODULE_FORM_MODULE_LABEL' => 'ชื่อโมดูล (สำหรับเมนูด้านบน)', 'PHPSHOP_MODULE_FORM_NAME' => 'ชื่อโมดูล', 'PHPSHOP_MODULE_FORM_PERMS' => 'ผู้มีสิทธิ์ใช้งาน', 'PHPSHOP_MODULE_FORM_HEADER' => 'โมดูล Header', 'PHPSHOP_MODULE_FORM_FOOTER' => 'โมดูล Footer', 'PHPSHOP_MODULE_FORM_MENU' => 'แสดงรายการโมดูลในส่วนของเมนูผู้ดูแลระบบ?', 'PHPSHOP_MODULE_FORM_ORDER' => 'ลำดับการแสดง', 'PHPSHOP_MODULE_FORM_DESCRIPTION' => 'รายละเอียดโมดูล', 'PHPSHOP_MODULE_FORM_LANGUAGE_CODE' => 'รหัสภาษา', 'PHPSHOP_MODULE_FORM_LANGUAGE_FILE' => 'ไฟล์ภาษา', 'PHPSHOP_FUNCTION_LIST_LBL' => 'ฟังก์ชั่น', 'PHPSHOP_FUNCTION_LIST_NAME' => 'ชื่อฟังก์ชั่น', 'PHPSHOP_FUNCTION_LIST_CLASS' => 'ชื่อคลาส', 'PHPSHOP_FUNCTION_LIST_METHOD' => 'คลาสเมธอด', 'PHPSHOP_FUNCTION_LIST_PERMS' => 'ผู้มีสิทธิ์ใช้งาน', 'PHPSHOP_FUNCTION_FORM_LBL' => 'รายละเอียดฟังก์ชั่น', 'PHPSHOP_FUNCTION_FORM_NAME' => 'ชื่อฟังก์ชั่น', 'PHPSHOP_FUNCTION_FORM_CLASS' => 'ชื่อคลาส', 'PHPSHOP_FUNCTION_FORM_METHOD' => 'คลาสเมธอด', 'PHPSHOP_FUNCTION_FORM_PERMS' => 'ผู้มีสิทธิ์ใช้งาน', 'PHPSHOP_FUNCTION_FORM_DESCRIPTION' => 'รายละเอียดฟังก์ชั่น', 'PHPSHOP_CURRENCY_LIST_LBL' => 'สกุลเงิน', 'PHPSHOP_CURRENCY_LIST_NAME' => 'ชื่อสกุลเงิน', 'PHPSHOP_CURRENCY_LIST_CODE' => 'สัญลักษณ์', 'PHPSHOP_COUNTRY_LIST_LBL' => 'รายชื่อประเทศ', 'PHPSHOP_COUNTRY_LIST_NAME' => 'ชื่อประเทศ', 'PHPSHOP_COUNTRY_LIST_3_CODE' => 'รหัสประเทศ (3)', 'PHPSHOP_COUNTRY_LIST_2_CODE' => 'รหัสประเทศ (2)', 'PHPSHOP_STATE_LIST_MNU' => 'แสดงชื่อเมือง', 'PHPSHOP_STATE_LIST_LBL' => 'แสดงชื่อเมืองสำหรับ: ', 'PHPSHOP_STATE_LIST_ADD' => 'เพิ่ม/เปลี่ยนแปลง ชื่อเมือง', 'PHPSHOP_STATE_LIST_NAME' => 'ชื่อเมือง', 'PHPSHOP_STATE_LIST_3_CODE' => ' Code เมือง (3)', 'PHPSHOP_STATE_LIST_2_CODE' => ' Code เมือง (2)', 'PHPSHOP_ADMIN_CFG_GLOBAL' => 'ทั่วไป', 'PHPSHOP_ADMIN_CFG_SITE' => 'ไซต์', 'PHPSHOP_ADMIN_CFG_SHIPPING' => 'การจัดส่ง', 'PHPSHOP_ADMIN_CFG_CHECKOUT' => 'สั่งซื้อ', 'PHPSHOP_ADMIN_CFG_DOWNLOADABLEGOODS' => 'ดาวน์โหลด', 'PHPSHOP_ADMIN_CFG_USE_ONLY_AS_CATALOGUE' => 'แสดงเฉพาะรายการแคตตาล็อกสินค้า', 'PHPSHOP_ADMIN_CFG_USE_ONLY_AS_CATALOGUE_EXPLAIN' => 'ถ้าเลือกรายการนี้ จะไม่สามารถใช้ฟังก์ชั่นรถเข็นชำระเงินได้', 'PHPSHOP_ADMIN_CFG_SHOW_PRICES' => 'แสดงราคา', 'PHPSHOP_ADMIN_CFG_SHOW_PRICES_EXPLAIN' => 'เลือกเพื่อให้แสดงราคา กรณีที่เลือกแสดงเฉพาะแคตตาล็อกสินค้าอย่างเดียว อาจจะไม่ต้องการแสดงราคา', 'PHPSHOP_ADMIN_CFG_VIRTUAL_TAX' => 'ภาษีตามจริง', 'PHPSHOP_ADMIN_CFG_VIRTUAL_TAX_EXPLAIN' => 'กำหนดรายการที่ไม่ระบุน้ำหนักว่าต้องมีภาษีหรือไม่ ให้แก้ไข ps_checkout.php->calc_order_taxable() เพื่อเปลี่ยนแปลงผล', 'PHPSHOP_ADMIN_CFG_TAX_MODE' => 'รูปแบบการคำนวนภาษี:', 'PHPSHOP_ADMIN_CFG_TAX_MODE_SHIP' => 'กำหนดตามสถานที่จัดส่ง', 'PHPSHOP_ADMIN_CFG_TAX_MODE_VENDOR' => 'กำหนดตามที่อยู่ผู้ขาย', 'PHPSHOP_ADMIN_CFG_TAX_MODE_EXPLAIN' => 'กำหนดเพื่อเลือกอัตราภาษีที่จะนำไปใช้ในการคำนวนภาษี:<br /> <ul><li>จากรัฐหรือประเทศที่ร้านค้าตั้งอยู่</li><br/> <li>หรือจากประเทศที่ลูกค้าอยู่</li></ul>', 'PHPSHOP_ADMIN_CFG_MULTI_TAX_RATE' => 'แสดงภาษีหลายอัตรา?', 'PHPSHOP_ADMIN_CFG_MULTI_TAX_RATE_EXPLAIN' => 'เลือกรายการนี้ ถ้ามีรายการสินค้าที่มีอัตราภาษีแตกต่างกัน (เช่น หนังสือและอาหาร 7% , อย่างอื่นๆ 16%)', 'PHPSHOP_ADMIN_CFG_SUBSTRACT_PAYEMENT_BEFORE' => 'หักส่วนลดก่อนคิดภาษีและค่าขนส่ง?', 'PHPSHOP_ADMIN_CFG_REVIEW' => 'อนุญาตให้ลูกค้าแสดงความคิดเห็น หรือโหวตให้คะแนนได้', 'PHPSHOP_ADMIN_CFG_REVIEW_EXPLAIN' => 'ถ้าเลือกรายการนี้ จะทำให้ลูกค้าสามารถให้คะแนนโหวตสินค้า และแสดงความคิดเห็นได้<br /> เพื่อให้ลูกค้าสามารถแสดงความเห็นเกี่ยวกับตัวสินค้านั้นแก่ลูกค้ารายอื่นๆ<br />', 'PHPSHOP_ADMIN_CFG_SUBSTRACT_PAYEMENT_BEFORE_EXPLAIN' => 'กำหนดให้หักส่วนลดก่อนเลือกขั้นตอนชำระเงิน หรือหลังจากรวมภาษีและค่าขนส่งแล้ว', 'PHPSHOP_ADMIN_CFG_AGREE_TERMS' => 'ต้องเห็นชอบกับข้อตกลงการใช้บริการ?', 'PHPSHOP_ADMIN_CFG_AGREE_TERMS_EXPLAIN' => 'เลือกรายการนี้ หากต้องการให้ผู้ซื้อต้องเห็นชอบกับข้อตกลงการใช้บริการก่อน', 'PHPSHOP_ADMIN_CFG_CHECK_STOCK' => 'ตรวจนับสินค้า?', 'PHPSHOP_ADMIN_CFG_CHECK_STOCK_EXPLAIN' => 'กำหนดให้มีการตรวจนับสินค้า เมื่อผู้ซื้อหยิบสินค้าใส่รถเข็น ถ้าเลือกรายการนี้จะทำให้ลูกค้าไม่สามารถเพิ่มรายการสินค้าในรถเข็นถ้าหากไม่มีสินค้าในสต๊อค', 'PHPSHOP_ADMIN_CFG_MAIL_FORMAT' => 'รูปแบบการยืนยันการสั่งซื้อที่ส่งไปทางอีเมล์:', 'PHPSHOP_ADMIN_CFG_MAIL_FORMAT_TEXT' => 'แบบอักษรธรรมดา', 'PHPSHOP_ADMIN_CFG_MAIL_FORMAT_HTML' => 'แบบ HTML', 'PHPSHOP_ADMIN_CFG_MAIL_FORMAT_EXPLAIN' => 'ระบุการยืนยันการสั่งซื้อทางอีเมล์:<br /> <ul><li>แบบอักษรธรรมดา</li> <li>แบบ HTML พร้อมรูปภาพ</li></ul>', 'PHPSHOP_ADMIN_CFG_FRONTENDAMDIN' => 'อนุญาตให้มีผู้ดูแลระบบเฉพาะหน้าร้าน?', 'PHPSHOP_ADMIN_CFG_FRONTENDAMDIN_EXPLAIN' => 'สามารถกำหนดให้มีผู้ดูแลระบบเฉพาะหน้าร้าน เช่น storeadmins แต่ไม่สามารถเข้าถึงระบบการจัดการของ Mambo ได้ (เช่น Registered / Editor)', 'PHPSHOP_ADMIN_CFG_URLSECURE' => 'SECUREURL', 'PHPSHOP_ADMIN_CFG_URLSECURE_EXPLAIN' => 'URL สำหรับการเข้ารหัสรักษาความปลอดภัย (https - และใส่เครื่องหมาย / ต่อท้ายด้วย!)', 'PHPSHOP_ADMIN_CFG_HOMEPAGE' => 'หน้าแรก', 'PHPSHOP_ADMIN_CFG_HOMEPAGE_EXPLAIN' => 'หน้าแสดงผลหน้าแรก', 'PHPSHOP_ADMIN_CFG_ERRORPAGE' => 'หน้าแสดงข้อผิดพลาด', 'PHPSHOP_ADMIN_CFG_ERRORPAGE_EXPLAIN' => 'หน้าแสดงข้อความเกี่ยวกับข้อผิดพลาด', 'PHPSHOP_ADMIN_CFG_DEBUG' => 'DEBUG ?', 'PHPSHOP_ADMIN_CFG_DEBUG_EXPLAIN' => 'DEBUG ? เปิดใช้งานการแสดงผลการดีบัก - จะแสดงผลที่ด้านล่างของแต่ละหน้า. ซึ่งจะช่วยในการปรับปรุงแก้ไขระบบ การพัฒนาร้านค้า การแสดงรายละเอียดในรถเข็น การแสดงค่าต่างๆ เป็นต้น', 'PHPSHOP_ADMIN_CFG_FLYPAGE' => 'หน้าต่างใหม่', 'PHPSHOP_ADMIN_CFG_FLYPAGE_EXPLAIN' => 'หน้าต่างแสดงรายละเอียดสินค้า', 'PHPSHOP_ADMIN_CFG_CATEGORY_TEMPLATE' => 'รูปแบบหมวดสินค้า', 'PHPSHOP_ADMIN_CFG_CATEGORY_TEMPLATE_EXPLAIN' => 'กำหนดรูปแบบปกติสำหรับการแสดงสินค้าในแต่ละหมวด<br /> ท่านสามารถสร้างรูปแบบใหม่จากไฟล์เทมเพลตที่มีอยู่<br /> (ซึ่งเก็บอยู่ในไดเรคทอรี่ <strong>COMPONENTPATH/html/templates/</strong>)', 'PHPSHOP_ADMIN_CFG_PRODUCTS_PER_ROW' => 'จำนวนปกติของสินค้าในแต่ละแถว', 'PHPSHOP_ADMIN_CFG_PRODUCTS_PER_ROW_EXPLAIN' => 'แสดงจำนวนสินค้าในแต่ละแถว. <br /> ตัวอย่างเช่น: ถ้ากำหนดเป็น 4 ก็จะแสดงจำนวนสินค้า 4 รายการต่อแถว', 'PHPSHOP_ADMIN_CFG_NOIMAGEPAGE' => 'รูปภาพ ', 'PHPSHOP_ADMIN_CFG_NOIMAGEPAGE_EXPLAIN' => 'แสดงภาพนี้เมื่อไม่มีภาพสินค้า', 'PHPSHOP_ADMIN_CFG_SHOWPHPSHOP_VERSION' => 'แสดง ', 'PHPSHOP_ADMIN_CFG_SHOWPHPSHOP_VERSION_EXPLAIN' => 'แสดงภาพ powered-by-mambo-phpShop', 'PHPSHOP_ADMIN_CFG_STORE_SHIPPING_METHOD_STANDARD' => 'โมดูลขนส่งมาตรฐาน ตามผู้ขนส่ง และอัตราค่าขนส่งของแต่ละราย <strong>แนะนำ !</strong>', 'PHPSHOP_ADMIN_CFG_STORE_SHIPPING_METHOD_ZONE' => ' Zone Shipping Module Country Version 1.0<br />ดูรายละเอียดเพิ่มเติม <a href="http://ZephWare.com">http://ZephWare.com</a><br /> หรือต้องการติดต่อ <a href="mailto:zephware@devcompany.com">ZephWare.com</a><br /> เลือกใช้โมดูล Zone Shipping', 'PHPSHOP_ADMIN_CFG_STORE_SHIPPING_METHOD_DISABLE' => 'ไม่ต้องเลือกวิธีการขนส่ง กรณีที่ลูกค้าซื้อสินค้าที่ใช้วิธีดาวน์โหลด', 'PHPSHOP_ADMIN_CFG_ENABLE_CHECKOUTBAR' => 'แสดงแถบขั้นตอนการชำระเงิน', 'PHPSHOP_ADMIN_CFG_ENABLE_CHECKOUTBAR_EXPLAIN' => 'เลือกรายการนี้เพื่อแสดงแถบขั้นตอนการชำระเงิน ( 1 - 2 - 3 - 4 พร้อมภาพกราฟฟิค)', 'PHPSHOP_ADMIN_CFG_CHECKOUT_PROCESS' => 'เลือกวิธีการชำระเงินสำหรับร้านค้าของท่าน', 'PHPSHOP_ADMIN_CFG_ENABLE_DOWNLOADS' => 'อนุญาตให้ดาวน์โหลดได้', 'PHPSHOP_ADMIN_CFG_ENABLE_DOWNLOADS_EXPLAIN' => 'เลือกเพื่ออนุญาตให้สามารถดาวน์โหลดได้ ใช้สำหรับจำหน่ายสินค้าที่ให้บริการแบบดาวน์โหลด', 'PHPSHOP_ADMIN_CFG_ORDER_ENABLE_DOWNLOADS' => 'สถานะการสั่งซื้อกรณีอนุญาตให้ดาวน์โหลดได้', 'PHPSHOP_ADMIN_CFG_ORDER_ENABLE_DOWNLOADS_EXPLAIN' => 'เลือกสถานะการสั่งซื้อ ในกรณีที่ลูกค้าระบุให้มีการดาวน์โหลดทางอีเมล์', 'PHPSHOP_ADMIN_CFG_ORDER_DISABLE_DOWNLOADS' => 'สถานะการสั่งซื้อกรณีไม่อนุญาตให้มีการดาวน์โหลด', 'PHPSHOP_ADMIN_CFG_ORDER_DISABLE_DOWNLOADS_EXPLAIN' => 'กำหนดสถานะการสั่งซื้อ ในกรณีที่ไม่อนุญาตให้ลูกค้าดาวน์โหลด', 'PHPSHOP_ADMIN_CFG_DOWNLOADROOT' => 'พาธที่ใช้เก็บไฟล์ดาวน์โหลด', 'PHPSHOP_ADMIN_CFG_DOWNLOADROOT_EXPLAIN' => 'พาธที่อยู่ที่ใช้เก็บไฟล์สำหรับให้ลูกค้าดาวน์โหลด (ใส่เครื่องหมาย / ตอนท้ายด้วย!)<br><span class="message">เพื่อความปลอดภัย: กรุณาอย่าใช้พาธที่เป็น WEBROOT</span>', 'PHPSHOP_ADMIN_CFG_DOWNLOAD_MAX' => 'จำนวนครั้งดาวน์โหลดสูงสุด', 'PHPSHOP_ADMIN_CFG_DOWNLOAD_MAX_EXPLAIN' => 'กำหนดจำนวนครั้งที่สามารถดาวน์โหลดได้ต่อหนึ่งรหัส Download-ID (ต่อการสั่งซื้อหนึ่งรายการ)', 'PHPSHOP_ADMIN_CFG_DOWNLOAD_EXPIRE' => 'ครบกำหนดดาวน์โหลด', 'PHPSHOP_ADMIN_CFG_DOWNLOAD_EXPIRE_EXPLAIN' => 'กำหนดระยะเวลาเป็น <strong>วินาที</strong> โดยจะคิดเมื่อเริ่มมีการดาวน์โหลด เมื่อครบเวลาแล้วรหัส download-ID จะไม่สามารถใช้งานได้อีก<br />หมายเหตุ : 86400 วินาที = 24 ชม.', 'PHPSHOP_COUPONS' => 'คูปอง', 'PHPSHOP_COUPONS_ENABLE' => 'อนุญาตให้ใช้คูปอง', 'PHPSHOP_COUPONS_ENABLE_EXPLAIN' => 'ถ้าอนุญาตให้ใช้คูปองได้ ลูกค้าจะสามารถระบุหมายเพื่อรับส่วนลดในการสั่งซื้อได้', 'PHPSHOP_ADMIN_CFG_PDF_BUTTON' => 'ปุ่ม - PDF', 'PHPSHOP_ADMIN_CFG_PDF_BUTTON_EXPLAIN' => 'แสดงหรือซ่อนปุ่ม - PDF ในส่วนร้านค้า', 'PHPSHOP_ADMIN_CFG_AGREE_TERMS_ONORDER' => 'ต้องยอมรับข้อตกลงทุกรายการสั่งซื้อ?', 'PHPSHOP_ADMIN_CFG_AGREE_TERMS_ONORDER_EXPLAIN' => 'เลือกรายการนี้ หากต้องการให้ลูกค้าต้องยอมรับข้อตกลงทุกรายการ (ก่อนทำการสั่งซื้อ).', 'PHPSHOP_ADMIN_CFG_SHOW_OUT_OF_STOCK_PRODUCTS' => 'แสดงสินค้าที่ไม่อยู่ในสต๊อก', 'PHPSHOP_ADMIN_CFG_SHOW_OUT_OF_STOCK_PRODUCTS_EXPLAIN' => 'เมื่อเลือก สินค้าที่ไม่มีในสต๊อกจะแสดง. สินค้าถูกซ่อนอยู่.', 'PHPSHOP_ADMIN_CFG_SHOP_OFFLINE' => 'ปิดร้านค้า?', 'PHPSHOP_ADMIN_CFG_SHOP_OFFLINE_TIP' => 'ถ้าเลือกตัวนี้, ร้านค้าจะปิดการทำงาน.', 'PHPSHOP_ADMIN_CFG_SHOP_OFFLINE_MSG' => 'ข้อความปิดร้าน', 'PHPSHOP_ADMIN_CFG_TABLEPREFIX' => 'คำหน้าของตารางร้านค้า', 'PHPSHOP_ADMIN_CFG_TABLEPREFIX_TIP' => 'ใช้ <strong>vm</strong> เป็นค่าปรกติ', 'PHPSHOP_ADMIN_CFG_NAV_AT_TOP' => 'แสดงหน้านำทางไปยังส่วนบนสุดของสินค้า', 'PHPSHOP_ADMIN_CFG_NAV_AT_TOP_TIP' => 'สับเปลี่ยน เปิด(On) หรือ(Off) หน้าเพจจะชี้ไปยังสินค้าที่อยู่ส่วนบนสุดของส่วนด้านหน้า.', 'PHPSHOP_ADMIN_CFG_SHOW_PRODUCT_COUNT' => 'แสดงหมายเลขสินค้า?', 'PHPSHOP_ADMIN_CFG_SHOW_PRODUCT_COUNT_TIP' => 'แสดงหมายเลขสินค้าของแคตตาล๊อกเหมือน Category (4)?', 'PHPSHOP_ADMIN_CFG_DYNAMIC_THUMBNAIL_RESIZING' => 'เปิดใช้ การย่อรูปอัตโนมัติ?', 'PHPSHOP_ADMIN_CFG_DYNAMIC_THUMBNAIL_RESIZING_TIP' => 'ถ้าเลือกตัวเลือกนี้ คุณเปิดการปรับรูปภาพ หมายความว่ารูปย่อจะถูกเปลี่ยนขนาดโดยที่ท่านเป็นคนกำหนดเอง ตามด้านล่างนี้, ใช้ PHP\'s GD2 functions (ท่านสามารถตรวจสอบได้ว่าระบบคุณมี GD2 หรือไม่โดยไปที่ "System" -> "System Info" -> "PHP Info" -> gd. คุณภาพของรูปย่อจะดีมากกว่ารูปที่ถูกย่อขนาดโดย Browser. รูปภาพที่ถูกย่อขนาดจะถูกเก็บไว้ที่ /shop_image/prduct/resized. ถ้ารูปภาพถูกย่อขนาดเรียบร้อยแล้ว รูปภาพจะถูกคัดลอกไปที่ Browser , ซึ่งจะไม่มีรูปภาพที่จะถูกย่อขนาดอีกครั้งอีกต่อไป.', 'PHPSHOP_ADMIN_CFG_THUMBNAIL_WIDTH' => 'ขนาดกว้างของรูปย่อ', 'PHPSHOP_ADMIN_CFG_THUMBNAIL_WIDTH_TIP' => 'ขนาด <strong>ความกว้าง</strong> ของรูปย่อ.', 'PHPSHOP_ADMIN_CFG_THUMBNAIL_HEIGHT' => 'ขนาดสูงของรูปย่อ', 'PHPSHOP_ADMIN_CFG_THUMBNAIL_HEIGHT_TIP' => 'ขนาด <strong>ความสูง</strong> ของรูปย่อ.', 'PHPSHOP_ADMIN_CFG_SHIPPING_NO_SELECTION' => 'กรุณาเลือกอย่างน้อย 1 Checkbox ในคอนฟิกการขนส่ง!', 'PHPSHOP_ADMIN_CFG_PRICE_CONFIGURATION' => 'ตั้งค่า ราคาขาย', 'PHPSHOP_ADMIN_CFG_PRICE_ACCESS_LEVEL' => 'แสดงราคาให้กับ Membergroup นี้', 'PHPSHOP_ADMIN_CFG_PRICE_ACCESS_LEVEL_TIP' => 'เลือก membergroup และ groups ทั้งหมด จะสามารถเห็นราคาสินค้าได้ทั้งหมด', 'PHPSHOP_ADMIN_CFG_PRICE_SHOW_INCLUDINGTAX' => 'แสดง "(บวกภาษี XX% )" when applicable?', 'PHPSHOP_ADMIN_CFG_PRICE_SHOW_INCLUDINGTAX_TIP' => 'เมื่อเลือกตัวเลือกนี้ ผู้ใช้บริการจะพบตัวหนังสือบอก "(บวกภาษี xx% )" เมื่อสินค้านั้นๆได้แสดงการบวกภาษี', 'PHPSHOP_ADMIN_CFG_PRICE_SHOW_PACKAGING_PRICELABEL' => 'แสดงป้ายราคาต่อหน่วย?', 'PHPSHOP_ADMIN_CFG_PRICE_SHOW_PACKAGING_PRICELABEL_TIP' => 'เมื่อเลือกตัวเลือกนี้, ป้ายราคาจะแสดงสินค้า ต่อหน่วย และจำนวน:th <strong>ราคาต่อชิ้น (10 ชื้น)<strong><br/> ถ้าไม่ได้เลือก, ราคาสินค้าจะแสดง: <strong>ราคา: $xx.xx</strong>', 'PHPSHOP_ADMIN_CFG_MORE_CORE_SETTINGS' => 'ตั้งค่าภายในเพิ่มเติม', 'PHPSHOP_ADMIN_CFG_CORE_SETTINGS' => 'ตั้งค่าภายใน', 'PHPSHOP_ADMIN_CFG_FRONTEND_FEATURES' => 'ตั้งค่าหน้าร้าน', 'PHPSHOP_ADMIN_CFG_TAX_CONFIGURATION' => 'ตั้งค่าภาษี', 'PHPSHOP_ADMIN_CFG_USER_REGISTRATION_SETTINGS' => 'ตั้งค่าผู้ลงทะเบียน', 'PHPSHOP_ADMIN_CFG_ALLOW_REGISTRATION' => 'เฉพาะ User ที่ลงทะเบียน?', 'PHPSHOP_ADMIN_CFG_ACCOUNT_ACTIVATION' => 'จำเป็นที่จะให้ บัญชีผู้ใช้ใหม่ activation?', 'VM_FIELDMANAGER_NAME' => 'ชื่อ', 'VM_FIELDMANAGER_TITLE' => 'หัวข้อ', 'VM_FIELDMANAGER_TYPE' => 'ชนิด', 'VM_FIELDMANAGER_REQUIRED' => 'ต้องการ', 'VM_FIELDMANAGER_PUBLISHED' => 'เผยแพร่', 'VM_FIELDMANAGER_SHOW_ON_REGISTRATION' => 'แสดงในแบบฟอร์มลงทะเบียน', 'VM_FIELDMANAGER_SHOW_ON_ACCOUNT' => 'แสดงใน account maintenance', 'VM_USERFIELD_FORM_LBL' => 'เพิ่ม/แก้ไข ผู้ใช้งาน', 'VM_BROWSE_ORDERBY_DEFAULT_FIELD_LBL' => 'ให้เรียงสินค้าตาม ', 'VM_BROWSE_ORDERBY_DEFAULT_FIELD_LBL_TIP' => 'กำหนดให้เรียงรายการสินค้าตามค่าที่เลือกบนหน้าเว็บไซต์', 'VM_BROWSE_ORDERBY_FIELDS_LBL' => 'เปิดให้ใช้งาน "Sort-by"', 'VM_BROWSE_ORDERBY_FIELDS_LBL_TIP' => 'เลือกจาก "Sort-by" สำหรับด้านหน้าเว็บไซต์. เพื่อกำหนดการจัดเรียงสินค้าด้านหน้าเวบไซต์. ถ้าท่านไม่ได้เลือกอะไรเลย รูปแบบ Order-By-Form จะไม่แสดง.', 'VM_GENERALLY_PREVENT_HTTPS' => 'ป้องกันการติดต่อทาง https connections?', 'VM_GENERALLY_PREVENT_HTTPS_TIP' => 'เมื่อเลือกตัวเลือกนี้, หน้าร้านจะส่งหน้าไปยัง <strong>http</strong> URL when not browsing in those shop areas, which are forced to use https.', 'VM_ALLOW_EXTENDED_CLASSES' => 'Allow the inclusion of extended classes from the theme-directory?', 'VM_ALLOW_EXTENDED_CLASSES_TIP' => 'When checked, virtuemart executes extended programm code. The original virtuemart code can be replaced or extended. If you don\'t know what this is or you don\'t need it, uncheck this', 'VM_MODULES_FORCE_HTTPS' => 'พื้นที่จำเป็นต้องใช้ https', 'VM_MODULES_FORCE_HTTPS_TIP' => 'คุณสามารถเลือกใช้ คอมม่า-เส้นขั้น (comma-separated) รายการ ของโมดูลสินค้าหลัก (ดูได้ที่ "Admin" => "List Modules"), เพื่อใช้ การเชื่อมต่อแบบ https .', 'VM_SHOW_REMEMBER_ME_BOX' => 'แสดง checkbox "จำค่าตัวเอง" บน login?', 'VM_SHOW_REMEMBER_ME_BOX_TIP' => 'เมื่อเลือกตัวเลือกนี้ checkbox "จำค่าตัวเอง" จะแสดงเครื่องหมาย. ไม่แนะนำ หากท่านใช้ shared ssl, because the customer could choose not to get a user cookie - but that user cookie is required to keep the user logged in on both domains.', 'VM_ADMIN_CFG_REVIEW_MINIMUM_COMMENT_LENGTH' => 'คอมเมนท์ได้น้อยที่สุด', 'VM_ADMIN_CFG_REVIEW_MINIMUM_COMMENT_LENGTH_TIP' => 'จำนวนของตัวอักษรที่ลูกค้าสามารถเขียนได้น้อยที่สุด ก่อนที่จะสามารถส่งข้อความได้.', 'VM_ADMIN_CFG_REVIEW_MAXIMUM_COMMENT_LENGTH' => 'คอมเมนท์ได้มากที่สุด', 'VM_ADMIN_CFG_REVIEW_MAXIMUM_COMMENT_LENGTH_TIP' => 'จำนวนตัวอักษรที่ลูกค้าสามารถเขียนได้มากที่สุดในคอมเมนท์.', 'VM_ADMIN_SHOW_EMAILFRIEND' => 'แสดงลิงค์ "แนะนำเพื่อน"?', 'VM_ADMIN_SHOW_EMAILFRIEND_TIP' => 'เมื่อเลือกตัวนี้, จะมีลิงค์แสดง ให้ลูกค้าเมลล์แนะนำสินค้า.', 'VM_ADMIN_SHOW_PRINTICON' => 'แสดงลิงค์ "พิมพ์แสดงผล"?', 'VM_ADMIN_SHOW_PRINTICON_TIP' => 'เมื่อเลือกตัวนี้, จะมีลิงค์แสดงหน้าปัจจุบันเป็นปอปอัพเพื่อให้แสดงผลออกทางเครื่องพิมพ์.', 'VM_REVIEWS_AUTOPUBLISH' => 'นำขึ้นแสดงอัตโนมัติ?', 'VM_REVIEWS_AUTOPUBLISH_TIP' => 'ถ้าเลือกตัวเลือกนี้, จะแสดงสินค้าโดยอัตโนมัติ หลังจากเริ่มการโพสเสร็จ หากไม่ ผู้ดูแลระบบจำเป็นต้องเป็นผู้ ตรวจสอบและเลือกนำแสดงสินค้าเอง ', 'VM_ADMIN_CFG_PROXY_SETTINGS' => 'ตั้งค่าพร๊อกซี่', 'VM_ADMIN_CFG_PROXY_URL' => 'ที่อยู่ของพร๊อกซี่เซอร์เวอร์', 'VM_ADMIN_CFG_PROXY_URL_TIP' => 'ตัวอย่าง: <strong>http://10.42.21.1</strong>.<br /> ปล่อยให้ว่างไว้หากท่านไม่แน่ใจ</strong> ค่านี้จะใช้ติดต่อกับ Internet จากเซอร์เวอร์ร้านค้า (e.g. when fetching shipping rates from UPS/USPS).', 'VM_ADMIN_CFG_PROXY_PORT' => 'พอร์ทของพร๊อกซี่', 'VM_ADMIN_CFG_PROXY_PORT_TIP' => 'พอร์ทจะใช้ติดต่อกับพร๊อกซี่เซอร์เวอร์(ใช้ <b>80</b> หรือ <b>8080</b>).', 'VM_ADMIN_CFG_PROXY_USER' => 'Proxy username', 'VM_ADMIN_CFG_PROXY_USER_TIP' => 'ถ้าพร๊อกซี่ต้องการเข้ารหัส กรุณาป้อน Username ที่นี่', 'VM_ADMIN_CFG_PROXY_PASS' => 'Proxy password', 'VM_ADMIN_CFG_PROXY_PASS_TIP' => '้าพร๊อกซี่ต้องการเข้ารหัส กรุณาป้อน Password ที่นี่', 'VM_ADMIN_ONCHECKOUT_SHOW_LEGALINFO' => 'แสดงข้อมูลเกี่ยวกับ "Return Policy" ในหน้ายืนยันรายการสินค้า?', 'VM_ADMIN_ONCHECKOUT_SHOW_LEGALINFO_TIP' => 'คลังสินค้าของเรา ต้องแสดงข้อตกลงกับลูกค้า เกี่ยวกับกรณีการส่งคืนสินค้า หรือยกเลิกสินค้า และนโยบายการยกเลิกส่วนมากเป็นระเบียบในประเทศยุโรป ดังนั้นควรจะเลือกใช้งานส่วนนี้.', 'VM_ADMIN_ONCHECKOUT_LEGALINFO_SHORTTEXT' => 'เอกสารเกี่ยวกับข้อตกลง (ฉบับย่อ).', 'VM_ADMIN_ONCHECKOUT_LEGALINFO_SHORTTEXT_TIP' => 'ข้อความนี้เป็นคำแนะนำสำหรับลูกค้าฉบับย่อ เกี่ยวกับนโยบายการส่งคืนสินค้า หรือยกเลิกสินค้า. ส่วนนี้จะแสดงที่หน้าสุดท้ายของหน้าที่จะสั่งซื้อ อยู่ล่างปุ่ม ยืนยันการสั่งซื้อ ("Confirm Order").', 'VM_ADMIN_ONCHECKOUT_LEGALINFO_LINK' => 'ลิงค์ไปยัง นโยบายการการส่งคืนสินค้า ฉบับเต็ม.', 'VM_ADMIN_ONCHECKOUT_LEGALINFO_LINK_TIP' => 'กรุณาเพิ่มคอนเทนท์ เกี่ยวกับรายละเอียดของนโยบายการส่งคืนสินค้า หรือยกเลิกสินค้า. จากนั้นท่านถึงจะสามารถเลือกส่วนนี้ได้.', 'VM_SELECT_THEME' => 'เลือกหน้าตาของร้านค้าของท่าน', 'VM_SELECT_THEME_TIP' => 'หน้าตาร้านค้า สามารถตั้งค่าและออกแบบโดยท่านเองได้ <br />ถ้าไม่มีหน้าตาร้านค้าตัวอื่นให้เลือก ระบบจะตั้งค่าให้ท่านเป็นหน้าตาปกติ.', 'VM_CFG_CONTENT_PLUGINS_ENABLE' => 'เปิดให้คอนเทนท์ใช้แมมบอท / รายละเอียดในปลั๊กอิน?', 'VM_CFG_CONTENT_PLUGINS_ENABLE_TIP' => 'ถ้าเปิดใช้งาน, รายละเอียด สินค้าและแคตตาล๊อกจะถูก ตัดคำในทุกๆ คอนเทนท์ที่ถูกเผยแพร่อยู่ โดยแมมบอท/ปลั๊กอิน.', 'VM_CFG_CURRENCY_MODULE' => 'เลือกใช้โมดูลเปลี่ยนแปลงค่าเงิน', 'VM_CFG_CURRENCY_MODULE_TIP' => 'This allows you to select a certain currency converter module. Such modules fetch exchange rates from a server and convert one currency into another.', 'PHPSHOP_ADMIN_CFG_TAX_MODE_EU' => 'European Union mode', 'VM_ADMIN_CFG_DOWNLOAD_KEEP_STOCKLEVEL' => 'Keep Product Stock Level on Purchase?', 'VM_ADMIN_CFG_DOWNLOAD_KEEP_STOCKLEVEL_TIP' => 'When enabled, the stock level for a downloadable product is not lowered although it was purchased by customers.', 'VM_USERGROUP_FORM_LBL' => 'เพิ่ม/แก้ไข กลุ่มสมาชิก', 'VM_USERGROUP_NAME' => 'ชื่อกลุ่มผู้ใช้', 'VM_USERGROUP_LEVEL' => 'ระดับกลุ่มผู้ใช้', 'VM_USERGROUP_LEVEL_TIP' => 'Important! A bigger number means <b>less</b> permissions. The <b>admin</b> group is <em>level 0</em>, storeadmin is level 250, users are level 500.', 'VM_USERGROUP_LIST_LBL' => 'User Group List', 'VM_ADMIN_CFG_COOKIE_CHECK' => 'เปิดใช้คุกกี้ตรวจสอบ?', 'VM_ADMIN_CFG_COOKIE_CHECK_EXPLAIN' => 'If enabled, VirtueMart checks wether the browser of the customer accepts cookies or not. This is user-friendly, but it can have negative consequences on the Search-Engine-Friendlyness of your shop.', 'VM_CFG_REGISTRATION_TYPE' => 'ชนิดของการลงทะเบียนผู้ใช้', 'VM_CFG_REGISTRATION_TYPE_TIP' => 'เลือกชนิดของการลงทะเบียนในร้านค้าของท่าน!<br /> <strong>Normal Registration</strong><br /> This is the standard registration type where the customer must register and choose an username and password<br /><br /> <strong>Silent Registration</strong><br /> Silent Registration means the customer doesn\'t need to choose username and password, but those are created automatically during registration and sent to the provided email address. <br /><br /> <strong>Optional Registration</strong><br /> Opotional Registration let\'s the customer choose wether he/she wants to create an account or not. If the customer wants to create an account, a username and password must be chosen. <br /><br /> <strong>No Registration</strong><br /> Customers don\'t need to and are not able to register in this type of registration.', 'VM_CFG_REGISTRATION_TYPE_NORMAL_REGISTRATION' => 'สร้างบัญชีผู้ใช้แบบปกติ', 'VM_CFG_REGISTRATION_TYPE_SILENT_REGISTRATION' => 'สร้างบัญชีผู้ใช้แบบพิเศษ', 'VM_CFG_REGISTRATION_TYPE_OPTIONAL_REGISTRATION' => 'ออปชั่นของบัญชีที่สร้าง', 'VM_CFG_REGISTRATION_TYPE_NO_REGISTRATION' => 'ไม่มีบัญชีที่สร้าง', 'VM_ADMIN_CFG_FEED_CONFIGURATION' => 'ตั้งค่าการฟีด', 'VM_ADMIN_CFG_FEED_ENABLE' => 'เปิดสินค้าให้ฟีดได้', 'VM_ADMIN_CFG_FEED_ENABLE_TIP' => 'ถ้าเปิดใช้งาน, ลูกค้าสามารถรับข้อมูลของสินค้าตัวล่าสุด (ของทั้งหมด หรือของแคตตาล๊อก) ในร้านค้าของท่าน.', 'VM_ADMIN_CFG_FEED_CACHE' => 'ตั้งค่าแคชของการฟีด', 'VM_ADMIN_CFG_FEED_CACHE_ENABLE' => 'เปิดใช้แคช?', 'VM_ADMIN_CFG_FEED_CACHETIME' => 'เวลาในการเก็บแคช (วินาที)', 'VM_ADMIN_CFG_FEED_CACHE_TIP' => 'Caching speeds up the feed delivery and reduces the server load, because the feed is only created once and saved to a file.', 'VM_ADMIN_CFG_FEED_SHOWPRICES' => 'ใส่ราคาในรายละเอียดสินค้า?', 'VM_ADMIN_CFG_FEED_SHOWPRICES_TIP' => 'ถ้าเปิดใช้งาน, ราคาสินค้าทั่วไป จะไปแสดงในรายละเอียดของสินค้า', 'VM_ADMIN_CFG_FEED_SHOWDESC' => 'ใส่รายละเอียดสินค้า?', 'VM_ADMIN_CFG_FEED_SHOWDESC_TIP' => 'ถ้าเปิดใช้งาน, รายละเอียกสินค้า จะเพิ่มไปยังรายการฟีดด้วย', 'VM_ADMIN_CFG_FEED_SHOWIMAGES' => 'ใส่รูปภาพในฟีด?', 'VM_ADMIN_CFG_FEED_SHOWIMAGES_TIP' => 'ถ้าเปิดใช้งาน, รูปย่อจะรวมอยู่ในฟีดด้วย.', 'VM_ADMIN_CFG_FEED_DESCRIPTION_TYPE' => 'รายละเอียดชนิดสินค้าType of Product Description', 'VM_ADMIN_CFG_FEED_DESCRIPTION_TYPE_TIP' => 'เลือกรายละเอียดชนิดของสินค้า ส่วนนั้นจะแสดงรวมอยู่ในฟีดด้วย.', 'VM_ADMIN_CFG_FEED_LIMITTEXT' => 'จำกัดรายละเอียด?', 'VM_ADMIN_CFG_FEED_MAX_TEXT_LENGTH' => 'จำนวนรายละเอียดมากสุด', 'VM_ADMIN_CFG_MAX_TEXT_LENGTH_TIP' => 'รายละเอียดสินค้ามากสุด สำหรับแต่ละรายการฟีด.', 'VM_ADMIN_CFG_FEED_TITLE_TIP' => 'Title of the Feed (the placeholder {storename} holds the name of your store)', 'VM_ADMIN_CFG_FEED_TITLE_CATEGORIES_TIP' => 'Title of a Category Feed (\'{catname}\' is the placeholder for the category name, {storename} holds the name of your store)', 'VM_ADMIN_CFG_FEED_TITLE' => 'ฟีดหัวข้อมา', 'VM_ADMIN_CFG_FEED_TITLE_CATEGORIES' => 'ฟีดหัวข้อของแต่ละประเภท', 'VM_ADMIN_SECURITY' => 'ความปลอดภัย', 'VM_ADMIN_SECURITY_SETTINGS' => 'ตั้งค่าความปลอดภัย', 'VM_CFG_ENABLE_FEATURE' => 'เปิดใช้คุณสมบัตินี้', 'VM_CFG_CHECKOUT_SHOWSTEP_TIP' => 'Here you can enable, disable and reorder certain Checkout Steps. You can show multiple Steps on one Page by giving them the same Step Number.', 'PHPSHOP_ADMIN_CFG_STORE_SHIPPING_METHOD_FLEX' => 'Flex Shipping. Fixed shipping cost to set base value of order with percentage of total sale above base value', 'PHPSHOP_ADMIN_CFG_STORE_SHIPPING_METHOD_SHIPVALUE' => 'Shipping based on order totals. Fixed shipping costs based on values entered in configuration.', 'VM_CFG_CHECKOUT_SHOWSTEPINCHECKOUT' => 'แสดงขั้นตอน: %s ของกระบวนการ Checkout.', 'VM_ADMIN_ENCRYPTION_KEY' => 'Encryption Key', 'VM_ADMIN_ENCRYPTION_KEY_TIP' => 'Used to safely store and retrieve sensible data (like credit card information) encrypted in the database.', 'VM_ADMIN_STORE_CREDITCARD_DATA' => 'เก็บข้อมูลเกี่ยวกับ Credit Card?', 'VM_ADMIN_STORE_CREDITCARD_DATA_TIP' => 'VirtueMart จะทำการเก็บข้อมูลเกี่ยวกับ Credit Card ของลูกค้า เพื่อเข้ารหัสลงในดาต้าเบส. This is done even if the Credit Card Information is processed by an external server. <strong>If you don\'t need to process Credit Card Information manually after the order has been placed, you should turn this option off.</strong>', 'VM_USERFIELDS_URL_ONLY' => 'URL เท่านั้น', 'VM_USERFIELDS_HYPERTEXT_URL' => 'Hypertext และ URL', 'VM_FIELDS_TEXTFIELD' => 'Text Field', 'VM_FIELDS_CHECKBOX_SINGLE' => 'Check Box (Single)', 'VM_FIELDS_CHECKBOX_MULTIPLE' => 'Check Box (Muliple)', 'VM_FIELDS_DATE' => 'Date', 'VM_FIELDS_DROPDOWN_SINGLE' => 'Drop Down (Single Select)', 'VM_FIELDS_DROPDOWN_MULTIPLE' => 'Drop Down (Multi-Select)', 'VM_FIELDS_EMAIL' => 'ที่อยู่ Email', 'VM_FIELDS_EUVATID' => 'EU VAT ID', 'VM_FIELDS_EDITORAREA' => 'แก้ไขตัวอักษร', 'VM_FIELDS_TEXTAREA' => 'พื้นที่ตัวอักษร', 'VM_FIELDS_RADIOBUTTON' => 'ปุ่มเลือก', 'VM_FIELDS_WEBADDRESS' => 'ที่อยู่เวบไซท์', 'VM_FIELDS_DELIMITER' => '=== Fieldset delimiter ===', 'VM_FIELDS_NEWSLETTER' => 'รับจดหมายข่าว', 'VM_USERFIELDS_READONLY' => 'อ่านอย่างเดียว', 'VM_USERFIELDS_SIZE' => 'ขนาดของฟิลล์', 'VM_USERFIELDS_MAXLENGTH' => 'ยาวสุด', 'VM_USERFIELDS_DESCRIPTION' => 'รายละเอียด, ส่วนแสดง tip: ตัวอักษรหรือแบบ HTML', 'VM_USERFIELDS_COLUMNS' => 'คอลัมภ์', 'VM_USERFIELDS_ROWS' => 'แถว', 'VM_USERFIELDS_EUVATID_MOVESHOPPER' => 'ย้ายลูกค้าไปตามกลุ่มผู้ซื้อที่ตรวจสอบเรียบร้อย validation of the EU VAT ID', 'VM_USERFIELDS_ADDVALUES_TIP' => 'ใช้ตารางข่างล่างเพื่อนใส่ค่าใหม่.', 'VM_ADMIN_CFG_DISPLAY' => 'แสดงผล', 'VM_ADMIN_CFG_LAYOUT' => 'เลย์เอ้า', 'VM_ADMIN_CFG_THEME_SETTINGS' => 'ตั้งค่าหน้าตา', 'VM_ADMIN_CFG_THEME_PARAMETERS' => 'ตัวแปร', 'VM_ADMIN_ENCRYPTION_FUNCTION' => 'ฟังก์ชันการเข้ารหัส', 'VM_ADMIN_ENCRYPTION_FUNCTION_TIP' => 'Here you can select the encryption function used to encrypt sensible information before being stored in the database. AES_ENCRYPT is recommended, because it is very secure. ENCODE doesn\'t provide real encryption.', 'SAVE_PERMISSIONS' => 'บันทึกการยินยอม', 'VM_ADMIN_THEME_CFG_NOT_EXISTS' => 'ไฟล์ตั้งค่าสำหรับเทมเพลตไม่พบ และไม่สามารถสร้างได้. การตั้งค่าไม่สามารถทำได้', 'VM_ADMIN_THEME_NOT_EXISTS' => 'ไม่มีหน้าตา "{theme}" นี้อยู่.', 'VM_USERFIELDS_ADDVALUE' => 'ใส่ค่า', 'VM_USERFIELDS_TITLE' => 'หัวข้อ', 'VM_USERFIELDS_VALUE' => 'ค่า', 'VM_USER_FORM_LASTVISIT_NEVER' => 'ไม่เคย', 'VM_USER_FORM_TAB_GENERALINFO' => 'ข้อมูลทั่วไปของสมาชิก', 'VM_USER_FORM_LEGEND_USERDETAILS' => 'รายละเอียดสมาชิก', 'VM_USER_FORM_LEGEND_PARAMETERS' => 'พารามิเตอร์', 'VM_USER_FORM_LEGEND_CONTACTINFO' => 'ข้อมูลการติดต่อ', 'VM_USER_FORM_NAME' => 'ชื่อ', 'VM_USER_FORM_USERNAME' => 'ชื่อผู้ใช้', 'VM_USER_FORM_EMAIL' => 'อีเมล์', 'VM_USER_FORM_NEWPASSWORD' => 'รหัสผ่านใหม่', 'VM_USER_FORM_VERIFYPASSWORD' => 'ยืนยัน รหัสผ่าน', 'VM_USER_FORM_GROUP' => 'กลุ่ม', 'VM_USER_FORM_BLOCKUSER' => 'ระงับ สมาชิก', 'VM_USER_FORM_RECEIVESYSTEMEMAILS' => 'รับอีเมล์จากระบบ', 'VM_USER_FORM_REGISTERDATE' => 'วันลงทะเบียน', 'VM_USER_FORM_LASTVISITDATE' => 'วันที่เข้าใช้ล่าสุด', 'VM_USER_FORM_NOCONTACTDETAILS_1' => 'ไม่มีรายละเอียดการติดต่อที่ลิงค์ไปยังสมาชิก:', 'VM_USER_FORM_NOCONTACTDETAILS_2' => 'ดูที่ \'Components -> Contact -> Manage Contacts\' สำหรับรายละเอียด.', 'VM_USER_FORM_CONTACTDETAILS_NAME' => 'ชื่อ', 'VM_USER_FORM_CONTACTDETAILS_POSITION' => 'ตำแหน่ง', 'VM_USER_FORM_CONTACTDETAILS_TELEPHONE' => 'โทรศัพท์', 'VM_USER_FORM_CONTACTDETAILS_FAX' => 'แฟกซ์', 'VM_USER_FORM_CONTACTDETAILS_CHANGEBUTTON' => 'เปลี่ยนรายละเอียดผู้ติดต่อ', 'VM_ADMIN_CFG_LOGFILE_HEADER' => 'ตั้งค่า Logfile', 'VM_ADMIN_CFG_LOGFILE_ENABLED' => 'เปิดใช้ logging?', 'VM_ADMIN_CFG_LOGFILE_ENABLED_EXPLAIN' => 'ถ้าปิดหรือไม่ใช้, a "null" logger will be instantiated instead, so that the vmFileLogger can still be invoked without error.', 'VM_ADMIN_CFG_LOGFILE_NAME' => 'ชื่อ Logfile', 'VM_ADMIN_CFG_LOGFILE_NAME_EXPLAIN' => 'แพทของ logfile. ต้องเข้าถึงได้และเขียนได้.', 'VM_ADMIN_CFG_LOGFILE_LEVEL' => 'ระดับ Logging', 'VM_ADMIN_CFG_LOGFILE_LEVEL_EXPLAIN' => 'ข้อความของ Log ด้านล่างนี้จะเรียงตามความสำคัญ.', 'VM_ADMIN_CFG_LOGFILE_LEVEL_TIP' => 'TIP - 8', 'VM_ADMIN_CFG_LOGFILE_LEVEL_DEBUG' => 'DEBUG - 7', 'VM_ADMIN_CFG_LOGFILE_LEVEL_INFO' => 'INFO - 6', 'VM_ADMIN_CFG_LOGFILE_LEVEL_NOTICE' => 'NOTICE - 5', 'VM_ADMIN_CFG_LOGFILE_LEVEL_WARNING' => 'WARNING - 4', 'VM_ADMIN_CFG_LOGFILE_LEVEL_ERR' => 'ERROR - 3', 'VM_ADMIN_CFG_LOGFILE_LEVEL_CRIT' => 'CRITICAL - 2', 'VM_ADMIN_CFG_LOGFILE_LEVEL_ALERT' => 'ALERT - 1', 'VM_ADMIN_CFG_LOGFILE_LEVEL_EMERG' => 'EMERGENCY - 0', 'VM_ADMIN_CFG_LOGFILE_FORMAT' => 'รูปแบบ Logfile', 'VM_ADMIN_CFG_LOGFILE_FORMAT_EXPLAIN' => 'Format for individual logfile line entries.', 'VM_ADMIN_CFG_LOGFILE_FORMAT_EXPLAIN_EXTRA' => 'Logfile format fields can include any of the following: %{timestamp} %{ident} [%{priority}] [%{remoteip}] [%{username}] %{message} %{vmsessionid}.', 'VM_ADMIN_CFG_LOGFILE_ERROR' => 'ไม่สามารถสร้าง หรือเข้าถึง log ไฟล์. กรุณาติดต่อผู้ดูแลระบบ หรือผู้ดูแลเว็บไซต์.', 'VM_ADMIN_CFG_DEBUG_MODE_ENABLED' => 'เปิดใช้โหมดการ DEBUG?', 'VM_ADMIN_CFG_DEBUG_IP_ENABLED' => 'จำกัดโดย IP address?', 'VM_ADMIN_CFG_DEBUG_IP_ENABLED_EXPLAIN' => 'จำกัดการ debugging output โดยการระบุ IP address?', 'VM_ADMIN_CFG_DEBUG_IP_ADDRESS' => 'IP address เครื่องลูกข่าย', 'VM_ADMIN_CFG_DEBUG_IP_ADDRESS_EXPLAIN' => 'ถ้าเปิดใช้งานเลือกตัวเลือกนี้ และใส่ค่า IP address ที่นี่, จะทำการ Debug Output จะทำการยินยอมเฉพาะ IP นี้เท่านั้น. เครื่องอื่นจะไม่สามารถพบเห็นการ debugging output.', 'VM_FIELDMANAGER_SHOW_ON_SHIPPING' => 'แสดงในที่อยู่ผู้ส่ง', 'VM_USER_NOSHIPPINGADDR' => 'ไม่มีที่อยู่ผู้ส่ง.', 'VM_UPDATE_CHECK_LBL' => 'ตรวจสอบ อัพเดท VirtueMart', 'VM_UPDATE_CHECK_VERSION_INSTALLED' => 'VirtueMart Version installed here', 'VM_UPDATE_CHECK_LATEST_VERSION' => 'VirtueMart เวอร์ชันล่าสุด', 'VM_UPDATE_CHECK_CHECKNOW' => 'ตรวจสอบเดี๋ยวนี้!', 'VM_UPDATE_CHECK_DLUPDATE' => 'ดาวน์โหลด อัพเดท', 'VM_UPDATE_CHECK_CHECKING' => 'กำลังตรวจสอบ...', 'VM_UPDATE_CHECK_CHECK' => 'ตรวจสอบ', 'VM_UPDATE_NOTDOWNLOADED' => 'ไม่สามารถดาวโหลด แพคเกจได้.', 'VM_UPDATE_PREVIEW_LBL' => 'แสดงการอัพเดท VirtueMart', 'VM_UPDATE_WARNING_TITLE' => 'คำเตือนทั่วไป', 'VM_UPDATE_WARNING_TEXT' => 'ติดตั้ง และอัพเดท VirtueMart โดยใช้แพคเกจแพท อาจจะทำให้เสียหายบนเว็บไซต์ของท่านได้ หากท่านปรับปรุงบางไฟล์ของ VirtueMart component. กระบวนการแพท จะทำการเขียนทับไฟล์ทั้งหมดที่แสดงด้านล่างนี้ -ซึ่งไม่เหมาะหากจะเปลี่ยนแปลงแค่ไฟล์เล็กๆ หากท่านมีไฟล์ที่ปรับปรุงอยู่ที่ท่านแล้ว การติดตั้งนี้จะไม่สอดคล้องกัน จะทำให้การทำงานผิดพลาด.', 'VM_UPDATE_PATCH_DETAILS' => 'รายละเอียดแพช', 'VM_UPDATE_PATCH_DESCRIPTION' => 'รายละเอียด', 'VM_UPDATE_PATCH_DATE' => 'วันที่นำเสนอ', 'VM_UPDATE_PATCH_FILESTOUPDATE' => 'ไฟล์ได้ทำการอัพเดทแล้ว', 'VM_UPDATE_PATCH_STATUS' => 'สถานะ', 'VM_UPDATE_PATCH_WRITABLE' => 'เขียนได้', 'VM_UPDATE_PATCH_UNWRITABLE' => 'File/Directory ไม่สามารถเขียนได้', 'VM_UPDATE_PATCH_QUERYTOEXEC' => 'Queries ดำเนินการบนดาต้าเบส', 'VM_UPDATE_PATCH_CONFIRM_TEXT' => 'ฉันได้อ่าน <a href="#warning">คำเตือน</a> และ ฉันยืนยันที่จะยอมรับแพคเกจแพท VirtueMart ให้ทำการติดตั้งตอนนี้.', 'VM_UPDATE_PATCH_APPLY' => 'ยอมรับแพท', 'VM_UPDATE_PATCH_ERR_UNWRITABLE' => 'ไม่พบ files/directories ทั้งหมดที่ต้องการอัพเดท ตั้งเป็นเขียนได้. กรุณาตั้งค่าการยินยอมก่อนเป็นอันดับแรก.', 'VM_UPDATE_PATCH_PLEASEMARK' => 'กรุณาเลือก checkbox ก่อนคุณยืนยันแพท.', 'VM_UPDATE_RESULT_TITLE' => 'ติดตั้งเวอร์ชันปัจุบันแล้ว', 'VM_FIELDS_CAPTCHA' => 'ช่อง Captcha (ใช้งาน com_securityimages)', 'VM_FIELDS_AGEVERIFICATION' => 'ตรวจสอบอายุ (Date Select Fields)', 'VM_FIELDS_AGEVERIFICATION_MINIMUM' => 'ระบุอายุที่น้อยสุด' ); $VM_LANG->initModule( 'admin', $langvars ); ?>
gpl-2.0
Pengfei-Gao/source-Insight-3-for-centos7
SourceInsight3/NetFramework/NativeMethods.NMTVCUSTOMDRAW.cs
338
public class NMTVCUSTOMDRAW { // Constructors public NMTVCUSTOMDRAW() {} // Methods public Type GetType() {} public virtual string ToString() {} public virtual bool Equals(object obj) {} public virtual int GetHashCode() {} // Fields public NMCUSTOMDRAW nmcd; public int clrText; public int clrTextBk; public int iLevel; }
gpl-2.0
ericski/roseandpoppie.com
themes/gavias_amon/includes/override.php
4634
<?php function gavias_amon_preprocess_views_view_unformatted__taxonomy_term(&$variables){ $current_uri = \Drupal::request()->getRequestUri(); $url = \Drupal::service('path.current')->getPath(); $arg = explode('/', $url); $tid = 0; if ((isset($arg[1]) && $arg[1] == "taxonomy") && (isset($arg[2]) && $arg[2] == "term") && isset($arg[3]) && is_numeric($arg[3]) ) { $tid = $arg[3]; } $term = taxonomy_term_load($tid); $layout = 'list'; $columns = 3; try{ $field = $term->get('field_category_layout'); if(isset($field) && $field){ $field = $field->getValue(); if( isset($field[0]['value']) && $field[0]['value'] ){ $layout = $field[0]['value']; } } }catch(Exception $e){ $layout = 'list'; } $item_class = ''; if($layout == 'grid' || $layout == 'masonry'){ try{ $field = $term->get('field_category_columns'); if(isset($field) && $field){ $field = $field->getValue(); if( isset($field[0]['value']) && $field[0]['value'] ){ $columns = $field[0]['value']; } } }catch(Exception $e){ $columns = 3; } if ($columns == '1'){ $item_class = 'col-lg-12 col-md-12 col-sm-12 col-xs-12'; }else if($columns == 2){ $item_class = 'col-lg-6 col-md-6 col-sm-6 col-xs-12'; }else if($columns == 3){ $item_class = 'col-lg-4 col-md-4 col-sm-4 col-xs-12'; }else if($columns == 4){ $item_class = 'col-lg-3 col-md-3 col-sm-6 col-xs-12'; }else if($columns == 6){ $item_class = 'col-lg-2 col-md-2 col-sm-6 col-xs-12'; } } if($layout=='masonry'){ $item_class .= ' item-masory'; } $variables['gva_columns'] = $columns; $variables['gva_item_class'] = $item_class; $variables['gva_layout'] = $layout; } function gavias_amon_preprocess_views_view_unformatted(&$variables) { $view = $variables['view']; $rows = $variables['rows']; $style = $view->style_plugin; $options = $style->options; if(is_numeric(strpos($options['row_class'] , 'gva-carousel-1')) || $options['row_class'] == 'gva-carousel-1' ){ $variables['gva_carousel']['class'] = 'owl-carousel init-carousel-owl'; $variables['gva_carousel']['columns'] = '1'; } if(is_numeric(strpos($options['row_class'].'x' , 'gva-carousel-2')) || $options['row_class'] == 'gva-carousel-2' ){ $variables['gva_carousel']['class'] = 'owl-carousel init-carousel-owl'; $variables['gva_carousel']['columns'] = '2'; } if(is_numeric(strpos($options['row_class'].'x', 'gva-carousel-3')) || $options['row_class'] == 'gva-carousel-3' ){ $variables['gva_carousel']['class'] = 'owl-carousel init-carousel-owl'; $variables['gva_carousel']['columns'] = '3'; } if(is_numeric(strpos($options['row_class'].'x', 'gva-carousel-4')) || $options['row_class'] == 'gva-carousel-4' ){ $variables['gva_carousel']['class'] = 'owl-carousel init-carousel-owl'; $variables['gva_carousel']['columns'] = '4'; } if(is_numeric(strpos($options['row_class'], 'gva-carousel-5')) || $options['row_class'] == 'gva-carousel-5' ){ $variables['gva_carousel']['class'] = 'owl-carousel init-carousel-owl'; $variables['gva_carousel']['columns'] = '5'; } if(is_numeric(strpos($options['row_class'].'x', 'gva-carousel-6')) || $options['row_class'] == 'gva-carousel-6' ){ $variables['gva_carousel']['class'] = 'owl-carousel init-carousel-owl'; $variables['gva_carousel']['columns'] = '6'; } if(is_numeric(strpos($options['row_class'].'x', 'gva-carousel-7')) || $options['row_class'] == 'gva-carousel-7' ){ $variables['gva_carousel']['class'] = 'owl-carousel init-carousel-owl'; $variables['gva_carousel']['columns'] = '7'; } if(is_numeric(strpos($options['row_class'].'x', 'gva-carousel-8')) || $options['row_class'] == 'gva-carousel-8' ){ $variables['gva_carousel']['class'] = 'owl-carousel init-carousel-owl'; $variables['gva_carousel']['columns'] = '8'; } } function gavias_amon_preprocess_views_view_grid(&$variables) { $view = $variables['view']; $rows = $variables['rows']; $style = $view->style_plugin; $options = $style->options; $variables['gva_masonry']['class'] = ''; $variables['gva_masonry']['class_item'] = ''; if(strpos($options['row_class_custom'] , 'masonry') || $options['row_class_custom'] == 'masonry' ){ $variables['gva_masonry']['class'] = 'post-masonry-style row'; $variables['gva_masonry']['class_item'] = 'item-masory'; } }
gpl-2.0
arnoschoon/ext-solr
Classes/Search/SearchComponent.php
1606
<?php namespace ApacheSolrForTypo3\Solr\Search; /*************************************************************** * Copyright notice * * (c) 2012-2015 Ingo Renner <ingo@typo3.org> * All rights reserved * * This script is part of the TYPO3 project. The TYPO3 project is * free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * The GNU General Public License can be found at * http://www.gnu.org/copyleft/gpl.html. * A copy is found in the textfile GPL.txt and important notices to the license * from the author is found in LICENSE.txt distributed with these scripts. * * * This script is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * This copyright notice MUST APPEAR in all copies of the script! ***************************************************************/ /** * Search component interface. * * @author Ingo Renner <ingo@typo3.org> */ interface SearchComponent { /** * Provides the plugin's search configuration from plugin.tx_solr.search * * @param array $configuration Configuration */ public function setSearchConfiguration(array $configuration); /** * Initializes the search component. * */ public function initializeSearchComponent(); }
gpl-2.0
lijiaqigreat/regex_to_dfa
main.js
10419
/* A -> ... E -> A E E -> @ E -> ( S ) E -> ( S ) * O -> E | O O -> E |,+,* */ function add(node, k,v) { if(!Array.isArray(v)){ v=[v]; } if(node[k]===undefined){ node[k]=v; }else{ [].push.apply(node[k],v); } } function swap(dict2,str,x) { var y=dict2.indexOf(str); var tmp=dict2[x]; dict2[x]=dict2[y]; dict2[y]=tmp; } function getL(letter) { return function(obj){return obj[letter];}; } function walk(nfa,array,letter,repeat) { var f=(repeat?array.slice(0):Array()); var queue=array.slice(0); while(queue.length!==0){ //pivot var nodee=letter(nfa[queue.pop()]); if(nodee===undefined){ continue; } //potential for(var i=0;i<nodee.length;i++){ for(var j=0;j<f.length;j++){ if(f[j]===nodee[i]){ break; } } //new if(j===f.length){ f.push(nodee[i]); if(repeat){ queue.push(nodee[i]); } } } } return f.sort(); } function map(dfa,dict1,dict2) { var f=Array.isArray(dict2)?Array(dict2.length):{}; dict2.forEach(function(v,i){ f[i]={}; var obj=dfa[v]; for(var k in obj){ if(!obj.hasOwnProperty(k)) continue; if(dict1[obj[k]]!==undefined){ f[i][k]=dict1[obj[k]]; } } }); return f; } var language= { "empty":'@', "left":'(', "right":')', "escape":'\\', "star":'*', "or":'|' }; function regex_to_tree(str) { var i=0; var E,A,O; var f; E=function() { //console.log("E: "+i+", "+str[i]); switch(str[i]){ case language.empty: i++; f=["e"]; break; case language.escape: i++; if(str[i]===undefined) throw new Error("unexpected EOF"); f=str[i++]; break; case language.left: i++; f=O(); if(str[i]!==language.right){ throw new Error("bracket not match: "+i); } i++; break; case undefined: case language.right: case language.or: case language.star: throw new Error("Unexpected char."); default: f=str[i++]; } if(str[i]===language.star){ i++; return ["*",f]; }else{ return f; } }; A=function() { //console.log("A: "+i); var f=['+',E()]; while(true){ switch(str[i]){ case language.star: throw new Error("Unexpected star."); case language.right: case language.or: case undefined: if(f.length===2){ return f[1]; } return f; /* case language.left: case language.empty: */ default: f.push(E()); } } }; O=function() { //console.log("O: "+i); var f=['|',A()]; while(true){ switch(str[i]){ case language.left: case language.empty: case language.star: throw new Error("Unexpected char."); case language.right: case undefined: if(f.length===2){ return f[1]; } return f; /* */ case language.or: i++; f.push(A()); } } }; return str===""?undefined:O(); } function tree_to_nfa(tree) { var nodes= [ { }, { } ]; if(!tree) return nodes; //special table entry: end,epi if(tree===undefined) { nodes[0].end=[1]; return nodes; } function rec(tr,start,end) { var i; if((!Array.isArray(tr))||tr[0]=='e') { if(Array.isArray(tr)&&tr[0]=='e'){ tr='epi'; } add(nodes[start],tr,end); return; } switch(tr[0]) { case '+': var start2=start; for(i=1;i<tr.length-1;i++){ var end2=nodes.length; nodes.push({}); rec(tr[i],start2,end2); start2=end2; } rec(tr[i],start2,end); break; case '|': for(i=1;i<tr.length;i++){ rec(tr[i],start,end); } break; case '*': var size=nodes.length; nodes.push({},{}); rec(tr[1],size,size+1); add(nodes[start],'epi',size); add(nodes[size+1],'epi',size); add(nodes[size],'epi',end); } } rec(tree,0,1); return nodes; } function nfa_to_dfa(nfa) { var i; //new node queue var queue=[walk(nfa,[0],getL('epi'),true)]; var f={}; var counter=1; while(queue.length!==0){ var array=queue.pop(); var arrays=array.join(","); var f2=f[arrays]={}; for(i=0;i<array.length;i++){ var node=nfa[array[i]]; for(var key in node){ if(!node.hasOwnProperty(key)) continue; if(key==='epi') continue; if(f2[key]!==undefined) continue; var array2=walk( nfa, walk(nfa,array,getL(key),false), getL('epi'), true ); var array2s=array2.join(','); f2[key]=array2s; if(f[array2s]===undefined){ queue.push(array2); } } } if(array.indexOf(1)!==-1){ f2.end='end'; } } f.end={}; var dict2=Object.keys(f);//int > str swap(dict2,walk(nfa,[0],getL('epi'),true).join(','),0); swap(dict2,'end',1); var dict1={};//str > int for(i=0;i<dict2.length;i++){ dict1[dict2[i]]=i; } var ff=map(f,dict1,dict2); return ff; } function inverse_fa(dfa) { var dfa2=Array(dfa.length); var i,k; for(i=0;i<dfa.length;i++){ dfa2[i]={}; } for(i=0;i<dfa.length;i++){ for(k in dfa[i]){ if(!dfa[i].hasOwnProperty(k)) continue; add(dfa2[dfa[i][k]],k,i); } } return dfa2; } function reduce_dfa1(dfa) { var i,k; var dfa2=inverse_fa(dfa); var array=walk( dfa2, [1], function(obj){ return [].concat.apply([], Object.keys(obj).map(function(k){ return obj[k]; }) ); }, true ); if(array[0]!==0){ return [{},{}]; } var dict=Array(dfa.length); var f=Array(array.length); for(i=0;i<array.length;i++){ dict[array[i]]=i; f[i]={}; } for(i=0;i<array.length;i++){ f[i]={}; var obj=dfa[array[i]]; for(k in obj){ if(!obj.hasOwnProperty(k)) continue; if(dict[obj[k]]!==undefined){ f[i][k]=dict[obj[k]]; } } } return f; } function reduce_dfa2(dfa) { if(dfa.length===2) return dfa; var i; var Ps=Array(dfa.length);//index > group index var W=Array(dfa.length); for(i=0;i<dfa.length;i++){ Ps[i]=0; W[i]=i; } var Pn=1;//number of groups: all var dfa2=inverse_fa(dfa); function index_to_keys2(i) { return Object.keys(dfa2[i]); } function extend(s,v)//push array { for(var vv in v){ if(v.hasOwnProperty(vv)){ s[v[vv]]=true; } } return s; } //var Sig=W.map(index_to_keys2).reduce(extend,{}); //Sig=Object.keys(Sig);//array of all alphas W=[W.join(',')];//queue function indexes_to_ukeys2(A) { return Object.keys(A .map(index_to_keys2) .reduce(extend,{})); } function parti(Pi,X) { var i=0; var f1=[],f2=[],f3=[]; for(var n1=0;n1<Ps.length;n1++){ //console.log(n1+": "+Ps[n1]); if(Ps[n1]!==Pi){ continue; } while(X[i]<n1){ i++; } if(X[i]===n1){ f1.push(n1); }else{ f2.push(n1); } f3.push(n1); } //console.log(JSON.stringify([Pi,X,Ps,Pn,f1,f2,f3])); return [f1,f2,f3]; } while(W.length!==0){ //console.log(W); var A=W.pop().split(','); var cs=indexes_to_ukeys2(A); //console.log('A: '+JSON.stringify([A,cs])); for(var ci=0;ci<cs.length;ci++){ var c=cs[ci]; var X=walk(dfa2,A,getL(c),false); for(var Pi=0;Pi<Pn;Pi++){ var ptt=parti(Pi,X); //console.log("ptt: "+Pi+" "+JSON.stringify([c,ptt,Ps,X])); if(ptt[0].length!==0&&ptt[1].length!==0){ for(var ptt1i=0;ptt1i<ptt[1].length;ptt1i++){ Ps[ptt[1][ptt1i]]=Pn; } Pn++; var Wi=W.indexOf(ptt[2].join(',')); if(Wi!==-1){ W.splice(Wi,1,ptt[0].join(','),ptt[1].join(',')); }else{ if(ptt[0].length>=ptt[1].length){ W.push(ptt[0].join(',')); }else{ W.push(ptt[1].join(',')); } } } } } } //console.log("Ps: "+JSON.stringify(Ps)); var tmp=Array(Pn); for(i=0;i<Pn;i++){ tmp[i]=i; } tmp[Ps[0]]=0; tmp[0]=Ps[0]; tmp[Ps[1]]=1; tmp[tmp[1]]=Ps[1]; //console.log(tmp); Ps=Ps.map(function(e){ return tmp[e]; }); //console.log("Ps: "+JSON.stringify(Ps)); var Pin=Array(Pn); for(i=0;i<Ps.length;i++){ if(Pin[Ps[i]]===undefined){ Pin[Ps[i]]=i; } } return map(dfa,Ps,Pin); } function parse(dfa) { return function(string){ var si=0; for(var i=0;si!==undefined&&i<string.length;i++){ si=dfa[si][string[i]]; //console.log(si); } return si!==undefined&&dfa[si].end===1; }; } function fa_to_dot(fa) //TODO broken { var i; var table=Array(fa.length*fa.length); for(i=0;i<fa.length*fa.length;i++){ table[i]=[]; } for(i=0;i<fa.length;i++){ for(var k in fa[i]){ if(!fa[i].hasOwnProperty(k)) continue; var tmp=fa[i][k]; if(!Array.isArray(tmp)){ tmp=[tmp]; } for(var j=0;j<tmp.length;j++){ table[i*fa.length+tmp[j]].push(escape(k)); } } } table=table.map(function(v,i){ return v.length===0?"":(" "+(i/fa.length|0)+" -> "+(i%fa.length)+" [label=\""+v.join(',')+"\"];\n"); }); var f=""; f+="digraph G{\n"; f+=" 0 [color=\"red\"]\n"; f+=" 1 [color=\"red\"]\n"; f+=table.join(''); f+="}"; return f; } var t1t=regex_to_tree("(a|b)*ababab"); console.log(t1t); var t1n=tree_to_nfa(t1t); console.log(t1n); var t1d=nfa_to_dfa(t1n); console.log(t1d); var t1a=reduce_dfa1(t1d); console.log(t1a); var t1b=reduce_dfa2(t1a); console.log(t1b); var t1p=parse(t1b); console.log("parse: "); console.log(t1p("ababaababab")); var t1g=fa_to_dot(t1b); console.log("t1g"); console.log(t1g); var t2d=[ {'a':2,'b':3}, {}, {'end':1,'a':4}, {'end':1}, {} ]; if(exports!==undefined){ console.log("t2d: "); console.log(t2d); var t2din=inverse_fa(t2d); console.log("t2din: "); console.log(t2din); var t2a=reduce_dfa1(t2d); console.log("t2a"); console.log(t2a); var t2b=reduce_dfa2(t2a); console.log("t2b"); console.log(t2b); var t2g=fa_to_dot(t2b); console.log("t2g"); console.log(t2g); }
gpl-2.0
umang11/glotech
wp-content/plugins/cherry-parallax/cherry-parallax.php
2435
<?php /* Plugin Name: Cherry Parallax Plugin Version: 1.0 Plugin URI: http://www.cherryframework.com/ Description: Create blocks with parallax effect Author: Cherry Team. Author URI: http://www.cherryframework.com/ Text Domain: cherry-parallax Domain Path: languages/ License URI: http://www.gnu.org/licenses/gpl-2.0.html */ if ( ! defined( 'ABSPATH' ) ) exit; class cherry_parallax { public $version = '1.0'; function __construct() { add_action( 'wp_enqueue_scripts', array( $this, 'assets' ) ); add_shortcode( 'cherry_parallax', array( $this, 'parallax_shortcode' ) ); } function assets() { if ( is_singular() ) { wp_enqueue_script( 'cherry-parallax', $this->url('js/cherry.parallax.js'), array('jquery'), $this->version, true ); wp_enqueue_script('device-check', $this->url('js/device.min.js'), array('jquery'), '1.0.0', true ); wp_enqueue_style( 'cherry-parallax', $this->url('css/parallax.css'), '', $this->version ); } } /** * return plugin url */ function url( $path = null ) { $base_url = untrailingslashit( plugin_dir_url( __FILE__ ) ); if ( !$path ) { return $base_url; } else { return esc_url( $base_url . '/' . $path ); } } /** * return plugin dir */ function dir( $path = null ) { $base_dir = untrailingslashit( plugin_dir_path( __FILE__ ) ); if ( !$path ) { return $base_dir; } else { return esc_url( $base_dir . '/' . $path ); } } /** * Shortcode */ function parallax_shortcode( $atts, $content = null ) { extract(shortcode_atts( array( 'image' => '', 'width' => '1920', 'speed' => '3', 'custom_class' => '' ), $atts, 'cherry_parallax' )); if ( !$image ) { return; } $width = intval($width); $result = '<section class="parallax-box ' . esc_attr( $custom_class ) . '">'; $result .= '<div class="parallax-content">' . do_shortcode( $content ) . '</div>'; $default_css = apply_filters( 'cherry_parallax_css', 'background:url(\'' . $image . '\') no-repeat center 0; left:50%; margin-left:-' . ($width/2) . 'px; width:' . $width . 'px', $custom_class ); $result .= '<div data-speed="' . $speed . '" class="parallax-bg" style="' . $default_css . '"></div>'; $result .= '</section>'; return $result; } } new cherry_parallax(); ?>
gpl-2.0
kaushal76/j34
administrator/components/com_jdeveloper/library/table.php
4932
<?php /** * @package JDeveloper * @subpackage Library * * @copyright Copyright (C) 2014, Tilo-Lars Flasche. All rights reserved. * @license GNU General Public License version 2 or later */ defined('_JEXEC') or die; jimport('joomla.filesystem.file'); /** * Class for working with database tables * * @package JDeveloper * @subpackage Library */ class JDeveloperTable { /** * Get the field`s information from a db table * * @param table string The table`s name * * @return array<JRegistry> The field`s information */ public static function getDbTableFields($table, $ignore) { $db = JFactory::getDBO(); $fieldlist = array(); $db->setQuery('SHOW COLUMNS FROM ' . $table); $dbfields = $db->loadAssocList(); foreach ($dbfields as $dbfield) { if (in_array($dbfield['Field'], $ignore) || self::isCoreField($dbfield['Field'])) continue; $field = new JRegistry(); $field->set('id', 0); $field->set('name', $dbfield['Field']); $field->set('label', ucfirst($dbfield['Field'])); $field->set('description', ''); $type = explode('(', $dbfield['Type']); $field->set('dbtype', trim(preg_replace('/\)|unsigned/', '', $type[0]))); // Set field maxlength if (isset($type[1])) { $field->set('maxlength', trim(preg_replace('/\)|unsigned/', '', $type[1]))); } // Set field type if (preg_match('/CHAR|INT|FLOAT|DOUBLE|REAL|DECIMAL/i', $type[0])) { $field->set('type', 'text'); } elseif (preg_match('/DATE/i', $type[0])) { $field->set('type', 'calendar'); } elseif (preg_match('/TEXT/i', $type[0])) { $field->set('type', 'textarea'); } else { $field->set('type', 'text'); } // Set params $form = JModelLegacy::getInstance("Field", "JDeveloperModel")->getForm(); $params = new JRegistry(); foreach ($form->getGroup("params") as $param) { $params->set($param->fieldname, ""); } $field->set('params', $params->toString()); // add field to fieldlist $fieldlist[] = $field; } return $fieldlist; } public static function getTableSql($id) { require_once JDeveloperLIB.DS.'template.php'; $template = new JDeveloperTemplate(JDeveloperPath::dots2ds(JDeveloperTEMPLATES.DS.'com.admin.sql.install.mysql.utf8.create.sql')); $table = JModelLegacy::getInstance('Table', 'JDeveloperModel')->getItem($id); $component = JModelLegacy::getInstance('Table', 'JDeveloperModel')->getItem($table->component); $fields = JModelLegacy::getInstance('Fields', 'JDeveloperModel')->getTableFields($table->id); if ($component === false) $component = new JObject(array('name' => '')); $template->addAreas(array( 'access' => ( (bool) $table->get('access', 0) ), 'alias' => ( (bool) $table->get('alias', 0) ), 'asset_id' => ( (bool) $table->get('asset_id', 0) ), 'catid' => ( (bool) $table->get('catid', 0) ), 'checked_out' => ( (bool) $table->get('checked_out', 0) ), 'created' => ( (bool) $table->get('created', 0) ), 'created_by' => ( (bool) $table->get('created_by', 0) ), 'created_by_alias' => ( (bool) $table->get('created_by_alias', 0) ), 'hits' => ( (bool) $table->get('hits', 0) ), 'language' => ( (bool) $table->get('language', 0) ), 'metadata' => ( (bool) $table->get('metadata', 0) ), 'metadesc' => ( (bool) $table->get('metadesc', 0) ), 'metakey' => ( (bool) $table->get('metakey', 0) ), 'modified' => ( (bool) $table->get('modified', 0) ), 'modified_by' => ( (bool) $table->get('modified_by', 0) ), 'ordering' => ( (bool) $table->get('ordering', 0) ), 'params' => ( !empty($table->params) ), 'publish' => ( (bool) $table->get('publish_up', 0) || (bool) $table->get('publish_down', 0)), 'publish_up' => ( (bool) $table->get('publish_up', 0) ), 'publish_down' => ( (bool) $table->get('publish_down', 0) ), 'published' => ( (bool) $table->get('published', 0) ), 'tags' => false, 'version' => ( (bool) $table->get('version', 0) ) )); $template->addPlaceholders(array( 'table_db' => (JComponentHelper::getParams('com_jdeveloper')->get('add_component_name_to_table_name')) ? $component->name . '_' . $table->name : $table->name, 'pk' => $table->pk, 'sql' => '<br>' . self::sqlFields($fields) )); $buffer = $template->getBuffer(); $buffer = preg_replace('/(CREATE TABLE IF NOT EXISTS|NOT NULL|CHARACTER SET|COLLATE|AUTO_INCREMENT|PRIMARY KEY|DEFAULT|COMMENT|unsigned)/', "<span style=\"color:blue\">$0</span>", $buffer); $buffer = preg_replace('/`.*`/', "<span style=\"color:orange\">$0</span>", $buffer); $buffer = preg_replace('/\'.*\'/', "<span style=\"color:#999999\">$0</span>", $buffer); return $buffer; } }
gpl-2.0
titokone/titotrainer
WEB-INF/src/fi/helsinki/cs/titotrainer/app/model/Input.java
7086
package fi.helsinki.cs.titotrainer.app.model; import static fi.helsinki.cs.titotrainer.app.model.misc.ArgumentUtils.*; import java.util.Collection; import java.util.HashSet; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.MapKey; import javax.persistence.OneToMany; import javax.persistence.Table; import javax.persistence.Transient; import org.apache.commons.lang.StringUtils; import org.hibernate.annotations.Cascade; import org.hibernate.annotations.CascadeType; import org.hibernate.validator.NotNull; import fi.helsinki.cs.titotrainer.framework.model.Bidirectional; /** * <p>Represents one row in the table "input". Input is basically a string given to the solution of a task to * test it for correctness.</p> * * <p>{@link Comparable} comparisons are done on the input string.</p> */ @Entity @Table(name = "input") public class Input extends AbstractTitoEntity { //////////////////// // PRIVATE FIELDS // //////////////////// private long id; private String input; private boolean secret; private Task task; private Collection<Criterion> criteria; ////////////////// // CONSTRUCTORS // ////////////////// /** * Constructs an input with all fields unset. */ public Input() { } /** * Constructs an input with all relevant fields set. The values of the fields are given as parameters to * the constructor. * * @param task The task this input should be used for. * @param input The input to be used to test the solution to the task. * @param secret A flag denoting if the input is visible to the user. */ public Input(Task task, String input, boolean secret) { this.task = task; this.input = input; this.secret = secret; } /////////////// // ACCESSORS // /////////////// /** * Returns the unique id of this input. * * @return The unique numerical id of this input. */ @Id @GeneratedValue @Override public long getId() { return this.id; } /** * Set the id for this input. This method should never be called directly, assigning an * id to an input is taken care of by the persistence framework. * * @param id The new id of this input. */ @Override public void setId(long id) { this.id = id; } /** * Returns the input to a task. * * @return The input to a task. */ @NotNull public String getInput() { return this.input; } @Transient public int[] getInputNumbers() { String[] parts = StringUtils.split(this.getInput(), ','); int[] result = new int[parts.length]; for (int i = 0; i < parts.length; ++i) { result[i] = Integer.parseInt(parts[i].trim()); } return result; } /** * Sets the input to a task. The input must not be null. * * @param input The input to test the solution to a task with. */ public void setInput(String input) { validateStringArgument(input, "input", STRING_CONSTRAINT_NOT_NULL); input = input.trim(); this.input = input; } /** * Returns true if the input is considered "secret". A secret input must not be shown to a student * solving the task. * * @return {@code true} if the input is "secret". */ public boolean isSecret() { return this.secret; } /** * Sets the secrecy status of the input. * * @param secret {@code true} if the input should be secret. */ public void setSecret(boolean secret) { this.secret = secret; } /** * Returns the task this input applies to. * * @return The task this input shall be used with. */ @Bidirectional @ManyToOne @JoinColumn(name = "taskId", nullable = false) public Task getTask() { return this.task; } /** * Sets the task this input shall be used with. * * @param task The task this input shall be used with. */ public void setTask(Task task) { if (task == null) { throw new NullPointerException("Argument 'task' must not be null!"); } this.task = task; } /** * Returns the criteria that are specific to this input. */ @Bidirectional @MapKey(name = "id") @OneToMany(mappedBy = "input") @Cascade({CascadeType.DELETE}) public Collection<Criterion> getCriteria() { if (this.criteria == null) { this.criteria = new HashSet<Criterion>(); } return this.criteria; } public void setCriteria(Collection<Criterion> criteria) { this.criteria = criteria; } ////////////////////// // INSTANCE METHODS // ////////////////////// /** * Copies this input for the same task. * * <h4 class = "implementation">Implementation Note</h4> * Internally, this method redirects to {@code deepCopy(null, false)}. * * @return A true copy of this input * @see #deepCopy(Task, boolean) */ public Input deepCopy() { return this.deepCopy(null, false); } /** * Copies this input and attaches it to another task. The deep-copy semantics for an input are the following:<br /><br /> * * <ul> * <li>The id is not copied at all (it's later assigned by the persistence framework)</li> * <li>If {@code targetTask == null}, the old reference to task is copied, otherwise the copy of this input refers to {@code targetTask}</li> * <li>The secrecy status is copied</li> * <li>The input is copied</li> * <li>Dependent validations are not copied at all</li> * <li>If {@code updateAssociations==true}, the copy is added to the collection of inputs in the "owning" task</li> * </ul> * * @param targetTask The task the copy of this input should be attached to. If {@code null}, the task reference of the source is used * @param updateAssociations If {@code true}, bidirectional associations are automatically updated * @return A true copy of this input */ public Input deepCopy(Task targetTask, boolean updateAssociations) { Input copy = new Input(); copy.setInput(this.input); copy.setSecret(this.secret); /* Use target-task if provided, otherwise copy the old reference */ if (targetTask == null) { copy.setTask(this.task); } else { copy.setTask(targetTask); } /* Update bidirectional associations if requested */ if (updateAssociations) { copy.getTask().getInputs().add(copy); } return copy; } }
gpl-2.0
yehnan/python_book_yehnan
ch11/ch11_private.py
401
class A(): def bar(self): return 4 def foo(self): return 3 + self.bar() class B(A): def bar(self): return 104 b = B() print(b.foo()) class A(): def __bar(self): return 4 def foo(self): return 3 + self.__bar() class B(A): def bar(self): return 104 def bm(self): return self.bar() + 1000 b = B() print(b.foo()) print(b.bm()) print(b._A__bar())
gpl-2.0
neolit123/subsurface
core/configuredivecomputer.cpp
21862
// SPDX-License-Identifier: GPL-2.0 #include "configuredivecomputer.h" #include <QTextStream> #include <QFile> #include <libxml/parser.h> #include <libxml/parserInternals.h> #include <libxml/tree.h> #include <libxslt/transform.h> #include <QStringList> #include <QXmlStreamWriter> ConfigureDiveComputer::ConfigureDiveComputer() : readThread(0), writeThread(0), resetThread(0), firmwareThread(0) { setState(INITIAL); } void ConfigureDiveComputer::readSettings(device_data_t *data) { setState(READING); if (readThread) readThread->deleteLater(); readThread = new ReadSettingsThread(this, data); connect(readThread, SIGNAL(finished()), this, SLOT(readThreadFinished()), Qt::QueuedConnection); connect(readThread, SIGNAL(error(QString)), this, SLOT(setError(QString))); connect(readThread, SIGNAL(devicedetails(DeviceDetails *)), this, SIGNAL(deviceDetailsChanged(DeviceDetails *))); connect(readThread, SIGNAL(progress(int)), this, SLOT(progressEvent(int)), Qt::QueuedConnection); readThread->start(); } void ConfigureDiveComputer::saveDeviceDetails(DeviceDetails *details, device_data_t *data) { setState(WRITING); if (writeThread) writeThread->deleteLater(); writeThread = new WriteSettingsThread(this, data); connect(writeThread, SIGNAL(finished()), this, SLOT(writeThreadFinished()), Qt::QueuedConnection); connect(writeThread, SIGNAL(error(QString)), this, SLOT(setError(QString))); connect(writeThread, SIGNAL(progress(int)), this, SLOT(progressEvent(int)), Qt::QueuedConnection); writeThread->setDeviceDetails(details); writeThread->start(); } bool ConfigureDiveComputer::saveXMLBackup(QString fileName, DeviceDetails *details, device_data_t *data) { QString xml = ""; QString vendor = data->vendor; QString product = data->product; QXmlStreamWriter writer(&xml); writer.setAutoFormatting(true); writer.writeStartDocument(); writer.writeStartElement("DiveComputerSettingsBackup"); writer.writeStartElement("DiveComputer"); writer.writeTextElement("Vendor", vendor); writer.writeTextElement("Product", product); writer.writeEndElement(); writer.writeStartElement("Settings"); writer.writeTextElement("CustomText", details->customText); //Add gasses QString gas1 = QString("%1,%2,%3,%4") .arg(QString::number(details->gas1.oxygen), QString::number(details->gas1.helium), QString::number(details->gas1.type), QString::number(details->gas1.depth)); QString gas2 = QString("%1,%2,%3,%4") .arg(QString::number(details->gas2.oxygen), QString::number(details->gas2.helium), QString::number(details->gas2.type), QString::number(details->gas2.depth)); QString gas3 = QString("%1,%2,%3,%4") .arg(QString::number(details->gas3.oxygen), QString::number(details->gas3.helium), QString::number(details->gas3.type), QString::number(details->gas3.depth)); QString gas4 = QString("%1,%2,%3,%4") .arg(QString::number(details->gas4.oxygen), QString::number(details->gas4.helium), QString::number(details->gas4.type), QString::number(details->gas4.depth)); QString gas5 = QString("%1,%2,%3,%4") .arg(QString::number(details->gas5.oxygen), QString::number(details->gas5.helium), QString::number(details->gas5.type), QString::number(details->gas5.depth)); writer.writeTextElement("Gas1", gas1); writer.writeTextElement("Gas2", gas2); writer.writeTextElement("Gas3", gas3); writer.writeTextElement("Gas4", gas4); writer.writeTextElement("Gas5", gas5); // //Add dil values QString dil1 = QString("%1,%2,%3,%4") .arg(QString::number(details->dil1.oxygen), QString::number(details->dil1.helium), QString::number(details->dil1.type), QString::number(details->dil1.depth)); QString dil2 = QString("%1,%2,%3,%4") .arg(QString::number(details->dil2.oxygen), QString::number(details->dil2.helium), QString::number(details->dil2.type), QString::number(details->dil2.depth)); QString dil3 = QString("%1,%2,%3,%4") .arg(QString::number(details->dil3.oxygen), QString::number(details->dil3.helium), QString::number(details->dil3.type), QString::number(details->dil3.depth)); QString dil4 = QString("%1,%2,%3,%4") .arg(QString::number(details->dil4.oxygen), QString::number(details->dil4.helium), QString::number(details->dil4.type), QString::number(details->dil4.depth)); QString dil5 = QString("%1,%2,%3,%4") .arg(QString::number(details->dil5.oxygen), QString::number(details->dil5.helium), QString::number(details->dil5.type), QString::number(details->dil5.depth)); writer.writeTextElement("Dil1", dil1); writer.writeTextElement("Dil2", dil2); writer.writeTextElement("Dil3", dil3); writer.writeTextElement("Dil4", dil4); writer.writeTextElement("Dil5", dil5); //Add setpoint values QString sp1 = QString("%1,%2") .arg(QString::number(details->sp1.sp), QString::number(details->sp1.depth)); QString sp2 = QString("%1,%2") .arg(QString::number(details->sp2.sp), QString::number(details->sp2.depth)); QString sp3 = QString("%1,%2") .arg(QString::number(details->sp3.sp), QString::number(details->sp3.depth)); QString sp4 = QString("%1,%2") .arg(QString::number(details->sp4.sp), QString::number(details->sp4.depth)); QString sp5 = QString("%1,%2") .arg(QString::number(details->sp5.sp), QString::number(details->sp5.depth)); writer.writeTextElement("SetPoint1", sp1); writer.writeTextElement("SetPoint2", sp2); writer.writeTextElement("SetPoint3", sp3); writer.writeTextElement("SetPoint4", sp4); writer.writeTextElement("SetPoint5", sp5); //Other Settings writer.writeTextElement("DiveMode", QString::number(details->diveMode)); writer.writeTextElement("Saturation", QString::number(details->saturation)); writer.writeTextElement("Desaturation", QString::number(details->desaturation)); writer.writeTextElement("LastDeco", QString::number(details->lastDeco)); writer.writeTextElement("Brightness", QString::number(details->brightness)); writer.writeTextElement("Units", QString::number(details->units)); writer.writeTextElement("SamplingRate", QString::number(details->samplingRate)); writer.writeTextElement("Salinity", QString::number(details->salinity)); writer.writeTextElement("DiveModeColor", QString::number(details->diveModeColor)); writer.writeTextElement("Language", QString::number(details->language)); writer.writeTextElement("DateFormat", QString::number(details->dateFormat)); writer.writeTextElement("CompassGain", QString::number(details->compassGain)); writer.writeTextElement("SafetyStop", QString::number(details->safetyStop)); writer.writeTextElement("GfHigh", QString::number(details->gfHigh)); writer.writeTextElement("GfLow", QString::number(details->gfLow)); writer.writeTextElement("PressureSensorOffset", QString::number(details->pressureSensorOffset)); writer.writeTextElement("PpO2Min", QString::number(details->ppO2Min)); writer.writeTextElement("PpO2Max", QString::number(details->ppO2Max)); writer.writeTextElement("FutureTTS", QString::number(details->futureTTS)); writer.writeTextElement("CcrMode", QString::number(details->ccrMode)); writer.writeTextElement("DecoType", QString::number(details->decoType)); writer.writeTextElement("AGFSelectable", QString::number(details->aGFSelectable)); writer.writeTextElement("AGFHigh", QString::number(details->aGFHigh)); writer.writeTextElement("AGFLow", QString::number(details->aGFLow)); writer.writeTextElement("CalibrationGas", QString::number(details->calibrationGas)); writer.writeTextElement("FlipScreen", QString::number(details->flipScreen)); writer.writeTextElement("SetPointFallback", QString::number(details->setPointFallback)); writer.writeTextElement("LeftButtonSensitivity", QString::number(details->leftButtonSensitivity)); writer.writeTextElement("RightButtonSensitivity", QString::number(details->rightButtonSensitivity)); writer.writeTextElement("BottomGasConsumption", QString::number(details->bottomGasConsumption)); writer.writeTextElement("DecoGasConsumption", QString::number(details->decoGasConsumption)); writer.writeTextElement("ModWarning", QString::number(details->modWarning)); writer.writeTextElement("DynamicAscendRate", QString::number(details->dynamicAscendRate)); writer.writeTextElement("GraphicalSpeedIndicator", QString::number(details->graphicalSpeedIndicator)); writer.writeTextElement("AlwaysShowppO2", QString::number(details->alwaysShowppO2)); // Suunto vyper settings. writer.writeTextElement("Altitude", QString::number(details->altitude)); writer.writeTextElement("PersonalSafety", QString::number(details->personalSafety)); writer.writeTextElement("TimeFormat", QString::number(details->timeFormat)); writer.writeStartElement("Light"); writer.writeAttribute("enabled", QString::number(details->lightEnabled)); writer.writeCharacters(QString::number(details->light)); writer.writeEndElement(); writer.writeStartElement("AlarmTime"); writer.writeAttribute("enabled", QString::number(details->alarmTimeEnabled)); writer.writeCharacters(QString::number(details->alarmTime)); writer.writeEndElement(); writer.writeStartElement("AlarmDepth"); writer.writeAttribute("enabled", QString::number(details->alarmDepthEnabled)); writer.writeCharacters(QString::number(details->alarmDepth)); writer.writeEndElement(); writer.writeEndElement(); writer.writeEndElement(); writer.writeEndDocument(); QFile file(fileName); if (!file.open(QIODevice::WriteOnly)) { lastError = tr("Could not save the backup file %1. Error Message: %2") .arg(fileName, file.errorString()); return false; } //file open successful. write data and save. QTextStream out(&file); out << xml; file.close(); return true; } bool ConfigureDiveComputer::restoreXMLBackup(QString fileName, DeviceDetails *details) { QFile file(fileName); if (!file.open(QIODevice::ReadOnly)) { lastError = tr("Could not open backup file: %1").arg(file.errorString()); return false; } QString xml = file.readAll(); QXmlStreamReader reader(xml); while (!reader.atEnd()) { if (reader.isStartElement()) { QString settingName = reader.name().toString(); QXmlStreamAttributes attributes = reader.attributes(); reader.readNext(); QString keyString = reader.text().toString(); if (settingName == "CustomText") details->customText = keyString; if (settingName == "Gas1") { QStringList gasData = keyString.split(","); gas gas1; gas1.oxygen = gasData.at(0).toInt(); gas1.helium = gasData.at(1).toInt(); gas1.type = gasData.at(2).toInt(); gas1.depth = gasData.at(3).toInt(); details->gas1 = gas1; } if (settingName == "Gas2") { QStringList gasData = keyString.split(","); gas gas2; gas2.oxygen = gasData.at(0).toInt(); gas2.helium = gasData.at(1).toInt(); gas2.type = gasData.at(2).toInt(); gas2.depth = gasData.at(3).toInt(); details->gas2 = gas2; } if (settingName == "Gas3") { QStringList gasData = keyString.split(","); gas gas3; gas3.oxygen = gasData.at(0).toInt(); gas3.helium = gasData.at(1).toInt(); gas3.type = gasData.at(2).toInt(); gas3.depth = gasData.at(3).toInt(); details->gas3 = gas3; } if (settingName == "Gas4") { QStringList gasData = keyString.split(","); gas gas4; gas4.oxygen = gasData.at(0).toInt(); gas4.helium = gasData.at(1).toInt(); gas4.type = gasData.at(2).toInt(); gas4.depth = gasData.at(3).toInt(); details->gas4 = gas4; } if (settingName == "Gas5") { QStringList gasData = keyString.split(","); gas gas5; gas5.oxygen = gasData.at(0).toInt(); gas5.helium = gasData.at(1).toInt(); gas5.type = gasData.at(2).toInt(); gas5.depth = gasData.at(3).toInt(); details->gas5 = gas5; } if (settingName == "Dil1") { QStringList dilData = keyString.split(","); gas dil1; dil1.oxygen = dilData.at(0).toInt(); dil1.helium = dilData.at(1).toInt(); dil1.type = dilData.at(2).toInt(); dil1.depth = dilData.at(3).toInt(); details->dil1 = dil1; } if (settingName == "Dil2") { QStringList dilData = keyString.split(","); gas dil2; dil2.oxygen = dilData.at(0).toInt(); dil2.helium = dilData.at(1).toInt(); dil2.type = dilData.at(2).toInt(); dil2.depth = dilData.at(3).toInt(); details->dil1 = dil2; } if (settingName == "Dil3") { QStringList dilData = keyString.split(","); gas dil3; dil3.oxygen = dilData.at(0).toInt(); dil3.helium = dilData.at(1).toInt(); dil3.type = dilData.at(2).toInt(); dil3.depth = dilData.at(3).toInt(); details->dil3 = dil3; } if (settingName == "Dil4") { QStringList dilData = keyString.split(","); gas dil4; dil4.oxygen = dilData.at(0).toInt(); dil4.helium = dilData.at(1).toInt(); dil4.type = dilData.at(2).toInt(); dil4.depth = dilData.at(3).toInt(); details->dil4 = dil4; } if (settingName == "Dil5") { QStringList dilData = keyString.split(","); gas dil5; dil5.oxygen = dilData.at(0).toInt(); dil5.helium = dilData.at(1).toInt(); dil5.type = dilData.at(2).toInt(); dil5.depth = dilData.at(3).toInt(); details->dil5 = dil5; } if (settingName == "SetPoint1") { QStringList spData = keyString.split(","); setpoint sp1; sp1.sp = spData.at(0).toInt(); sp1.depth = spData.at(1).toInt(); details->sp1 = sp1; } if (settingName == "SetPoint2") { QStringList spData = keyString.split(","); setpoint sp2; sp2.sp = spData.at(0).toInt(); sp2.depth = spData.at(1).toInt(); details->sp2 = sp2; } if (settingName == "SetPoint3") { QStringList spData = keyString.split(","); setpoint sp3; sp3.sp = spData.at(0).toInt(); sp3.depth = spData.at(1).toInt(); details->sp3 = sp3; } if (settingName == "SetPoint4") { QStringList spData = keyString.split(","); setpoint sp4; sp4.sp = spData.at(0).toInt(); sp4.depth = spData.at(1).toInt(); details->sp4 = sp4; } if (settingName == "SetPoint5") { QStringList spData = keyString.split(","); setpoint sp5; sp5.sp = spData.at(0).toInt(); sp5.depth = spData.at(1).toInt(); details->sp5 = sp5; } if (settingName == "Saturation") details->saturation = keyString.toInt(); if (settingName == "Desaturation") details->desaturation = keyString.toInt(); if (settingName == "DiveMode") details->diveMode = keyString.toInt(); if (settingName == "LastDeco") details->lastDeco = keyString.toInt(); if (settingName == "Brightness") details->brightness = keyString.toInt(); if (settingName == "Units") details->units = keyString.toInt(); if (settingName == "SamplingRate") details->samplingRate = keyString.toInt(); if (settingName == "Salinity") details->salinity = keyString.toInt(); if (settingName == "DiveModeColour") details->diveModeColor = keyString.toInt(); if (settingName == "Language") details->language = keyString.toInt(); if (settingName == "DateFormat") details->dateFormat = keyString.toInt(); if (settingName == "CompassGain") details->compassGain = keyString.toInt(); if (settingName == "SafetyStop") details->safetyStop = keyString.toInt(); if (settingName == "GfHigh") details->gfHigh = keyString.toInt(); if (settingName == "GfLow") details->gfLow = keyString.toInt(); if (settingName == "PressureSensorOffset") details->pressureSensorOffset = keyString.toInt(); if (settingName == "PpO2Min") details->ppO2Min = keyString.toInt(); if (settingName == "PpO2Max") details->ppO2Max = keyString.toInt(); if (settingName == "FutureTTS") details->futureTTS = keyString.toInt(); if (settingName == "CcrMode") details->ccrMode = keyString.toInt(); if (settingName == "DecoType") details->decoType = keyString.toInt(); if (settingName == "AGFSelectable") details->aGFSelectable = keyString.toInt(); if (settingName == "AGFHigh") details->aGFHigh = keyString.toInt(); if (settingName == "AGFLow") details->aGFLow = keyString.toInt(); if (settingName == "CalibrationGas") details->calibrationGas = keyString.toInt(); if (settingName == "FlipScreen") details->flipScreen = keyString.toInt(); if (settingName == "SetPointFallback") details->setPointFallback = keyString.toInt(); if (settingName == "LeftButtonSensitivity") details->leftButtonSensitivity = keyString.toInt(); if (settingName == "RightButtonSensitivity") details->rightButtonSensitivity = keyString.toInt(); if (settingName == "BottomGasConsumption") details->bottomGasConsumption = keyString.toInt(); if (settingName == "DecoGasConsumption") details->decoGasConsumption = keyString.toInt(); if (settingName == "ModWarning") details->modWarning = keyString.toInt(); if (settingName == "DynamicAscendRate") details->dynamicAscendRate = keyString.toInt(); if (settingName == "GraphicalSpeedIndicator") details->graphicalSpeedIndicator = keyString.toInt(); if (settingName == "AlwaysShowppO2") details->alwaysShowppO2 = keyString.toInt(); if (settingName == "Altitude") details->altitude = keyString.toInt(); if (settingName == "PersonalSafety") details->personalSafety = keyString.toInt(); if (settingName == "TimeFormat") details->timeFormat = keyString.toInt(); if (settingName == "Light") { if (attributes.hasAttribute("enabled")) details->lightEnabled = attributes.value("enabled").toString().toInt(); details->light = keyString.toInt(); } if (settingName == "AlarmDepth") { if (attributes.hasAttribute("enabled")) details->alarmDepthEnabled = attributes.value("enabled").toString().toInt(); details->alarmDepth = keyString.toInt(); } if (settingName == "AlarmTime") { if (attributes.hasAttribute("enabled")) details->alarmTimeEnabled = attributes.value("enabled").toString().toInt(); details->alarmTime = keyString.toInt(); } } reader.readNext(); } return true; } void ConfigureDiveComputer::startFirmwareUpdate(QString fileName, device_data_t *data) { setState(FWUPDATE); if (firmwareThread) firmwareThread->deleteLater(); firmwareThread = new FirmwareUpdateThread(this, data, fileName); connect(firmwareThread, SIGNAL(finished()), this, SLOT(firmwareThreadFinished()), Qt::QueuedConnection); connect(firmwareThread, SIGNAL(error(QString)), this, SLOT(setError(QString))); connect(firmwareThread, SIGNAL(progress(int)), this, SLOT(progressEvent(int)), Qt::QueuedConnection); firmwareThread->start(); } void ConfigureDiveComputer::resetSettings(device_data_t *data) { setState(RESETTING); if (resetThread) resetThread->deleteLater(); resetThread = new ResetSettingsThread(this, data); connect(resetThread, SIGNAL(finished()), this, SLOT(resetThreadFinished()), Qt::QueuedConnection); connect(resetThread, SIGNAL(error(QString)), this, SLOT(setError(QString))); connect(resetThread, SIGNAL(progress(int)), this, SLOT(progressEvent(int)), Qt::QueuedConnection); resetThread->start(); } void ConfigureDiveComputer::progressEvent(int percent) { emit progress(percent); } void ConfigureDiveComputer::setState(ConfigureDiveComputer::states newState) { currentState = newState; emit stateChanged(currentState); } void ConfigureDiveComputer::setError(QString err) { lastError = err; emit error(err); } void ConfigureDiveComputer::readThreadFinished() { setState(DONE); if (lastError.isEmpty()) { //No error emit message(tr("Dive computer details read successfully")); } } void ConfigureDiveComputer::writeThreadFinished() { setState(DONE); if (lastError.isEmpty()) { //No error emit message(tr("Setting successfully written to device")); } } void ConfigureDiveComputer::firmwareThreadFinished() { setState(DONE); if (lastError.isEmpty()) { //No error emit message(tr("Device firmware successfully updated")); } } void ConfigureDiveComputer::resetThreadFinished() { setState(DONE); if (lastError.isEmpty()) { //No error emit message(tr("Device settings successfully reset")); } } QString ConfigureDiveComputer::dc_open(device_data_t *data) { FILE *fp = NULL; dc_status_t rc; if (data->libdc_log) fp = subsurface_fopen(logfile_name, "w"); data->libdc_logfile = fp; rc = dc_context_new(&data->context); if (rc != DC_STATUS_SUCCESS) { return tr("Unable to create libdivecomputer context"); } if (fp) { dc_context_set_loglevel(data->context, DC_LOGLEVEL_ALL); dc_context_set_logfunc(data->context, logfunc, fp); } #if defined(SSRF_CUSTOM_IO) if (data->bluetooth_mode) { #if defined(BT_SUPPORT) && defined(SSRF_CUSTOM_IO) rc = dc_context_set_custom_io(data->context, get_qt_serial_ops(), data); #endif #ifdef SERIAL_FTDI } else if (!strcmp(data->devname, "ftdi")) { rc = dc_context_set_custom_io(data->context, &serial_ftdi_ops, data); #endif } if (rc != DC_STATUS_SUCCESS) { report_error(errmsg(rc)); } else { #else { #endif rc = dc_device_open(&data->device, data->context, data->descriptor, data->devname); } if (rc != DC_STATUS_SUCCESS) { return tr("Could not a establish connection to the dive computer."); } setState(OPEN); return NULL; } void ConfigureDiveComputer::dc_close(device_data_t *data) { if (data->device) dc_device_close(data->device); data->device = NULL; if (data->context) dc_context_free(data->context); data->context = NULL; if (data->libdc_logfile) fclose(data->libdc_logfile); setState(INITIAL); }
gpl-2.0
jw-psychopomp/ThirtyNorth-development
wp-content/themes/builder/admin/functions/functions.options.php
66413
<?php add_action('init','of_options'); if (!function_exists('of_options')) { function of_options() { //Access the WordPress Categories via an Array $of_categories = array(); $of_categories_obj = get_categories('hide_empty=0'); foreach ($of_categories_obj as $of_cat) { $of_categories[$of_cat->cat_ID] = $of_cat->cat_name;} $categories_tmp = array_unshift($of_categories, "Select a category:"); //Access the WordPress Pages via an Array $of_pages = array(); $of_pages_obj = get_pages('sort_column=post_parent,menu_order'); foreach ($of_pages_obj as $of_page) { $of_pages[$of_page->ID] = $of_page->post_name; } $of_pages_tmp = array_unshift($of_pages, "Select a page:"); //Testing $of_options_select = array("one","two","three","four","five"); $of_options_radio = array("one" => "One","two" => "Two","three" => "Three","four" => "Four","five" => "Five"); //Sample Homepage blocks for the layout manager (sorter) $of_options_homepage_blocks = array ( "disabled" => array ( "placebo" => "placebo", //REQUIRED! "block_one" => "Block One", "block_two" => "Block Two", "block_three" => "Block Three", ), "enabled" => array ( "placebo" => "placebo", //REQUIRED! "block_four" => "Block Four", ), ); //Stylesheets Reader $alt_stylesheet_path = LAYOUT_PATH; $alt_stylesheets = array(); if ( is_dir($alt_stylesheet_path) ) { if ($alt_stylesheet_dir = opendir($alt_stylesheet_path) ) { while ( ($alt_stylesheet_file = readdir($alt_stylesheet_dir)) !== false ) { if(stristr($alt_stylesheet_file, ".css") !== false) { $alt_stylesheets[] = $alt_stylesheet_file; } } } } //Background Images Reader $of_theme_layout = array( "1" => "Boxed and 1170px container", "2" => "Boxed and 960px container", "3" => "Fullwidth and 1170px container", "4" => "Fullwidth and 960px container" ); $of_tag_line_position = array("1" => "Before Slider", "2" => "After Slider"); $of_portfolio_style = array("1" => "6 Columns Portfolio", "2" => "4 Columns Portfolio", "3" => "3 Columns Portfolio", "4" => "2 Columns Portfolio", "5" => "Portfolio with Sidebar"); $of_portfolio_details_style = array("1" => "Landscape Style", "2" => "Portrait Style", "3" => "With Sidebar"); $of_blog_style = array("1" => "Large Images", "2" => "Medium Images"); $of_blog_sidebar = array("1" => "Right Sidebar", "2" => "Left Sidebar"); $of_portfolio_sidebar = array("1" => "Right Sidebar", "2" => "Left Sidebar"); $of_blog_image_hover_icons = array("1" => "Zoom icon + Link icon", "2" => "Zoom icon only", "3" => "Link icon only"); $of_blog_date_format = array("1" => "American Style", "2" => "European Style"); $bg_images_path = get_stylesheet_directory(). '/images/bg/'; // change this to where you store your bg images $bg_images_url = get_template_directory_uri().'/images/bg/'; // change this to where you store your bg images $bg_images = array(); if ( is_dir($bg_images_path) ) { if ($bg_images_dir = opendir($bg_images_path) ) { while ( ($bg_images_file = readdir($bg_images_dir)) !== false ) { if(stristr($bg_images_file, ".png") !== false || stristr($bg_images_file, ".jpg") !== false) { $bg_images[] = $bg_images_url . $bg_images_file; } } } } /*-----------------------------------------------------------------------------------*/ /* TO DO: Add options/functions that use these */ /*-----------------------------------------------------------------------------------*/ //More Options $uploads_arr = wp_upload_dir(); $all_uploads_path = $uploads_arr['path']; $all_uploads = get_option('of_uploads'); $other_entries = array("Select a number:","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"); $body_repeat = array("no-repeat","repeat-x","repeat-y","repeat"); $body_pos = array("top left","top center","top right","center left","center center","center right","bottom left","bottom center","bottom right"); // Image Alignment radio box $of_options_thumb_align = array("alignleft" => "Left","alignright" => "Right","aligncenter" => "Center"); // Image Links to Options $of_options_image_link_to = array("image" => "The Image","post" => "The Post"); /*-----------------------------------------------------------------------------------*/ /* The Options Array */ /*-----------------------------------------------------------------------------------*/ // Set the Options Array global $of_options; $of_options = array(); //Layout $of_options[] = array( "name" => __("General Settings","builder"), "type" => "heading"); $of_options[] = array( "name" => __("GENERAL SETTINGS","builder"), "desc" => __("Select your themes alternative color scheme","builder"), "id" => "alt_stylesheet", "std" => "empty.css", "type" => "select", "options" => $alt_stylesheets); $of_options[] = array( "name" => "", "desc" => __("Choose WebSite Layout","builder"), "id" => "theme_layout", "std" => "1", "type" => "select", "options" => $of_theme_layout); $of_options[] = array( "name" => "", "desc" => __("Upload your favicon.ico","builder"), "id" => "header_favicon", "std" => "http://www.orange-idea.com/assets/builder/favicon.ico", "type" => "media"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for the Container Background","builder"), "id" => "theme_conatiner_bg_color", "std" => "#fdfdfd", "type" => "color"); $of_options[] = array( "name" => __("BOXED LAYOUT SETTINGS","builder"), "desc" => __("Pick a color for the Background","builder"), "id" => "theme_boxed_bg_color", "std" => "#fdfdfd", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Past the value for top and bottom margin for main container","builder"), "id" => "theme_boxed_margin", "std" => "0", "type" => "text"); $of_options[] = array( "name" => " ", "desc" => __("Pick a image for the Background ( Choose first image to show only background color )","builder"), "id" => "theme_boxed_bg", "std" => $bg_images_url."1_px.png", "type" => "tiles", "options" => $bg_images, ); $of_options[] = array("name" => __("HEADERS TYPOGRAPHY","builder"), "desc" => __("Specify the h1 header font properties","builder"), "id" => "headers_font_one", "std" => array('size' => '36px', 'face' => 'Open Sans','style' => 'normal','color' => '#555555'), "type" => "typography"); $of_options[] = array("name" => "", "desc" => __("Specify the h2 header font properties","builder"), "id" => "headers_font_two", "std" => array('size' => '30px','face' => 'Open Sans','style' => 'normal','color' => '#555555'), "type" => "typography"); $of_options[] = array("name" => "", "desc" => __("Specify the h3 header font properties","builder"), "id" => "headers_font_three", "std" => array('size' => '24px','face' => 'Open Sans','style' => 'normal','color' => '#555555'), "type" => "typography"); $of_options[] = array("name" => "", "desc" => __("Specify the h4 header font properties","builder"), "id" => "headers_font_four", "std" => array('size' => '18px','face' => 'Open Sans','style' => 'normal','color' => '#555555'), "type" => "typography"); $of_options[] = array("name" => "", "desc" => __("Specify the h5 header font properties","builder"), "id" => "headers_font_five", "std" => array('size' => '14px','face' => 'Open Sans','style' => 'normal','color' => '#555555'), "type" => "typography"); $of_options[] = array("name" => "", "desc" => __("Specify the h6 header font properties","builder"), "id" => "headers_font_six", "std" => array('size' => '12px','face' => 'Open Sans','style' => 'normal','color' => '#555555'), "type" => "typography"); $of_options[] = array("name" => __("BODY TYPOGRAPHY","builder"), "desc" => __("Specify body font properties","builder"), "id" => "body_font", "std" => array('size' => '12px', 'face' => 'arial','style' => 'normal','color' => '#666666'), "type" => "typography"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for the links","builder"), "id" => "main_conent_links", "std" => "#AEC71E", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for the links, when hover","builder"), "id" => "main_conent_links_hover", "std" => "#000000", "type" => "color"); $of_options[] = array( "name" => __("REVOLUTION SLIDER","builder"), "desc" => __("Show Revolution Slider on the HomePage?","builder"), "id" => "revolution_homepage", "std" => 1, "folds" => 1, "type" => "checkbox"); $of_options[] = array( "name" => "", "desc" => __("Show Revolution Slider on other pages?","builder"), "id" => "revolution_index", "std" => 0, "folds" => 1, "type" => "checkbox"); $of_options[] = array( "name" => __("CUSTOM CSS","builder"), "desc" => __("Please put your custom css here","builder"), "id" => "custom_css", "std" => "", "type" => "textarea"); //Top Line $of_options[] = array( "name" => __("Top Line","builder"), "type" => "heading"); $of_options[] = array( "name" => __("Show/Hide Top Line","builder"), "desc" => __("Show Top Line","builder"), "id" => "top_line_show", "std" => 1, "folds" => 1, "type" => "checkbox"); $of_options[] = array( "name" => __("TOP LINE BACKGROND","builder"), "desc" => __("Pick a color for the 'Top Line' area background","builder"), "id" => "theme_colors_top_line", "std" => "#AEC71E", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Pick a image for the 'Top Line' area background ( Choose first image to show only background color )","builder"), "id" => "theme_colors_top_line_bg_image", "std" => $bg_images_url."1_px.png", "type" => "tiles", "options" => $bg_images, ); $of_options[] = array( "name" => __("TOP LINE TEXT","builder"), "desc" => __("Past your text or HTML","builder"), "id" => "header_top_line", "std" => "", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for the Top Line text","builder"), "id" => "theme_colors_top_line_text", "std" => "#FFFFFF", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for the Top Line links","builder"), "id" => "theme_colors_top_line_a", "std" => "#FFFFFF", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for the Top Line mouse over links","builder"), "id" => "theme_colors_top_line_a_hover", "std" => "#FFFFFF", "type" => "color"); $of_options[] = array( "name" => __("SOCIAL ICONS","builder"), "desc" => __("Twitter","builder"), "id" => "header_social_tw", "std" => "", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("Facebook","builder"), "id" => "header_social_fb", "std" => "", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("Google +","builder"), "id" => "header_social_g", "std" => "", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("Dribbble","builder"), "id" => "header_social_dr", "std" => "", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("Flickr","builder"), "id" => "header_social_fl", "std" => "", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("YouTube","builder"), "id" => "header_social_yt", "std" => "", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("Linkedin","builder"), "id" => "header_social_in", "std" => "", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("Pinterest","builder"), "id" => "header_social_pi", "std" => "", "type" => "text"); //Logo And Menu $of_options[] = array( "name" => __("Logo And Menu","builder"), "type" => "heading"); $of_options[] = array( "name" => __("LOGO AND MENU AREA","builder"), "desc" => __("Top padding","builder"), "id" => "logo_and_menu_t_padding", "std" => "0", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("Bottom padding","builder"), "id" => "logo_and_menu_b_padding", "std" => "0", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for the 'Logo and Menu' area background","builder"), "id" => "logo_and_menu_bg", "std" => "#F9F9F9", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Pick a image for the 'Logo and Menu' area background ( Choose first image to show only background color )","builder"), "id" => "logo_and_menu_bg_image", "std" => $bg_images_url."1_px.png", "type" => "tiles", "options" => $bg_images, ); $of_options[] = array( "name" => __("LOGO OPTIONS","builder"), "desc" => __("Upload your logo","builder"), "id" => "header_logo", "std" => "http://www.orange-idea.com/assets/builder/logo.png", "type" => "media"); $of_options[] = array( "name" => "", "desc" => __("Top margin for logo"), "id" => "logo_and_menu_logo_margin", "std" => "20", "type" => "text"); $of_options[] = array( "name" => __("MENU OPTIONS","builder"), "desc" => __("Top margin for menu","builder"), "id" => "logo_and_menu_menu_margin", "std" => "0", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("Space between menu items","builder"), "id" => "logo_and_menu_menu_li_margin", "std" => "0", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("Menu items Border Radius","builder"), "id" => "logo_and_menu_menu_li_radius", "std" => "0", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("Menu items Font Size","builder"), "id" => "logo_and_menu_menu_li_font", "std" => "12", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("Menu items Horizontal Padding","builder"), "id" => "logo_and_menu_menu_li_h_padding", "std" => "20", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("Menu items Vertical Padding","builder"), "id" => "logo_and_menu_menu_li_v_padding", "std" => "25", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("Show Menu Items shadow","builder"), "id" => "logo_and_menu_menu_li_shadow", "std" => 0, "folds" => 1, "type" => "checkbox"); $of_options[] = array( "name" => "", "desc" => __("Show Dropdown Menu Triangles","builder"), "id" => "logo_and_menu_menu_li_triangles", "std" => 0, "folds" => 1, "type" => "checkbox"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for the Menu items shadow","builder"), "id" => "logo_and_menu_menu_li_shadow_color", "std" => "#ededed", "type" => "color"); $of_options[] = array( "name" => " ", "desc" => __("Pick a color for the Menu item background","builder"), "id" => "logo_and_menu_menu_li_bg", "std" => "#f9f9f9", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for the Menu item text","builder"), "id" => "logo_and_menu_menu_li_a_color", "std" => "#666666", "type" => "color"); $of_options[] = array( "name" => " ", "desc" => __("Pick a color for the Menu item background when mouse over","builder"), "id" => "logo_and_menu_menu_li_bg_hover", "std" => "#444444", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for the Menu item text when mouse over","builder"), "id" => "logo_and_menu_menu_li_a_hover", "std" => "#ffffff", "type" => "color"); $of_options[] = array( "name" => " ", "desc" => __("Pick a color for the SubLevel Menu background","builder"), "id" => "logo_and_menu_menu_sublevel_li_bg", "std" => "#444444", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for the SubLevel Menu text","builder"), "id" => "logo_and_menu_menu_sublevel_li_a", "std" => "#bcbcbc", "type" => "color"); $of_options[] = array( "name" => " ", "desc" => __("Pick a color for the SubLevel Menu background when mouse over","builder"), "id" => "logo_and_menu_menu_sublevel_li_hover_bg", "std" => "#AEC71E", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for the SubLevel Menu text when mouse over","builder"), "id" => "logo_and_menu_menu_sublevel_li_a_hover", "std" => "#ffffff", "type" => "color"); $of_options[] = array( "name" => " ", "desc" => __("Pick a color for the Current Menu item background","builder"), "id" => "logo_and_menu_menu_li_currnet_bg", "std" => "#AEC71E", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for the Current Menu item text","builder"), "id" => "logo_and_menu_menu_li_currnet_a_color", "std" => "#ffffff", "type" => "color"); //Tag Line $of_options[] = array( "name" => __("Tag Line","builder"), "type" => "heading"); $of_options[] = array( "name" => __("Show/Hide Tag Line","builder"), "desc" => __("Show Tag Line?","builder"), "id" => "tag_line_show", "std" => 1, "folds" => 1, "type" => "checkbox"); $of_options[] = array( "name" => "", "desc" => __("Show Breadcumbs?","builder"), "id" => "breadcumbs", "std" => 1, "folds" => 1, "type" => "checkbox"); $of_options[] = array( "name" => "", "desc" => __("Choose Tag Line Position on Home Page","builder"), "id" => "tag_line_position", "std" => "1", "type" => "select", "options" => $of_tag_line_position); $of_options[] = array( "name" => __("TAG LINE SETTINGS","builder"), "desc" => __("Homepage Tag Line content","builder"), "id" => "header_tagline", "std" => "<strong class='colored'>BUILDER:</strong> Super powerful <span class='colored'>&amp;</span> responsive wordpress theme with hundreds options.", "type" => "text"); $of_options[] = array( "name" => " ", "desc" => __("Pick a color for the tag line background","builder"), "id" => "tag_line_bg", "std" => "#ffffff", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for the tag line top border","builder"), "id" => "tag_line_border_top", "std" => "#ededed", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for the tag line bottom border","builder"), "id" => "tag_line_border_bottom", "std" => "#ededed", "type" => "color"); $of_options[] = array( "name" => " ", "desc" => __("Tag Line top padding","builder"), "id" => "tag_line_padding_top", "std" => "20", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("Tag Line bottom padding","builder"), "id" => "tag_line_padding_bottom", "std" => "20", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("Tag Line bottom margin","builder"), "id" => "main_content_margin_top", "std" => "30", "type" => "text"); $of_options[] = array( "name" => __("BACKGROUND PATTERNS","builder"), "desc" => __("Select a background pattern ( Choose first image to show only background color )","builder"), "id" => "tag_line_custom_bg", "std" => $bg_images_url."1_px.png", "type" => "tiles", "options" => $bg_images, ); /* Page Sidebar */ $of_options[] = array( "name" => __("Page Sidebar","builder"), "type" => "heading"); $of_options[] = array( "name" => __("PAGE SIDEBAR","builder"), "desc" => __("How many sidebars do you want?","builder"), "id" => "page_sidebar_generator", "std" => "8", "type" => "text"); $of_options[] = array( "name" => __("SIDEBAR AREA SETTINGS","builder"), "desc" => __("Pick a color for the widget background","builder"), "id" => "page_sidebar_bg_color", "std" => "", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Border radius value","builder"), "id" => "page_sidebar_border_radius", "std" => "0", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("Select a background pattern ( Choose first image to show only background color )","builder"), "id" => "page_sidebar_bg_image", "std" => $bg_images_url."1_px.png", "type" => "tiles", "options" => $bg_images, ); $of_options[] = array( "name" => __("WIDGET SETTINGS","builder"), "desc" => __("Pick a color for the widget background","builder"), "id" => "page_sidebar_widget_bg_color", "std" => "#f9f9f9", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for the widget border","builder"), "id" => "page_sidebar_widget_border_color", "std" => "#f1f1f1", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Border radius value","builder"), "id" => "page_sidebar_widget_border_radius", "std" => "4", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("Select a background pattern ( Choose first image to show only background color )","builder"), "id" => "page_sidebar_widget_bg_image", "std" => $bg_images_url."1_px.png", "type" => "tiles", "options" => $bg_images, ); $of_options[] = array( "name" => " ", "desc" => __("Pick a color for the widget header","builder"), "id" => "page_sidebar_widget_header_color", "std" => "#333333", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for 'separator' after widget header","builder"), "id" => "page_sidebar_widget_hr", "std" => "#ededed", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for the widget text","builder"), "id" => "page_sidebar_widget_text_color", "std" => "#666666", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for the widget links","builder"), "id" => "page_sidebar_widget_links_color", "std" => "#333333", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for the widget links on hover","builder"), "id" => "page_sidebar_widget_links_color_hover", "std" => "#AEC71E", "type" => "color"); /* Portfolio */ $of_options[] = array( "name" => __("Portfolio","builder"), "type" => "heading"); $of_options[] = array( "name" => __("CHOOSE PORTFOLIO STYLE","builder"), "desc" => "", "id" => "sl_portfolio_style", "std" => "1", "type" => "select", "options" => $of_portfolio_style); $of_options[] = array("name" => "", "desc" => __("Amount of projects on one page","builder"), "id" => "sl_portfolio_projects", "std" => "10", "type" => "text"); $of_options[] = array( "name" => __("FILTER BUTTONS SETTINGS","builder"), "desc" => __("Vertical padding amount","builder"), "id" => "portfolio_filter_padding_v", "std" => "4", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("Horizontal padding amount","builder"), "id" => "portfolio_filter_padding_h", "std" => "8", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("Right margin amount","builder"), "id" => "portfolio_filter_margin", "std" => "3", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for buttons background","builder"), "id" => "portfolio_filter_bg_color", "std" => "#3a3a3a", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for buttons border","builder"), "id" => "portfolio_filter_border_color", "std" => "#3a3a3a", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for buttons text","builder"), "id" => "portfolio_filter_text_color", "std" => "#ffffff", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for text shadow","builder"), "id" => "portfolio_filter_text_shadow", "std" => "#111111", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Font size","builder"), "id" => "portfolio_filter_text_size", "std" => "11", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("Border radius amount","builder"), "id" => "portfolio_filter_border_radius", "std" => "0", "type" => "text"); $of_options[] = array( "name" => " ", "desc" => __("Pick a color for buttons background when hover","builder"), "id" => "portfolio_filter_bg_color_hover", "std" => "#AEC71E", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for buttons text when hover","builder"), "id" => "portfolio_filter_text_color_hover", "std" => "#ffffff", "type" => "color"); $of_options[] = array( "name" => __("IMAGE HOVER EFFECTS (RGBA)","builder"), "desc" => __("First rgba value (red color)","builder"), "id" => "portfolio_image_bg_1", "std" => "0", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("Second rgba value (green color)","builder"), "id" => "portfolio_image_bg_2", "std" => "0", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("Third rgba value (blue color)","builder"), "id" => "portfolio_image_bg_3", "std" => "0", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("Fourth rgba value (opacity)","builder"), "id" => "portfolio_image_bg_op", "std" => "0.15", "type" => "text"); $of_options[] = array( "name" => __("ZOOM AND LINK ICONS SETTINGS","builder"), "desc" => __("Choose Icons for image hover","builder"), "id" => "portfolio_image_hover_icons", "std" => "1", "type" => "select", "options" => $of_blog_image_hover_icons); $of_options[] = array( "name" => "", "desc" => __("Upload Link icon","builder"), "id" => "portfolio_image_icons_link", "std" => "http://www.orange-idea.com/assets/builder/link.png", "type" => "media"); $of_options[] = array( "name" => "", "desc" => __("Upload Zoom icon","builder"), "id" => "portfolio_image_icons_zoom", "std" => "http://www.orange-idea.com/assets/builder/zoom.png", "type" => "media"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for the icons background","builder"), "id" => "portfolio_image_icons_bg", "std" => "#000000", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for the icons background when hover","builder"), "id" => "portfolio_image_icons_bg_hover", "std" => "#AEC71E", "type" => "color"); $of_options[] = array( "name" => __("SMALL DESCRIPTIOS SETTINGS","builder"), "desc" => "Show small description?", "id" => "portfolio_descr_show", "std" => 1, "folds" => 1, "type" => "checkbox"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for the background","builder"), "id" => "portfolio_descr_bg_color", "std" => "#f9f9f9", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for the border","builder"), "id" => "portfolio_descr_border_color", "std" => "#ededed", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Select a background pattern ( Choose first image to show only background color )","builder"), "id" => "portfolio_descr_bg_image", "std" => $bg_images_url."1_px.png", "type" => "tiles", "options" => $bg_images, ); $of_options[] = array( "name" => " ", "desc" => __("Pick a color for the links","builder"), "id" => "portfolio_descr_links_color", "std" => "#AEC71E", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for the links when hover","builder"), "id" => "portfolio_descr_links_color_hover", "std" => "#000000", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Show small description?","builder"), "id" => "portfolio_descr_clo_text", "std" => 1, "folds" => 1, "type" => "checkbox"); $of_options[] = array( "name" => "", "desc" => __("Pick a color small description","builder"), "id" => "portfolio_descr_text_color", "std" => "#747474", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Small description font size","builder"), "id" => "portfolio_descr_text_size", "std" => "11", "type" => "text"); /* Portfolio Post */ $of_options[] = array( "name" => __("Portfolio Post","builder"), "type" => "heading"); $of_options[] = array( "name" => __("CHOOSE DETAILS PAGE STYLE","builder"), "desc" => "", "id" => "sl_portfolio_details_style", "std" => "1", "type" => "select", "options" => $of_portfolio_details_style); ; $of_options[] = array( "name" => __("DESCRIPTION SETTINGS","builder"), "desc" => __("Show 'Next post and Previous post' pagination?","builder"), "id" => "portfolio_details_pagination", "std" => 1, "folds" => 1, "type" => "checkbox"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for the 'Next post and Previous post","builder"), "id" => "portfolio_post_show_posts_meta_color", "std" => "#3a3a3a", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for the 'Next post and Previous post color when hover","builder"), "id" => "portfolio_post_show_posts_meta_color_hover", "std" => "#AEC71E", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Padding value","builder"), "id" => "portfolio_post_item_description_padding", "std" => "20", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for background","builder"), "id" => "portfolio_post_item_description_bg_color", "std" => "#f9f9f9", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for text","builder"), "id" => "portfolio_post_item_description_text_color", "std" => "#747474", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for border","builder"), "id" => "portfolio_post_item_description_border_color", "std" => "#ededed", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Select a background pattern ( Choose first image to show only background color )","builder"), "id" => "portfolio_post_item_description_bg_image", "std" => $bg_images_url."1_px.png", "type" => "tiles", "options" => $bg_images, ); /* Portfolio Sidebar */ $of_options[] = array( "name" => __("Portfolio Sidebar","builder"), "type" => "heading"); $of_options[] = array( "name" => __("CHOOSE SIDEBAR POSITION","builder"), "desc" => "", "id" => "portfolio_sidebar_position", "std" => "1", "type" => "select", "options" => $of_portfolio_sidebar); $of_options[] = array( "name" => __("SIDEBAR AREA SETTINGS","builder"), "desc" => "Pick a color for the widget background", "id" => "portfolio_sidebar_bg_color", "std" => "", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Border radius value","builder"), "id" => "portfolio_sidebar_border_radius", "std" => "0", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("Select a background pattern ( Choose first image to show only background color )","builder"), "id" => "portfolio_sidebar_bg_image", "std" => $bg_images_url."1_px.png", "type" => "tiles", "options" => $bg_images, ); $of_options[] = array( "name" => __("WIDGET SETTINGS","builder"), "desc" => __("Pick a color for the widget background","builder"), "id" => "portfolio_sidebar_widget_bg_color", "std" => "#f9f9f9", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for the widget border","builder"), "id" => "portfolio_sidebar_widget_border_color", "std" => "#f1f1f1", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Border radius value","builder"), "id" => "portfolio_sidebar_widget_border_radius", "std" => "4", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("Select a background pattern ( Choose first image to show only background color )","builder"), "id" => "portfolio_sidebar_widget_bg_image", "std" => $bg_images_url."1_px.png", "type" => "tiles", "options" => $bg_images, ); $of_options[] = array( "name" => " ", "desc" => __("Pick a color for the widget header","builder"), "id" => "portfolio_sidebar_widget_header_color", "std" => "#333333", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for 'separator' after widget header","builder"), "id" => "portfolio_sidebar_widget_hr", "std" => "#ededed", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for the widget text","builder"), "id" => "portfolio_sidebar_widget_text_color", "std" => "#666666", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for the widget links","builder"), "id" => "portfolio_sidebar_widget_links_color", "std" => "#333333", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for the widget links on hover","builder"), "id" => "portfolio_sidebar_widget_links_color_hover", "std" => "#AEC71E", "type" => "color"); /* Blog Settings */ $of_options[] = array( "name" => __("Blog","builder"), "type" => "heading"); $of_options[] = array( "name" => __("CHOOSE BLOG STYLE","builder"), "desc" => "", "id" => "sl_blog_style", "std" => "1", "type" => "select", "options" => $of_blog_style); $of_options[] = array( "name" => __("DATE SETTINGS","builder"), "desc" => __("Show Posts Date?","builder"), "id" => "blog_show_posts_date", "std" => 1, "folds" => 1, "type" => "checkbox"); $of_options[] = array( "name" => "", "desc" => __("Choose Date Format","builder"), "id" => "blog_date_format", "std" => "1", "type" => "select", "options" => $of_blog_date_format); $of_options[] = array( "name" => "", "desc" => __("Show Date Icon?","builder"), "id" => "blog_show_date_icon", "std" => 1, "folds" => 1, "type" => "checkbox"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for the Blog date background","builder"), "id" => "blog_date_bg", "std" => "#3a3a3a", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for the Blog date text","builder"), "id" => "blog_date_color", "std" => "#ffffff", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for the Blog date text shadow","builder"), "id" => "blog_date_text_shadow", "std" => "#000000", "type" => "color"); $of_options[] = array("name" => "", "desc" => __("Past the value for border radius","builder"), "id" => "blog_date_border_radius", "std" => "0", "type" => "text"); $of_options[] = array( "name" => __("META TAGS SETTINGS","builder"), "desc" => __("Show Post Author?","builder"), "id" => "blog_show_posts_meta_author", "std" => 1, "folds" => 1, "type" => "checkbox"); $of_options[] = array( "name" => "", "desc" => __("Show Post Category?","builder"), "id" => "blog_show_posts_meta_category", "std" => 1, "folds" => 1, "type" => "checkbox"); $of_options[] = array( "name" => "", "desc" => __("Show Post Comments?","builder"), "id" => "blog_show_posts_meta_comments", "std" => 1, "folds" => 1, "type" => "checkbox"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for the Blog meta color","builder"), "id" => "blog_show_posts_meta_color", "std" => "#3a3a3a", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for the Blog meta color when hover","builder"), "id" => "blog_show_posts_meta_color_hover", "std" => "#AEC71E", "type" => "color"); $of_options[] = array( "name" => __("IMAGE HOVER EFFECTS (RGBA)","builder"), "desc" => __("First rgba value (red color)","builder"), "id" => "blog_image_bg_1", "std" => "0", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("Second rgba value (green color)","builder"), "id" => "blog_image_bg_2", "std" => "0", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("Third rgba value (blue color)","builder"), "id" => "blog_image_bg_3", "std" => "0", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("Fourth rgba value (opacity)","builder"), "id" => "blog_image_bg_op", "std" => "0.15", "type" => "text"); $of_options[] = array( "name" => __("ZOOM AND LINK ICONS SETTINGS","builder"), "desc" => __("Choose Icons for image hover","builder"), "id" => "blog_image_hover_icons", "std" => "1", "type" => "select", "options" => $of_blog_image_hover_icons); $of_options[] = array( "name" => "", "desc" => __("Upload Link icon","builder"), "id" => "blog_image_icons_link", "std" => "http://www.orange-idea.com/assets/builder/link.png", "type" => "media"); $of_options[] = array( "name" => "", "desc" => __("Upload Zoom icon","builder"), "id" => "blog_image_icons_zoom", "std" => "http://www.orange-idea.com/assets/builder/zoom.png", "type" => "media"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for the icons background","builder"), "id" => "blog_image_icons_bg", "std" => "#000000", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for the icons background when hover","builder"), "id" => "blog_image_icons_bg_hover", "std" => "#AEC71E", "type" => "color"); $of_options[] = array( "name" => __("POST PREVIEW SETTINGS","builder"), "desc" => __("Pick a color for text","builder"), "id" => "blog_item_description_text_color", "std" => "#747474", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Padding value","builder"), "id" => "blog_item_description_padding", "std" => "20", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for background","builder"), "id" => "blog_item_description_bg_color", "std" => "#f9f9f9", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for border","builder"), "id" => "blog_item_description_border_color", "std" => "#ededed", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Select a background pattern ( Choose first image to show only background color )","builder"), "id" => "blog_item_description_bg_image", "std" => $bg_images_url."1_px.png", "type" => "tiles", "options" => $bg_images, ); $of_options[] = array( "name" => __("BLOG ARCHIVE","builder"), "desc" => __("Show Featured Images In Blog Archive?","builder"), "id" => "blog_archive_show_imges", "std" => 1, "folds" => 1, "type" => "checkbox"); $of_options[] = array( "name" => "", "desc" => __("'Blog Archive' page title","builder"), "id" => "blog_archive_title", "std" => "Blog Archive", "type" => "text"); /* Blog Post */ $of_options[] = array( "name" => __("Blog Post","builder"), "type" => "heading"); $of_options[] = array( "name" => __("FEATURED IMAGE SETTINGS","builder"), "desc" => __("Show Featured Image?","builder"), "id" => "blog_post_show_featured_image", "std" => 1, "folds" => 1, "type" => "checkbox"); $of_options[] = array( "name" => __("META TAGS SETTINGS","builder"), "desc" => __("Show Post Title?","builder"), "id" => "blog_post_show_posts_meta_title", "std" => 1, "folds" => 1, "type" => "checkbox"); $of_options[] = array( "name" => "", "desc" => __("Show Post Author?","builder"), "id" => "blog_post_show_posts_meta_author", "std" => 1, "folds" => 1, "type" => "checkbox"); $of_options[] = array( "name" => "", "desc" => __("Show Post Category?","builder"), "id" => "blog_post_show_posts_meta_category", "std" => 1, "folds" => 1, "type" => "checkbox"); $of_options[] = array( "name" => "", "desc" => __("Show Post Comments?","builder"), "id" => "blog_post_show_posts_meta_comments", "std" => 1, "folds" => 1, "type" => "checkbox"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for the Blog meta color","builder"), "id" => "blog_post_show_posts_meta_color", "std" => "#b7b7b7", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for the Blog meta color when hover","builder"), "id" => "blog_post_show_posts_meta_color_hover", "std" => "#AEC71E", "type" => "color"); $of_options[] = array( "name" => __("POST SETTINGS","builder"), "desc" => "Padding value", "id" => "blog_post_item_description_padding", "std" => "20", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for background","builder"), "id" => "blog_post_item_description_bg_color", "std" => "#f9f9f9", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for text","builder"), "id" => "blog_post_item_description_text_color", "std" => "#747474", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for border","builder"), "id" => "blog_post_item_description_border_color", "std" => "#ededed", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Select a background pattern ( Choose first image to show only background color )","builder"), "id" => "blog_post_item_description_bg_image", "std" => $bg_images_url."1_px.png", "type" => "tiles", "options" => $bg_images, ); $of_options[] = array( "name" => __("SHARE OPTIONS","builder"), "desc" => "Show 'Share This' button?", "id" => "blog_post_show_share_button", "std" => 0, "folds" => 1, "type" => "checkbox"); $of_options[] = array( "name" => "", "desc" => __("'Share' text","builder"), "id" => "blog_post_show_share_button_text", "std" => "Share This Story:", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("Padding value","builder"), "id" => "blog_share_padding", "std" => "7", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for Background","builder"), "id" => "blog_share_bg_color", "std" => "#ededed", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for text","builder"), "id" => "blog_share_text_color", "std" => "#3d3d3d", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Select a background pattern ( Choose first image to show only background color )","builder"), "id" => "blog_share_bg_image", "std" => $bg_images_url."1_px.png", "type" => "tiles", "options" => $bg_images, ); $of_options[] = array( "name" => __("ABOUT AUTHOR OPTIONS","builder"), "desc" => __("Show 'About Author'?","builder"), "id" => "blog_post_show_author", "std" => 1, "folds" => 1, "type" => "checkbox"); $of_options[] = array( "name" => "", "desc" => __("Upload your avatar","builder"), "id" => "blog_post_show_author_avatar", "std" => "http://1.s3.envato.com/files/31496845/oi-80.jpg", "type" => "media"); $of_options[] = array( "name" => "", "desc" => __("Header text","builder"), "id" => "blog_post_show_author_header", "std" => "About The Author", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("Padding value","builder"), "id" => "blog_author_item_description_padding", "std" => "20", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for text","builder"), "id" => "blog_author_item_description_text_color", "std" => "#747474", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for background","builder"), "id" => "blog_author_item_description_bg_color", "std" => "#f9f9f9", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for border","builder"), "id" => "blog_author_item_description_border_color", "std" => "#ededed", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Select a background pattern ( Choose first image to show only background color )","builder"), "id" => "blog_author_item_description_bg_image", "std" => $bg_images_url."1_px.png", "type" => "tiles", "options" => $bg_images, ); $of_options[] = array( "name" => __("COMMENTS OPTIONS","builder"), "desc" => __("Show 'comments'?","builder"), "id" => "blog_post_show_comments", "std" => 1, "folds" => 1, "type" => "checkbox"); $of_options[] = array( "name" => "", "desc" => __("Left padding value","builder"), "id" => "blog_comments_padding", "std" => "20", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for MAIN LEFT border","builder"), "id" => "blog_comments_border_color", "std" => "#ededed", "type" => "color"); $of_options[] = array( "name" => " ", "desc" => __("Left padding value","builder"), "id" => "blog_comments_li_padding", "std" => "20", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for comments border","builder"), "id" => "blog_comments_border_color", "std" => "#ededed", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for comments background","builder"), "id" => "blog_comments_bg_color", "std" => "#f9f9f9", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for text","builder"), "id" => "blog_comments_text_color", "std" => "#747474", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Select a background pattern ( Choose first image to show only background color )","builder"), "id" => "blog_comments_bg_image", "std" => $bg_images_url."1_px.png", "type" => "tiles", "options" => $bg_images, ); /* Blog Sidebar */ $of_options[] = array( "name" => __("Blog Sidebar","builder"), "type" => "heading"); $of_options[] = array( "name" => __("CHOOSE SIDEBAR POSITION","builder"), "desc" => "", "id" => "blog_sidebar_position", "std" => "1", "type" => "select", "options" => $of_blog_sidebar); $of_options[] = array( "name" => __("SIDEBAR AREA SETTINGS","builder"), "desc" => __("Pick a color for the widget background","builder"), "id" => "blog_sidebar_bg_color", "std" => "", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Border radius value","builder"), "id" => "blog_sidebar_border_radius", "std" => "0", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("Select a background pattern ( Choose first image to show only background color )","builder"), "id" => "blog_sidebar_bg_image", "std" => $bg_images_url."1_px.png", "type" => "tiles", "options" => $bg_images, ); $of_options[] = array( "name" => __("WIDGET SETTINGS","builder"), "desc" => __("Pick a color for the widget background","builder"), "id" => "blog_sidebar_widget_bg_color", "std" => "#f6f6f6", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for the widget border","builder"), "id" => "blog_sidebar_widget_border_color", "std" => "#f1f1f1", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Border radius value","builder"), "id" => "blog_sidebar_widget_border_radius", "std" => "0", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("Select a background pattern ( Choose first image to show only background color )","builder"), "id" => "blog_sidebar_widget_bg_image", "std" => $bg_images_url."1_px.png", "type" => "tiles", "options" => $bg_images, ); $of_options[] = array( "name" => " ", "desc" => __("Pick a color for the widget header","builder"), "id" => "blog_sidebar_widget_header_color", "std" => "#333333", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for 'separator' after widget header","builder"), "id" => "blog_sidebar_widget_hr", "std" => "#ededed", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for the widget text","builder"), "id" => "blog_sidebar_widget_text_color", "std" => "#666666", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for the widget links","builder"), "id" => "blog_sidebar_widget_links_color", "std" => "#333333", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for the widget links on hover","builder"), "id" => "blog_sidebar_widget_links_color_hover", "std" => "#AEC71E", "type" => "color"); /* Pagination */ $of_options[] = array( "name" => __("Pagination","builder"), "type" => "heading"); $of_options[] = array( "name" => __("PAGINATION SETTINGS","builder"), "desc" => __("Pick a color for the element background","builder"), "id" => "pagination_bg_color", "std" => "#3a3a3a", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for the element text","builder"), "id" => "pagination_text_color", "std" => "#ffffff", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for the element text shadow","builder"), "id" => "pagination_text_shadow", "std" => "#222222", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Vertical padding value","builder"), "id" => "pagination_padding_v", "std" => "4", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("Horizontal padding value","builder"), "id" => "pagination_padding_h", "std" => "10", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("Horizontal padding value","builder"), "id" => "pagination_border_radius", "std" => "0", "type" => "text"); $of_options[] = array( "name" => " ", "desc" => __("Pick a color for the current and hover elements background","builder"), "id" => "pagination_hover_bg_color", "std" => "#AEC71E", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for the current and hover elements text","builder"), "id" => "pagination_hover_text_color", "std" => "#ffffff", "type" => "color"); $of_options[] = array( "name" => " ", "desc" => __("Select a background pattern ( Choose first image to show only background color )","builder"), "id" => "pagination_bg_image", "std" => $bg_images_url."1_px.png", "type" => "tiles", "options" => $bg_images, ); //Footer $of_options[] = array( "name" => __("Footer","builder"), "type" => "heading"); $of_options[] = array( "name" => __("TWITTER FEED SETTINGS","builder"), "desc" => __("Show Twitter Feed?","builder"), "id" => "show_twitter_feed", "std" => 1, "folds" => 1, "type" => "checkbox"); $of_options[] = array( "name" => "", "desc" => __("Text for Header","builder"), "id" => "footer_social_tw_header", "std" => "Twitter Feed", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("Description","builder"), "id" => "footer_social_tw_descr", "std" => "Find out what's happening, right now, with the people and organizations you care about.", "type" => "textarea"); //Twitter settings $of_options[] = array( "name" => __("TWITTER SETTINGS","builder"), "desc" => __("Twitter username","builder"), "id" => "TW_USERNAME", "std" => "", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("Number of Tweets","builder"), "id" => "TW_NUMBER", "std" => "", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("CONSUMER_KEY","builder"), "id" => "TW_CONSUMER_KEY", "std" => "", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("CONSUMER_SECRET","builder"), "id" => "TW_CONSUMER_SECRET", "std" => "", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("OAUTH_TOKEN","builder"), "id" => "TW_OAUTH_TOKEN", "std" => "", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("OAUTH_SECRET","builder"), "id" => "TW_OAUTH_SECRET", "std" => "", "type" => "text"); $of_options[] = array( "name" => __("FOOTER LOGO","builder"), "desc" => __("Upload your logo for footer","builder"), "id" => "footer_logo", "std" => "http://www.orange-idea.com/assets/builder/logo-footer.png", "type" => "media"); $of_options[] = array( "name" => __("SOCIAL ICONS","builder"), "desc" => __("Twitter","builder"), "id" => "footer_social_tw", "std" => "http://twitter.com/", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("Facebook","builder"), "id" => "footer_social_fb", "std" => "https://facebook.com/", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("Google +","builder"), "id" => "footer_social_g", "std" => "http://plus.google.com/", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("Dribbble","builder"), "id" => "footer_social_dr", "std" => "http://dribbble.com/", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("Flickr","builder"), "id" => "footer_social_fl", "std" => "http://flickr.com/", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("YouTube","builder"), "id" => "footer_social_yt", "std" => "http://youtube.com/", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("Linkedin","builder"), "id" => "footer_social_in", "std" => "http://linkedin.com/", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("Pinterest","builder"), "id" => "footer_social_pi", "std" => "http://pinterest.com/", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("Skype","builder"), "id" => "footer_social_skype", "std" => "http://www.skype.com/", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("MySpace","builder"), "id" => "footer_social_myspace", "std" => "http://myspace.com/", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("ICQ","builder"), "id" => "footer_social_icq", "std" => "http://www.icq.com/", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("Envato","builder"), "id" => "footer_social_envato", "std" => "http://envato.com/", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("Bing","builder"), "id" => "footer_social_bing", "std" => "http://www.bing.com/", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("Forrst","builder"), "id" => "footer_social_forrst", "std" => "http://forrst.com/", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("DeviantArt","builder"), "id" => "footer_social_da", "std" => "http://deviantart.com/", "type" => "text"); $of_options[] = array( "name" => __("FOOTER SETTINGS","builder"), "desc" => __("Pick a color for the footer background","builder"), "id" => "footer_bg_color", "std" => "#303030", "type" => "color"); $of_options[] = array( "name" => " ", "desc" => __("Select a footer background pattern ( Choose first image to show only background color )","builder"), "id" => "footer_bg_image", "std" => $bg_images_url."1_px.png", "type" => "tiles", "options" => $bg_images, ); $of_options[] = array( "name" => " ", "desc" => __("Footer top margin","builder"), "id" => "footer_margin_top", "std" => "0", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("Footer top padding","builder"), "id" => "footer_padding_top", "std" => "40", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("Footer bottom padding","builder"), "id" => "footer_padding_bottom", "std" => "10", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("Footer top bodrer value","builder"), "id" => "footer_border_value", "std" => "1", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for the footer top border","builder"), "id" => "footer_border_color", "std" => "#444444", "type" => "color"); $of_options[] = array( "name" => " ", "desc" => __("Pick a color for the footer headers","builder"), "id" => "footer_text_header_color", "std" => "#ffffff", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for the lines after headers","builder"), "id" => "footer_hr_color", "std" => "#444444", "type" => "color"); $of_options[] = array( "name" => " ", "desc" => __("Pick a color for the footer text","builder"), "id" => "footer_text_color", "std" => "#a8a8a8", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for the footer strong text elements","builder"), "id" => "footer_text_strong_color", "std" => "#ffffff", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for the footer small text elements","builder"), "id" => "footer_text_small_color", "std" => "#666666", "type" => "color"); $of_options[] = array( "name" => " ", "desc" => __("Pick a color for the footer links","builder"), "id" => "footer_text_a_color", "std" => "#a8a8a8", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for the footer hovered links","builder"), "id" => "footer_text_a_hover_color", "std" => "#ffffff", "type" => "color"); // Bottom Line $of_options[] = array( "name" => __("Bottom Line","builder"), "type" => "heading"); $of_options[] = array( "name" => __("Show/Hide Bottom Line","builder"), "desc" => __("Show Bottom Line?","builder"), "id" => "bottom_line_show", "std" => 1, "folds" => 1, "type" => "checkbox"); $of_options[] = array( "name" => __("BOTTOM LINE BACKGROND","builder"), "desc" => __("Pick a color for the 'Bottom Line' area background","builder"), "id" => "theme_colors_bottom_line", "std" => "#3a3a3a", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Pick a image for the 'Bottom Line' area background ( Choose first image to show only background color )","builder"), "id" => "theme_colors_bottom_line_bg_image", "std" => $bg_images_url."1_px.png", "type" => "tiles", "options" => $bg_images, ); $of_options[] = array( "name" => __("BOTTOM LINE TEXT","builder"), "desc" => __("Past your text or HTML","builder"), "id" => "bottom_line_text", "std" => "Copyright 2012 Builder - Company. Design by <a href='http://themeforest.net/user/OrangeIdea?ref=OrangeIdea'>OrangeIdea</a>", "type" => "text"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for the Bottom Line text","builder"), "id" => "theme_colors_bottom_line_text", "std" => "#FFFFFF", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for the Bottom Line links","builder"), "id" => "theme_colors_bottom_line_a", "std" => "#FFFFFF", "type" => "color"); $of_options[] = array( "name" => "", "desc" => __("Pick a color for the Top Line mouse over links","builder"), "id" => "theme_colors_bottom_line_a_hover", "std" => "#FFFFFF", "type" => "color"); // Backup Options $of_options[] = array( "name" => __("Backup Options","builder"), "type" => "heading"); $of_options[] = array( "name" => __("Backup and Restore Options","builder"), "id" => "of_backup", "std" => "", "type" => "backup", "desc" => __("You can use the two buttons below to backup your current options, and then restore it back at a later time. This is useful if you want to experiment on the options but would like to keep the old settings in case you need it back.","builder"), ); $of_options[] = array( "name" => __("Transfer Theme Options Data","builder"), "id" => "theme_update", "std" => "", "type" => "transfer", "desc" => __("You can tranfer the saved options data between different installs by copying the text inside the text box. To import data from another install, replace the data in the text box with the one from another install and click 'Import Options'","builder")); } } ?>
gpl-2.0
guoxiao/terminator-gtk3
terminatorlib/optionparse.py
6818
#!/usr/bin/python # Terminator.optionparse - Parse commandline options # Copyright (C) 2006-2010 cmsj@tenshu.net # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, version 2 only. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA """Terminator.optionparse - Parse commandline options""" import sys import os from optparse import OptionParser, SUPPRESS_HELP from util import dbg, err import util import config import version from translation import _ options = None def execute_cb(option, opt, value, lparser): """Callback for use in parsing execute options""" assert value is None value = [] while lparser.rargs: arg = lparser.rargs[0] value.append(arg) del(lparser.rargs[0]) setattr(lparser.values, option.dest, value) def parse_options(): """Parse the command line options""" usage = "usage: %prog [options]" is_x_terminal_emulator = os.path.basename(sys.argv[0]) == 'x-terminal-emulator' parser = OptionParser(usage) parser.add_option('-v', '--version', action='store_true', dest='version', help=_('Display program version')) parser.add_option('-m', '--maximise', action='store_true', dest='maximise', help=_('Maximize the window')) parser.add_option('-f', '--fullscreen', action='store_true', dest='fullscreen', help=_('Make the window fill the screen')) parser.add_option('-b', '--borderless', action='store_true', dest='borderless', help=_('Disable window borders')) parser.add_option('-H', '--hidden', action='store_true', dest='hidden', help=_('Hide the window at startup')) parser.add_option('-T', '--title', dest='forcedtitle', help=_('Specify a title for the window')) parser.add_option('--geometry', dest='geometry', type='string', help=_('Set the preferred size and position of the window' '(see X man page)')) if not is_x_terminal_emulator: parser.add_option('-e', '--command', dest='command', help=_('Specify a command to execute inside the terminal')) else: parser.add_option('--command', dest='command', help=_('Specify a command to execute inside the terminal')) parser.add_option('-e', '--execute2', dest='execute', action='callback', callback=execute_cb, help=_('Use the rest of the command line as a command to ' 'execute inside the terminal, and its arguments')) parser.add_option('-g', '--config', dest='config', help=_('Specify a config file')) parser.add_option('-x', '--execute', dest='execute', action='callback', callback=execute_cb, help=_('Use the rest of the command line as a command to execute ' 'inside the terminal, and its arguments')) parser.add_option('--working-directory', metavar='DIR', dest='working_directory', help=_('Set the working directory')) parser.add_option('-c', '--classname', dest='classname', help=_('Set a \ custom name (WM_CLASS) property on the window')) parser.add_option('-i', '--icon', dest='forcedicon', help=_('Set a custom \ icon for the window (by file or name)')) parser.add_option('-r', '--role', dest='role', help=_('Set a custom WM_WINDOW_ROLE property on the window')) parser.add_option('-l', '--layout', dest='layout', help=_('Launch with the given layout')) parser.add_option('-s', '--select-layout', action='store_true', dest='select', help=_('Select a layout from a list')) parser.add_option('-p', '--profile', dest='profile', help=_('Use a different profile as the default')) parser.add_option('-u', '--no-dbus', action='store_true', dest='nodbus', help=_('Disable DBus')) parser.add_option('-d', '--debug', action='count', dest='debug', help=_('Enable debugging information (twice for debug server)')) parser.add_option('--debug-classes', action='store', dest='debug_classes', help=_('Comma separated list of classes to limit debugging to')) parser.add_option('--debug-methods', action='store', dest='debug_methods', help=_('Comma separated list of methods to limit debugging to')) parser.add_option('--new-tab', action='store_true', dest='new_tab', help=_('If Terminator is already running, just open a new tab')) for item in ['--sm-client-id', '--sm-config-prefix', '--screen', '-n', '--no-gconf' ]: parser.add_option(item, dest='dummy', action='store', help=SUPPRESS_HELP) global options (options, args) = parser.parse_args() if len(args) != 0: parser.error('Additional unexpected arguments found: %s' % args) if options.version: print '%s %s' % (version.APP_NAME, version.APP_VERSION) sys.exit(0) if options.debug_classes or options.debug_methods: if not options.debug > 0: options.debug = 1 if options.debug: util.DEBUG = True if options.debug > 1: util.DEBUGFILES = True if options.debug_classes: classes = options.debug_classes.split(',') for item in classes: util.DEBUGCLASSES.append(item.strip()) if options.debug_methods: methods = options.debug_methods.split(',') for item in methods: util.DEBUGMETHODS.append(item.strip()) if options.working_directory: if os.path.exists(os.path.expanduser(options.working_directory)): os.chdir(os.path.expanduser(options.working_directory)) else: err('OptionParse::parse_options: %s does not exist' % options.working_directory) options.working_directory = '' if options.layout is None: options.layout = 'default' configobj = config.Config() if options.profile and options.profile not in configobj.list_profiles(): options.profile = None configobj.options_set(options) if util.DEBUG == True: dbg('OptionParse::parse_options: command line options: %s' % options) return(options)
gpl-2.0
amarlearning/teammates
src/e2e/java/teammates/e2e/cases/InstructorCourseStudentDetailsPageE2ETest.java
2088
package teammates.e2e.cases; import org.testng.annotations.Test; import teammates.common.datatransfer.attributes.StudentAttributes; import teammates.common.datatransfer.attributes.StudentProfileAttributes; import teammates.common.util.AppUrl; import teammates.common.util.Const; import teammates.e2e.pageobjects.AppPage; import teammates.e2e.pageobjects.InstructorCourseStudentDetailsViewPage; /** * SUT: {@link Const.WebPageURIs#INSTRUCTOR_COURSE_STUDENT_DETAILS_PAGE}. */ public class InstructorCourseStudentDetailsPageE2ETest extends BaseE2ETestCase { @Override protected void prepareTestData() { testData = loadDataBundle("/InstructorCourseStudentDetailsPageE2ETest.json"); removeAndRestoreDataBundle(testData); } @Test @Override public void testAll() { ______TS("verify loaded details - student with profile"); StudentAttributes student = testData.students.get("ICSDet.jose.tmms"); StudentProfileAttributes studentProfile = testData.profiles.get("ICSDet.jose.tmms"); AppUrl viewPageUrl = getStudentDetailsViewPageUrl(student.getEmail()); InstructorCourseStudentDetailsViewPage viewPage = loginAdminToPage(viewPageUrl, InstructorCourseStudentDetailsViewPage.class); viewPage.verifyStudentDetails(studentProfile, student); ______TS("verify loaded details - student without profile"); student = testData.students.get("ICSDet.benny.c"); viewPageUrl = getStudentDetailsViewPageUrl(student.getEmail()); viewPage = AppPage.getNewPageInstance(browser, viewPageUrl, InstructorCourseStudentDetailsViewPage.class); viewPage.verifyStudentDetails(null, student); } private AppUrl getStudentDetailsViewPageUrl(String studentEmail) { return createUrl(Const.WebPageURIs.INSTRUCTOR_COURSE_STUDENT_DETAILS_PAGE) .withUserId(testData.instructors.get("ICSDet.instr").getGoogleId()) .withCourseId(testData.courses.get("ICSDet.CS2104").getId()) .withStudentEmail(studentEmail); } }
gpl-2.0
DanEEStar/wiki
inc/subscription.php
13420
<?php /** * Utilities for handling (email) subscriptions * * The public interface of this file consists of the functions * - subscription_find * - subscription_send_digest * - subscription_send_list * - subscription_set * - get_info_subscribed * - subscription_addresslist * - subscription_lock * - subscription_unlock * * @author Adrian Lang <lang@cosmocode.de> * @license GPL 2 (http://www.gnu.org/licenses/gpl.html) */ /** * Get the name of the metafile tracking subscriptions to target page or * namespace * * @author Adrian Lang <lang@cosmocode.de> * * @param string $id The target page or namespace, specified by id; Namespaces * are identified by appending a colon. * @return string */ function subscription_filename($id) { $meta_fname = '.mlist'; if ((substr($id, -1, 1) === ':')) { $meta_froot = getNS($id); $meta_fname = '/' . $meta_fname; } else { $meta_froot = $id; } return metaFN((string) $meta_froot, $meta_fname); } /** * Lock subscription info for an ID * * @author Adrian Lang <lang@cosmocode.de> * @param string $id The target page or namespace, specified by id; Namespaces * are identified by appending a colon. * @return string */ function subscription_lock_filename ($id){ global $conf; return $conf['lockdir'].'/_subscr_' . md5($id) . '.lock'; } /** * Creates a lock file for writing subscription data * * @todo add lock time parameter to io_lock() and use this instead * @param $id * @return bool */ function subscription_lock($id) { global $conf; $lock = subscription_lock_filename($id); if (is_dir($lock) && time()-@filemtime($lock) > 60*5) { // looks like a stale lock - remove it @rmdir($lock); } // try creating the lock directory if (!@mkdir($lock,$conf['dmode'])) { return false; } if($conf['dperm']) chmod($lock, $conf['dperm']); return true; } /** * Unlock subscription info for an ID * * @author Adrian Lang <lang@cosmocode.de> * @param string $id The target page or namespace, specified by id; Namespaces * are identified by appending a colon. * @return bool */ function subscription_unlock($id) { $lockf = subscription_lock_filename($id); return @rmdir($lockf); } /** * Set subscription information * * Allows to set subscription information for permanent storage in meta files. * Subscriptions consist of a target object, a subscribing user, a subscribe * style and optional data. * A subscription may be deleted by specifying an empty subscribe style. * Only one subscription per target and user is allowed. * The function returns false on error, otherwise true. Note that no error is * returned if a subscription should be deleted but the user is not subscribed * and the subscription meta file exists. * * @author Adrian Lang <lang@cosmocode.de> * * @param string $user The subscriber or unsubscriber * @param string $page The target object (page or namespace), specified by * id; Namespaces are identified by a trailing colon. * @param string $style The subscribe style; DokuWiki currently implements * “every”, “digest”, and “list”. * @param string $data An optional data blob * @param bool $overwrite Whether an existing subscription may be overwritten * @return bool */ function subscription_set($user, $page, $style, $data = null, $overwrite = false) { global $lang; if (is_null($style)) { // Delete subscription. $file = subscription_filename($page); if (!@file_exists($file)) { msg(sprintf($lang['subscr_not_subscribed'], $user, prettyprint_id($page)), -1); return false; } // io_deleteFromFile does not return false if no line matched. return io_deleteFromFile($file, subscription_regex(array('user' => auth_nameencode($user))), true); } // Delete subscription if one exists and $overwrite is true. If $overwrite // is false, fail. $subs = subscription_find($page, array('user' => $user)); if (count($subs) > 0 && isset($subs[$page])) { if (!$overwrite) { msg(sprintf($lang['subscr_already_subscribed'], $user, prettyprint_id($page)), -1); return false; } // Fail if deletion failed, else continue. if (!subscription_set($user, $page, null)) { return false; } } $file = subscription_filename($page); $content = auth_nameencode($user) . ' ' . $style; if (!is_null($data)) { $content .= ' ' . $data; } return io_saveFile($file, $content . "\n", true); } /** * Recursively search for matching subscriptions * * This function searches all relevant subscription files for a page or * namespace. * * @author Adrian Lang <lang@cosmocode.de> * @see function subscription_regex for $pre documentation * * @param string $page The target object’s (namespace or page) id * @param array $pre A hash of predefined values * @return array */ function subscription_find($page, $pre) { // Construct list of files which may contain relevant subscriptions. $filenames = array(':' => subscription_filename(':')); do { $filenames[$page] = subscription_filename($page); $page = getNS(rtrim($page, ':')) . ':'; } while ($page !== ':'); // Handle files. $matches = array(); foreach ($filenames as $cur_page => $filename) { if (!@file_exists($filename)) { continue; } $subscriptions = file($filename); foreach ($subscriptions as $subscription) { if (strpos($subscription, ' ') === false) { // This is an old subscription file. $subscription = trim($subscription) . " every\n"; } list($user, $rest) = explode(' ', $subscription, 2); $subscription = rawurldecode($user) . " " . $rest; if (preg_match(subscription_regex($pre), $subscription, $line_matches) === 0) { continue; } $match = array_slice($line_matches, 1); if (!isset($matches[$cur_page])) { $matches[$cur_page] = array(); } $matches[$cur_page][] = $match; } } return array_reverse($matches); } /** * Get data for $INFO['subscribed'] * * $INFO['subscribed'] is either false if no subscription for the current page * and user is in effect. Else it contains an array of arrays with the fields * “target”, “style”, and optionally “data”. * * @author Adrian Lang <lang@cosmocode.de> */ function get_info_subscribed() { global $ID; global $conf; if (!$conf['subscribers']) { return false; } $subs = subscription_find($ID, array('user' => $_SERVER['REMOTE_USER'])); if (count($subs) === 0) { return false; } $_ret = array(); foreach ($subs as $target => $subs_data) { $new = array('target' => $target, 'style' => $subs_data[0][0]); if (count($subs_data[0]) > 1) { $new['data'] = $subs_data[0][1]; } $_ret[] = $new; } return $_ret; } /** * Construct a regular expression parsing a subscription definition line * * @author Adrian Lang <lang@cosmocode.de> * * @param array $pre A hash of predefined values; “user”, “style”, and * “data” may be set to limit the results to * subscriptions matching these parameters. If * “escaped” is true, these fields are inserted into the * regular expression without escaping. * * @return string complete regexp including delimiters */ function subscription_regex($pre = array()) { if (!isset($pre['escaped']) || $pre['escaped'] === false) { $pre = array_map('preg_quote_cb', $pre); } foreach (array('user', 'style', 'data') as $key) { if (!isset($pre[$key])) { $pre[$key] = '(\S+)'; } } return '/^' . $pre['user'] . '(?: ' . $pre['style'] . '(?: ' . $pre['data'] . ')?)?$/'; } /** * Return a string with the email addresses of all the * users subscribed to a page * * This is the default action for COMMON_NOTIFY_ADDRESSLIST. * * @author Steven Danz <steven-danz@kc.rr.com> * @author Adrian Lang <lang@cosmocode.de> * * @todo this does NOT return a string but uses a reference to write back, either fix function or docs * @param array $data Containing $id (the page id), $self (whether the author * should be notified, $addresslist (current email address * list) * @return string */ function subscription_addresslist(&$data){ global $conf; /** @var auth_basic $auth */ global $auth; $id = $data['id']; $self = $data['self']; $addresslist = $data['addresslist']; if (!$conf['subscribers'] || $auth === null) { return ''; } $pres = array('style' => 'every', 'escaped' => true); if (!$self && isset($_SERVER['REMOTE_USER'])) { $pres['user'] = '((?!' . preg_quote_cb($_SERVER['REMOTE_USER']) . '(?: |$))\S+)'; } $subs = subscription_find($id, $pres); $emails = array(); foreach ($subs as $by_targets) { foreach ($by_targets as $sub) { $info = $auth->getUserData($sub[0]); if ($info === false) continue; $level = auth_aclcheck($id, $sub[0], $info['grps']); if ($level >= AUTH_READ) { if (strcasecmp($info['mail'], $conf['notify']) != 0) { $emails[$sub[0]] = $info['mail']; } } } } $data['addresslist'] = trim($addresslist . ',' . implode(',', $emails), ','); } /** * Send a digest mail * * Sends a digest mail showing a bunch of changes. * * @author Adrian Lang <lang@cosmocode.de> * * @param string $subscriber_mail The target mail address * @param array $id The ID * @param int $lastupdate Time of the last notification */ function subscription_send_digest($subscriber_mail, $id, $lastupdate) { $n = 0; do { $rev = getRevisions($id, $n++, 1); $rev = (count($rev) > 0) ? $rev[0] : null; } while (!is_null($rev) && $rev > $lastupdate); $replaces = array('NEWPAGE' => wl($id, '', true, '&'), 'SUBSCRIBE' => wl($id, array('do' => 'subscribe'), true, '&')); if (!is_null($rev)) { $subject = 'changed'; $replaces['OLDPAGE'] = wl($id, "rev=$rev", true, '&'); $df = new Diff(explode("\n", rawWiki($id, $rev)), explode("\n", rawWiki($id))); $dformat = new UnifiedDiffFormatter(); $replaces['DIFF'] = $dformat->format($df); } else { $subject = 'newpage'; $replaces['OLDPAGE'] = 'none'; $replaces['DIFF'] = rawWiki($id); } subscription_send($subscriber_mail, $replaces, $subject, $id, 'subscr_digest'); } /** * Send a list mail * * Sends a list mail showing a list of changed pages. * * @author Adrian Lang <lang@cosmocode.de> * * @param string $subscriber_mail The target mail address * @param array $ids Array of ids * @param string $ns_id The id of the namespace */ function subscription_send_list($subscriber_mail, $ids, $ns_id) { if (count($ids) === 0) return; global $conf; $list = ''; foreach ($ids as $id) { $list .= '* ' . wl($id, array(), true) . NL; } subscription_send($subscriber_mail, array('DIFF' => rtrim($list), 'SUBSCRIBE' => wl($ns_id . $conf['start'], array('do' => 'subscribe'), true, '&')), 'subscribe_list', prettyprint_id($ns_id), 'subscr_list'); } /** * Helper function for sending a mail * * @author Adrian Lang <lang@cosmocode.de> * * @param string $subscriber_mail The target mail address * @param array $replaces Predefined parameters used to parse the * template * @param string $subject The lang id of the mail subject (without the * prefix “mail_”) * @param string $id The page or namespace id * @param string $template The name of the mail template * @return bool */ function subscription_send($subscriber_mail, $replaces, $subject, $id, $template) { global $lang; global $conf; $text = rawLocale($template); $trep = array_merge($replaces, array('PAGE' => $id)); $subject = $lang['mail_' . $subject] . ' ' . $id; $mail = new Mailer(); $mail->bcc($subscriber_mail); $mail->subject($subject); $mail->setBody($text,$trep); $mail->from($conf['mailfromnobody']); $mail->setHeader( 'List-Unsubscribe', '<'.wl($id,array('do'=>'subscribe'),true,'&').'>', false ); return $mail->send(); }
gpl-2.0
ArchaeoPY/ArchaeoPY
IO/view_and_save_data_gui.py
8232
import numpy as np import sys from PyQt4 import QtCore from PyQt4 import QtGui import matplotlib.pyplot as plt import matplotlib.mlab as mlab from matplotlib.backends.backend_qt4 import NavigationToolbar2QT as NavigationToolbar # import the MainWindow widget from the converted .ui files from ArchaeoPY.GUI_Templates.mpl import Ui_MainWindow #import geoplot load module from open_binary import Load_Comp from ArchaeoPY.Processing.geophysical_processing import median_filter class ArchaeoPYMainWindow(QtGui.QMainWindow, Ui_MainWindow): """Customization for Qt Designer created window""" def ClearPlot(self): self.mpl.canvas.ax.clear() self.mpl.canvas.draw() def copy_to_clipboard(self): pixmap = QtGui.QPixmap.grabWidget(self.mpl.canvas) QtGui.QApplication.clipboard().setPixmap(pixmap) def Open_Geoplot(self): self.fname = QtGui.QFileDialog.getOpenFileName() def Plot_Function(self): #Get values from Options Grid grid_length = self.TravL_val.value() grid_width = self.GridL_val.value() sample_interval = self.TravI_val.value() traverse_interval = self.GridI_val.value() self.output = Load_Comp(self.fname,grid_length,grid_width,sample_interval,traverse_interval) self.mpl.canvas.ax.clear() print np.shape(self.output) self.mpl.canvas.ax.imshow(self.output,cmap=plt.cm.Greys,extent=[0,grid_length,grid_width,0], aspect='equal',interpolation='none',vmin = self.neg_val.value(), vmax = self.pos_val.value()) self.mpl.canvas.draw() def Plot_Median_Filter(self): grid_length = self.TravL_val.value() grid_width = self.GridL_val.value() sample_interval = self.TravI_val.value() traverse_interval = self.GridI_val.value() self.output = Load_Comp(self.fname,grid_length,grid_width,sample_interval,traverse_interval) self.filter_output = median_filter(self.output) self.mpl.canvas.ax.clear() print np.shape(self.output) self.mpl.canvas.ax.imshow(self.filter_output,cmap=plt.cm.Greys,extent=[0,grid_length,grid_width,0], aspect='equal',interpolation='none',vmin = self.neg_val.value(), vmax = self.pos_val.value()) self.mpl.canvas.draw() def plot_options(self): self.neg_label = QtGui.QLabel('Neg Value', self) self.neg_val = QtGui.QDoubleSpinBox(self) self.neg_val.setRange(-100, 100) self.neg_val.setValue(-1) self.pos_label = QtGui.QLabel('Pos Value', self) self.pos_val = QtGui.QDoubleSpinBox(self) self.pos_val.setRange(-100, 100) self.pos_val.setValue(2) self.TravL_label = QtGui.QLabel('Trav Length', self) self.TravL_val = QtGui.QDoubleSpinBox(self) self.TravL_val.setRange(0, 1000) self.TravL_val.setValue(30) self.TravI_label = QtGui.QLabel('Sample Interval', self) self.TravI_val = QtGui.QDoubleSpinBox(self) self.TravI_val.setValue(0.25) self.GridL_label = QtGui.QLabel('Grid Width', self) self.GridL_val = QtGui.QDoubleSpinBox(self) self.GridL_val.setRange(0, 1000) self.GridL_val.setValue(30) self.GridI_label = QtGui.QLabel('Traverse Interval', self) self.GridI_val = QtGui.QDoubleSpinBox(self) self.GridI_val.setValue(1) self.Grid_horizontal_Layout_1.addWidget(self.TravL_label) self.Grid_horizontal_Layout_1.addWidget(self.TravL_val) self.Grid_horizontal_Layout_1.addWidget(self.TravI_label) self.Grid_horizontal_Layout_1.addWidget(self.TravI_val) self.Grid_horizontal_Layout_2.addWidget(self.GridL_label) self.Grid_horizontal_Layout_2.addWidget(self.GridL_val) self.Grid_horizontal_Layout_2.addWidget(self.GridI_label) self.Grid_horizontal_Layout_2.addWidget(self.GridI_val) self.Grid_horizontal_Layout_3 = QtGui.QHBoxLayout() self.Grid_horizontal_Layout_3.setObjectName("Grid_horizontal_Layout_3") self.Options_Grid.addLayout(self.Grid_horizontal_Layout_3, 2, 0, 1, 1) self.Grid_horizontal_Layout_3.addWidget(self.neg_label) self.Grid_horizontal_Layout_3.addWidget(self.neg_val) self.Grid_horizontal_Layout_3.addWidget(self.pos_label) self.Grid_horizontal_Layout_3.addWidget(self.pos_val) def Button_Definitions(self): self.firstrun=True self.Open_button = QtGui.QPushButton('Open', self) self.fname = self.Open_button.clicked.connect(self.Open_Geoplot) self.Button_Layout.addWidget(self.Open_button) self.pushButton_plot.clicked.connect(self.Plot_Function) self.pushButton_clear.clicked.connect(self.ClearPlot) QtGui.QShortcut(QtGui.QKeySequence("Ctrl+P"),self, self.Plot_Function) self.Save_button = QtGui.QPushButton('Save as .txt',self) self.Save_button.clicked.connect(self.save_as_txt) self.Button_Layout.addWidget(self.Save_button) self.pushButton = QtGui.QPushButton('Median Filter',self) self.pushButton.clicked.connect(self.Plot_Median_Filter) self.pushButton_clear.clicked.connect(self.ClearPlot) #QtGui.QShortcut(QtGui.QKeySequence("Ctrl+P"),self, self.Plot_Function) QtGui.QShortcut(QtGui.QKeySequence("Ctrl+C"),self, self.copy_to_clipboard) def save_as_txt(self): self.txt_name = QtGui.QFileDialog.getSaveFileName(self) np.savetxt(self.txt_name + '.txt', self.output) def __init__(self, parent = None): # initialization of the superclass super(ArchaeoPYMainWindow, self).__init__(parent) # setup the GUI --> function generated by pyuic4 self.setupUi(self) #Adds a Matplotlib Toolbar to the display, clears the display and adds only the required buttons self.navi_toolbar = NavigationToolbar(self.mpl.canvas, self) self.navi_toolbar.clear() #Adds Buttons a = self.navi_toolbar.addAction(self.navi_toolbar._icon('home.png'), 'Home', self.navi_toolbar.home) #a.setToolTip('returns axes to original position') a = self.navi_toolbar.addAction(self.navi_toolbar._icon('move.png'), 'Pan', self.navi_toolbar.pan) a.setToolTip('Pan axes with left mouse, zoom with right') a = self.navi_toolbar.addAction(self.navi_toolbar._icon('zoom_to_rect.png'), 'Zoom', self.navi_toolbar.zoom) a.setToolTip('Zoom to Rectangle') a = self.navi_toolbar.addAction(self.navi_toolbar._icon('filesave.png'), 'Save', self.navi_toolbar.save_figure) a.setToolTip('Save the figure') #Button_layout is a QT desginer Grid Layout. self.toolbar_grid.addWidget(self.navi_toolbar) self.Button_Definitions() self.plot_options() if __name__=='__main__': #Creates Main UI window app = QtGui.QApplication(sys.argv) app.processEvents() #Creates Window Form form = ArchaeoPYMainWindow() #display form and focus form.show() #if sys.platform == "darwin": form.raise_() #Something to do with the App & Cleanup? app.exec_() atexit.register(form.cleanup)
gpl-2.0
tomtom-lodz/amelinium
amelinium-grails/ModelBuilder/src/main/java/amelinium/model/Project.java
1117
package amelinium.model; import java.util.ArrayList; import java.util.List; public class Project { private List<Release> releases; String projectName = ""; String afterBacklogHtml = ""; public Project() { releases = new ArrayList<Release>(); } public List<Release> getReleases() { return releases; } public void setReleases(List<Release> releases) { this.releases = releases; } public void addRelease(Release r) { releases.add(r); } public void removeRelease(Release r) { if(releases.contains(r)) releases.remove(r); } public String getProjectName() { return projectName; } public void setProjectName(String projectName) { this.projectName = projectName; } public String getAfterBacklogHtml() { return afterBacklogHtml; } public void setAfterBacklogHtml(String afterBacklogHtml) { this.afterBacklogHtml = afterBacklogHtml; } public Release getLastRelease(){ if(releases.size()>0) return releases.get(releases.size()-1); return null; } @Override public String toString() { return "Project: "+projectName+" \n\n releases: "+releases+"\n\n"; } }
gpl-2.0
Decentrify/GVoD
core/core-impl/src/main/java/se/sics/nstream/torrent/connMngr/SimplePeerConnection.java
1802
/* * Copyright (C) 2009 Swedish Institute of Computer Science (SICS) Copyright (C) * 2009 Royal Institute of Technology (KTH) * * GVoD is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ package se.sics.nstream.torrent.connMngr; import java.util.HashMap; import java.util.Map; import se.sics.ktoolbox.util.network.KAddress; import se.sics.nstream.FileId; /** * @author Alex Ormenisan <aaor@kth.se> */ public class SimplePeerConnection implements PeerConnection { private final KAddress peer; private final Map<FileId, FilePeerConnection> fpcs = new HashMap<>(); public SimplePeerConnection(KAddress peer) { this.peer = peer; } @Override public KAddress getPeer() { return peer; } @Override public boolean available(FileId fileId) { //manual or seeder imposed limitations - none atm return true; } @Override public void addFilePeerConnection(FileId fileId, FilePeerConnection fpc) { fpcs.put(fileId, fpc); } @Override public FilePeerConnection removeFileConnection(FileId fileId) { return fpcs.remove(fileId); } }
gpl-2.0
Pengfei-Gao/source-Insight-3-for-centos7
SourceInsight3/NetFramework/FILETIME.cs
269
public class FILETIME : System.ValueType { // Methods public virtual int GetHashCode() {} public virtual bool Equals(object obj) {} public virtual string ToString() {} public Type GetType() {} // Fields public int dwLowDateTime; public int dwHighDateTime; }
gpl-2.0
laozhaokun/leetcode
java/UniquePathsII.java
656
package leetcode; /** * @author:zhaohf@asiainfo.com * @date:2014年11月20日 下午1:49:07 * @Description: TODO */ public class UniquePathsII { public int uniquePathsWithObstacles(int[][] obstacleGrid) { int m = obstacleGrid.length, n = obstacleGrid[0].length; int[][] dp = new int[m][n]; for (int i = 0; i < m; i++) { for (int j = 0; j < n; j++) { if (obstacleGrid[i][j] == 0) { if (i == 0 && j == 0) dp[i][j] = 1; else if (i == 0) dp[i][j] = dp[i][j - 1]; else if (j == 0) dp[i][j] = dp[i - 1][j]; else dp[i][j] = dp[i - 1][j] + dp[i][j - 1]; } } } return dp[m - 1][n - 1]; } }
gpl-2.0
emrojo/samples_extraction
lib/label_templates/smp3_tube.rb
1774
require './lib/label_template_setup' # LabelTemplateSetup.register_template('SMPE - Tube example 3','Tube') do |name, type_id| # { # name: name, # label_type_id: type_id, # Plate # labels_attributes:[{ # name: 'label', # bitmaps_attributes:[ # {"x_origin" => "0038", "y_origin" => "0210", "field_name" => "bottom_line", "horizontal_magnification" => "05", "vertical_magnification" => "05", "font" => "H", "space_adjustment" => "03", "rotational_angles" => "11"}, # {"x_origin" => "0070", "y_origin" => "0210", "field_name" => "middle_line", "horizontal_magnification" => "05", "vertical_magnification" => "05", "font" => "H", "space_adjustment" => "02", "rotational_angles" => "11"}, # {"x_origin" => "0120", "y_origin" => "0210", "field_name" => "top_line", "horizontal_magnification" => "05", "vertical_magnification" => "05", "font" => "H", "space_adjustment" => "02", "rotational_angles" => "11"}, # {"x_origin" => "0240", "y_origin" => "0165", "field_name" => "round_label_top_line", "horizontal_magnification" => "05", "vertical_magnification" => "1", "font" => "G", "space_adjustment" => "00", "rotational_angles" => "00"}, # {"x_origin" => "0220", "y_origin" => "0193", "field_name" => "round_label_bottom_line", "horizontal_magnification" => "05", "vertical_magnification" => "1", "font" => "G", "space_adjustment" => "00", "rotational_angles" => "00"} # ], # barcodes_attributes:[ # {"x_origin" => "0043", "y_origin" => "0100", "field_name" => "barcode", "barcode_type" => "9", "one_module_width" => "01", # "height" => "0100", "rotational_angle" => nil, "one_cell_width" => nil, "type_of_check_digit" => "2", "bar_height" => nil, # "no_of_columns" => nil} # ] # }] # } # end
gpl-2.0
expandrew/unload
config/initializers/assets.rb
644
# Be sure to restart your server when you modify this file. # Version of your assets, change this if you want to expire all your assets. Rails.application.config.assets.version = (ENV["ASSETS_VERSION"] || "1.0") # Add additional assets to the asset load path # Rails.application.config.assets.paths << Emoji.images_path # Precompile additional assets. # application.js, application.css, and all non-JS/CSS in app/assets folder are already added. # Rails.application.config.assets.precompile += %w( search.js ) Rails.application.config.assets.precompile += %w( dashboard.css ) Rails.application.config.assets.precompile += %w( landing.css )
gpl-2.0
klst-com/metasfresh
de.metas.adempiere.adempiere/base/src/main/java-gen/org/compiere/model/X_C_Subscription_Delivery.java
4490
/****************************************************************************** * Product: Adempiere ERP & CRM Smart Business Solution * * Copyright (C) 1999-2007 ComPiere, Inc. All Rights Reserved. * * This program is free software, you can redistribute it and/or modify it * * under the terms version 2 of the GNU General Public License as published * * by the Free Software Foundation. This program is distributed in the hope * * that it will be useful, but WITHOUT ANY WARRANTY, without even the implied * * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * * with this program, if not, write to the Free Software Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * * For the text or an alternative of this public license, you may reach us * * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * * or via info@compiere.org or http://www.compiere.org/license.html * *****************************************************************************/ /** Generated Model - DO NOT CHANGE */ package org.compiere.model; import java.sql.ResultSet; import java.util.Properties; import org.compiere.util.KeyNamePair; /** Generated Model for C_Subscription_Delivery * @author Adempiere (generated) * @version Release 3.5.4a - $Id$ */ public class X_C_Subscription_Delivery extends PO implements I_C_Subscription_Delivery, I_Persistent { /** * */ private static final long serialVersionUID = 20090915L; /** Standard Constructor */ public X_C_Subscription_Delivery (Properties ctx, int C_Subscription_Delivery_ID, String trxName) { super (ctx, C_Subscription_Delivery_ID, trxName); /** if (C_Subscription_Delivery_ID == 0) { setC_Subscription_Delivery_ID (0); setC_Subscription_ID (0); } */ } /** Load Constructor */ public X_C_Subscription_Delivery (Properties ctx, ResultSet rs, String trxName) { super (ctx, rs, trxName); } /** AccessLevel * @return 3 - Client - Org */ protected int get_AccessLevel() { return accessLevel.intValue(); } /** Load Meta Data */ protected POInfo initPO (Properties ctx) { POInfo poi = POInfo.getPOInfo (ctx, Table_ID, get_TrxName()); return poi; } public String toString() { StringBuffer sb = new StringBuffer ("X_C_Subscription_Delivery[") .append(get_ID()).append("]"); return sb.toString(); } /** Set Subscription Delivery. @param C_Subscription_Delivery_ID Optional Delivery Record for a Subscription */ public void setC_Subscription_Delivery_ID (int C_Subscription_Delivery_ID) { if (C_Subscription_Delivery_ID < 1) set_ValueNoCheck (COLUMNNAME_C_Subscription_Delivery_ID, null); else set_ValueNoCheck (COLUMNNAME_C_Subscription_Delivery_ID, Integer.valueOf(C_Subscription_Delivery_ID)); } /** Get Subscription Delivery. @return Optional Delivery Record for a Subscription */ public int getC_Subscription_Delivery_ID () { Integer ii = (Integer)get_Value(COLUMNNAME_C_Subscription_Delivery_ID); if (ii == null) return 0; return ii.intValue(); } /** Get Record ID/ColumnName @return ID/ColumnName pair */ public KeyNamePair getKeyNamePair() { return new KeyNamePair(get_ID(), String.valueOf(getC_Subscription_Delivery_ID())); } public I_C_Subscription getC_Subscription() throws RuntimeException { return (I_C_Subscription)MTable.get(getCtx(), I_C_Subscription.Table_Name) .getPO(getC_Subscription_ID(), get_TrxName()); } /** Set Subscription. @param C_Subscription_ID Subscription of a Business Partner of a Product to renew */ public void setC_Subscription_ID (int C_Subscription_ID) { if (C_Subscription_ID < 1) set_ValueNoCheck (COLUMNNAME_C_Subscription_ID, null); else set_ValueNoCheck (COLUMNNAME_C_Subscription_ID, Integer.valueOf(C_Subscription_ID)); } /** Get Subscription. @return Subscription of a Business Partner of a Product to renew */ public int getC_Subscription_ID () { Integer ii = (Integer)get_Value(COLUMNNAME_C_Subscription_ID); if (ii == null) return 0; return ii.intValue(); } }
gpl-2.0
Goutte/Ni
v1/cache/frontend/dev/modules/autoAEventAdmin/templates/_list_th_stacked.php
80
<?php include_partial('aEventAdmin/list_th_tabular', array('sort' => $sort)) ?>
gpl-2.0
SilunWang/popush-fruits
static/js/lib/github.js
20934
// Github.js 0.9.0 // (c) 2013 Michael Aufreiter, Development Seed // Github.js is freely distributable under the MIT license. // For all details and documentation: // http://substance.io/michael/github (function() { // Initial Setup // ------------- var XMLHttpRequest, Base64, _; if (typeof exports !== 'undefined') { XMLHttpRequest = require('xmlhttprequest').XMLHttpRequest; _ = require('underscore'); Base64 = require('./lib/base64.js'); }else{ _ = window._; Base64 = window.Base64; } //prefer native XMLHttpRequest always if (typeof window !== 'undefined' && typeof window.XMLHttpRequest !== 'undefined'){ XMLHttpRequest = window.XMLHttpRequest; } var API_URL = 'https://api.github.com'; var Github = function(options) { // HTTP Request Abstraction // ======= // // I'm not proud of this and neither should you be if you were responsible for the XMLHttpRequest spec. function _request(method, path, data, cb, raw, sync) { function getURL() { var url = path.indexOf('//') >= 0 ? path : API_URL + path; return url + ((/\?/).test(url) ? "&" : "?") + (new Date()).getTime(); } var xhr = new XMLHttpRequest(); if (!raw) {xhr.dataType = "json";} xhr.open(method, getURL(), !sync); if (!sync) { xhr.onreadystatechange = function () { if (this.readyState == 4) { if (this.status >= 200 && this.status < 300 || this.status === 304) { cb(null, raw ? this.responseText : this.responseText ? JSON.parse(this.responseText) : true, this); } else { cb({path: path, request: this, error: this.status}); } } } }; xhr.setRequestHeader('Accept','application/vnd.github.raw+json'); xhr.setRequestHeader('Content-Type','application/json;charset=UTF-8'); if ((options.token) || (options.username && options.password)) { xhr.setRequestHeader('Authorization', options.token ? 'token '+ options.token : 'Basic ' + Base64.encode(options.username + ':' + options.password) ); } data ? xhr.send(JSON.stringify(data)) : xhr.send(); if (sync) return xhr.response; } function _requestAllPages(path, cb) { var results = []; (function iterate() { _request("GET", path, null, function(err, res, xhr) { if (err) { return cb(err); } results.push.apply(results, res); var links = (xhr.getResponseHeader('link') || '').split(/\s*,\s*/g), next = _.find(links, function(link) { return /rel="next"/.test(link); }); if (next) { next = (/<(.*)>/.exec(next) || [])[1]; } if (!next) { cb(err, results); } else { path = next; iterate(); } }); })(); } // User API // ======= Github.User = function() { this.repos = function(cb) { // Github does not always honor the 1000 limit so we want to iterate over the data set. _requestAllPages("/user/repos?type=all&per_page=1000&sort=updated", function(err, res) { cb(err, res); }); }; // List user organizations // ------- this.orgs = function(cb) { _request("GET", "/user/orgs", null, function(err, res) { cb(err, res); }); }; // List authenticated user's gists // ------- this.gists = function(cb) { _request("GET", "/gists", null, function(err, res) { cb(err,res); }); }; // List authenticated user's unread notifications // ------- this.notifications = function(cb) { _request("GET", "/notifications", null, function(err, res) { cb(err,res); }); }; // Show user information // ------- this.show = function(username, cb) { var command = username ? "/users/"+username : "/user"; _request("GET", command, null, function(err, res) { cb(err, res); }); }; // List user repositories // ------- this.userRepos = function(username, cb) { // Github does not always honor the 1000 limit so we want to iterate over the data set. _requestAllPages("/users/"+username+"/repos?type=all&per_page=1000&sort=updated", function(err, res) { cb(err, res); }); }; // List a user's gists // ------- this.userGists = function(username, cb) { _request("GET", "/users/"+username+"/gists", null, function(err, res) { cb(err,res); }); }; // List organization repositories // ------- this.orgRepos = function(orgname, cb) { // Github does not always honor the 1000 limit so we want to iterate over the data set. _requestAllPages("/orgs/"+orgname+"/repos?type=all&&page_num=1000&sort=updated&direction=desc", function(err, res) { cb(err, res); }); }; // Follow user // ------- this.follow = function(username, cb) { _request("PUT", "/user/following/"+username, null, function(err, res) { cb(err, res); }); }; // Unfollow user // ------- this.unfollow = function(username, cb) { _request("DELETE", "/user/following/"+username, null, function(err, res) { cb(err, res); }); }; }; // Repository API // ======= Github.Repository = function(options) { var repo = options.name; var user = options.user; var that = this; var repoPath = "/repos/" + user + "/" + repo; var currentTree = { "branch": null, "sha": null }; // Uses the cache if branch has not been changed // ------- function updateTree(branch, cb) { if (branch === currentTree.branch && currentTree.sha) return cb(null, currentTree.sha); that.getRef("heads/"+branch, function(err, sha) { currentTree.branch = branch; currentTree.sha = sha; cb(err, sha); }); } // Get a particular reference // ------- this.getRef = function(ref, cb) { _request("GET", repoPath + "/git/refs/" + ref, null, function(err, res) { if (err) return cb(err); cb(null, res.object.sha); }); }; // Create a new reference // -------- // // { // "ref": "refs/heads/my-new-branch-name", // "sha": "827efc6d56897b048c772eb4087f854f46256132" // } this.createRef = function(options, cb) { _request("POST", repoPath + "/git/refs", options, cb); }; // Delete a reference // -------- // // repo.deleteRef('heads/gh-pages') // repo.deleteRef('tags/v1.0') this.deleteRef = function(ref, cb) { _request("DELETE", repoPath + "/git/refs/"+ref, options, cb); }; // Create a repo // ------- this.createRepo = function(options, cb) { _request("POST", "/user/repos", options, cb); }; // Delete a repo // -------- this.deleteRepo = function(cb) { _request("DELETE", repoPath, options, cb); }; // List all tags of a repository // ------- this.listTags = function(cb) { _request("GET", repoPath + "/tags", null, function(err, tags) { if (err) return cb(err); cb(null, tags); }); }; // List all pull requests of a respository // ------- this.listPulls = function(state, cb) { _request("GET", repoPath + "/pulls" + (state ? '?state=' + state : ''), null, function(err, pulls) { if (err) return cb(err); cb(null, pulls); }); }; // Gets details for a specific pull request // ------- this.getPull = function(number, cb) { _request("GET", repoPath + "/pulls/" + number, null, function(err, pull) { if (err) return cb(err); cb(null, pull); }); }; // Retrieve the changes made between base and head // ------- this.compare = function(base, head, cb) { _request("GET", repoPath + "/compare/" + base + "..." + head, null, function(err, diff) { if (err) return cb(err); cb(null, diff); }); }; // List all branches of a repository // ------- this.listBranches = function(cb) { _request("GET", repoPath + "/git/refs/heads", null, function(err, heads) { if (err) return cb(err); cb(null, _.map(heads, function(head) { return _.last(head.ref.split('/')); })); }); }; // Retrieve the contents of a blob // ------- this.getBlob = function(sha, cb) { _request("GET", repoPath + "/git/blobs/" + sha, null, cb, 'raw'); }; // For a given file path, get the corresponding sha (blob for files, tree for dirs) // ------- this.getSha = function(branch, path, cb) { // Just use head if path is empty if (path === "") return that.getRef("heads/"+branch, cb); that.getTree(branch+"?recursive=true", function(err, tree) { if (err) return cb(err); var file = _.select(tree, function(file) { return file.path === path; })[0]; cb(null, file ? file.sha : null); }); }; // Retrieve the tree a commit points to // ------- this.getTree = function(tree, cb) { _request("GET", repoPath + "/git/trees/"+tree, null, function(err, res) { if (err) return cb(err); cb(null, res.tree); }); }; // Post a new blob object, getting a blob SHA back // ------- this.postBlob = function(content, cb) { if (typeof(content) === "string") { content = { "content": content, "encoding": "utf-8" }; } _request("POST", repoPath + "/git/blobs", content, function(err, res) { if (err) return cb(err); cb(null, res.sha); }); }; // Update an existing tree adding a new blob object getting a tree SHA back // ------- this.updateTree = function(baseTree, path, blob, cb) { var data = { "base_tree": baseTree, "tree": [ { "path": path, "mode": "100644", "type": "blob", "sha": blob } ] }; _request("POST", repoPath + "/git/trees", data, function(err, res) { if (err) return cb(err); cb(null, res.sha); }); }; // Post a new tree object having a file path pointer replaced // with a new blob SHA getting a tree SHA back // ------- this.postTree = function(tree, cb) { _request("POST", repoPath + "/git/trees", { "tree": tree }, function(err, res) { if (err) return cb(err); cb(null, res.sha); }); }; // Create a new commit object with the current commit SHA as the parent // and the new tree SHA, getting a commit SHA back // ------- this.commit = function(parent, tree, message, cb) { var data = { "message": message, "author": { "name": options.username }, "parents": [ parent ], "tree": tree }; _request("POST", repoPath + "/git/commits", data, function(err, res) { currentTree.sha = res.sha; // update latest commit if (err) return cb(err); cb(null, res.sha); }); }; // Update the reference of your head to point to the new commit SHA // ------- this.updateHead = function(head, commit, cb) { _request("PATCH", repoPath + "/git/refs/heads/" + head, { "sha": commit }, function(err, res) { cb(err); }); }; // Show repository information // ------- this.show = function(cb) { _request("GET", repoPath, null, cb); }; // Get contents // -------- this.contents = function(branch, path, cb, sync) { return _request("GET", repoPath + "/contents?ref=" + branch + (path ? "&path=" + path : ""), null, cb, 'raw', sync); }; // Fork repository // ------- this.fork = function(cb) { _request("POST", repoPath + "/forks", null, cb); }; // Branch repository // -------- this.branch = function(oldBranch,newBranch,cb) { if(arguments.length === 2 && typeof arguments[1] === "function") { cb = newBranch; newBranch = oldBranch; oldBranch = "master"; } this.getRef("heads/" + oldBranch, function(err,ref) { if(err && cb) return cb(err); that.createRef({ ref: "refs/heads/" + newBranch, sha: ref },cb); }); } // Create pull request // -------- this.createPullRequest = function(options, cb) { _request("POST", repoPath + "/pulls", options, cb); }; // List hooks // -------- this.listHooks = function(cb) { _request("GET", repoPath + "/hooks", null, cb); }; // Get a hook // -------- this.getHook = function(id, cb) { _request("GET", repoPath + "/hooks/" + id, null, cb); }; // Create a hook // -------- this.createHook = function(options, cb) { _request("POST", repoPath + "/hooks", options, cb); }; // Edit a hook // -------- this.editHook = function(id, options, cb) { _request("PATCH", repoPath + "/hooks/" + id, options, cb); }; // Delete a hook // -------- this.deleteHook = function(id, cb) { _request("DELETE", repoPath + "/hooks/" + id, null, cb); }; // Read file at given path // ------- this.read = function(branch, path, cb) { that.getSha(branch, path, function(err, sha) { if (!sha) return cb("not found", null); that.getBlob(sha, function(err, content) { cb(err, content, sha); }); }); }; // Remove a file from the tree // ------- this.remove = function(branch, path, cb) { updateTree(branch, function(err, latestCommit) { that.getTree(latestCommit+"?recursive=true", function(err, tree) { // Update Tree var newTree = _.reject(tree, function(ref) { return ref.path === path; }); _.each(newTree, function(ref) { if (ref.type === "tree") delete ref.sha; }); that.postTree(newTree, function(err, rootTree) { that.commit(latestCommit, rootTree, 'Deleted '+path , function(err, commit) { that.updateHead(branch, commit, function(err) { cb(err); }); }); }); }); }); }; // Move a file to a new location // ------- this.move = function(branch, path, newPath, cb) { updateTree(branch, function(err, latestCommit) { that.getTree(latestCommit+"?recursive=true", function(err, tree) { // Update Tree _.each(tree, function(ref) { if (ref.path === path) ref.path = newPath; if (ref.type === "tree") delete ref.sha; }); that.postTree(tree, function(err, rootTree) { that.commit(latestCommit, rootTree, 'Deleted '+path , function(err, commit) { that.updateHead(branch, commit, function(err) { cb(err); }); }); }); }); }); }; // Write file contents to a given branch and path // ------- this.write = function(branch, path, content, message, cb) { updateTree(branch, function(err, latestCommit) { if (err) return cb(err); that.postBlob(content, function(err, blob) { if (err) return cb(err); that.updateTree(latestCommit, path, blob, function(err, tree) { if (err) return cb(err); that.commit(latestCommit, tree, message, function(err, commit) { if (err) return cb(err); that.updateHead(branch, commit, cb); }); }); }); }); }; // List commits on a repository. Takes an object of optional paramaters: // sha: SHA or branch to start listing commits from // path: Only commits containing this file path will be returned // since: ISO 8601 date - only commits after this date will be returned // until: ISO 8601 date - only commits before this date will be returned // ------- this.getCommits = function(options, cb) { options = options || {}; var url = repoPath + "/commits"; var params = []; if (options.sha) { params.push("sha=" + encodeURIComponent(options.sha)); } if (options.path) { params.push("path=" + encodeURIComponent(options.path)); } if (options.since) { var since = options.since; if (since.constructor === Date) { since = since.toISOString(); } params.push("since=" + encodeURIComponent(since)); } if (options.until) { var until = options.until; if (until.constructor === Date) { until = until.toISOString(); } params.push("until=" + encodeURIComponent(until)); } if (params.length > 0) { url += "?" + params.join("&"); } _request("GET", url, null, cb); }; }; // Gists API // ======= Github.Gist = function(options) { var id = options.id; var gistPath = "/gists/"+id; // Read the gist // -------- this.read = function(cb) { _request("GET", gistPath, null, function(err, gist) { cb(err, gist); }); }; // Create the gist // -------- // { // "description": "the description for this gist", // "public": true, // "files": { // "file1.txt": { // "content": "String file contents" // } // } // } this.create = function(options, cb){ _request("POST","/gists", options, cb); }; // Delete the gist // -------- this.delete = function(cb) { _request("DELETE", gistPath, null, function(err,res) { cb(err,res); }); }; // Fork a gist // -------- this.fork = function(cb) { _request("POST", gistPath+"/fork", null, function(err,res) { cb(err,res); }); }; // Update a gist with the new stuff // -------- this.update = function(options, cb) { _request("PATCH", gistPath, options, function(err,res) { cb(err,res); }); }; // Star a gist // -------- this.star = function(cb) { _request("PUT", gistPath+"/star", null, function(err,res) { cb(err,res); }); }; // Untar a gist // -------- this.unstar = function(cb) { _request("DELETE", gistPath+"/star", null, function(err,res) { cb(err,res); }); }; // Check if a gist is starred // -------- this.isStarred = function(cb) { _request("GET", gistPath+"/star", null, function(err,res) { cb(err,res); }); }; }; // Issues API // ========== Github.Issue = function(options) { var path = "/repos/" + options.user + "/" + options.repo + "/issues"; this.list = function(options, cb) { _request("GET", path, options, function(err, res) { cb(err,res) }); }; }; // Top Level API // ------- this.getIssues = function(user, repo) { return new Github.Issue({user: user, repo: repo}); }; this.getRepo = function(user, repo) { return new Github.Repository({user: user, name: repo}); }; this.getUser = function() { return new Github.User(); }; this.getGist = function(id) { return new Github.Gist({id: id}); }; }; if (typeof exports !== 'undefined') { // Github = exports; module.exports = Github; } else { window.Github = Github; } }).call(this);
gpl-2.0
jensnerche/plantuml
src/net/sourceforge/plantuml/skin/ArrowBody.java
1367
/* ======================================================================== * PlantUML : a free UML diagram generator * ======================================================================== * * (C) Copyright 2009-2014, Arnaud Roques * * Project Info: http://plantuml.sourceforge.net * * This file is part of PlantUML. * * PlantUML is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * PlantUML distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public * License for more details. * * You should have received a copy of the GNU General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, * USA. * * [Java is a trademark or registered trademark of Sun Microsystems, Inc. * in the United States and other countries.] * * Original Author: Arnaud Roques * * Revision $Revision: 5191 $ * */ package net.sourceforge.plantuml.skin; public enum ArrowBody { NORMAL, DOTTED; }
gpl-2.0
router123/taxlosslovers
wp-content/themes/twentyfourteen/index.php
1583
<?php /** * The main template file * * This is the most generic template file in a WordPress theme and one * of the two required files for a theme (the other being style.css). * It is used to display a page when nothing more specific matches a query, * e.g., it puts together the home page when no home.php file exists. * * @link http://codex.wordpress.org/Template_Hierarchy * * @package WordPress * @subpackage Twenty_Fourteen * @since Twenty Fourteen 1.0 */ get_header(); ?> <div id="main-content" class="main-content"> <?php if ( is_front_page() && twentyfourteen_has_featured_posts() ) { // Include the featured content template. get_template_part( 'featured-content' ); } ?> <div id="primary" class="content-area"> <div id="content" class="site-content" role="main"> <?php if ( have_posts() ) : // Start the Loop. while ( have_posts() ) : the_post(); /* * Include the post format-specific template for the content. If you want to * use this in a child theme, then include a file called called content-___.php * (where ___ is the post format) and that will be used instead. */ get_template_part( 'content', get_post_format() ); endwhile; // Previous/next post navigation. twentyfourteen_paging_nav(); else : // If no content, include the "No posts found" template. get_template_part( 'content', 'none' ); endif; ?> </div><!-- #content --> </div><!-- #primary --> <?php //get_sidebar( 'content' ); ?> </div><!-- #main-content --> <?php //get_sidebar(); get_footer();
gpl-2.0
beorc/langtrainer2
app/controllers/user/dashboard_controller.rb
605
class User::DashboardController < ApplicationController layout :determine_layout before_filter :fetch_user def show @courses = @user.courses gon.answers = {} @courses.each do |course| snapshots = course.snapshots.with_user(@user) chart = ::Charts::Answers.new snapshots, Period.find(Period::OneYear), { month: 1 } gon.answers[course.id] = chart.data end end private def determine_layout return 'user_profile' if user_signed_in? 'application' end def fetch_user @user = current_user || User.find_by_username(params[:username]) end end
gpl-2.0
aharrison24/XCSoar
src/Engine/Trace/Vector.cpp
1312
/* Copyright_License { XCSoar Glide Computer - http://www.xcsoar.org/ Copyright (C) 2000-2012 The XCSoar Project A detailed list of copyright holders can be found in the file "AUTHORS". This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. } */ #include "Vector.hpp" #include "Point.hpp" #include "Navigation/TaskProjection.hpp" TaskProjection TracePointVector::GetBounds(const GeoPoint &fallback_location) const { TaskProjection task_projection; task_projection.reset(fallback_location); for (auto it = begin(); it != end(); ++it) task_projection.scan_location(it->get_location()); task_projection.update_fast(); return task_projection; }
gpl-2.0
BeWelcome/rox.prototypes
htdocs/bw/faq_ProtectionTowardCriminel_en.php
60
<?php $IdFaq=17;$lang="en";require_once "publicfaq.php"; ?>
gpl-2.0
MississippiGreetings/wordpress
maillist/index.php
9585
<?php #------------------------------------------------------# # INFO # #------------------------------------------------------# # Title: E-Mail Notification # # Author: Brian Groce (http://watershedstudio.com) # # Date: December 8, 2005 # # Version: 2.3.1 # # # # Credits & Changelog: see readme.txt # #------------------------------------------------------# include ("wpemn_config.php"); //********************************************************// // GET VARIABLES FROM URL //********************************************************// $action=$_GET['action']; $id=$_GET['id']; $addr=$_GET['addr']; //********************************************************// // DB CONNECTION //********************************************************// $dbh = mysql_connect("$dbhost", "$dbuser", "$dbpass"); mysql_select_db("$db", $dbh); if ($_POST['email']) { $action = 'sub'; $addr = $_POST['email']; } //********************************************************// // GET CONFIG INFO //********************************************************// $query = "select * from wp_email_list_config where id = '1'"; $res = mysql_query($query) or print mysql_error(); $row = mysql_fetch_assoc($res); $site_name = $row['site_name']; $site_url = $row['site_url']; $blog_url = $row['blog_url']; $from_email = $row['from_email']; $admin_email = $row['admin_email']; $nice_urls = $row['nice_urls']; ?> <? include "header.php"; ?> <div id="blogpage"> <div id="blogmenu"> <a href="/signup.php"><img class="swapImage {src: '/images/blog/submenu-signmeup-over.png'}" src="/images/blog/submenu-signmeup.png" alt="Sign Me Up" /></a> <a href="/downloads/PhatwaterChallenge2009.pdf"><img class="swapImage {src: '/images/blog/submenu-thechallenge-over.png'}" src="/images/blog/submenu-thechallenge.png" alt="The Challenge" /></a> <a href="/downloads/PhatwaterCourseMap2009.pdf"><img class="swapImage {src: '/images/blog/submenu-coursemap-over.png'}" src="/images/blog/submenu-coursemap.png" alt="Course Map" /></a> <a href="/downloads/PhatwaterDirections2009.pdf"><img class="swapImage {src: '/images/blog/submenu-gettingthere-over.png'}" src="/images/blog/submenu-gettingthere.png" alt="Getting There" /></a> <? // <img class="swapImage {src: '/images/blog/submenu-sponsors-over.png'}" src="/images/blog/submenu-sponsors.png" alt="Sponsors" /> ?> <img class="swapImage {src: '/images/menu/over-comingsoon.png'}" src="/images/blog/submenu-sponsors.png" alt="Sponsors" /> </div> <div id="blogheader"> <img src="../../../../images/blog/blog-header.png" alt="The Phatwater Blog" /> </div> <div id="container"> <div class="signup-confirmation-thankyou"> <?php if ($action == "") { /*echo "Sorry, no action was supplied.";*/ exit;} //********************************************************// // SUBSCRIBE //********************************************************// if ($action == "sub") { $query = "select id,email_addr,gets_mail from wp_email_list where email_addr = '$addr'"; $res = mysql_query($query) or print mysql_error(); $row = mysql_fetch_assoc($res); if ($row['email_addr'] == $addr && $row['gets_mail'] == 1) { echo "You're already subscribed!<br><br><a href=$blog_url>Go Back</a>"; exit; } if ($row['email_addr'] != $addr) { $query = "insert into wp_email_list (email_addr,date_subscribed) values ('$addr',now())"; $res = mysql_query($query) or print mysql_error(); $id = mysql_insert_id(); } else { $id = $row['id']; } send_conf($addr,$id,"0",$site_url,$blog_url,$site_name,$from_email); ?> <h1>Thank You</h1> <br /> <br /> You will receive an email shortly to confirm your subscription. Please check your spam or filtering folders for this message. You may need to add <b>info@kayakmississippi.com</b> to your white list.<br /> <br /> Once you confirm your subscription you will begin to receive notifications whenever the Phatwater Blog is updated.<br /><br /> <a href="http://www.kayakmississippi.com/phatwater/">Return to the Phatwater Blog</a> <? } //********************************************************// // INVITE //********************************************************// elseif ($action == "inv") { $query = "select id,email_addr,gets_mail from wp_email_list where email_addr = '$addr'"; $res = mysql_query($query) or print mysql_error(); $row = mysql_fetch_assoc($res); if ($row['email_addr'] == $addr && $row['gets_mail'] == 1) { echo "$addr is already subscribed!<br><br><a href=$blog_url>Go Back</a>"; exit; } if ($row['email_addr'] != $addr) { $query = "insert into wp_email_list (email_addr,date_subscribed) values ('$addr',now())"; $res = mysql_query($query) or print mysql_error(); $id = mysql_insert_id(); } else { $id = $row['id']; } send_conf($addr,$id,"invite",$site_url,$blog_url,$site_name,$from_email); echo "$addr has been sent an invitation to subscribe.<br /><br/><a href=$blog_url>Go Back</a>"; } //********************************************************// // UNSUBSCRIBE //********************************************************// elseif ($action == "unsub") { $query = "delete from wp_email_list where email_addr = '$addr'"; $res = mysql_query($query) or print mysql_error(); if (mysql_affected_rows() > 0) { $msg = "$addr has unsubscribed.\n"; $header = "From: \"$site_name\" <$from_email>\n"; Mail($admin_email, "$site_name Unsubscribe: $addr", $msg, $header); $msg = "$addr will no longer receive notifications from $site_name.\n\n"; $msg .= "If you would like to sign up again, visit: $blog_url\n\n"; $msg .= "Thanks,\n\n$site_name"; $header = "From: \"$site_name\" <$from_email>\n"; Mail($addr, "$site_name Unsubscribe", $msg, $header); } echo "You will no longer receive notifications from $site_name.<br><br><a href=$blog_url>Go Back</a>"; } //********************************************************// // CONFIRM //********************************************************// elseif ($action == "conf") { list($id,$md) = explode(',',$addr); $query = "select email_addr from wp_email_list where id = $id"; $res = mysql_query($query); $row = mysql_fetch_assoc($res); $addr2 = $row['email_addr']; if (md5($addr2) == $md) { $query = "update wp_email_list set gets_mail = 1 where id = $id"; $res = mysql_query($query); $msg = "$addr2 has subscribed.\n"; $header = "From: \"$site_name\" <$from_email>\n"; $header .= "Sender: $from_email\n"; Mail($admin_email, "$site_name Subscribe: $addr2", $msg, $header); echo "Thanks for confirming your subscription, $addr2.<br>"; echo "You will now receive email notifications whenever<br>"; echo "$site_name is updated.<br><br>"; echo "<a href=$blog_url>Go Back</a>"; } else { echo "I'm sorry, that address is not in our database.<br>"; echo "Please try subscribing again.<br><br>"; echo "<a href=$blog_url>Go Back</a>"; } } //********************************************************// // EMPTY //********************************************************// else { echo "Sorry, no action was supplied."; } //********************************************************// // FUNCTION - send_conf //********************************************************// function send_conf($addr,$id,$invite,$site_url,$blog_url,$site_name,$from_email) { // This is for the default URL permalink $confurl = $site_url . "maillist/index.php?action=conf&addr=$id," . md5($addr); if ($invite == 'invite') { $msg = "Someone has invited you to receive e-mail\n"; $msg .= "notifications from $site_name. If you would\n"; $msg .= "like to receive these notifications, please visit the URL below\n"; $msg .= "to confirm. Thanks!\n\n"; $msg .= "$confurl\n\n"; $msg .= "If you are not interested, you can safely\n"; $msg .= "disregard this message.\n"; $header = "From: \"$site_name\" <$from_email>\n"; $header .= "Sender: $from_email\n"; Mail($addr, "$site_name Invitation", $msg, $header); } else { $msg = "Someone has requested that $addr be subscribed to receive\n"; $msg .= "notifications from $site_name. If this was you, please\n"; $msg .= "visit the URL below to confirm your subscription. Thanks!\n\n"; $msg .= "$confurl\n\n"; $msg .= "If you did not ask to be subscribed to the list, you can safely\n"; $msg .= "disregard this message. We apologize for your trouble.\n"; $header = "From: \"$site_name\" <$from_email>\n"; $header .= "Sender: $from_email\n"; Mail($addr, "$site_name Confirmation", $msg, $header); } } ?> </div> </div> </div> <? include "../../inc/footer.inc.php"; ?>
gpl-2.0
niloc132/mauve-gwt
src/main/java/gnu/testlet/java/lang/ThreadDeath/classInfo/getSuperclass.java
1653
// Test for method java.lang.ThreadDeath.getClass().getSuperclass() // Copyright (C) 2012 Pavel Tisnovsky <ptisnovs@redhat.com> // This file is part of Mauve. // Mauve is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2, or (at your option) // any later version. // Mauve is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with Mauve; see the file COPYING. If not, write to // the Free Software Foundation, Inc., 51 Franklin Street, // Fifth Floor, Boston, MA 02110-1301 USA. // Tags: JDK1.5 package gnu.testlet.java.lang.ThreadDeath.classInfo; import gnu.testlet.TestHarness; import gnu.testlet.Testlet; import java.lang.ThreadDeath; /** * Test for method java.lang.ThreadDeath.getClass().getSuperclass() */ public class getSuperclass implements Testlet { /** * Runs the test using the specified harness. * * @param harness the test harness (<code>null</code> not permitted). */ public void test(TestHarness harness) { // create instance of a class ThreadDeath final Object o = new ThreadDeath(); // get a runtime class of an object "o" final Class c = o.getClass(); Class superClass = c.getSuperclass(); harness.check(superClass.getName(), "java.lang.Error"); } }
gpl-2.0
niravpatel2008/tripping-octo-batman
wp-content/plugins/email-newsletter/widget/widget.js
3531
// JavaScript Document function eemail_submit_ajax(url) { txt_email_newsletter = document.getElementById("eemail_txt_email"); var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/; if(txt_email_newsletter.value=="") { alert("Please enter email address."); txt_email_newsletter.focus(); return false; } if(txt_email_newsletter.value!="" && (txt_email_newsletter.value.indexOf("@",0)==-1 || txt_email_newsletter.value.indexOf(".",0)==-1)) { alert("Please provide a valid email address.") txt_email_newsletter.focus(); txt_email_newsletter.select(); return false; } if (!filter.test(txt_email_newsletter.value)) { alert('Please provide a valid email address.'); txt_email_newsletter.focus(); txt_email_newsletter.select(); return false; } // if (['test@test.com', '123@123.com', 'test123@test.com'].indexOf(txt_email_newsletter.value) >= 0) // { // alert('Please provide a valid email address. 3'); // txt_email_newsletter.focus(); // txt_email_newsletter.select(); // return false; // } document.getElementById("eemail_msg").innerHTML="loading..."; var date_now = ""; var mynumber = Math.random(); var str= "txt_email_newsletter="+ encodeURI(txt_email_newsletter.value) + "&timestamp=" + encodeURI(date_now) + "&action=" + encodeURI(mynumber); eemail_submitpostrequest(url+'/eemail_subscribe.php', str); } var http_req = false; function eemail_submitpostrequest(url, parameters) { http_req = false; if (window.XMLHttpRequest) { http_req = new XMLHttpRequest(); if (http_req.overrideMimeType) { http_req.overrideMimeType('text/html'); } } else if (window.ActiveXObject) { try { http_req = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { http_req = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { } } } if (!http_req) { alert('Cannot create XMLHTTP instance'); return false; } http_req.onreadystatechange = eemail_submitresult; http_req.open('POST', url, true); http_req.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); http_req.setRequestHeader("Content-length", parameters.length); http_req.setRequestHeader("Connection", "close"); http_req.send(parameters); } function eemail_submitresult() { //alert(http_req.readyState); //alert(http_req.responseText); if (http_req.readyState == 4) { if (http_req.status == 200) { if (http_req.readyState==4 || http_req.readyState=="complete") { if((http_req.responseText).trim() == "subscribed-successfully") { document.getElementById("eemail_msg").innerHTML = "Subscribed successfully."; document.getElementById("eemail_txt_email").value=""; } else if((http_req.responseText).trim() == "already-exist") { document.getElementById("eemail_msg").innerHTML = "Email already exist."; } else if((http_req.responseText).trim() == "unexpected-error") { document.getElementById("eemail_msg").innerHTML = "Oops.. Unexpected error occurred."; } else if((http_req.responseText).trim() == "invalid-email") { document.getElementById("eemail_msg").innerHTML = "Invalid email address."; } else { document.getElementById("eemail_msg").innerHTML = "Please try after some time."; document.getElementById("eemail_txt_email").value=""; } } } else { alert('There was a problem with the request.'); } } }
gpl-2.0
doubletap1410/Map
map/interact/maphelpersubhelpers.cpp
76599
#include <QCursor> #include <QTransform> #include <QUuid> #include "coord/mapcamera.h" #include "frame/mapframe.h" #include "frame/mapsettings.h" #include "object/mapobject.h" #include "drawer/mapdrawer.h" #include "core/mapmath.h" #include "layers/maplayersystem.h" #include "layers/maplayerobjects.h" #include "core/maptemplates.h" #include "core/mapmetric.h" #include "interact/maphelperevent.h" #include "interact/maphelper_p.h" #include "maphelpersubhelpers.h" //---------------------------------------------------------- #define D_MAP if (d->map == NULL) return false; //---------------------------------------------------------- #define MoveDelta 100 // дельта для нанесения новой точки #define MarkColorPen QColor(255, 0, 0) // цвет удаляемого маркера #define MarkColorBrush QColor(64, 224, 208, 200) // цвет меток #define MarkerDeletePen QColor(0, 0, 255) // цвет удаляемого маркера #define MarkerDeleteBrush QColor(255, 20, 147) // цвет удаляемого маркера #define MarkerActivePen QColor(0, 0, 0) // цвет удаляемого маркера #define MarkerActiveBrush QColor(0, 0, 255) // цвет удаляемого маркера // цвета маркеров #define LineMarkPenColor QColor(255, 140, 0) #define PointMarkPenColor QColor(0, 0, 255) #define PointMarkBrushColor QColor(255, 255, 0) #define PolyMarkPenColor QColor(46, 139, 87) #define PolyMarkBrushColor QColor(238, 130, 238, 100) #define StandartHelperMarker 3 // -------------------------------------- template <class T> Q_INLINE_TEMPLATE uint qHash(QPointer<T> const &ptr) { return QT_PREPEND_NAMESPACE(qHash)<T>(ptr.data()); } // -------------------------------------- //! вспомогательные функции namespace { QPoint deaccelerate(QPoint &speed, int a = 1, int max = 64) { int x = qBound(-max, speed.x(), max); int y = qBound(-max, speed.y(), max); x = (x == 0) ? 0 : (x > 0) ? qMax(0, x - a) : qMin(0, x + a); y = (y == 0) ? 0 : (y > 0) ? qMax(0, y - a) : qMin(0, y + a); return QPoint(x, y); } minigis::MapLayerObjects * initStandartLayer(minigis::MapFrame *map) { minigis::MapLayerObjects *l = qobject_cast<minigis::MapLayerObjects*>(map->layerByName(minigis::StandartLayerName)); if (!l) { l = new minigis::MapLayerObjects; l->setName(minigis::StandartLayerName); l->setCamera(map->camera()); map->registerLayer(l); } return l; } minigis::MapLayerSystem * initSystemLayer(minigis::MapFrame *map) { minigis::MapLayerSystem *l = qobject_cast<minigis::MapLayerSystem*>(map->layerByName(minigis::SystemLayerName)); if (!l) { l = new minigis::MapLayerSystem; l->setName(minigis::SystemLayerName); l->setCamera(map->camera()); map->registerLayer(l); } return l; } minigis::MapLayerSystem * initMarkerLayer(minigis::MapFrame *map) { QString markerLayerName = QString::fromUtf8("Слой маркеров"); minigis::MapLayerSystem *l = qobject_cast<minigis::MapLayerSystem*>(map->layerByName(markerLayerName)); if (!l) { l = new minigis::MapLayerSystem; l->setName(markerLayerName); l->setCamera(map->camera()); l->setZOrder(-1); map->registerLayer(l); } return l; } QPointF markerBound(QPointF pos, QRectF boundRect) { return QPointF( qBound(boundRect.left() + 25, pos.x(), boundRect.right() - 25), qBound(boundRect.top() + 25, pos.y(), boundRect.bottom() - 25) ); } void clearIgnorGenList(QHash<minigis::MapObject*, bool> &list) { for (QHashIterator<minigis::MapObject*, bool> it(list); it.hasNext(); ) { it.next(); minigis::MapObject *mo = it.key(); mo->setAttribute(minigis::attrGenIgnore, it.value()); } list.clear(); } // -------------------------------------- Functors struct TransformPoint { TransformPoint(QPolygonF &polygon, const QTransform &matrix) : points(polygon), trans(matrix) { } void operator()(const QPointF &p) { points.append(trans.map(p)); } private: QPolygonF &points; const QTransform &trans; }; } // -------------------------------------- namespace minigis { // -------------------------------------- MapSubHelper::MapSubHelper(MapFrame *map_, QObject *parent) : MapSubHelperParent(parent), isMouseDown(false), map(map_) { } MapSubHelper::~MapSubHelper() { } // -------------------------------------- MapSubHelperMove::MapSubHelperMove(MapFrame *map_, QObject *parent) : MapSubHelper(map_, parent), isTap(false), scrollState(NoScroll) { } MapSubHelperMove::~MapSubHelperMove() { scrollState = NoScroll; } bool MapSubHelperMove::start(QPointF pos) { MHEMovePress mhep(pos); emit handler(&mhep); isMouseDown = true; lastScreenPos = pos; pressPos = pos; isTap = true; scrollState = ManualScroll; dragPos = QCursor::pos(); if (scrollState == AutoScroll) { scrollState = NoScroll; speed = QPoint(0, 0); } if (!ticker.isActive()) ticker.start(20, this); return true; } bool MapSubHelperMove::finish(QPointF pos) { if (!isMouseDown) return false; MHEMoveRelease mher(pos); emit handler(&mher); if (isTap) { MapCamera *cam = map->camera(); MapOptions opt = map->settings()->mapOptions(); QRectF rgn(pos, QSizeF()); int sizeR = 20; rgn.adjust(-sizeR, -sizeR, sizeR, sizeR); QList<MapObject*> lo(map->selectObjects(rgn, cam)); QList<MapObject*> reslo; reslo.reserve(lo.size()); foreach (MapObject *mo, lo) { if (mo->drawer()->hit(mo, rgn, cam, opt)) reslo.append(mo); } MHETap mhtap(reslo, pos); emit handler(&mhtap); } isMouseDown = false; QPointF dt(pos - lastScreenPos); map->camera()->moveBy(moveValidate(map->camera()->toWorld(pos) - map->camera()->toWorld(lastScreenPos))); sendWorldChanged(dt); if (scrollState == ManualScroll) { #if 0 QLineF line(QPointF(), speed); qreal l = line.length(); if (qAbs(l) < 0.1) { qDebug() << "qAbs(l) < 0.1" << l << speed; // return true; } if (l > 128) line.setLength(128); speedL = line.unitVector().p2(); #endif scrollState = AutoScroll; map->updateScene(); } return true; } bool MapSubHelperMove::proccessing(QPointF pos) { if (!isMouseDown) return false; if (qFuzzyCompare(pos.x(), lastScreenPos.x()) && qFuzzyCompare(pos.y(), lastScreenPos.y())) return false; QPointF dt(pos - lastScreenPos); map->camera()->moveBy(map->camera()->toWorld(pos) - map->camera()->toWorld(lastScreenPos)); lastScreenPos = pos; if (isTap) { QPoint p((pressPos - pos).toPoint()); isTap = qAbs(p.x()) < 10 && qAbs(p.y()) < 10; } sendWorldChanged(dt); map->updateScene(); return true; } void MapSubHelperMove::initData(const QRectF &rgn) { moveRgn = rgn; } void MapSubHelperMove::timerEvent(QTimerEvent *event) { bool used = false; if (scrollState == ManualScroll) { used = true; speed = (QCursor::pos() - dragPos) * 0.5; dragPos = QCursor::pos(); } if (scrollState == AutoScroll) { used = true; speed = deaccelerate(speed, 2, 64); QPointF start = map->camera()->toWorld(QPointF()); QPointF offset = map->camera()->toWorld(speed) - start; map->camera()->moveBy(offset); if (speed.isNull()) scrollState = NoScroll; map->camera()->moveTo(moveValidate(map->camera()->position())); sendWorldChanged(speed); map->updateScene(); } if (!used) ticker.stop(); QObject::timerEvent(event); } QPointF MapSubHelperMove::moveValidate(const QPointF &p) const { if (moveRgn.isNull()) return p; QPointF mp(map->camera()->position()); QPointF r(p + mp); return QPointF( qBound(moveRgn.left(), r.x(), moveRgn.right()), qBound(moveRgn.top(), r.y(), moveRgn.bottom()) ) - mp; } void MapSubHelperMove::sendWorldChanged(const QPointF &dt) { QTransform tr; tr.translate(dt.x(), dt.y()); emit worldChanged(tr); } // -------------------------------------- MapSubHelperScale::MapSubHelperScale(MapFrame *map_, QObject *parent) : MapSubHelper(map_, parent) { } MapSubHelperScale::~MapSubHelperScale() { } bool MapSubHelperScale::start(QPointF pos) { isMouseDown = true; pressPos = pos; prevScale = map->camera()->scale(); return true; } bool MapSubHelperScale::finish(QPointF pos) { if (!isMouseDown) return false; isMouseDown = false; calculate(pos); map->updateScene(); return true; } bool MapSubHelperScale::proccessing(QPointF pos) { if (!isMouseDown || qFuzzyCompare(pos.y(), pressPos.y())) return false; calculate(pos); map->updateScene(); return true; } QTransform MapSubHelperScale::scale(MapCamera *cam, const QPointF &mid, int delta) { if (!cam || delta == 0) return QTransform(); qreal lastScale = cam->scale(); cam->moveBy(cam->position() - cam->toWorld(mid)); delta < 0 ? cam->scaleOut(-delta) : cam->scaleIn(delta); cam->moveBy(cam->toWorld(mid) - cam->position()); qreal scale = cam->scale() / lastScale; QTransform tr; tr.translate(mid.x(), mid.y()).scale(scale, scale).translate(-mid.x(), -mid.y()); return tr; } void MapSubHelperScale::calculate(const QPointF &screenPos) { MapCamera *cam = map->camera(); qreal lastScale = cam->scale(); qreal dt = screenPos.y() - pressPos.y(); int steps = qAbs(int(dt / (0.046875 * cam->screenSize().height()))); // 0.046875 = 3/8 * 1/8 * h QPointF dtt(cam->position() - cam->toWorld(pressPos)); cam->setScale(prevScale); cam->moveBy(dtt); dt < 0 ? cam->scaleOut(steps) : cam->scaleIn(steps); dtt = cam->toWorld(pressPos) - cam->position(); cam->moveBy(dtt); sendWorldChanged(pressPos, cam->scale() / lastScale); } void MapSubHelperScale::sendWorldChanged(const QPointF &mid, qreal scale) { QTransform tr; tr.translate(mid.x(), mid.y()).scale(scale, scale).translate(-mid.x(), -mid.y()); emit worldChanged(tr); } // -------------------------------------- MapSubHelperRotate::MapSubHelperRotate(MapFrame *map_, QObject *parent) : MapSubHelper(map_, parent) { } MapSubHelperRotate::~MapSubHelperRotate() { } bool MapSubHelperRotate::start(QPointF pos) { isMouseDown = true; lastScreenPos = pos; pressPos = pos; return true; } bool MapSubHelperRotate::finish(QPointF pos) { if (!isMouseDown) return false; isMouseDown = false; QPointF mid = QPointF(map->camera()->screenSize().width() * 0.5, map->camera()->screenSize().height() * 0.5); qreal angle = radToDeg(polarAngle(pos - mid) - polarAngle(lastScreenPos - mid)); map->camera()->rotateBy(angle); sendWorldChanged(mid, angle); map->updateScene(); return true; } bool MapSubHelperRotate::proccessing(QPointF pos) { if (qFuzzyCompare(pos.x(), lastScreenPos.x()) && qFuzzyCompare(pos.y(), lastScreenPos.y())) return false; QPointF mid(map->camera()->screenSize().width() * 0.5, map->camera()->screenSize().height() * 0.5); qreal angle = radToDeg(polarAngle(pos - mid) - polarAngle(lastScreenPos - mid)); map->camera()->rotateBy(angle); lastScreenPos = pos; sendWorldChanged(mid, angle); map->updateScene(); return true; } void MapSubHelperRotate::sendWorldChanged(const QPointF &mid, qreal angle) { QTransform tr; tr.translate(mid.x(), mid.y()).rotate(angle).translate(-mid.x(), -mid.y()); emit worldChanged(tr); } // -------------------------------------- MapSubHelperSelect::MapSubHelperSelect(MapFrame *map_, bool continuedSelection_, QObject *parent) : MapSubHelper(map_, parent), continuedSelection(continuedSelection_) { systemLayer = initSystemLayer(map_); visualRubber = new MapObject; visualRubber->setSemantic(PenSemanticSquare, QPen(Qt::black, 2, Qt::DashLine)); visualRubber->setSemantic(BrushSemanticSquare, QBrush(Qt::NoBrush)); visualRubber->setSemantic(MarkersSemantic, (int)hoSquare); visualRubber->setLayer(systemLayer); } MapSubHelperSelect::~MapSubHelperSelect() { delete visualRubber; } bool MapSubHelperSelect::start(QPointF pos) { isMouseDown = true; lastScreenPos = pos; rubberBand = QRectF(pos, QSizeF()); visualRubber->setMetric(Metric(rectToPoly(rubberBand), Mercator)); return true; } bool MapSubHelperSelect::finish(QPointF pos) { Q_UNUSED(pos); if (!isMouseDown) return false; isMouseDown = false; // ------------------------------------------------ QRectF updateRect = rubberBand.toRect(); visualRubber->setMetric(Metric(rectToPoly(QRectF()), Mercator)); QList<MapObject*> objList; foreach (MapObject *mo, map->selectObjects(rubberBand, map->camera())) if (mo->drawer()->hit(mo, rubberBand, map->camera(), map->settings()->mapOptions())) objList.append(mo); MHEObjectList current(objList); emit handler(&current); if (canSelect.isEmpty()) { // Deselect all objects foreach (MapObjectPtr obj, selectedObjectsFull) if (obj) { obj->setSelected(false); updateRect = updateRect.united(obj->drawer()->localBound(obj, map->camera())); } clearIgnorGenList(ignorGenList); selectedObjectsFull.clear(); } else { foreach (MapObjectPtr obj, canSelect.keys()) { if (obj.isNull()) continue; if (obj->selected()) { selectedObjectsFull.insert(obj); if (!ignorGenList.contains(obj.data())) { QVariant var = obj->attribute(attrGenIgnore); ignorGenList.insert(obj.data(), var.isNull() ? false : var.toBool()); obj->setAttribute(attrGenIgnore, true); } } else { selectedObjectsFull.remove(obj); obj->setAttribute(attrGenIgnore, ignorGenList.take(obj.data())); updateRect = updateRect.united(obj->drawer()->localBound(obj, map->camera())); } } // clear deselected objects // TODO: как могу появиться в списке невыделенные объекты // QSet<MapObjectPtr> tmp = selectedObjectsFull; // selectedObjectsFull.clear(); // for (auto it = tmp.begin(); it != tmp.end(); ++it) { // MapObjectPtr obj = *it; // if (obj.isNull() || !obj->selected()) // continue; // selectedObjectsFull.insert(obj); // } } QList<MapObject*> fullList; foreach (MapObjectPtr mo, selectedObjectsFull) fullList.append(mo.data()); MHESelectedObjects selected(fullList); emit handler(&selected); canSelect.clear(); // static const int dt = 8; // map->updateScene(updateRect.toRect().adjusted(-dt, -dt, dt, dt)); map->updateScene(); return true; } bool MapSubHelperSelect::proccessing(QPointF pos) { if (!isMouseDown) return false; static const int adjRect = 10; QRectF updateRect = rubberBand; rubberBand = QRectF(lastScreenPos, pos).normalized(); visualRubber->setMetric(Metric(rectToPoly(rubberBand), Mercator)); if (rubberBand.isNull()) rubberBand.adjust(-adjRect, -adjRect, adjRect, adjRect); updateRect = updateRect.united(rubberBand); QList<MapObject*> objList; foreach (MapObject *mo, map->selectObjects(rubberBand, map->camera())) if (mo->drawer()->hit(mo, rubberBand, map->camera(), map->settings()->mapOptions())) objList.append(mo); for (QMutableHashIterator<MapObject*, CanSelect> it(canSelect); it.hasNext(); ) { it.next(); it.value().flag = false; } foreach (MapObjectPtr obj, objList) { if (!canSelect.contains(obj.data())) { // добавляем объект в кэш MHECanSelect query(obj); emit handler(&query); CanSelect sel; sel.beSelected = obj->selected(); sel.canSelect = query.result(); canSelect.insert(obj.data(), sel); } CanSelect &sel = canSelect[obj.data()]; sel.flag = true; if (sel.canSelect) { // выделяем объект obj->setSelected(!sel.beSelected); updateRect = updateRect.united(obj->drawer()->localBound(obj, map->camera())); } } for (QMutableHashIterator<MapObject*, CanSelect> it(canSelect); it.hasNext(); ) { // возвращаем выделение объекту it.next(); MapObject *mo = it.key(); CanSelect &cs = it.value(); if (!cs.flag && cs.canSelect && mo) { if (mo->selected() != cs.beSelected) updateRect = updateRect.united(mo->drawer()->localBound(mo, map->camera())); mo->setSelected(cs.beSelected); } } // static const int dt = 8; // map->updateScene(updateRect.toRect().adjusted(-dt, -dt, dt, dt)); map->updateScene(); return true; } void MapSubHelperSelect::reject(bool) { QRectF updateRect; if (continuedSelection) { foreach (MapObject *mo, selectedObjectsFull) { QRectF r = mo->drawer()->localBound(mo, map->camera()); updateRect = updateRect.isEmpty() ? r : updateRect.united(r); } } else { foreach (MapObject *mo, selectedObjectsFull) { mo->setSelected(false); QRectF r = mo->drawer()->localBound(mo, map->camera()); updateRect = updateRect.isEmpty() ? r : updateRect.united(r); } } canSelect.clear(); selectedObjectsFull.clear(); clearIgnorGenList(ignorGenList); if (!updateRect.isEmpty()) // map->updateScene(updateRect.toRect()); map->updateScene(); } void MapSubHelperSelect::initData(MapObjectList *baseSelection) { if (!baseSelection) return; QRectF updateRect; foreach (MapObjectPtr obj, *baseSelection) { if (!obj->parentObject()) continue; if (!ignorGenList.contains(obj)) { QVariant var = obj->attribute(attrGenIgnore); ignorGenList.insert(obj.data(), var.isNull() ? false : var.toBool()); obj->setAttribute(attrGenIgnore, true); } obj->setSelected(true); selectedObjectsFull.insert(obj); updateRect = updateRect.united(obj->drawer()->localBound(obj, map->camera())); } if (!updateRect.isNull()) { // static const int dt = 2; // map->updateScene(updateRect.toRect().adjusted(-dt, -dt, dt, dt)); map->updateScene(); } } void MapSubHelperSelect::deleteObject(QObject *obj) { MapObject *mo = qobject_cast<MapObject*>(obj); if (!mo || !selectedObjectsFull.contains(mo)) return; selectedObjectsFull.remove(mo); if (ignorGenList.contains(mo)) mo->setAttribute(attrGenIgnore, ignorGenList.take(mo)); canSelect.remove(mo); QRectF updateRect = mo->drawer()->localBound(mo, map->camera()); if (!updateRect.isNull()) { // static const int dt = 2; // map->updateScene(updateRect.toRect().adjusted(-dt, -dt, dt, dt)); map->updateScene(); } } void MapSubHelperSelect::deleteObjects(const QList<MapObject *> &objects) { foreach (MapObject *obj, objects) deleteObject(obj); } void MapSubHelperSelect::appendCustomObjects(const QList<MapObject *> &baseSelection) { QRectF updateRect; foreach (MapObject *obj, baseSelection) { if (!obj) continue; if (!ignorGenList.contains(obj)) { QVariant var = obj->attribute(attrGenIgnore); ignorGenList.insert(obj, var.isNull() ? false : var.toBool()); obj->setAttribute(attrGenIgnore, true); } obj->setSelected(true); selectedObjectsFull.insert(obj); updateRect = updateRect.united(obj->drawer()->localBound(obj, map->camera())); } if (!updateRect.isNull()) { // static const int dt = 2; // map->updateScene(updateRect.toRect().adjusted(-dt, -dt, dt, dt)); map->updateScene(); } } QList<MapObjectPtr> MapSubHelperSelect::getSelectedObjects() const { return selectedObjectsFull.toList(); } // -------------------------------------- // -------------------------------------- // -------------------------------------- MapSubMultiHelper::MapSubMultiHelper(MapFrame *map_, QObject *parent) : MapSubHelper(map_, parent), subhelper(NULL) { systemLayer = initSystemLayer(map_); markerLayer = initMarkerLayer(map_); standartLayer = initStandartLayer(map_); } MapSubMultiHelper::~MapSubMultiHelper() { qDeleteAll(allSubhelpers); allSubhelpers.clear(); subhelper = NULL; } bool MapSubMultiHelper::start(QPointF pos) { pressPos = pos; lastScreenPos = pos; for (QVector<SubHelper*>::iterator it = allSubhelpers.begin(); it != allSubhelpers.end(); ++it) { SubHelper *sub = *it; bool f = sub->start(pos); if (f) { isMouseDown = true; subhelper = sub; return true; } } return false; } bool MapSubMultiHelper::finish(QPointF pos) { if (!isMouseDown) return false; subhelper->finish(pos); isMouseDown = false; subhelper = NULL; return true; } bool MapSubMultiHelper::proccessing(QPointF pos) { if (!isMouseDown) return false; subhelper->proccessing(pos); lastScreenPos = pos; return true; } void MapSubMultiHelper::reject(bool flag) { foreach (SubHelper *sub, allSubhelpers) sub->reject(flag); } static bool subhelpersCompare(SubHelper *a, SubHelper *b) { Q_ASSERT(a); Q_ASSERT(b); return a->type() < b->type(); } MapSubHelperEdit::MapSubHelperEdit(MapFrame *map, QObject *parent) : MapSubMultiHelper(map, parent) { dialogFlag.insert("isCachedMode", true); dialogFlag.insert("isChangePointMode", true); dialogFlag.insert("isRemovePointMode", false); dialogFlag.insert("canUseMarkMode", true); dialogFlag.insert("isAddPointMode", true); dialogFlag.insert("addTypeMode", 2); SubHelperMark *subMark = new SubHelperMark(this); SubHelperEdit *subEdit = new SubHelperEdit(this); SubHelperCustom *subCustom = new SubHelperCustom(this); allSubhelpers.append(subMark); allSubhelpers.append(subEdit); allSubhelpers.append(subCustom); std::sort(allSubhelpers.begin(), allSubhelpers.end(), subhelpersCompare); } MapSubHelperEdit::~MapSubHelperEdit() { objectsMark.deleteAll(); } void MapSubHelperEdit::reject(bool flag) { MapSubMultiHelper::reject(flag); for (EditedObjects::iterator it = objectsMark.begin(), itEnd = objectsMark.end(); it != itEnd; ++it) { MapObject *key = *it; key->setSelected(false); disconnect(key, SIGNAL(metricChanged()), this, SLOT(recalcObject())); disconnect(key, SIGNAL(aniNotify(MapObject*)), this, SLOT(recalcObject(MapObject*))); disconnect(key, SIGNAL(destroyed(QObject*)), this, SLOT(deleteObject(QObject*))); disconnect(key, SIGNAL(classCodeChanged(QString)), this, SLOT(changeClassCode(QString))); disconnect(key, SIGNAL(attributeChanged(int, QVariant)), this, SLOT(changeAttribute(int,QVariant))); } for (EditedObjects::iterator it = objectsMark.mBegin(), itEnd = objectsMark.mEnd(); it != itEnd; ++it) { MapObject *mark = *it; mark->setMetric(Metric(Mercator)); mark->clearAttributes(); } objectsMark.clear(); clearIgnorGenList(); if (flag) { MHEEditedObjects ed(objectsMark.edited()); emit handler(&ed); } map->updateScene(); } void MapSubHelperEdit::addObjects(MapObjectPtr mo, bool isLowPriority) { MapObjectList list; list.append(mo); addObjects(list, isLowPriority); } void MapSubHelperEdit::addObjects(const MapObjectList &objects, bool isLowPriority) { QRectF updateRect; int size = objectsMark.size(); foreach (MapObjectPtr mo, objects) { if (!mo || mo->parentObject() || !mo->drawer() || objectsMark.contains(mo)) continue; if (!mo->useMetricNotify()) mo->setUseMetricNotify(true); connect(mo.data(), SIGNAL(metricChanged()), this, SLOT(recalcObject())); connect(mo.data(), SIGNAL(aniNotify(MapObject*)), this, SLOT(recalcObject(MapObject*))); if (!ignorGenList.contains(mo)) { QVariant var = mo->attribute(attrGenIgnore); ignorGenList.insert(mo, var.isNull() ? false : var.toBool()); mo->setAttribute(attrGenIgnore, true); } updateRect = updateRect.united(mo->drawer()->localBound(mo, map->camera())); mo->setSelected(true); MapObject *obj; if (!(obj = objectsMark.freePop())) { obj = new MapObject; obj->setUid(QUuid::createUuid().toString()); obj->setSemantic(PointSemantic , QPointF(10, 10) ); obj->setSemantic(PenSemantic , QPen(PointMarkPenColor, 2, Qt::SolidLine) ); obj->setSemantic(BrushSemantic , QBrush(PointMarkBrushColor, Qt::SolidPattern)); obj->setSemantic(PenSemanticLine , QPen(LineMarkPenColor, 7, Qt::SolidLine) ); obj->setSemantic(PenSemanticSquare , QPen(PolyMarkPenColor, 1, Qt::SolidLine) ); obj->setSemantic(BrushSemanticSquare, QBrush(PolyMarkBrushColor, Qt::SolidPattern) ); obj->setLayer(markerLayer); } HeOptions visual = opt & (hoPoint | hoLine | hoSquare | hoHelpers); obj->setSemantic(MarkersSemantic, (int)visual); obj->setMetric(Metric(mo->drawer()->controlPoints(mo, map->camera()), Mercator)); obj->setClassCode(mo->classCode()); obj->clearAttributes(); obj->setAttribute(attrSmoothed, mo->attributeDraw(attrSmoothed)); if (isLowPriority) objectsMark.push_back(mo.data(), obj); else objectsMark.push_front(mo.data(), obj); connect(mo.data(), SIGNAL(destroyed(QObject*)), SLOT(deleteObject(QObject*)), Qt::UniqueConnection); connect(mo.data(), SIGNAL(classCodeChanged(QString)), SLOT(changeClassCode(QString)), Qt::UniqueConnection); connect(mo.data(), SIGNAL(attributeChanged(int, QVariant)), SLOT(changeAttribute(int,QVariant)), Qt::UniqueConnection); } if (!updateRect.isNull()) { // static const int dt = 10; // map->updateScene(updateRect.toRect().adjusted(-dt, -dt, dt, dt)); map->updateScene(); } if (size != objectsMark.size()) emit objectsCountChanged(); } QList<MapObject *> MapSubHelperEdit::objects() const { return objectsMark.objects(); } MapObject *MapSubHelperEdit::object(MapObject *mark) { return objectsMark.object(mark); } QList<MapObject *> MapSubHelperEdit::markers() const { return objectsMark.markers(); } MapObject *MapSubHelperEdit::marker(MapObject *obj) { return objectsMark.marker(obj); } void MapSubHelperEdit::initData(const MapObjectList &objects, HeOptions options) { objectsMark.clear(); MHECachedMode mhCm; emit handler(&mhCm); MHEMovePress mp(QPointF(-1, -1)); emit handler(&mp); bool isCachedMode = mhCm.result(); setFlag("isCachedMode", isCachedMode); if (isCachedMode) { MHECanRemovePoint mhCrp; emit handler(&mhCrp); setFlag("isRemovePointMode", mhCrp.result()); MHECanChangePoint mhCcp; emit handler(&mhCcp); setFlag("isChangePointMode", mhCcp.result()); MHECanAddPoint mhCap; emit handler(&mhCap); setFlag("isAddPointMode", mhCap.result()); setFlag("addType", mhCap.flag); } MHEMarkMode mhUmm; emit handler(&mhUmm); setFlag("canUseMarkMode", mhUmm.result()); opt = options; if (!objects.isEmpty()) addObjects(objects); emit dataInited(options); } void MapSubHelperEdit::recalcObject() { MapObject *obj = qobject_cast<MapObject*>(sender()); recalcObject(obj); } void MapSubHelperEdit::recalcObject(MapObject *obj) { if (!obj) return; MapObject *mark = objectsMark.marker(obj); if (mark) mark->setMetric(Metric(obj->drawer()->controlPoints(obj, map->camera()), Mercator)); } void MapSubHelperEdit::deleteObject(QObject *obj) { MapObject *mobj = static_cast<minigis::MapObject *>(obj); objectsMark.remove(mobj); ignorGenList.remove(mobj); // FIXME: error on destruction // emit objectsCountChanged(); } void MapSubHelperEdit::changeClassCode(QString cls) { MapObject *obj = qobject_cast<MapObject *>(sender()); MapObject *mark = objectsMark.marker(obj); if (mark) mark->setClassCode(cls); } void MapSubHelperEdit::changeAttribute(int key, QVariant attr) { if (key != attrSmoothed) return; MapObject *obj = qobject_cast<MapObject *>(sender()); MapObject *mark = objectsMark.marker(obj); if (mark) mark->setAttribute(key, attr); } void MapSubHelperEdit::correctWorldImpl(QTransform tr) { emit correctSubWorld(tr); // for (EditedObjects::iterator it = objectsMark.mBegin(), itEnd = objectsMark.mEnd(); it != itEnd; ++it) { // MapObject *mark = *it; // if (!mark) // continue; // mark->setMetric(Metric(tr.map(mark->metric().toMercator()), Mercator)); // } for (EditedObjects::hIterator it = objectsMark.hBegin(), itEnd = objectsMark.hEnd(); it != itEnd; ++it) { MapObject* key = it.key(); MapObject* value = it.value(); if (!key || !value) continue; value->setMetric(Metric(key->drawer()->controlPoints(key, map->camera()), Mercator)); } map->updateScene(); } void MapSubHelperEdit::changeObjectsImpl(QTransform tr, QRectF upd, bool flag) { MapCamera *cam = map->camera(); emit correctSubWorld2(tr); for (EditedObjects::const_hIterator it = objectsMark.hBegin(); it != objectsMark.hEnd(); ++it) { EditedObjects::ItemType global = it.key(); EditedObjects::ItemType local = it.value(); QRectF r = global->drawer()->localBound(global, cam); for (int i = 0; i < global->metric().size(); ++i) global->setMetric(i, Metric(tr.map(global->metric().toMercator(i)), Mercator)); r = r.united(global->drawer()->localBound(global, cam)); upd = upd.united(r); local->setMetric(Metric(global->drawer()->controlPoints(global, cam), Mercator)); } // static const int d = 30; // map->updateScene(upd.toRect().adjusted(-d, -d, d, d)); map->updateScene(); if (flag) objectsMark.editedAll(); } void MapSubHelperEdit::objectHasChangedImpl(MapObject *obj) { objectsMark.edited(obj); } void MapSubHelperEdit::clearIgnorGenList() { ::clearIgnorGenList(ignorGenList); } // -------------------------------------------- MapSubHelperCreate::MapSubHelperCreate(MapFrame *map, HeOptions opts, QObject *parent) : MapSubMultiHelper(map, parent), currentObject(NULL), visualObject(NULL), ignoreGen(false), tmpObj(false) { visualObject = new MapObject; visualObject->setLayer(markerLayer); dialogFlag.insert("isCachedMode", true); dialogFlag.insert("isAddPointMode", true); dialogFlag.insert("addTypeMode", 2); dialogFlag.insert("isChangePointMode", true); dialogFlag.insert("isRemovePointMode", true); dialogFlag.insert("canUseMarkMode", false); if (!opts.testFlag(hoDisableEdit)) { SubHelperEdit *subEdit = new SubHelperEdit(this); allSubhelpers.append(subEdit); } SubHelperAdd *subAdd = new SubHelperAdd(this); allSubhelpers.append(subAdd); std::sort(allSubhelpers.begin(), allSubhelpers.end(), subhelpersCompare); } MapSubHelperCreate::~MapSubHelperCreate() { delete visualObject; } void MapSubHelperCreate::reject(bool flag) { MapSubMultiHelper::reject(flag); visualObject->setMetric(Metric(Mercator)); if (currentObject) { currentObject->setAttribute(attrGenIgnore, ignoreGen); disconnect(currentObject, SIGNAL(metricChanged()), this, SLOT(recalcObject())); disconnect(currentObject, SIGNAL(aniNotify(MapObject*)), this, SLOT(recalcObject(MapObject*))); disconnect(currentObject, SIGNAL(destroyed(QObject*)), this, SLOT(deleteObject(QObject*))); disconnect(currentObject, SIGNAL(classCodeChanged(QString)), this, SLOT(changeClassCode(QString))); disconnect(currentObject, SIGNAL(attributeChanged(int, QVariant)), this, SLOT(changeAttribute(int,QVariant))); } if (tmpObj) { tmpObj = false; delete currentObject; } currentObject = NULL; map->updateScene(); } void MapSubHelperCreate::addObjects(MapObjectPtr mo, bool isLowPriority) { Q_UNUSED(isLowPriority); init(mo.data(), 0, QFlag(hoPoint | hoHelpers), false); } void MapSubHelperCreate::addObjects(const MapObjectList &objects, bool isLowPriority) { if (objects.size() == 1) addObjects(objects.first(), isLowPriority); } QList<MapObject *> MapSubHelperCreate::objects() const { QList<MapObject*> list; if (currentObject) list << currentObject; return list; } MapObject *MapSubHelperCreate::object(MapObject *mark) { return mark == visualObject ? currentObject : NULL; } QList<MapObject *> MapSubHelperCreate::markers() const { QList<MapObject*> list; if (currentObject) list << visualObject; return list; } MapObject *MapSubHelperCreate::marker(MapObject *obj) { return (obj && obj == currentObject) ? visualObject : NULL; } void MapSubHelperCreate::addPoint(QPointF const &p) { static SubHelperAdd* const add = qobject_cast<SubHelperAdd*>( !allSubhelpers.isEmpty() ? allSubhelpers.last() : NULL); if (add) { add->start(p); add->finish(p); } } void MapSubHelperCreate::initData(MapObject *mo, int maxPoints, HeOptions options) { init(mo, maxPoints, options, true); } void MapSubHelperCreate::recalcObject() { MapObject *obj = qobject_cast<MapObject*>(sender()); recalcObject(obj); } void MapSubHelperCreate::recalcObject(MapObject *obj) { if (!obj || obj != currentObject) return; visualObject->setMetric(Metric(currentObject->drawer()->controlPoints(currentObject, map->camera()), Mercator)); } void MapSubHelperCreate::deleteObject(QObject *obj) { MapObject *mobj = static_cast<minigis::MapObject *>(obj); if (!mobj || mobj != currentObject) return; reject(false); emit autoReject(); } void MapSubHelperCreate::changeClassCode(QString cls) { MapObject *obj = qobject_cast<MapObject *>(sender()); if (!obj || obj != currentObject) return; visualObject->setClassCode(cls); } void MapSubHelperCreate::changeAttribute(int key, QVariant attr) { if (key != attrSmoothed) return; MapObject *obj = qobject_cast<MapObject *>(sender()); if (!obj || obj != currentObject) return; visualObject->setAttribute(key, attr); } void MapSubHelperCreate::changeObjectsImpl(QTransform tr, QRectF upd, bool) { emit correctSubWorld2(tr); if (!currentObject) return; MapCamera *cam = map->camera(); static const int d = 10; QRectF r = currentObject->drawer()->localBound(currentObject, cam); for (int i = 0; i < currentObject->metric().size(); ++i) currentObject->setMetric(i, Metric(tr.map(currentObject->metric().toMercator(i)), Mercator)); r = r.united(currentObject->drawer()->localBound(currentObject, cam)); upd = upd.united(r.adjusted(-d, -d, d, d)); visualObject->setMetric(Metric(currentObject->drawer()->controlPoints(currentObject, cam), Mercator)); // map->updateScene(upd.toRect()); map->updateScene(); } void MapSubHelperCreate::objectHasChangedImpl(MapObject *) { } void MapSubHelperCreate::init(MapObject *mo, int maxPoints, HeOptions options, bool askQuestions) { if (mo && !mo->drawer()) { qWarning() << "Object without drawer."; emit autoReject(); return; } reject(false); if (askQuestions) { MHECachedMode mhCm; emit handler(&mhCm); bool isCachedMode = mhCm.result(); setFlag("isCachedMode", isCachedMode); if (isCachedMode) { MHECanRemovePoint mhCrp; emit handler(&mhCrp); setFlag("isRemovePointMode", mhCrp.result()); MHECanChangePoint mhCcp; emit handler(&mhCcp); setFlag("isChangePointMode", mhCcp.result()); MHECanAddPoint mhCap; emit handler(&mhCap); setFlag("isAddPointMode", mhCap.result()); setFlag("addType", mhCap.flag); } } visualObject->setMetric(Metric(Mercator)); visualObject->clearAttributes(); currentObject = mo; tmpObj = !currentObject; if (tmpObj) { currentObject = new MapObject; currentObject->setClassCode("{00000000-0000-409d-9621-f4899f6a4c6e}"); currentObject->setLayer(standartLayer); } if (currentObject) { QVariant var = currentObject->attribute(attrGenIgnore); ignoreGen = var.isNull() ? false : var.toBool(); currentObject->setAttribute(attrGenIgnore, true); if (!currentObject->useMetricNotify()) currentObject->setUseMetricNotify(true); connect(currentObject, SIGNAL(metricChanged()), this, SLOT(recalcObject())); connect(currentObject, SIGNAL(aniNotify(MapObject*)), this, SLOT(recalcObject(MapObject*))); connect(currentObject, SIGNAL(destroyed(QObject*)), this, SLOT(deleteObject(QObject*)), Qt::UniqueConnection); connect(currentObject, SIGNAL(classCodeChanged(QString)), SLOT(changeClassCode(QString)), Qt::UniqueConnection); connect(currentObject, SIGNAL(attributeChanged(int, QVariant)), SLOT(changeAttribute(int,QVariant)), Qt::UniqueConnection); QVector<QPolygonF> tmp = currentObject->drawer()->controlPoints(currentObject, map->camera()); visualObject->setMetric(Metric(tmp, Mercator)); visualObject->setClassCode(currentObject->classCode()); visualObject->setAttribute(attrSmoothed, currentObject->attribute(attrSmoothed)); } HeOptions visual = options & (hoPoint | hoLine | hoSquare | hoHelpers); visualObject->setSemantic(MarkersSemantic, (int)visual); visualObject->setSemantic(PointSemantic, QPointF(10, 10)); visualObject->setSemantic(PenSemantic, QPen(PointMarkPenColor, 2, Qt::SolidLine)); visualObject->setSemantic(BrushSemantic, QBrush(PointMarkBrushColor, Qt::SolidPattern)); visualObject->setSemantic(PenSemanticLine, QPen(LineMarkPenColor, 7, Qt::SolidLine)); visualObject->setSemantic(PenSemanticSquare, QPen(PolyMarkPenColor, 1, Qt::SolidLine)); visualObject->setSemantic(BrushSemanticSquare, QBrush(PolyMarkBrushColor, Qt::SolidPattern)); foreach (SubHelper *sub, allSubhelpers) { if (sub->type() == SubHelperAdd::Type) qobject_cast<SubHelperAdd*>(sub)->initData(currentObject, maxPoints, options); else if (sub->type() == SubHelperEdit::Type) qobject_cast<SubHelperEdit*>(sub)->initData(options); } if (currentObject) { // static const int dt = 2; // map->updateScene(visualObject->drawer()->boundRect(visualObject).toRect().adjusted(-dt, -dt, dt, dt)); map->updateScene(); } } void MapSubHelperCreate::correctWorldImpl(QTransform tr) { emit correctSubWorld(tr); if (!currentObject) return; visualObject->setMetric(Metric(currentObject->drawer()->controlPoints(currentObject, map->camera()), Mercator)); // static const int dt = 2; // map->updateScene(visualObject->drawer()->boundRect(visualObject).toRect().adjusted(-dt, -dt, dt, dt)); map->updateScene(); } // -------------------------------------------- // -------------------------------------------- // -------------------------------------------- SubHelperMark::SubHelperMark(MapSubMultiHelper *subhelper, QObject *parent) : SubHelper(subhelper, parent) { midMark = new MapObject; midMark->setSemantic(PointSemantic, QPointF(8, 8)); midMark->setSemantic(PenSemantic, QPen(MarkColorPen, 1, Qt::SolidLine)); midMark->setSemantic(BrushSemantic, QBrush(MarkColorBrush, Qt::SolidPattern)); midMark->setSemantic(ImageSemantic, QImage(":/minimap/ctrl/point.png")); midMark->setSemantic(MarkersSemantic, (int)hoPoint); midMark->setLayer(q_ptr->getSystemLayer()); posMark = new MapObject; posMark->setSemantic(PointSemantic, QPointF(25, 25)); posMark->setSemantic(PenSemantic, QPen(MarkColorPen, 1, Qt::SolidLine)); posMark->setSemantic(BrushSemantic, QBrush(MarkColorBrush, Qt::SolidPattern)); posMark->setSemantic(ImageSemantic, QImage(":/minimap/ctrl/move.png")); posMark->setSemantic(MarkersSemantic, (int)hoPoint); posMark->setLayer(q_ptr->getSystemLayer()); rotateMark = new MapObject; rotateMark->setSemantic(PointSemantic, QPointF(25, 25)); rotateMark->setSemantic(PenSemantic, QPen(MarkColorPen, 1, Qt::SolidLine)); rotateMark->setSemantic(BrushSemantic, QBrush(MarkColorBrush, Qt::SolidPattern)); rotateMark->setSemantic(ImageSemantic, QImage(":/minimap/ctrl/rotate.png")); rotateMark->setSemantic(MarkersSemantic, (int)hoPoint); rotateMark->setLayer(q_ptr->getSystemLayer()); scaleMark = new MapObject; scaleMark->setSemantic(PointSemantic, QPointF(25, 25)); scaleMark->setSemantic(PenSemantic, QPen(MarkColorPen, 1, Qt::SolidLine)); scaleMark->setSemantic(BrushSemantic, QBrush(MarkColorBrush, Qt::SolidPattern)); scaleMark->setSemantic(ImageSemantic, QImage(":/minimap/ctrl/scale.png")); scaleMark->setSemantic(MarkersSemantic, (int)hoPoint); scaleMark->setLayer(q_ptr->getSystemLayer()); midAni = new MarkerAnimation(midMark); posAni = new MarkerAnimation(posMark); rotateAni = new MarkerAnimation(rotateMark); scaleAni = new MarkerAnimation(scaleMark); int pause = 50; markersGroup.addAnimation(midAni); markersGroup.addAnimation(posAni, pause); markersGroup.addAnimation(rotateAni, pause); markersGroup.addAnimation(scaleAni, pause); midMark->setAttribute(attrOpacity, 0); posMark->setAttribute(attrOpacity, 0); rotateMark->setAttribute(attrOpacity, 0); scaleMark ->setAttribute(attrOpacity, 0); MapFrame *map = q_ptr->getMap(); connect(midAni, SIGNAL(valueChanged(QRect)), map, SLOT(updateScene(QRect))); connect(posAni, SIGNAL(valueChanged(QRect)), map, SLOT(updateScene(QRect))); connect(rotateAni, SIGNAL(valueChanged(QRect)), map, SLOT(updateScene(QRect))); connect(scaleAni, SIGNAL(valueChanged(QRect)), map, SLOT(updateScene(QRect))); connect(this, SIGNAL(changeObjects(QTransform,QRectF,bool)), q_ptr, SLOT(changeObjects(QTransform,QRectF,bool))); connect(q_ptr, SIGNAL(correctSubWorld(QTransform)), this, SLOT(correctMarkers(QTransform))); connect(q_ptr, SIGNAL(objectsCountChanged()), this, SLOT(checkMarkers())); connect(q_ptr, SIGNAL(dataInited(HeOptions)), this, SLOT(upMarkers(HeOptions))); } SubHelperMark::~SubHelperMark() { delete midMark; delete posMark; delete rotateMark; delete scaleMark; delete midAni; delete posAni; delete rotateAni; delete scaleAni; } bool SubHelperMark::start(QPointF pos) { isMarkMode = 0; if (midMark->metric().size() == 0 || markersGroup.isRunning()) return false; static const qreal r = 625; // 25 * 25 if (lengthR2Squared(scaleMark->metric().toMercator(0).first() - pos) < r) isMarkMode = 4; else if (lengthR2Squared(rotateMark->metric().toMercator(0).first() - pos) < r) isMarkMode = 3; else if (lengthR2Squared(posMark->metric().toMercator(0).first() - pos) < r) isMarkMode = 2; else if (lengthR2Squared(midMark->metric().toMercator(0).first() - pos) < r) isMarkMode = 1; return isMarkMode > 0; } bool SubHelperMark::finish(QPointF pos) { changeMarkers(pos, true); return true; } bool SubHelperMark::proccessing(QPointF pos) { changeMarkers(pos, false); return true; } void SubHelperMark::reject(bool) { clearMarkers(); } void SubHelperMark::clearMarkers() { if (midMark->metric().size() == 0) return; QPointF boundmid = markerBound(midMark->metric().toMercator(0).first(), QRectF(QPointF(), q_ptr->getCamera()->screenSize())); midAni->setEndPosition(boundmid); posAni->setEndPosition(boundmid); rotateAni->setEndPosition(boundmid); scaleAni->setEndPosition(boundmid); midAni->setEndOpacity(0); posAni->setEndOpacity(0); rotateAni->setEndOpacity(0); scaleAni->setEndOpacity(0); markersGroup.start(); } void SubHelperMark::checkMarkers() { QList<MapObject*> list = q_ptr->objects(); int size = list.size(); if (size && q_ptr->flag("canUseMarkMode").toBool()) { bool one = size == 1 && list.first()->drawer()->canUseMarkMode(); if (one || size > 1) initMarkesByObject(); } else clearMarkers(); } void SubHelperMark::correctMarkers(QTransform tr) { if (!midMark || midMark->metric().size() == 0) return; QRectF boundRect(QPointF(), q_ptr->getCamera()->screenSize()); midMark->setMetric(Metric(tr.map(midMark->metric().toMercator(0).first()), Mercator)); posMark->setMetric(Metric(markerBound(tr.map(posMark->metric().toMercator(0).first()), boundRect), Mercator)); rotateMark->setMetric(Metric(markerBound(tr.map(rotateMark->metric().toMercator(0).first()), boundRect), Mercator)); scaleMark->setMetric(Metric(markerBound(tr.map(scaleMark->metric().toMercator(0).first()), boundRect), Mercator)); } void SubHelperMark::upMarkers(HeOptions) { posMark->layer()->remObject(posMark); midMark->layer()->remObject(midMark); rotateMark->layer()->remObject(rotateMark); scaleMark->layer()->remObject(scaleMark); q_ptr->getSystemLayer()->addObject(posMark); q_ptr->getSystemLayer()->addObject(midMark); q_ptr->getSystemLayer()->addObject(rotateMark); q_ptr->getSystemLayer()->addObject(scaleMark); } void SubHelperMark::updateMarkRect(QRectF &updateRect) { QPolygonF tmp; tmp << midMark->metric().toMercator(0).first() << posMark->metric().toMercator(0).first() << rotateMark->metric().toMercator(0).first() << scaleMark->metric().toMercator(0).first(); updateRect = updateRect.isEmpty() ? tmp.boundingRect() : updateRect.united(tmp.boundingRect()); } void SubHelperMark::changeMarkers(QPointF pos, bool flag) { QTransform trWorld; // локальная матрица MapCamera *cam = q_ptr->getCamera(); QRectF boundRect(QPointF(), cam->screenSize()); QPointF prevPos = markerBound(q_ptr->getLastScreenPos(), boundRect); pos = markerBound(pos, boundRect); QRectF updateRect; static const int delta = 2; if (isMarkMode == 1) { updateMarkRect(updateRect); moveMarkers(pos - prevPos); updateMarkRect(updateRect); } else if (isMarkMode == 2) { QPointF deltaWorld = cam->toWorld(pos) - cam->toWorld(prevPos); trWorld.translate(deltaWorld.x(), deltaWorld.y()); updateMarkRect(updateRect); moveMarkers(pos - prevPos); updateMarkRect(updateRect); } else if (isMarkMode == 3) { QPointF mid = midMark->metric().toMercator(0).first(); qreal ang = radToDeg(polarAngle(pos - mid) - polarAngle(prevPos - mid)); QPointF midWorld = cam->toWorld(mid); trWorld.translate(midWorld.x(), midWorld.y()).rotate(ang).translate(-midWorld.x(), -midWorld.y()); updateRect = QRectF(rotateMark->metric().toMercator(0).first(), QSizeF(delta, delta)); rotateMark->setMetric(Metric(markerBound(rotateMark->metric().toMercator(0).first() + pos - prevPos, boundRect), Mercator)); updateRect = updateRect.united(QRectF(rotateMark->metric().toMercator(0).first(), QSizeF(delta, delta))); } else if (isMarkMode == 4) { QPointF mid = midMark->metric().toMercator(0).first(); qreal dist = lengthR2Squared(prevPos - mid); if (!qFuzzyIsNull(dist)) { qreal scale = lengthR2Squared(pos - mid) / dist; QPointF midWorld = cam->toWorld(mid); trWorld.translate(midWorld.x(), midWorld.y()).scale(scale, scale).translate(-midWorld.x(), -midWorld.y()); updateRect = QRectF(scaleMark->metric().toMercator(0).first(), QSizeF(delta, delta)); scaleMark->setMetric(Metric(markerBound(scaleMark->metric().toMercator(0).first() + pos - prevPos, boundRect), Mercator)); updateRect = updateRect.united(QRectF(scaleMark->metric().toMercator(0).first(), QSizeF(delta, delta))); } } else return; static const int dtMark = 30; updateRect = updateRect.adjusted(-dtMark, -dtMark, dtMark, dtMark); emit changeObjects(trWorld, updateRect, flag); } void SubHelperMark::moveMarkers(QPointF delta) { QRectF boundRect(QPointF(), q_ptr->getCamera()->screenSize()); midMark->setMetric(Metric(midMark->metric().toMercator(0).first() + delta, Mercator)); posMark->setMetric(Metric(markerBound(posMark->metric().toMercator(0).first() + delta, boundRect), Mercator)); rotateMark->setMetric(Metric(markerBound(rotateMark->metric().toMercator(0).first() + delta, boundRect), Mercator)); scaleMark->setMetric(Metric(markerBound(scaleMark->metric().toMercator(0).first() + delta , boundRect), Mercator)); } void SubHelperMark::initMarkesByObject() { QPointF mid; int count = 0; QList<MapObject *> list = q_ptr->markers(); for (QList<MapObject *>::iterator it = list.begin(); it != list.end(); ++it) { MapObject *obj = *it; if (!obj || obj->metric().size() == 0) continue; MetricItem mData = obj->metric().toMercator(0); for (int j = 0; j < mData.size(); ++j) { mid += mData.at(j); ++count; } } if (count != 0) initMarkersByPoint(mid / count); else clearMarkers(); } void SubHelperMark::initMarkersByPoint(QPointF mid) { qreal tmp = 150; qreal dcos = qCos(M_PI / 6.); qreal dsin = qSin(M_PI / 6.); qreal dx = tmp * dcos; qreal dy = tmp * dsin; QRectF boundRect(QPointF(), q_ptr->getCamera()->screenSize()); midAni->setEndOpacity(255); posAni->setEndOpacity(255); rotateAni->setEndOpacity(255); scaleAni->setEndOpacity(255); QPointF boundmid = markerBound(mid, boundRect); if (midMark->metric().size() == 0) midMark->setMetric(Metric(boundmid, Mercator)); if (posMark->metric().size() == 0) posMark->setMetric(Metric(boundmid, Mercator)); if (rotateMark->metric().size() == 0) rotateMark->setMetric(Metric(boundmid, Mercator)); if (scaleMark->metric().size() == 0) scaleMark->setMetric(Metric(boundmid, Mercator)); midAni->setEndPosition(mid); posAni->setEndPosition(markerBound(mid + QPointF(0, tmp), boundRect)); rotateAni->setEndPosition(markerBound(mid + QPointF(-dx, -dy), boundRect)); scaleAni->setEndPosition(markerBound(mid + QPointF(dx, -dy), boundRect)); markersGroup.start(); } // -------------------------------------------- SubHelperEdit::SubHelperEdit(MapSubMultiHelper *subhelper, QObject *parent) : SubHelper(subhelper, parent), changinIndex(-1), metricNumber(0), currentObject(NULL), visualObject(NULL) { markPoint = false; activePoint = new MapObject; activePoint->setSemantic(PointSemantic, QPointF(10, 10)); activePoint->setSemantic(PenSemantic, QPen(MarkerActivePen, 1, Qt::SolidLine)); activePoint->setSemantic(BrushSemantic, QBrush(MarkerActiveBrush, Qt::SolidPattern)); activePoint->setSemantic(MarkersSemantic, (int)hoPoint); activePoint->setLayer(q_ptr->getMarkerLayer()); deletePoints = new MapObject; deletePoints->setSemantic(PointSemantic, QPointF(10, 10)); deletePoints->setSemantic(PenSemantic, QPen(MarkerDeletePen, 1, Qt::SolidLine)); deletePoints->setSemantic(BrushSemantic, QBrush(MarkerDeleteBrush, Qt::SolidPattern)); deletePoints->setSemantic(MarkersSemantic, (int)hoPoint); deletePoints->setLayer(q_ptr->getMarkerLayer()); connect(q_ptr, SIGNAL(dataInited(HeOptions)), this, SLOT(initData(HeOptions))); connect(q_ptr, SIGNAL(objectsCountChanged()), this, SLOT(upDeleteMarkers())); connect(q_ptr, SIGNAL(correctSubWorld(QTransform)), this, SLOT(correct(QTransform))); connect(q_ptr, SIGNAL(correctSubWorld2(QTransform)), this, SLOT(correct2(QTransform))); connect(this, SIGNAL(objectHasChanged(MapObject*)), q_ptr, SLOT(objectHasChanged(MapObject*))); } SubHelperEdit::~SubHelperEdit() { delete deletePoints; delete activePoint; } bool SubHelperEdit::start(QPointF pos) { QList<MapObject*> list = q_ptr->markers(); for (QList<MapObject*>::iterator it = list.begin(); it != list.end(); ++it) { MapObject *mark = *it; MetricData mData = mark->metric().toMercator(); for (int i = mData.size() - 1; i >= 0; --i) { // выбираем текущий объект + запоминаем его индекс if (nearControlPoint(mData.at(i), pos, changinIndex)) { metricNumber = i; currentObject = q_ptr->object(mark); visualObject = mark; if (!q_ptr->flag("isCachedMode", false).toBool()) { MHECanChangePoint mhCcp(2, currentObject); emit q_ptr->handler(&mhCcp); q_ptr->setFlag("isChangePointMode", mhCcp.result()); } if (changeControlPoint(pos)) return true; else { visualObject = NULL; return false; } } } } // тянем объект за промежуточную точку for (QList<MapObject*>::iterator it = list.begin(); it != list.end(); ++it) { MapObject *mark = *it; MapObject *obj = q_ptr->object(mark); bool isClosed = obj->drawer() ? obj->drawer()->isClosed(obj->classCode()) : false; bool cubic = obj->attributeDraw(attrSmoothed).toBool(); MetricData mData = mark->metric().toMercator(); for (int i = 0; i < mData.size(); ++i) { // выбираем текущий объект + запоминаем его индекс if (cubic ? nearEdgePointCubic(mData.at(i), pos, changinIndex, isClosed) : nearEdgePoint(mData.at(i), pos, changinIndex, isClosed) ) { metricNumber = i; currentObject = obj; visualObject = mark; if (changeInterPoint(pos)) return true; else { visualObject = NULL; return false; } } } } return false; } bool SubHelperEdit::finish(QPointF pos) { Q_UNUSED(pos); MHEPointDrop drop(currentObject, metricNumber, changinIndex); emit q_ptr->handler(&drop); MapCamera *cam = q_ptr->getCamera(); if (changinIndex == -1 || metricNumber >= visualObject->metric().size() || changinIndex >= visualObject->metric().toMercator(metricNumber).size()) { deletePoints->setMetric(Metric(Mercator)); activePoint->setMetric(Metric(Mercator)); currentObject = NULL; visualObject = NULL; return false; } QPolygonF tmp = visualObject->metric().toMercator(metricNumber); bool canRemove = q_ptr->flag("isRemovePointMode").toBool(); if (!q_ptr->flag("isCachedMode").toBool()) { MHECanRemovePoint mhCrp(false, currentObject, metricNumber); emit q_ptr->handler(&mhCrp); q_ptr->setFlag("isRemovePointMode", mhCrp.result()); } canRemove = currentObject->drawer()->canRemovePoint(currentObject, metricNumber) & q_ptr->flag("isRemovePointMode").toBool(); if (canRemove) { QPointF del; bool cubic = currentObject ? currentObject->attributeDraw(attrSmoothed).toBool() : false; bool closed = currentObject ? (currentObject->drawer() ? currentObject->drawer()->isClosed(currentObject->classCode()) : false) : false; if (cubic ? pointCanBeRemovedCubic(tmp, changinIndex, closed) : pointCanBeRemovedLinear(tmp, changinIndex, closed)) { del = tmp.at(changinIndex); tmp.remove(changinIndex); if (markPoint) activePoint->setMetric(Metric(Mercator)); MHEPointRemoved mherp(currentObject, cam->toWorld(del), metricNumber, changinIndex); q_ptr->handler(&mherp); } else { if (changinIndex + 1 < tmp.size()) if (cubic ? pointCanBeRemovedCubic(tmp, changinIndex + 1, closed) : pointCanBeRemovedLinear(tmp, changinIndex + 1, closed)) { del = tmp.at(changinIndex); tmp.remove(changinIndex + 1); MHEPointRemoved mherp(currentObject, cam->toWorld(del), metricNumber, changinIndex + 1); q_ptr->handler(&mherp); } if (changinIndex - 1 > 0) { if (cubic ? pointCanBeRemovedCubic(tmp, changinIndex - 1, closed) : pointCanBeRemovedLinear(tmp, changinIndex - 1, closed)) { del = tmp.at(changinIndex); tmp.remove(changinIndex - 1); MHEPointRemoved mherp(currentObject, cam->toWorld(del), metricNumber, changinIndex + 1); q_ptr->handler(&mherp); } } } } QRectF updateRect = currentObject->drawer()->localBound(currentObject, q_ptr->getCamera()); changeHelperMetric(tmp); changeCurrentObject(); updateRect = updateRect.united(currentObject->drawer()->localBound(currentObject, q_ptr->getCamera())); emit objectHasChanged(currentObject); reject(false); // q_ptr->getMap()->updateScene(updateRect.toRect() // .adjusted(-updateDelta, -updateDelta, updateDelta, updateDelta)); q_ptr->getMap()->updateScene(); return true; } bool SubHelperEdit::proccessing(QPointF pos) { if (changinIndex == -1) return false; if (metricNumber >= visualObject->metric().size() || changinIndex >= visualObject->metric().toMercator(metricNumber).size()) { deletePoints->setMetric(Metric(Mercator)); activePoint->setMetric(Metric(Mercator)); return false; } QPolygonF tmp = visualObject->metric().toMercator(metricNumber); QPointF prev = tmp.at(changinIndex); if (qFuzzyCompare(prev.x(), pos.x()) && qFuzzyCompare(prev.y(), pos.y())) return false; tmp.replace(changinIndex, pos); if (markPoint) activePoint->setMetric(Metric(MetricItem() << pos, Mercator)); MHEChangedPoint change(currentObject, q_ptr->getCamera()->toWorld(prev), q_ptr->getCamera()->toWorld(pos), metricNumber, changinIndex); emit q_ptr->handler(&change); bool canRemove = q_ptr->flag("isRemovePointMode").toBool(); if (!q_ptr->flag("isCachedMode").toBool()) { MHECanRemovePoint mhCrp(false, currentObject, metricNumber); emit q_ptr->handler(&mhCrp); q_ptr->setFlag("isRemovePointMode", mhCrp.result()); } canRemove = currentObject->drawer()->canRemovePoint(currentObject, metricNumber) & q_ptr->flag("isRemovePointMode").toBool(); QPolygonF dp; if (canRemove) { bool cubic = currentObject ? currentObject->attributeDraw(attrSmoothed).toBool() : false; bool closed = currentObject ? (currentObject->drawer() ? currentObject->drawer()->isClosed(currentObject->classCode()) : false) : false; if (cubic ? pointCanBeRemovedCubic(tmp, changinIndex, closed) : pointCanBeRemovedLinear(tmp, changinIndex, closed)) dp.append(tmp.at(changinIndex)); else { if (changinIndex < tmp.size() - 1) { if (cubic ? pointCanBeRemovedCubic(tmp, changinIndex + 1, closed) : pointCanBeRemovedLinear(tmp, changinIndex + 1, closed)) dp.append(tmp.at(changinIndex + 1)); } if (changinIndex > 1) { if (cubic ? pointCanBeRemovedCubic(tmp, changinIndex - 1, closed) : pointCanBeRemovedLinear(tmp, changinIndex - 1, closed)) dp.append(tmp.at(changinIndex - 1)); } } } deletePoints->setMetric(Metric(dp, Mercator)); // QRectF updateRect = currentObject->drawer()->localBound(currentObject, q_ptr->getCamera()); changeHelperMetric(tmp); changeCurrentObject(); // updateRect = updateRect.united(currentObject->drawer()->localBound(currentObject, q_ptr->getCamera())); // q_ptr->getMap()->updateScene(updateRect.toRect() // .adjusted(-updateDelta, -updateDelta, updateDelta, updateDelta)); q_ptr->getMap()->updateScene(); return true; } void SubHelperEdit::reject(bool flag) { deletePoints->setMetric(Metric(Mercator)); currentObject = NULL; visualObject = NULL; metricNumber = 0; changinIndex = -1; if (flag) activePoint->setMetric(Metric(Mercator)); } void SubHelperEdit::initCustomObject(MapObject *mo, int mNumber, int pNumber) { currentObject = mo; visualObject = q_ptr->marker(currentObject); metricNumber = mNumber; changinIndex = pNumber; MHEPointDrag drag(currentObject, metricNumber, changinIndex); emit q_ptr->handler(&drag); } void SubHelperEdit::initData(HeOptions opt) { activePoint->setSemantic(MarkersSemantic, int(opt.testFlag(hoPoint) ? hoPoint : hoNone)); deletePoints->setSemantic(MarkersSemantic, int(opt.testFlag(hoPoint) ? hoPoint : hoNone)); markPoint = opt.testFlag(hoMarkPoint); } void SubHelperEdit::upDeleteMarkers() { activePoint->layer()->remObject(activePoint); q_ptr->getMarkerLayer()->addObject(activePoint); deletePoints->layer()->remObject(deletePoints); q_ptr->getMarkerLayer()->addObject(deletePoints); } void SubHelperEdit::correct(QTransform tr) { if (markPoint) { MetricItem it = activePoint->metric().toMercatorE(0); activePoint->setMetric(Metric(tr.map(it), Mercator)); } } void SubHelperEdit::correct2(QTransform tr) { if (markPoint) { MapCamera *cam = q_ptr->getCamera(); MetricItem it = cam->toWorld().map(activePoint->metric().toMercatorE(0)); activePoint->setMetric(Metric(cam->toScreen().map(tr.map(it)), Mercator)); } } bool SubHelperEdit::changeControlPoint(const QPointF &pos) { if (q_ptr->flag("isChangePointMode").toInt() == 0) return false; QPolygonF tmp = visualObject->metric().toMercator(metricNumber); QPointF prev = tmp.at(changinIndex); MHEChangedPoint change(currentObject, q_ptr->getCamera()->toWorld(prev), q_ptr->getCamera()->toWorld(pos), metricNumber, changinIndex); emit q_ptr->handler(&change); tmp.replace(changinIndex, pos); // QRectF updateRect = currentObject->drawer()->localBound(currentObject, q_ptr->getCamera()); changeHelperMetric(tmp); changeCurrentObject(); // updateRect = updateRect.united(currentObject->drawer()->localBound(currentObject, q_ptr->getCamera())); MHEPointDrag drag(currentObject, metricNumber, changinIndex); emit q_ptr->handler(&drag); if (markPoint) activePoint->setMetric(Metric(MetricItem() << pos, Mercator)); // q_ptr->getMap()->updateScene(updateRect.toRect() // .adjusted(-updateDelta, -updateDelta, updateDelta, updateDelta)); q_ptr->getMap()->updateScene(); return true; } bool SubHelperEdit::changeInterPoint(const QPointF &pos) { if (q_ptr->flag("isChangePointMode").toInt() < 2) return false; bool can = true; can = currentObject->drawer()->canAddControlPoints(currentObject); if (!can) return false; QPolygonF tmp = visualObject->metric().toMercator(metricNumber); tmp.insert(changinIndex, pos); MHEPointInsert ins(currentObject, pos, metricNumber, changinIndex); emit q_ptr->handler(&ins); deletePoints->setMetric(Metric(QPolygonF() << pos, Mercator)); // QRectF updateRect = currentObject->drawer()->localBound(currentObject, q_ptr->getCamera()); changeHelperMetric(tmp); changeCurrentObject(); // updateRect = updateRect.united(currentObject->drawer()->localBound(currentObject, q_ptr->getCamera())); MHEPointDrag drag(currentObject, metricNumber, changinIndex); emit q_ptr->handler(&drag); if (markPoint) activePoint->setMetric(Metric(MetricItem() << pos, Mercator)); // q_ptr->getMap()->updateScene(updateRect.toRect() // .adjusted(-updateDelta, -updateDelta, updateDelta, updateDelta)); q_ptr->getMap()->updateScene(); return true; } void SubHelperEdit::changeHelperMetric(const QPolygonF &tmp) { visualObject->setMetric( Metric( currentObject->drawer()->correctMetric(visualObject, tmp, metricNumber), Mercator ) ); } void SubHelperEdit::changeCurrentObject() { currentObject->blockSignals(true); currentObject->setMetric(Metric(Mercator)); MetricData mData = visualObject->metric().toMercator(); for (int i = 0; i < mData.size(); ++i) currentObject->setMetric(i, Metric(q_ptr->getCamera()->toWorld().map(mData.at(i)), Mercator)); currentObject->blockSignals(false); } // -------------------------------------------- SubHelperAdd::SubHelperAdd(MapSubMultiHelper *subhelper, QObject *parent) : SubHelper(subhelper, parent), currentObject(NULL), visualObject(NULL), maxPoints(0), noCutMax(true), addType(0) { visualTmp = new MapObject; visualTmp->setSemantic(MarkersSemantic, (int)hoLine); visualTmp->setSemantic(PointSemantic, QPointF(10, 10)); visualTmp->setSemantic(PenSemantic, QPen(PointMarkPenColor, 2, Qt::SolidLine)); visualTmp->setSemantic(BrushSemantic, QBrush(PointMarkBrushColor, Qt::SolidPattern)); visualTmp->setSemantic(PenSemanticLine, QPen(LineMarkPenColor, 7, Qt::SolidLine)); visualTmp->setSemantic(PenSemanticSquare, QPen(PolyMarkPenColor, 1, Qt::SolidLine)); visualTmp->setSemantic(BrushSemanticSquare, QBrush(PolyMarkBrushColor, Qt::SolidPattern)); visualTmp->setLayer(q_ptr->getSystemLayer()); connect(this, SIGNAL(autoReject()), q_ptr, SIGNAL(autoReject())); connect(this, SIGNAL(objectHasChanged(MapObject*)), q_ptr, SLOT(objectHasChanged(MapObject*))); } SubHelperAdd::~SubHelperAdd() { delete visualTmp; } bool SubHelperAdd::start(QPointF pos) { if (maxPoints && pointsCount >= maxPoints) return false; if (q_ptr->flag("isCacheMode").toBool()) { MHECanAddPoint mhCap(true, true, currentObject); emit q_ptr->handler(&mhCap); q_ptr->setFlag("isAddPointMode", mhCap.result()); q_ptr->setFlag("addType", mhCap.flag); } if (currentObject) { addType = (noCutMax & moveObject) || (currentObject->drawer()->canAddControlPoints(currentObject) & q_ptr->flag("isAddPointMode").toBool()) ? (currentObject->drawer()->canAddPen(currentObject) & q_ptr->flag("addType").toInt() ? 2 : 1) : 0; } else addType = q_ptr->flag("isAddPointMode").toBool() ? (q_ptr->flag("addType").toInt() ? 2 : 1) : 0; if (addType) { visualTmp->setMetric(Metric(pos, Mercator)); // q_ptr->getMap()->updateScene(QRect(pos.toPoint(), QSize()) // .adjusted(-updateDelta, -updateDelta, updateDelta, updateDelta)); q_ptr->getMap()->updateScene(); } return addType; } bool SubHelperAdd::finish(QPointF pos) { Q_UNUSED(pos); if (!addType) return false; QPolygonF tmp = visualTmp->metric().toMercator(0); if (addType == 1) { ++pointsCount; } else { tmp = polygonSmoothing(tmp, 10); if (!noCutMax && maxPoints && pointsCount + tmp.size() > maxPoints) tmp.resize(maxPoints - pointsCount); if (moveObject) pointsCount = tmp.size(); else pointsCount += tmp.size(); } if (currentObject) { QList<QPointF> poly = tmp.toList(); if (moveObject) { MapObject tmpObj; tmpObj.setClassCode(currentObject->classCode()); while (!poly.isEmpty() && currentObject->drawer()->canAddControlPoints(&tmpObj)) { int num = currentObject->drawer()->whereAddPoint(&tmpObj); QPolygonF tmp = tmpObj.metric().size() <= num ? QPolygonF() : tmpObj.metric().toMercator(num); tmpObj.setMetric(num, (Metric(tmp << q_ptr->getCamera()->toWorld(poly.takeFirst()), Mercator))); } currentObject->setMetric(tmpObj.metric()); visualObject->setMetric(Metric(currentObject->drawer()->controlPoints(currentObject, q_ptr->getCamera()), Mercator)); } else { while (!poly.isEmpty() && currentObject->drawer()->canAddControlPoints(currentObject)) { int num = currentObject->drawer()->whereAddPoint(visualObject); QPointF p = poly.takeFirst(); currentObject->blockSignals(true); QPolygonF tmp = currentObject->metric().size() <= num ? QPolygonF() : currentObject->metric().toMercator(num); currentObject->setMetric(num, (Metric(tmp << q_ptr->getCamera()->toWorld(p), Mercator))); currentObject->blockSignals(false); visualObject->setMetric(Metric(currentObject->drawer()->controlPoints(currentObject, q_ptr->getCamera()), Mercator)); } } } // QRect updateRect = visualTmp->metric().toMercator(0).boundingRect().toRect(); visualTmp->setMetric(Metric(Mercator)); // q_ptr->getMap()->updateScene(updateRect.adjusted(-updateDelta, -updateDelta, updateDelta, updateDelta)); q_ptr->getMap()->updateScene(); QPolygonF points; QTransform const &trans = q_ptr->getCamera()->toWorld(); std::for_each(tmp.begin(), tmp.end(), TransformPoint(points, trans)); MHEClickedPoints click(points); emit q_ptr->handler(&click); allClickedPoints += points; if (currentObject) emit objectHasChanged(currentObject); if (maxPoints && pointsCount >= maxPoints) emit autoReject(); return true; } bool SubHelperAdd::proccessing(QPointF pos) { if (!addType) return false; QPolygonF tmp = visualTmp->metric().toMercator(0); if (addType == 1) tmp.replace(tmp.size() - 1, pos); else if (lengthR2Squared(tmp.last() - pos) > MoveDelta) tmp.append(pos); visualTmp->setMetric(Metric(tmp, Mercator)); // q_ptr->getMap()->updateScene(tmp.boundingRect().toRect() // .adjusted(-updateDelta, -updateDelta, updateDelta, updateDelta)); q_ptr->getMap()->updateScene(); return true; } void SubHelperAdd::reject(bool flag) { if (currentObject && currentObject->drawer()) { currentObject->setMetric(Metric(currentObject->drawer()->fillMetric(currentObject, q_ptr->getCamera()), Mercator)); q_ptr->getMap()->updateScene(); } if (flag) { MHEAllClickedPoints click(allClickedPoints); emit q_ptr->handler(&click); } visualTmp->setMetric(Metric(Mercator)); currentObject = NULL; visualObject = NULL; allClickedPoints.clear(); pointsCount = 0; } void SubHelperAdd::initData(MapObject *mo, int maxPoints_, HeOptions opt) { currentObject = mo; visualObject = q_ptr->marker(mo); maxPoints = maxPoints_; noCutMax = opt.testFlag(hoNoCutMax); moveObject = opt.testFlag(hoMoveObject); pointsCount = 0; } // -------------------------------------------- SubHelperCustom::SubHelperCustom(MapSubMultiHelper *subhelper, QObject *parent) : SubHelper(subhelper, parent), customAction(NULL) { } SubHelperCustom::~SubHelperCustom() { } bool SubHelperCustom::start(QPointF pos) { QPointF worldPos = q_ptr->getCamera()->toWorld(pos); MHECustomAction custom(worldPos); emit q_ptr->handler(&custom); HelperAction *action = custom.action(); if (!action) return false; subtype = action->type(); switch (subtype) { case HelperActionMove::Type: { MapSubHelperMove *move = new MapSubHelperMove(q_ptr->getMap()); connect(move, SIGNAL(handler(minigis::MHEvent*)), q_ptr, SIGNAL(handler(minigis::MHEvent*))); connect(move, SIGNAL(worldChanged(QTransform)), q_ptr, SIGNAL(worldChanged(QTransform))); connect(move, SIGNAL(worldChanged(QTransform)), q_ptr, SLOT(correctWorld(QTransform))); customAction = move; customAction->start(pos); break; } case HelperActionSelect::Type: { MapSubHelperSelect *select = new MapSubHelperSelect(q_ptr->getMap(), true); select->appendCustomObjects(q_ptr->objects()); connect(select, SIGNAL(handler(minigis::MHEvent*)), q_ptr, SIGNAL(handler(minigis::MHEvent*))); connect(select, SIGNAL(worldChanged(QTransform)), q_ptr, SIGNAL(worldChanged(QTransform))); connect(select, SIGNAL(worldChanged(QTransform)), q_ptr, SLOT(correctWorld(QTransform))); customAction = select; customAction->start(pos); break; } case HelperActionCreate::Type: { HelperActionCreate *hac = dynamic_cast<HelperActionCreate*>(action); if (!hac || !hac->object()) return false; q_ptr->addObjects(hac->object()); SubHelperAdd *create = new SubHelperAdd(q_ptr); create->initData(hac->object()); customAction = create; customAction->start(pos); break; } case HelperActionEdit::Type: { HelperActionEdit *hae = dynamic_cast<HelperActionEdit *>(action); if (!hae || !hae->object()) return false; q_ptr->addObjects(hae->object()); SubHelperEdit *edit = new SubHelperEdit(q_ptr); edit->initCustomObject(hae->object(), hae->metricNumber(), hae->pointNumber()); customAction = edit; break; } default: break; } return bool(customAction); } bool SubHelperCustom::finish(QPointF pos) { customAction->finish(pos); if (subtype == 2) { MapSubHelperSelect *select = qobject_cast<MapSubHelperSelect*>(customAction); QList<MapObjectPtr> tmpList = select->getSelectedObjects(); q_ptr->reject(false); q_ptr->addObjects(tmpList); } else customAction->reject(false); subtype = 0; delete customAction; customAction = NULL; return true; } bool SubHelperCustom::proccessing(QPointF pos) { return customAction->proccessing(pos); } void SubHelperCustom::reject(bool flag) { if (customAction) customAction->reject(flag); } // -------------------------------------- } // namespace minigis // --------------------------------------
gpl-2.0
TheTypoMaster/Scaper
openjdk/jdk/test/javax/sound/midi/Gervill/ModelByteBuffer/NewModelByteBufferFile.java
3287
/* * Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Sun designates this * particular file as subject to the "Classpath" exception as provided * by Sun in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, * CA 95054 USA or visit www.sun.com if you need additional information or * have any questions. */ /* @test @summary Test ModelByteBuffer(File) constructor */ import java.io.File; import java.io.FileOutputStream; import javax.sound.sampled.*; import com.sun.media.sound.*; public class NewModelByteBufferFile { static float[] testarray; static byte[] test_byte_array; static File test_file; static AudioFormat format = new AudioFormat(44100, 16, 1, true, false); static void setUp() throws Exception { testarray = new float[1024]; for (int i = 0; i < 1024; i++) { double ii = i / 1024.0; ii = ii * ii; testarray[i] = (float)Math.sin(10*ii*2*Math.PI); testarray[i] += (float)Math.sin(1.731 + 2*ii*2*Math.PI); testarray[i] += (float)Math.sin(0.231 + 6.3*ii*2*Math.PI); testarray[i] *= 0.3; } test_byte_array = new byte[testarray.length*2]; AudioFloatConverter.getConverter(format).toByteArray(testarray, test_byte_array); test_file = File.createTempFile("test", ".raw"); FileOutputStream fos = new FileOutputStream(test_file); fos.write(test_byte_array); } static void tearDown() throws Exception { if(!test_file.delete()) test_file.deleteOnExit(); } public static void main(String[] args) throws Exception { try { setUp(); ModelByteBuffer buff = new ModelByteBuffer(test_file); if(buff.array() != null) throw new RuntimeException("buff.array() not null!"); if(buff.capacity() != test_file.length()) throw new RuntimeException("buff.capacity() incorrect!"); if(buff.arrayOffset() != 0) throw new RuntimeException("buff.arrayOffset() not 0!"); if(buff.getFile() != test_file) throw new RuntimeException("buff.getFile() incorrect!"); if(buff.getFilePointer() != 0) throw new RuntimeException("buff.getFilePointer() not 0!"); } finally { tearDown(); } } }
gpl-2.0
SIS-Team/SIS-Doc
sources/raspberry/display.php
675
<?php include("../../config.php"); include(ROOT_LOCATION . "/modules/monitors/Main.php"); $monitor = getMonitorByName($_GET['name']); if (!$monitor) die("none"); if ($monitor->displayMode == "permanent Ein") die("true"); else if ($monitor->displayMode == "permanent Aus") die("false"); else { // monitor off on sat and sun if (date("N") >= 6) die("true"); $on = $monitor->startTime; $off = $monitor->endTime; $on = $on % (24 * 60 * 60); $off = $off % (24 * 60 * 60); $now = time(); $now += date("I") * 60 * 60; $now = $now % (24 * 60 * 60); if ($now > $on && $now < $off) die ("true"); else die ("false"); } ?>
gpl-2.0
booshlin/form-analytics-for-wordpress
includes/class-form-analytics.php
4315
<?php /** * The file that defines the core plugin class * * A class definition that includes attributes and functions used across both the * public-facing side of the site and the admin area. * * @link http://example.com * @since 1.0.0 * * @package Form_Analytics * @subpackage Form_Analytics/includes */ /** * The core plugin class. * * This is used to define internationalization, admin-specific hooks, and * public-facing site hooks. * * Also maintains the unique identifier of this plugin as well as the current * version of the plugin. * * @since 1.0.0 * @package Form_Analytics * @subpackage Form_Analytics/includes * @author Your Name <email@example.com> */ class Form_Analytics { /** * The loader that's responsible for maintaining and registering all hooks that power * the plugin. * * @since 1.0.0 * @access protected * @var Form_Analytics_Loader $loader Maintains and registers all hooks for the plugin. */ protected $loader; /** * The unique identifier of this plugin. * * @since 1.0.0 * @access protected * @var string $plugin_name The string used to uniquely identify this plugin. */ protected $plugin_name; /** * The current version of the plugin. * * @since 1.0.0 * @access protected * @var string $version The current version of the plugin. */ protected $version; /** * Define the core functionality of the plugin. * * Set the plugin name and the plugin version that can be used throughout the plugin. * Load the dependencies, define the locale, and set the hooks for the admin area and * the public-facing side of the site. * * @since 1.0.0 */ public function __construct() { if ( defined( 'FORM_ANALYTICS_VERSION' ) ) { $this->version = FORM_ANALYTICS_VERSION; } else { $this->version = '1.0.0'; } $this->plugin_name = 'form-analytics'; $this->load_dependencies(); $this->define_public_hooks(); } /** * Load the required dependencies for this plugin. * * Include the following files that make up the plugin: * * - Form_Analytics_Loader. Orchestrates the hooks of the plugin. * - Form_Analytics_Public. Defines all hooks for the public side of the site. * * Create an instance of the loader which will be used to register the hooks * with WordPress. * * @since 1.0.0 * @access private */ private function load_dependencies() { /** * The class responsible for orchestrating the actions and filters of the * core plugin. */ require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-form-analytics-loader.php'; /** * The class responsible for defining all actions that occur in the public-facing * side of the site. */ require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-form-analytics-public.php'; $this->loader = new Form_Analytics_Loader(); } /** * Register all of the hooks related to the public-facing functionality * of the plugin. * * @since 1.0.0 * @access private */ private function define_public_hooks() { $plugin_public = new Form_Analytics_Public( $this->get_plugin_name(), $this->get_version() ); $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' ); $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' ); } /** * Run the loader to execute all of the hooks with WordPress. * * @since 1.0.0 */ public function run() { $this->loader->run(); } /** * The name of the plugin used to uniquely identify it within the context of * WordPress and to define internationalization functionality. * * @since 1.0.0 * @return string The name of the plugin. */ public function get_plugin_name() { return $this->plugin_name; } /** * The reference to the class that orchestrates the hooks with the plugin. * * @since 1.0.0 * @return Form_Analytics_Loader Orchestrates the hooks of the plugin. */ public function get_loader() { return $this->loader; } /** * Retrieve the version number of the plugin. * * @since 1.0.0 * @return string The version number of the plugin. */ public function get_version() { return $this->version; } }
gpl-2.0
nharedweb/redSOCIALSTREAM2
component/admin/tables/configure.php
508
<?php /** * @package redSocialstream * @subpackage Models * * @copyright Copyright (C) 2012 - 2013 redCOMPONENT.com. All rights reserved. * @license GNU General Public License version 2 or later, see LICENSE. */ defined('_JEXEC') or die; class RedSocialStreamTableConfigure extends RTable { /** * The table name without the prefix. * * @var string */ protected $_tableName = 'redsocialstream_configures'; /** * @var integer */ public $id; }
gpl-2.0
wishdev/rio
lib/rio/exception/notsupported.rb
1435
#-- # =============================================================================== # Copyright (c) 2005,2006,2007 Christopher Kleckner # All rights reserved # # This file is part of the Rio library for ruby. # # Rio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # Rio is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Rio; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # =============================================================================== #++ # # To create the documentation for Rio run the command # ruby build_doc.rb # from the distribution directory. # # Suggested Reading # * RIO::Doc::SYNOPSIS # * RIO::Doc::INTRO # * RIO::Doc::HOWTO # * RIO::Doc::EXAMPLES # * RIO::Rio # require 'rio/exception' module RIO module Exception class NotSupported < Base #:nodoc: all def self.emsg(fname,obj) "#{fname}() is not supported for #{obj.class} objects" end end end end
gpl-2.0
elbeardmorez/quodlibet
quodlibet/tests/test_plugins_songsmenu.py
7291
# -*- coding: utf-8 -*- # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. import shutil from quodlibet.library import SongLibrary from quodlibet.plugins.songsmenu import SongsMenuPlugin from quodlibet.plugins.songshelpers import any_song, each_song from tests import TestCase, mkstemp, mkdtemp import os from quodlibet.formats import AudioFile from quodlibet.plugins import PluginManager, Plugin from quodlibet.qltk.songsmenu import SongsMenuPluginHandler from tests.helper import capture_output from tests.test_library_libraries import FakeSong class TSongsMenuPlugins(TestCase): def _confirmer(self, *args): self.confirmed = True def setUp(self): self.tempdir = mkdtemp() self.pm = PluginManager(folders=[self.tempdir]) self.confirmed = False self.handler = SongsMenuPluginHandler(self._confirmer, self._confirmer) self.pm.register_handler(self.handler) self.pm.rescan() self.assertEquals(self.pm.plugins, []) self.library = SongLibrary('foo') def tearDown(self): self.library.destroy() self.pm.quit() shutil.rmtree(self.tempdir) def create_plugin(self, id='', name='', desc='', icon='', funcs=None, mod=False): fd, fn = mkstemp(suffix='.py', text=True, dir=self.tempdir) file = os.fdopen(fd, 'w') if mod: indent = '' else: file.write( "from quodlibet.plugins.songsmenu import SongsMenuPlugin\n") file.write("class %s(SongsMenuPlugin):\n" % name) indent = ' ' file.write("%spass\n" % indent) if name: file.write("%sPLUGIN_ID = %r\n" % (indent, name)) if name: file.write("%sPLUGIN_NAME = %r\n" % (indent, name)) if desc: file.write("%sPLUGIN_DESC = %r\n" % (indent, desc)) if icon: file.write("%sPLUGIN_ICON = %r\n" % (indent, icon)) for f in (funcs or []): if f in ["__init__"]: file.write("%sdef %s(self, *args): super(%s, self).__init__(" "*args); raise Exception(\"as expected\")\n" % (indent, f, name)) else: file.write("%sdef %s(*args): return args\n" % (indent, f)) file.flush() file.close() def test_empty_has_no_plugins(self): self.pm.rescan() self.assertEquals(self.pm.plugins, []) def test_name_and_desc_plus_func_is_one(self): self.create_plugin(name='Name', desc='Desc', funcs=['plugin_song']) self.pm.rescan() self.assertEquals(len(self.pm.plugins), 1) def test_additional_functions_still_only_one(self): self.create_plugin(name='Name', desc='Desc', funcs=['plugin_song', 'plugin_songs']) self.pm.rescan() self.assertEquals(len(self.pm.plugins), 1) def test_two_plugins_are_two(self): self.create_plugin(name='Name', desc='Desc', funcs=['plugin_song']) self.create_plugin(name='Name2', desc='Desc2', funcs=['plugin_albums']) self.pm.rescan() self.assertEquals(len(self.pm.plugins), 2) def test_disables_plugin(self): self.create_plugin(name='Name', desc='Desc', funcs=['plugin_song']) self.pm.rescan() self.failIf(self.pm.enabled(self.pm.plugins[0])) def test_enabledisable_plugin(self): self.create_plugin(name='Name', desc='Desc', funcs=['plugin_song']) self.pm.rescan() plug = self.pm.plugins[0] self.pm.enable(plug, True) self.failUnless(self.pm.enabled(plug)) self.pm.enable(plug, False) self.failIf(self.pm.enabled(plug)) def test_ignores_broken_plugin(self): self.create_plugin(name="Broken", desc="Desc", funcs=["__init__", "plugin_song"]) self.pm.rescan() plug = self.pm.plugins[0] self.pm.enable(plug, True) with capture_output(): menu = self.handler.Menu(None, [AudioFile()]) self.failIf(menu and menu.get_children()) def test_Menu(self): self.create_plugin(name='Name', desc='Desc', funcs=['plugin_song']) self.handler.Menu(None, [AudioFile()]) def test_handling_songs_without_confirmation(self): plugin = Plugin(FakeSongsMenuPlugin) self.handler.plugin_enable(plugin) MAX = FakeSongsMenuPlugin.MAX_INVOCATIONS songs = [AudioFile({'~filename': "/tmp/%s" % x, 'artist': 'foo'}) for x in range(MAX)] self.handler.handle(plugin.id, self.library, None, songs) self.failIf(self.confirmed, ("Wasn't expecting a confirmation for %d" " invocations" % len(songs))) def test_handling_lots_of_songs_with_confirmation(self): plugin = Plugin(FakeSongsMenuPlugin) self.handler.plugin_enable(plugin) MAX = FakeSongsMenuPlugin.MAX_INVOCATIONS songs = [AudioFile({'~filename': "/tmp/%s" % x, 'artist': 'foo'}) for x in range(MAX + 1)] self.handler.handle(plugin.id, self.library, None, songs) self.failUnless(self.confirmed, ("Should have confirmed %d invocations (Max=%d)." % (len(songs), MAX))) def even(i): return i % 2 == 0 def never(_): return False class Tsongsmenu(TestCase): songs = [FakeSong(1), FakeSong(2)] def test_any_song(self): FakeSongsMenuPlugin.plugin_handles = any_song(even) p = FakeSongsMenuPlugin(self.songs, None) self.failUnless(p.plugin_handles(self.songs)) self.failIf(p.plugin_handles(self.songs[:1])) def test_any_song_multiple(self): FakeSongsMenuPlugin.plugin_handles = any_song(even, never) p = FakeSongsMenuPlugin(self.songs, None) self.failIf(p.plugin_handles(self.songs)) self.failIf(p.plugin_handles(self.songs[:1])) def test_each_song(self): FakeSongsMenuPlugin.plugin_handles = each_song(even) p = FakeSongsMenuPlugin(self.songs, None) self.failIf(p.plugin_handles(self.songs)) self.failUnless(p.plugin_handles(self.songs[1:])) def test_each_song_multiple(self): FakeSongsMenuPlugin.plugin_handles = each_song(even, never) p = FakeSongsMenuPlugin(self.songs, None) self.failIf(p.plugin_handles(self.songs)) self.failIf(p.plugin_handles(self.songs[:1])) class FakeSongsMenuPlugin(SongsMenuPlugin): PLUGIN_NAME = "Fake Songs Menu Plugin" PLUGIN_ID = "SongsMunger" MAX_INVOCATIONS = 50 def __init__(self, songs, library): super(FakeSongsMenuPlugin, self).__init__(songs, library) self.total = 0 def plugin_song(self, song): self.total += 1 if self.total > self.MAX_INVOCATIONS: raise ValueError("Shouldn't have called me on this many songs" " (%d > %d)" % (self.total, self.MAX_INVOCATIONS))
gpl-2.0
opennms-forge/poc-nms-core
opennms-services/src/test/java/org/opennms/netmgt/capsd/JoeSnmpV2IfSnmpCollectorTest.java
1541
/******************************************************************************* * This file is part of OpenNMS(R). * * Copyright (C) 2008-2012 The OpenNMS Group, Inc. * OpenNMS(R) is Copyright (C) 1999-2012 The OpenNMS Group, Inc. * * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. * * OpenNMS(R) is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published * by the Free Software Foundation, either version 3 of the License, * or (at your option) any later version. * * OpenNMS(R) is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with OpenNMS(R). If not, see: * http://www.gnu.org/licenses/ * * For more information contact: * OpenNMS(R) Licensing <license@opennms.org> * http://www.opennms.org/ * http://www.opennms.com/ *******************************************************************************/ package org.opennms.netmgt.capsd; import org.junit.Before; import org.opennms.netmgt.capsd.IfSnmpCollectorTestCase.JoeSnmpIfSnmpCollectorTestCase; public class JoeSnmpV2IfSnmpCollectorTest extends JoeSnmpIfSnmpCollectorTestCase { @Before @Override public void setUp() throws Exception { setVersion(2); super.setUp(); } }
gpl-2.0
beaugogh/FreeBu
js/freebu.js
11559
(function(window){ 'use strict'; // --- define freebu --- function define_freebu() { var freebu = { version: "0", // --- ids on the control pannel (index.html) --- _DIV_ID_CONTROL: "div-control", _DIV_ID_VIS: "div-vis", _DIV_ID_FILTER: "div-filter", _DIV_PADDING: 30, _TOGGLE_ID_RUN: "toggle-run", _BUTTON_ID_SORT: "btn-sort", _TOGGLE_ID_COLLAPSE: "toggle-collapse", _TOGGLE_ID_LABEL: "toggle-label", _TOGGLE_ID_LASSO: "toggle-lasso", _TOGGLE_ID_CONFINE: "toggle-confine", _LABEL_ID_TOGGLE_RUN: "toggle-run-label", _LABEL_ID_TOGGLE_COLLAPSE: "toggle-collapse-label", _LABEL_ID_TOGGLE_CONFINE: "toggle-confine-label", _RADIO_ID_NETWORK_VIEW: "networkV", _RADIO_ID_CIRCLE_VIEW: "circleV", _RADIO_ID_RANK_VIEW: "rankV", _BUTTON_ID_RESET: "btn-reset", // --- global variables --- svg: {}, g: {}, hulls: {}, tip: {}, nodes: {}, links: {}, data: {}, data_path: {}, dx:0, //offset due to svg translation dy:0, is_mouse_left_down:false, is_mouse_dragging:false, is_lassoable:false, // --- zoom params --- min_zoom: 0.3, max_zoom: 10, // --- styles --- color: {}, short_duration: 500, moderate_duration: 1000, long_duration: 2000, font_default_size: 14, font_max_size: 30, font_min_size: 6, node_default_radius: 5, node_max_radius: 8, node_min_radius: 4, node_circle_max_radius:30, node_circle_min_radius:3, node_rank_default_radius: 10, node_rank_max_radius: 20, node_rank_min_radius: 10, link_default_width: 1, link_max_width: 3, link_min_width: 0.1, node_default_style: { "fill": "steelblue", "fill-opacity": "0.8", "stroke": "#fff", "stroke-width": "1.5px" }, node_circle_default_style: { "fill": "steelblue", "fill-opacity": "0.8", "stroke": "#fff", "stroke-width": "1.5px" }, node_default_stroke_style: { "stroke": "#fff", "stroke-width": "1.5px" }, super_node_default_stroke_style: { "stroke": "navy", "stroke-width": "1px", "stroke-dasharray": ("10, 10") }, node_highlight_stroke_style: { "stroke": "orange", "stroke-width": "3px" }, node_fixed_stroke_style: { "stroke": "#505050", "stroke-width": "2px" }, node_default_color_style: { "fill": "steelblue" }, node_dormant_color_style: { "fill": "#d0d1e6" }, node_text_default_style: { "font": "sans-serif", "font-size": 14, "stroke": "none", "fill": "black" }, link_default_style: { "stroke": "#999", "stroke-width": "1px", "stroke-opacity": "0.6" }, link_super_style: { "stroke": "#999", "stroke-linecap": "round", "stroke-opacity": "0.6" }, lasso_node_stroke_style: { "stroke": "#A80000", "stroke-opacity": "0.7", "stroke-width": "5px" }, // --- dimension --- width: function(x) { if(x) freebu.width = x; else return freebu.width; }, height: function(x) { if(x) freebu.height = x; else return freebu.height; }, resize: function() { var _w = document.getElementById(freebu._DIV_ID_VIS).offsetWidth-freebu._DIV_PADDING; var _h = _w/1.618; //console.log("resizing: " + _w + ", " + _h); //console.log(document.getElementById(freebu._DIV_ID_VIS)); freebu.width = _w; freebu.height = _h; freebu.svg.attr("width",_w); freebu.svg.attr("height",_h); freebu.svg.select("#svgrect") .attr("width",_w) .attr("height",_h); if(freebu.filter.list_data.length>0){ // var w = freebu.filter.list_w; // var x = freebu.width-w-freebu.filter.list_padding; // freebu.filter.lists.each(function(d,i){ // var list_node = d3.select(this); // var shift = x - list_node.select("rect").attr("x"); // /* a problem using transform: enlarge or shrink browser window mess up the objects' positions*/ // list_node.attr("transform","translate("+shift+",0)"); // }); freebu.filter.align_lists(); } }, adjust_tip_direction: function(d) { var padding = 30; var rect = freebu.g[0][0].getBoundingClientRect(); var left = rect.left; var right = left + rect.width; if(Math.abs(d.y-rect.top) < padding) { // freebu.tip.offset() freebu.tip.direction('s'); } else if(Math.abs(rect.bottom - d.y) < padding) freebu.tip.direction('n'); else freebu.tip.direction('e'); }, // --- initialize --- init: function(data_path, which_view) { var _w = document.getElementById(freebu._DIV_ID_VIS).offsetWidth-freebu._DIV_PADDING; var _h = _w/1.618; console.log("size: ("+_w+","+_h.toFixed(0)+")"); freebu.width = _w; freebu.height = _h; freebu.svg = d3.select("#"+freebu._DIV_ID_VIS) .append("svg") .attr("id","vis-svg") .attr("width",freebu.width) .attr("height",freebu.height); freebu.svg.append("rect").attr("id", "svgrect") .attr("x",0).attr("y",0) .attr("width",freebu.width) .attr("height",freebu.height) .attr("rx", 15).attr("ry", 15) .style("stroke", "rgba(130,130,130,130)") .style("stroke-width", 1).style("fill", "none") .style("opacity",0); freebu.g = freebu.svg.append("g").attr("id","visg"); //initialize tip freebu.tip = d3.tip().attr("class","d3-tip") .offset([0, 10]) .html(function(d) { var html = '<p style="color:orange;display:inline">'+d.name+"</p><br>"; if(d.nr_children == 0) { var info=freebu.filter.summary['info'][d.id]; for(var i=0; i<info.length; i++) { var obj = info[i]; html += obj.name+": "+obj.value+"<br>"; } } return html; }); window.onresize = freebu.resize; d3.json(data_path, function(error, data) { if (error) throw error; freebu.data = data; console.log("#nodes: " + data.nodes.length); console.log("#links: " + data.links.length); //inject properties to data $.each(freebu.data.links, function(i, link_item) { link_item.id = i; link_item.weight = 1; }); $.each(freebu.data.nodes, function(i, node_item) { node_item.degree = 0; node_item.nr_children = 0;//>0 if it's a super node }); //initialize links freebu.links = freebu.g.append("g") .attr("id", "linkg") .selectAll(".link") .data(data.links, function(d){return d.id;}); //initialize hulls and lasso freebu.g.append("g").attr("id","hullg"); d3.select("#hullg").append("rect") .attr("id", "lasso_area") .attr("width",freebu.width) .attr("height",freebu.height) // .style("fill", "red") .style("opacity",0); freebu.lasso.init(); freebu.g.append("g").attr("id", "listg"); //initialize nodes freebu.nodes = freebu.g.append("g") .attr("id","nodeg") .selectAll(".node") .data(data.nodes, function(d){return d.id;}); // freebu.nodes.each(function(d){ // // d3.select(this).attr("id","node_"+d.id); // console.log(d3.select(this)); // d.dormant = false; // d.marked = false; // }); // ------------ vis ------------ freebu.force.init(data); // else if(which_view=='circleV')freebu.force.init(data); // else if(which_view=='rankV')freebu.force.init(data); // ------------ filter ------------ freebu.filter.init(); console.log("data loaded"); $(document).mousedown(function(e) { if(e.which == 1) freebu.is_mouse_left_down = true; }); $(document).mouseup(function(e) { if(e.which == 1) freebu.is_mouse_left_down = false; }); // ------------ control ------------ freebu.control.init(); });//d3.json }, re_init: function(input_data) { //drop user's own file var data = {}; data.nodes = input_data.nodes; data.links = input_data.links; freebu.data = data; console.log("#nodes: " + data.nodes.length); console.log("#links: " + data.links.length); //inject properties to data $.each(freebu.data.links, function(i, link_item) { link_item.id = i; link_item.weight = 1; }); $.each(freebu.data.nodes, function(i, node_item) { node_item.degree = 0; node_item.nr_children = 0;//>0 if it's a super node }); //initialize links freebu.links = d3.select('#linkg').selectAll(".link") .data(data.links, function(d){return d.id;}); freebu.links.exit().remove(); //initialize nodes freebu.nodes = d3.select('#nodeg').selectAll(".node") .data(data.nodes, function(d){return d.id;}); freebu.nodes.exit().remove(); // ------------ vis ------------ freebu.force.init(data); // ------------ filter ------------ $('#div-filter').remove(); $('<div class="col-md-2" id="div-filter"></div>').insertAfter('#div-vis'); freebu.filter.init(); freebu.control.current_view = $('#'+freebu._RADIO_ID_NETWORK_VIEW).attr("id"); freebu.control.remove_network_toggles(); freebu.control.remove_rank_toggles(); freebu.control.add_network_toggles(); freebu.control.remove_hierarchy_circles(); freebu.links.each(function(d,i){ var line = d3.select(this).select('line'); line.style('visibility', 'visible'); }); freebu.nodes.each(function(d,i){ var circle = d3.select(this).select('circle'); circle.attr('r',freebu.node_default_radius); }); $('#'+freebu._TOGGLE_ID_RUN).bootstrapToggle("on"); }, reset_nodes: function() { freebu.nodes.each(function(d,i){ d.fixed = false; d.dormant = false; var circle = d3.select(this).select("circle"); if(d.nr_children == 0) { if(freebu.control.current_view == freebu._RADIO_ID_NETWORK_VIEW) { var r = freebu.node_default_radius; circle.attr("r", r); circle.transition().duration(freebu.moderate_duration).style(freebu.node_default_style); } else if(freebu.control.current_view == freebu._RADIO_ID_RANK_VIEW){ var r = freebu.node_rank_default_radius; circle.attr("r", r); circle.transition().duration(freebu.moderate_duration).style(freebu.node_default_style); } else if(freebu.control.current_view == freebu._RADIO_ID_CIRCLE_VIEW) { circle.transition().duration(freebu.moderate_duration).style(freebu.node_circle_default_style); } } }); freebu.force.nr_ticks = 0; $('#'+freebu._DIV_ID_FILTER).find("input").each(function() { var id = $(this).attr('id'); if(id !== undefined) { if(id.indexOf('intersection') == -1) { $(this).attr("checked", false); } else $(this).attr("checked", true); } }); if(freebu.control.current_view == freebu._RADIO_ID_RANK_VIEW) { freebu.rank.align_nodes(); } }, reset_nodes_color: function() { freebu.nodes.each(function(d,i){ if(d.nr_children == 0) { var circle = d3.select(this).select("circle"); circle.transition().duration(freebu.moderate_duration) .style(freebu.node_default_color_style); } }); } // --- --- }; return freebu; } if(typeof(freebu) === 'undefined') { window.freebu = define_freebu(); } else{ console.log("freebu already defined"); } })(window);
gpl-2.0
n3wb13/OpenNfrGui-5.0-1
lib/python/Plugins/Extensions/CustomSubservices/plugin.py
16545
# -*- coding: utf-8 -*- from Components.PluginComponent import plugins from Components.config import config from Components.Converter.ServiceInfo import * from Components.Element import cached from Plugins.Plugin import PluginDescriptor import Components.Converter from Screens.Screen import Screen from Screens.ChannelSelection import BouquetSelector from Screens.ChoiceBox import ChoiceBox from Screens.InfoBarGenerics import InfoBarSubserviceSelection from Screens.MessageBox import MessageBox from enigma import iServiceInformation, eEPGCache, eServiceCenter, eServiceReference import xml.dom.minidom import datetime from Subservice import Subservice from SubserviceGroup import SubserviceGroup from SubservicesQuickzapXML import SubservicesQuickzapXML XML_PATH = "/etc/enigma2/subservices.xml" #change/add methods of InfoBarSubserviceSelection def checkSubservicesAvail(self): #check traditional subservices first service = self.session.nav.getCurrentService() subservices = service and service.subServices() if not subservices or subservices.getNumberOfSubservices() == 0: #self["SubserviceQuickzapAction"].setEnabled(False) serviceRef = self.session.nav.getCurrentlyPlayingServiceReference() #DEBUG: print "Subsel curRef: "+ serviceRef.toString() + "\n" subservices = self.getAvailableSubservices(serviceRef) if not subservices or len(subservices) == 0: self["SubserviceQuickzapAction"].setEnabled(False) InfoBarSubserviceSelection.checkSubservicesAvail = checkSubservicesAvail def changeSubservice(self, direction): serviceRef = self.session.nav.getCurrentlyPlayingServiceReference() subservices = self.getAvailableSubservices(serviceRef) if subservices and len(subservices) > 0: #custom subservices n = len(subservices) selection = -1 idx = 0 while idx < n: if subservices[idx].getRef() == serviceRef.toString(): selection = idx break idx += 1 if selection != -1: selection += direction if selection >= n: selection=0 elif selection < 0: selection=n-1 newservice = eServiceReference(subservices[selection].getRef()) if newservice.valid(): del subservices del serviceRef self.session.nav.playService(newservice, False) else: #traditional subservices service = self.session.nav.getCurrentService() subservices = service and service.subServices() if subservices and subservices.getNumberOfSubservices() > 0: n = subservices and subservices.getNumberOfSubservices() if n and n > 0: selection = -1 ref = self.session.nav.getCurrentlyPlayingServiceReference() idx = 0 while idx < n: if subservices.getSubservice(idx).toString() == ref.toString(): selection = idx break idx += 1 if selection != -1: selection += direction if selection >= n: selection=0 elif selection < 0: selection=n-1 newservice = subservices.getSubservice(selection) if newservice.valid(): del subservices del service self.session.nav.playService(newservice, False) InfoBarSubserviceSelection.changeSubservice = changeSubservice def subserviceSelection(self): serviceRef = self.session.nav.getCurrentlyPlayingServiceReference() #DEBUG: print "Subsel curRef: "+ serviceRef.toString() + "\n" subservices = self.getAvailableSubservices(serviceRef) if subservices and len(subservices) > 1: #custom subservices self.bouquets = self.servicelist.getBouquetList() n = len(subservices) selection = 0 if n and n > 0: tlist = [] idx = 0 while idx < n: i = subservices[idx] if i.getRef() == serviceRef.toString(): selection = idx tlist.append((i.getDisplayString(), i)) idx += 1 if self.bouquets and len(self.bouquets): keys = ["red", "blue", "", "1", "2", "3", "4", "5", "6", "7", "8", "9", "green", "yellow"] + [""] * n if config.usage.multibouquet.value: tlist = [(_("Quickzap"), "quickzap", subservices), (_("Add to bouquet"), "CALLFUNC", self.addSubserviceToBouquetCallback), ("--", "")] + tlist else: tlist = [(_("Quickzap"), "quickzap", subservices), (_("Add to favourites"), "CALLFUNC", self.addSubserviceToBouquetCallback), ("--", "")] + tlist selection += 3 else: tlist = [(_("Quickzap"), "quickzap", subservices), ("--", "")] + tlist keys = ["red", "", "1", "2", "3", "4", "5", "6", "7", "8", "9", "green", "yellow"] + [""] * n selection += 2 self.session.openWithCallback(self.subserviceSelected, ChoiceBox, title=_("Please select a subservice..."), list = tlist, selection = selection, keys = keys, skin_name = "SubserviceSelection") else: #traditional subservices service = self.session.nav.getCurrentService() subservices = service and service.subServices() self.bouquets = self.servicelist.getBouquetList() n = subservices and subservices.getNumberOfSubservices() selection = 0 if n and n > 0: ref = self.session.nav.getCurrentlyPlayingServiceReference() tlist = [] idx = 0 while idx < n: i = subservices.getSubservice(idx) if i.toString() == ref.toString(): selection = idx tlist.append((i.getName(), i)) idx += 1 if self.bouquets and len(self.bouquets): keys = ["red", "blue", "", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" ] + [""] * n if config.usage.multibouquet.value: tlist = [(_("Quickzap"), "quickzap", service.subServices()), (_("Add to bouquet"), "CALLFUNC", self.addSubserviceToBouquetCallback), ("--", "")] + tlist else: tlist = [(_("Quickzap"), "quickzap", service.subServices()), (_("Add to favourites"), "CALLFUNC", self.addSubserviceToBouquetCallback), ("--", "")] + tlist selection += 3 else: tlist = [(_("Quickzap"), "quickzap", service.subServices()), ("--", "")] + tlist keys = ["red", "", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" ] + [""] * n selection += 2 self.session.openWithCallback(self.subserviceSelected, ChoiceBox, title=_("Please select a subservice..."), list = tlist, selection = selection, keys = keys, skin_name = "SubserviceSelection") InfoBarSubserviceSelection.subserviceSelection = subserviceSelection def subserviceSelected(self, service): #check traditional subservices first and call old method del self.bouquets if not service is None: if isinstance(service[1], str): if service[1] == "quickzap": if isinstance(service[2][0], Subservice): self.session.open(SubservicesQuickzapXML, service[2]) else: from Screens.SubservicesQuickzap import SubservicesQuickzap self.session.open(SubservicesQuickzap, service[2]) else: self["SubserviceQuickzapAction"].setEnabled(True) if isinstance(service[1], Subservice): self.session.nav.playService(eServiceReference(service[1].getRef()), False) else: self.session.nav.playService(service[1], False) InfoBarSubserviceSelection.subserviceSelected = subserviceSelected def addSubserviceToBouquetCallback(self, service): if len(service) > 1: if (isinstance(service[1], Subservice) and eServiceReference(service[1].getRef()).valid()) or (isinstance(service[1], eServiceReference)): self.selectedSubservice = service if self.bouquets is None: cnt = 0 else: cnt = len(self.bouquets) if cnt > 1: # show bouquet list self.bsel = self.session.openWithCallback(self.bouquetSelClosed, BouquetSelector, self.bouquets, self.addSubserviceToBouquet) elif cnt == 1: # add to only one existing bouquet self.addSubserviceToBouquet(self.bouquets[0][1]) self.session.open(MessageBox, _("Service has been added to the favourites."), MessageBox.TYPE_INFO) InfoBarSubserviceSelection.addSubserviceToBouquetCallback = addSubserviceToBouquetCallback def addSubserviceToBouquet(self, dest): if isinstance(self.selectedSubservice[1], Subservice): #custom subservices self.servicelist.addServiceToBouquet(dest, eServiceReference(self.selectedSubservice[1].getRef())) else: self.servicelist.addServiceToBouquet(dest, self.selectedSubservice[1]) if self.bsel: self.bsel.close(True) else: del self.selectedSubservice InfoBarSubserviceSelection.addSubserviceToBouquet = addSubserviceToBouquet def getAvailableSubservices(self, currentRef): #DEBUG: print "Service ref: " + currentRef.toString() + "\n" #Read channels and groups from xml config file subserviceGroups = self.session.subserviceGroups #Determine whether channel has subservices possibleSubservices = self.getPossibleSubservicesForCurrentChannel(currentRef, subserviceGroups) #Determine whether subservices are active activeSubservices = self.getActiveSubservicesForCurrentChannel(possibleSubservices) del subserviceGroups del possibleSubservices return activeSubservices InfoBarSubserviceSelection.getAvailableSubservices = getAvailableSubservices def readChannelsFromXml(): subserviceGroups = [] try: xmldataRaw = xml.dom.minidom.parse(XML_PATH).getElementsByTagName("options") #DEBUG: print "XML file parsed; read " + str(len(xmldataRaw)) + " option tags\n" #DEBUG: print xmldataRaw[0].firstChild.nodeValue + "\n" xmldata = xmldataRaw[0].getElementsByTagName("channelgroup") #DEBUG: print "read "+ str(len(xmldata)) + " SubserviceGroups from XML\n" for node in xmldata: subserviceGroup = SubserviceGroup() subserviceGroup.setName(node.getAttributeNode("name").nodeValue) notActiveShowName = node.getAttributeNode("notActiveShowName").nodeValue displayPattern = node.getAttributeNode("displayPattern").nodeValue channels = node.getElementsByTagName("channel") for channel in channels: name = channel.getElementsByTagName("name")[0].firstChild.nodeValue ref = channel.getElementsByTagName("ref")[0].firstChild.nodeValue if ref != "none": subserviceGroup.addSubservice(Subservice(name, ref, notActiveShowName, displayPattern)) #DEBUG: print "Channel: " + channel.getName() + ", sid: " + channel.getSid() + "\n" subserviceGroups.append(subserviceGroup) except: print "XML config file not available or misconfigured!\n" del subserviceGroups[:] return subserviceGroups #InfoBarSubserviceSelection.readChannelsFromXml = readChannelsFromXml def getPossibleSubservicesForCurrentChannel(self, currentRef, subserviceGroups): possibleSubservices =[] actualSubserviceGroup = None currentRefStr = currentRef.toString() #DEBUG: print "Current Channel ref: " + currentRef.toString() + "\n" for subserviceGroup in subserviceGroups: for channel in subserviceGroup.getSubservices(): #DEBUG: print "Read channel ref: " + str(channel.getRef()) + "\n" if channel.getRef() == currentRefStr: #DEBUG: print "Match found\n" actualSubserviceGroup = subserviceGroup break if actualSubserviceGroup is not None: #DEBUG: print "Actual SubserviceGroup is not none\n" possibleSubservices = actualSubserviceGroup.getSubservices() return possibleSubservices InfoBarSubserviceSelection.getPossibleSubservicesForCurrentChannel = getPossibleSubservicesForCurrentChannel def getActiveSubservicesForCurrentChannel(self, possibleSubservices): activeSubservices = [] epgCache = eEPGCache.getInstance() for subservice in possibleSubservices: #Query epgcache for current event on subservice #I...EventID #B...Beginn Time #D...Duration #C...Current Time #T...Title #S...Subtitle? #E...Description #R...Service Reference #N...Service Name #Default: 'IBDCTSERN' events = epgCache.lookupEvent(['BDTS' , (subservice.getRef(), 0, -1)]) #check whether events available if events is not None and len(events) == 1: #check whether channel is inactive event = events[0] title = event[2] subtitle = event[3] starttime = datetime.datetime.fromtimestamp(event[0]).strftime('%H:%M') endtime = datetime.datetime.fromtimestamp(event[0] + event[1]).strftime('%H:%M') #DEBUG: print "nonActiveShowName: " + subservice.getNotActiveShowName() + ", subtitle: " + str(subtitle) + "\n" if subservice.getNotActiveShowName() != str(subtitle): #option seems to be active --> prepare and add it subservice.setCurrentShowName(str(title)) subservice.setCurrentShowTime(str(starttime) + " - " + str(endtime)) #DEBUG: print "Generated show name: " + subservice.getCurrentShowName() + "\n" activeSubservices.append(subservice) # else: #add channel as option in unknown state # subservice.setCurrentShowName("EPG nicht verfügbar") # activeSubservices.append(subservice) return activeSubservices InfoBarSubserviceSelection.getActiveSubservicesForCurrentChannel = getActiveSubservicesForCurrentChannel ### modified Service.getBoolean to activate/deactivate infobar subservices icon ###### @cached def getBoolean(self): service = self.source.service info = service and service.info() if not info: return False if self.type == self.HAS_TELETEXT: tpid = info.getInfo(iServiceInformation.sTXTPID) return tpid != -1 elif self.type == self.IS_MULTICHANNEL: audio = service.audioTracks() if audio: n = audio.getNumberOfTracks() idx = 0 while idx < n: i = audio.getTrackInfo(idx) description = i.getDescription(); if "AC3" in description or "DTS" in description or "AC-3" in description or "Dolby Digital" in description: return True idx += 1 return False elif self.type == self.IS_CRYPTED: return info.getInfo(iServiceInformation.sIsCrypted) == 1 elif self.type == self.IS_WIDESCREEN: return info.getInfo(iServiceInformation.sAspect) in (3, 4, 7, 8, 0xB, 0xC, 0xF, 0x10) elif self.type == self.SUBSERVICES_AVAILABLE: ref = eServiceReference(str(info.getInfoString(iServiceInformation.sServiceref))) possibleSubservices = self.getPossibleSubservicesForCurrentChannel(ref, self.subserviceGroups) activeSubservices = self.getActiveSubservicesForCurrentChannel(possibleSubservices) if activeSubservices is not None and len(activeSubservices) > 1: return True else: subservices = service.subServices() return subservices and subservices.getNumberOfSubservices() > 0 elif self.type == self.HAS_HBBTV: return info.getInfoString(iServiceInformation.sHBBTVUrl) != "" elif self.type == self.AUDIOTRACKS_AVAILABLE: audio = service.audioTracks() return audio and audio.getNumberOfTracks() > 1 elif self.type == self.SUBTITLES_AVAILABLE: subtitle = service and service.subtitle() subtitlelist = subtitle and subtitle.getSubtitleList() if subtitlelist: return len(subtitlelist) > 0 return False elif self.type == self.EDITMODE: return hasattr(self.source, "editmode") and not not self.source.editmode return False ServiceInfo.getBoolean = getBoolean ServiceInfo.boolean = property(getBoolean) ServiceInfo.getPossibleSubservicesForCurrentChannel = getPossibleSubservicesForCurrentChannel ServiceInfo.getActiveSubservicesForCurrentChannel = getActiveSubservicesForCurrentChannel ########################################################################### def main(session, **kwargs): print "\n[CustomSubservicesPlugin] start\n" #read channels from XML session.subserviceGroups = readChannelsFromXml() ServiceInfo.subserviceGroups = session.subserviceGroups def main2(session, **kwargs): print "\n[CustomSubservicesPlugin] start\n" session.subserviceGroups = readChannelsFromXml() ServiceInfo.subserviceGroups = session.subserviceGroups from Screens.InfoBar import InfoBar if InfoBar and InfoBar.instance: InfoBar.subserviceSelection(InfoBar.instance) ########################################################################### def Plugins(**kwargs): return [PluginDescriptor( name="Custom Subservice Selection Plugin", description="Switching subservices based on XML config", where = PluginDescriptor.WHERE_SESSIONSTART, icon="../ihad_tut.png", fnc=main), PluginDescriptor( name=_("Custom Subservice Selection Plugin"), description=_("Switching subservices based on XML config"), where = PluginDescriptor.WHERE_PLUGINMENU, fnc=main2), PluginDescriptor( name=_("Custom Subservice Selection Plugin"), description=_("Switching subservices based on XML config"), where = PluginDescriptor.WHERE_EXTENSIONSMENU, fnc=main2)]
gpl-2.0
rodrigodemingo/abu_dhabi_ports
wp-content/themes/mana/framework/Pagebuilder/js/tinymce_plugin.js
3658
(function() { if( typeof tinymce!=='undefined' ){ if( typeof(tinymce.majorVersion)!=='undefined' && parseInt(tinymce.majorVersion)<4 ){ tinymce.create( "tinymce.plugins.themeton_shortcode", { init: function(ed,e) { }, createControl:function(d,e) { var ed = tinymce.activeEditor; if(d=="themeton_shortcode"){ d=e.createMenuButton( "themeton_shortcode",{ title: "Themeton Shortcode", icons: false }); var a=this;d.onRenderMenu.add(function(c,b){ a.addImmediate(b, "Button", '[blox_button text="" link="#" target="_self" style="default" color="#dd3333" icon="icon-thumbs-up-alt" size="medium" align="left" /]' ); a.addImmediate(b, "Icon", '[blox_icon style="blox_elem_icon_circle" color="#1e73be" icon="icon-thumbs-up-alt" size="48" align="left"]' ); a.addImmediate(b, "Iconic List", '[blox_list title="Title" icon="icon-thumbs-up-alt" color="#1e73be"]<ul><li>item 1</li><li>item 2</li></ul>[/blox_list]' ); b.addSeparator(); a.addImmediate(b, "Blog", '[blox_blog title="" style="regular" categories="all" content="both" count="10" pager="yes" filter="no" overlay="permalink" order="default"/]' ); b.addSeparator(); c=b.addMenu({title: "Media Shortcodes"}); a.addImmediate(c, "Audio", '[blox_audio title="" type="url" url="" color="#000000" /]' ); a.addImmediate(c, "Video", '[blox_audio title="" type="url" url="" color="#000000" /]' ); }); return d } return null }, addImmediate:function(d,e,a){d.add({title:e,onclick:function(){tinyMCE.activeEditor.execCommand( "mceInsertContent",false,a)}})} } ); tinymce.PluginManager.add( "themeton_shortcode", tinymce.plugins.themeton_shortcode); } else{ tinymce.PluginManager.add('themeton_shortcode', function(editor, url) { editor.addButton('themeton_shortcode', { type: 'menubutton', text: 'TT Shortcode', icon: false, menu: [ { text: "Button", onclick: function(){ editor.insertContent('[blox_button text="" link="#" target="_self" style="default" color="#dd3333" icon="icon-thumbs-up-alt" size="medium" align="left" /]'); }}, { text: "Icon", onclick: function(){ editor.insertContent('[blox_icon style="blox_elem_icon_circle" color="#1e73be" icon="icon-thumbs-up-alt" size="48" align="left"]'); }}, { text: "Iconic List", onclick: function(){ editor.insertContent('[blox_list title="Title" icon="icon-thumbs-up-alt" color="#1e73be"]<ul><li>item 1</li><li>item 2</li></ul>[/blox_list]'); }}, { text: "Blog", onclick: function(){ editor.insertContent('[blox_blog title="" style="regular" categories="all" content="both" count="10" pager="yes" filter="no" overlay="permalink" order="default"/]'); }}, { text: "Media Shortcodes", onclick: function(){}, menu: [ { text: "Audio", onclick: function(){ editor.insertContent('[blox_audio title="" type="url" url="" color="#000000" /]'); }}, { text: "Video", onclick: function(){ editor.insertContent('[blox_audio title="" type="url" url="" color="#000000" /]'); }} ] } ] }); }); } } })();
gpl-2.0
wxAstro/wxAstroCapture
wxWebcam/wxWebCoords.cpp
3528
#include "wxWebCoords.h" wxWebCoords::wxWebCoords() : wxCamCoords() { } wxWebCoords::~wxWebCoords() { } // transformations // wxCamPoint wxWebCoords::GetPoint(EPointOrigin org) { wxCamPoint newPt=m_point; switch (m_ptOrigin) { // transform FROM: case EPO_CCD: // CCD original pixels switch (org) { // transform TO: case EPO_CCD: ; // p'=p break; case EPO_Sample: // p'= B*p newPt.x = m_point.x/m_bfx; newPt.y = m_point.y/m_bfy; break; case EPO_Image: // p'= MB*p newPt.x = m_point.x/m_bfx; newPt.y = m_point.y/m_bfy; break; case EPO_DC: // p'= ZMB*p newPt.x = (m_point.x/m_bfx) *m_zfx; newPt.y = (m_point.y/m_bfy) *m_zfy; break; }//switch break; case EPO_Sample: switch (org) { // transform TO: case EPO_CCD: // p'= Bi*p newPt.x = m_point.x *m_bfx; newPt.y = m_point.y *m_bfy; break; case EPO_Sample: ; // p'=p break; case EPO_Image: // p'= M*p newPt.x = m_point.x; newPt.y = m_point.y; break; case EPO_DC: // p'= ZM*p newPt.x = (m_point.x) *m_zfx; newPt.y = (m_point.y) *m_zfy; break; }//switch break; case EPO_Image: switch (org) { // transform TO: case EPO_CCD: // p'= BiM*p newPt.x = m_point.x *m_bfx; newPt.y = m_point.y *m_bfy; break; case EPO_Sample: // p'= M*p newPt.x = m_point.x; newPt.y = m_point.y; break; case EPO_Image: ; // p'=p break; case EPO_DC: // p'= Z*p newPt.x = m_point.x *m_zfx; newPt.y = m_point.y *m_zfy; break; }//switch break; case EPO_DC: switch (org) { // transform TO: case EPO_CCD: // p'= BiMZi*p newPt.x = m_point.x/m_zfx *m_bfx; newPt.y = m_point.y/m_zfy *m_bfy; break; case EPO_Sample: // p'= MZi*p newPt.x = m_point.x/m_zfx; newPt.y = m_point.y/m_zfy; break; case EPO_Image: // p'= Zi*p newPt.x = m_point.x/m_zfx; newPt.y = m_point.y/m_zfy; break; case EPO_DC: ; // p'=p break; }//switch break; }//switch return newPt; } // returning the full size translated to org wxSize wxWebCoords::GetFullSize(EPointOrigin org) { if (org==EPO_CCD) { // no mirroing when asked for native CCD size - return values directly return wxSize(int(m_ccdw), int(m_ccdh)); } else { wxCamPoint size(m_ccdw, m_ccdh); SetPoint(size, EPO_CCD); size = GetPoint(org); size.IncBy(1.0); return wxSize(size.IntPoint().x, size.IntPoint().y); } }
gpl-2.0
jmflorezf/agente-uber
genetic.py
356
#!/usr/bin/env python3 """ Execution of taxi driver problem using genetic algorithms """ from genetic_models import GeneticAlgorithm, simulate_path g = GeneticAlgorithm(population_size=10, request_amount=70, max_generations=20000, mutation_rate=0.05) g.run() ##simulate_path(g.fittest)
gpl-2.0
anhredweb/togtejendomme.dk
plugins/system/nnframework/fields/hikashop.php
5450
<?php /** * Element: HikaShop * Displays a multiselectbox of available HikaShop categories / products * * @package NoNumber Framework * @version 13.12.6 * * @author Peter van Westen <peter@nonumber.nl> * @link http://www.nonumber.nl * @copyright Copyright © 2013 NoNumber All Rights Reserved * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL */ defined('_JEXEC') or die; require_once JPATH_PLUGINS . '/system/nnframework/helpers/functions.php'; require_once JPATH_PLUGINS . '/system/nnframework/helpers/parameters.php'; require_once JPATH_PLUGINS . '/system/nnframework/helpers/text.php'; class JFormFieldNN_HikaShop extends JFormField { public $type = 'HikaShop'; private $params = null; private $db = null; private $max_list_count = 0; protected function getInput() { if (!NNFrameworkFunctions::extensionInstalled('hikashop')) { return '<fieldset class="radio"><label class="nn_label nn_label_error">' . JText::_('ERROR') . ': ' . JText::sprintf('NN_FILES_NOT_FOUND', JText::_('NN_HIKASHOP')) . '</label></fieldset>'; } $this->params = $this->element->attributes(); $this->db = JFactory::getDBO(); $group = $this->get('group', 'categories'); $tables = $this->db->getTableList(); if (!in_array($this->db->getPrefix() . 'hikashop_' . ($group == 'products' ? 'product' : 'category'), $tables)) { return '<fieldset class="radio"><label class="nn_label nn_label_error">' . JText::_('ERROR') . ': ' . JText::sprintf('NN_TABLE_NOT_FOUND', JText::_('NN_HIKASHOP')) . '</label></fieldset>'; } $parameters = NNParameters::getInstance(); $params = $parameters->getPluginParams('nnframework'); $this->max_list_count = $params->max_list_count; if (!is_array($this->value)) { $this->value = explode(',', $this->value); } $options = $this->{'get' . $group}(); $size = (int) $this->get('size'); $multiple = $this->get('multiple'); require_once JPATH_PLUGINS . '/system/nnframework/helpers/html.php'; return nnHtml::selectlist($options, $this->name, $this->value, $this->id, $size, $multiple); } function getCategories() { $query = $this->db->getQuery(true) ->select('COUNT(*)') ->from('#__hikashop_category AS c') ->where('c.category_published > -1'); $this->db->setQuery($query); $total = $this->db->loadResult(); if ($total > $this->max_list_count) { return -1; } $show_ignore = $this->get('show_ignore'); $query->clear() ->select('c.category_id') ->from('#__hikashop_category AS c') ->where('c.category_type = ' . $this->db->quote('root')); $this->db->setQuery($query); $root = $this->db->loadResult(); $query->clear() ->select('c.category_id as id, c.category_parent_id AS parent_id, c.category_name AS title, c.category_published as published') ->from('#__hikashop_category AS c') ->where('c.category_type = ' . $this->db->quote('product')) ->where('c.category_published > -1') ->order('c.category_ordering, c.category_name'); $this->db->setQuery($query); $items = $this->db->loadObjectList(); // establish the hierarchy of the menu // TODO: use node model $children = array(); // first pass - collect children foreach ($items as $v) { $pt = $v->parent_id; $list = @$children[$pt] ? $children[$pt] : array(); array_push($list, $v); $children[$pt] = $list; } // second pass - get an indent list of the items $list = JHtml::_('menu.treerecurse', (int) $root, '', array(), $children, 9999, 0, 0); // assemble items to the array $options = array(); if ($show_ignore) { if (in_array('-1', $this->value)) { $this->value = array('-1'); } $options[] = JHtml::_('select.option', '-1', '- ' . JText::_('NN_IGNORE') . ' -', 'value', 'text', 0); $options[] = JHtml::_('select.option', '-', '&nbsp;', 'value', 'text', 1); } foreach ($list as $item) { $item->treename = NNText::prepareSelectItem($item->treename, $item->published, '', 1); $options[] = JHtml::_('select.option', $item->id, $item->treename, 'value', 'text', 0); } return $options; } function getProducts() { $query = $this->db->getQuery(true) ->select('COUNT(*)') ->from('#__hikashop_product AS p') ->where('p.product_published > -1'); $this->db->setQuery($query); $total = $this->db->loadResult(); if ($total > $this->max_list_count) { return -1; } $query->clear() ->select('p.product_id as id, p.product_name AS name, c.category_name AS cat, p.product_published AS published') ->from('#__hikashop_product AS p') ->join('LEFT', '#__hikashop_product_category AS x ON x.product_id = p.product_id') ->join('LEFT', '#__hikashop_category AS c ON c.category_id = x.category_id') ->where('p.product_published > -1') ->order('p.product_name, p.product_id'); $this->db->setQuery($query); $list = $this->db->loadObjectList(); // assemble items to the array $options = array(); foreach ($list as $item) { $item->name = $item->name . ' [' . $item->id . ']' . ($item->cat ? ' [' . $item->cat . ']' : ''); $item->name = NNText::prepareSelectItem($item->name, $item->published); $options[] = JHtml::_('select.option', $item->id, $item->name, 'value', 'text', 0); } return $options; } private function get($val, $default = '') { return (isset($this->params[$val]) && (string) $this->params[$val] != '') ? (string) $this->params[$val] : $default; } }
gpl-2.0
squid-cache/squid
src/adaptation/DynamicGroupCfg.cc
644
/* * Copyright (C) 1996-2022 The Squid Software Foundation and contributors * * Squid software is distributed under GPLv2+ license and includes * contributions from numerous individuals and organizations. * Please see the COPYING and CONTRIBUTORS files for details. */ #include "squid.h" #include "adaptation/DynamicGroupCfg.h" void Adaptation::DynamicGroupCfg::add(const String &item) { if (services.empty()) { // first item id = item; } else { id.append(','); id.append(item); } services.push_back(item); } void Adaptation::DynamicGroupCfg::clear() { id.clean(); services.clear(); }
gpl-2.0
BuddhaLabs/DeD-OSX
soot/soot-2.3.0/generated/jastadd/soot/JastAddJ/FieldDeclaration.java
37686
package soot.JastAddJ; import java.util.HashSet;import java.util.LinkedHashSet;import java.io.File;import java.util.*;import beaver.*;import java.util.ArrayList;import java.util.zip.*;import java.io.*;import java.io.FileNotFoundException;import java.util.Collection;import soot.*;import soot.util.*;import soot.jimple.*;import soot.coffi.ClassFile;import soot.coffi.method_info;import soot.coffi.CONSTANT_Utf8_info;import soot.coffi.CoffiMethodSource; public class FieldDeclaration extends MemberDecl implements Cloneable, SimpleSet, Iterator, Variable { public void flushCache() { super.flushCache(); accessibleFrom_TypeDecl_values = null; exceptions_computed = false; exceptions_value = null; isDAafter_Variable_values = null; isDUafter_Variable_values = null; constant_computed = false; constant_value = null; usesTypeVariable_computed = false; sourceVariableDecl_computed = false; sourceVariableDecl_value = null; sootRef_computed = false; sootRef_value = null; } @SuppressWarnings({"unchecked", "cast"}) public FieldDeclaration clone() throws CloneNotSupportedException { FieldDeclaration node = (FieldDeclaration)super.clone(); node.accessibleFrom_TypeDecl_values = null; node.exceptions_computed = false; node.exceptions_value = null; node.isDAafter_Variable_values = null; node.isDUafter_Variable_values = null; node.constant_computed = false; node.constant_value = null; node.usesTypeVariable_computed = false; node.sourceVariableDecl_computed = false; node.sourceVariableDecl_value = null; node.sootRef_computed = false; node.sootRef_value = null; node.in$Circle(false); node.is$Final(false); return node; } @SuppressWarnings({"unchecked", "cast"}) public FieldDeclaration copy() { try { FieldDeclaration node = (FieldDeclaration)clone(); if(children != null) node.children = (ASTNode[])children.clone(); return node; } catch (CloneNotSupportedException e) { } System.err.println("Error: Could not clone node of type " + getClass().getName() + "!"); return null; } @SuppressWarnings({"unchecked", "cast"}) public FieldDeclaration fullCopy() { FieldDeclaration res = (FieldDeclaration)copy(); for(int i = 0; i < getNumChildNoTransform(); i++) { ASTNode node = getChildNoTransform(i); if(node != null) node = node.fullCopy(); res.setChild(node, i); } return res; } // Declared in BoundNames.jrag at line 11 public Access createQualifiedBoundAccess() { if(isStatic()) return hostType().createQualifiedAccess().qualifiesAccess(new BoundFieldAccess(this)); else return new ThisAccess("this").qualifiesAccess( new BoundFieldAccess(this)); } // Declared in BoundNames.jrag at line 86 public Access createBoundFieldAccess() { return createQualifiedBoundAccess(); } // Declared in DataStructures.jrag at line 69 public SimpleSet add(Object o) { return new SimpleSetImpl().add(this).add(o); } // Declared in DataStructures.jrag at line 75 private FieldDeclaration iterElem; // Declared in DataStructures.jrag at line 76 public Iterator iterator() { iterElem = this; return this; } // Declared in DataStructures.jrag at line 77 public boolean hasNext() { return iterElem != null; } // Declared in DataStructures.jrag at line 78 public Object next() { Object o = iterElem; iterElem = null; return o; } // Declared in DataStructures.jrag at line 79 public void remove() { throw new UnsupportedOperationException(); } // Declared in DefiniteAssignment.jrag at line 179 public void definiteAssignment() { super.definiteAssignment(); if(isBlank() && isFinal() && isClassVariable()) { boolean found = false; TypeDecl typeDecl = hostType(); for(int i = 0; i < typeDecl.getNumBodyDecl(); i++) { if(typeDecl.getBodyDecl(i) instanceof StaticInitializer) { StaticInitializer s = (StaticInitializer)typeDecl.getBodyDecl(i); if(s.isDAafter(this)) found = true; } else if(typeDecl.getBodyDecl(i) instanceof FieldDeclaration) { FieldDeclaration f = (FieldDeclaration)typeDecl.getBodyDecl(i); if(f.isStatic() && f.isDAafter(this)) found = true; } } if(!found) error("blank final class variable " + name() + " in " + hostType().typeName() + " is not definitely assigned in static initializer"); } if(isBlank() && isFinal() && isInstanceVariable()) { TypeDecl typeDecl = hostType(); boolean found = false; for(int i = 0; !found && i < typeDecl.getNumBodyDecl(); i++) { if(typeDecl.getBodyDecl(i) instanceof FieldDeclaration) { FieldDeclaration f = (FieldDeclaration)typeDecl.getBodyDecl(i); if(!f.isStatic() && f.isDAafter(this)) found = true; } else if(typeDecl.getBodyDecl(i) instanceof InstanceInitializer) { InstanceInitializer ii = (InstanceInitializer)typeDecl.getBodyDecl(i); if(ii.getBlock().isDAafter(this)) found = true; } } for(Iterator iter = typeDecl.constructors().iterator(); !found && iter.hasNext(); ) { ConstructorDecl c = (ConstructorDecl)iter.next(); if(!c.isDAafter(this)) { error("blank final instance variable " + name() + " in " + hostType().typeName() + " is not definitely assigned after " + c.signature()); } } } if(isBlank() && hostType().isInterfaceDecl()) { error("variable " + name() + " in " + hostType().typeName() + " which is an interface must have an initializer"); } } // Declared in Modifiers.jrag at line 112 public void checkModifiers() { super.checkModifiers(); if(hostType().isInterfaceDecl()) { if(isProtected()) error("an interface field may not be protected"); if(isPrivate()) error("an interface field may not be private"); if(isTransient()) error("an interface field may not be transient"); if(isVolatile()) error("an interface field may not be volatile"); } } // Declared in NameCheck.jrag at line 277 public void nameCheck() { super.nameCheck(); // 8.3 for(Iterator iter = hostType().memberFields(name()).iterator(); iter.hasNext(); ) { Variable v = (Variable)iter.next(); if(v != this && v.hostType() == hostType()) error("field named " + name() + " is multiply declared in type " + hostType().typeName()); } } // Declared in NodeConstructors.jrag at line 86 public FieldDeclaration(Modifiers m, Access type, String name) { this(m, type, name, new Opt()); } // Declared in NodeConstructors.jrag at line 90 public FieldDeclaration(Modifiers m, Access type, String name, Expr init) { this(m, type, name, new Opt(init)); } // Declared in PrettyPrint.jadd at line 171 public void toString(StringBuffer s) { s.append(indent()); getModifiers().toString(s); getTypeAccess().toString(s); s.append(" " + name()); if(hasInit()) { s.append(" = "); getInit().toString(s); } s.append(";\n"); } // Declared in TypeCheck.jrag at line 33 // 5.2 public void typeCheck() { if(hasInit()) { TypeDecl source = getInit().type(); TypeDecl dest = type(); if(!source.assignConversionTo(dest, getInit())) error("can not assign " + name() + " of type " + dest.typeName() + " a value of type " + source.typeName()); } } // Declared in Generics.jrag at line 1084 public BodyDecl p(Parameterization parTypeDecl) { FieldDeclaration f = new FieldDeclarationSubstituted( (Modifiers)getModifiers().fullCopy(), getTypeAccess().type().substituteReturnType(parTypeDecl), getID(), new Opt(), this ); return f; } // Declared in InnerClasses.jrag at line 270 public MethodDecl createAccessor(TypeDecl fieldQualifier) { MethodDecl m = (MethodDecl)fieldQualifier.getAccessor(this, "field_read"); if(m != null) return m; int accessorIndex = fieldQualifier.accessorCounter++; Modifiers modifiers = new Modifiers(new List()); modifiers.addModifier(new Modifier("static")); modifiers.addModifier(new Modifier("synthetic")); modifiers.addModifier(new Modifier("public")); List parameters = new List(); if(!isStatic()) parameters.add(new ParameterDeclaration(fieldQualifier.createQualifiedAccess(), "that")); m = new MethodDecl( modifiers, type().createQualifiedAccess(), "get$" + name() + "$access$" + accessorIndex, parameters, new List(), new Opt( new Block( new List().add( new ReturnStmt(createAccess()) ) ) ) ); m = fieldQualifier.addMemberMethod(m); fieldQualifier.addAccessor(this, "field_read", m); return m; } // Declared in InnerClasses.jrag at line 303 public MethodDecl createAccessorWrite(TypeDecl fieldQualifier) { MethodDecl m = (MethodDecl)fieldQualifier.getAccessor(this, "field_write"); if(m != null) return m; int accessorIndex = fieldQualifier.accessorCounter++; Modifiers modifiers = new Modifiers(new List()); modifiers.addModifier(new Modifier("static")); modifiers.addModifier(new Modifier("synthetic")); modifiers.addModifier(new Modifier("public")); List parameters = new List(); if(!isStatic()) parameters.add(new ParameterDeclaration(fieldQualifier.createQualifiedAccess(), "that")); parameters.add(new ParameterDeclaration(type().createQualifiedAccess(), "value")); m = new MethodDecl( modifiers, type().createQualifiedAccess(), "set$" + name() + "$access$" + accessorIndex, parameters, new List(), new Opt( new Block( new List().add( new ExprStmt( new AssignSimpleExpr( createAccess(), new VarAccess("value") ) ) ).add( new ReturnStmt( new Opt( new VarAccess("value") ) ) ) ) ) ); m = fieldQualifier.addMemberMethod(m); fieldQualifier.addAccessor(this, "field_write", m); return m; } // Declared in InnerClasses.jrag at line 348 private Access createAccess() { Access fieldAccess = new VarAccess(name()); return isStatic() ? fieldAccess : new VarAccess("that").qualifiesAccess(fieldAccess); } // Declared in EmitJimple.jrag at line 322 public void jimplify1phase2() { String name = name(); soot.Type type = type().getSootType(); int modifiers = sootTypeModifiers(); if(!hostType().getSootClassDecl().declaresFieldByName(name)) { SootField f = new SootField(name, type, modifiers); hostType().getSootClassDecl().addField(f); if(isStatic() && isFinal() && isConstant() && (type().isPrimitive() || type().isString())) { if(type().isString()) f.addTag(new soot.tagkit.StringConstantValueTag(constant().stringValue())); else if(type().isLong()) f.addTag(new soot.tagkit.LongConstantValueTag(constant().longValue())); else if(type().isDouble()) f.addTag(new soot.tagkit.DoubleConstantValueTag(constant().doubleValue())); else if(type().isFloat()) f.addTag(new soot.tagkit.FloatConstantValueTag(constant().floatValue())); else if(type().isIntegralType()) f.addTag(new soot.tagkit.IntegerConstantValueTag(constant().intValue())); } sootField = f; } addAttributes(); } // Declared in EmitJimple.jrag at line 345 public SootField sootField; // Declared in AnnotationsCodegen.jrag at line 32 public void addAttributes() { super.addAttributes(); ArrayList c = new ArrayList(); getModifiers().addRuntimeVisibleAnnotationsAttribute(c); getModifiers().addRuntimeInvisibleAnnotationsAttribute(c); getModifiers().addSourceOnlyAnnotations(c); for(Iterator iter = c.iterator(); iter.hasNext(); ) { soot.tagkit.Tag tag = (soot.tagkit.Tag)iter.next(); sootField.addTag(tag); } } // Declared in java.ast at line 3 // Declared in java.ast line 77 public FieldDeclaration() { super(); setChild(new Opt(), 2); } // Declared in java.ast at line 11 // Declared in java.ast line 77 public FieldDeclaration(Modifiers p0, Access p1, String p2, Opt<Expr> p3) { setChild(p0, 0); setChild(p1, 1); setID(p2); setChild(p3, 2); } // Declared in java.ast at line 19 // Declared in java.ast line 77 public FieldDeclaration(Modifiers p0, Access p1, beaver.Symbol p2, Opt<Expr> p3) { setChild(p0, 0); setChild(p1, 1); setID(p2); setChild(p3, 2); } // Declared in java.ast at line 26 protected int numChildren() { return 3; } // Declared in java.ast at line 29 public boolean mayHaveRewrite() { return false; } // Declared in java.ast at line 2 // Declared in java.ast line 77 public void setModifiers(Modifiers node) { setChild(node, 0); } // Declared in java.ast at line 5 public Modifiers getModifiers() { return (Modifiers)getChild(0); } // Declared in java.ast at line 9 public Modifiers getModifiersNoTransform() { return (Modifiers)getChildNoTransform(0); } // Declared in java.ast at line 2 // Declared in java.ast line 77 public void setTypeAccess(Access node) { setChild(node, 1); } // Declared in java.ast at line 5 public Access getTypeAccess() { return (Access)getChild(1); } // Declared in java.ast at line 9 public Access getTypeAccessNoTransform() { return (Access)getChildNoTransform(1); } // Declared in java.ast at line 2 // Declared in java.ast line 77 protected String tokenString_ID; // Declared in java.ast at line 3 public void setID(String value) { tokenString_ID = value; } // Declared in java.ast at line 6 public int IDstart; // Declared in java.ast at line 7 public int IDend; // Declared in java.ast at line 8 public void setID(beaver.Symbol symbol) { if(symbol.value != null && !(symbol.value instanceof String)) throw new UnsupportedOperationException("setID is only valid for String lexemes"); tokenString_ID = (String)symbol.value; IDstart = symbol.getStart(); IDend = symbol.getEnd(); } // Declared in java.ast at line 15 public String getID() { return tokenString_ID != null ? tokenString_ID : ""; } // Declared in java.ast at line 2 // Declared in java.ast line 77 public void setInitOpt(Opt<Expr> opt) { setChild(opt, 2); } // Declared in java.ast at line 6 public boolean hasInit() { return getInitOpt().getNumChild() != 0; } // Declared in java.ast at line 10 @SuppressWarnings({"unchecked", "cast"}) public Expr getInit() { return (Expr)getInitOpt().getChild(0); } // Declared in java.ast at line 14 public void setInit(Expr node) { getInitOpt().setChild(node, 0); } // Declared in java.ast at line 17 @SuppressWarnings({"unchecked", "cast"}) public Opt<Expr> getInitOpt() { return (Opt<Expr>)getChild(2); } // Declared in java.ast at line 21 @SuppressWarnings({"unchecked", "cast"}) public Opt<Expr> getInitOptNoTransform() { return (Opt<Expr>)getChildNoTransform(2); } protected java.util.Map accessibleFrom_TypeDecl_values; // Declared in AccessControl.jrag at line 109 @SuppressWarnings({"unchecked", "cast"}) public boolean accessibleFrom(TypeDecl type) { Object _parameters = type; if(accessibleFrom_TypeDecl_values == null) accessibleFrom_TypeDecl_values = new java.util.HashMap(4); if(accessibleFrom_TypeDecl_values.containsKey(_parameters)) return ((Boolean)accessibleFrom_TypeDecl_values.get(_parameters)).booleanValue(); int num = boundariesCrossed; boolean isFinal = this.is$Final(); boolean accessibleFrom_TypeDecl_value = accessibleFrom_compute(type); if(isFinal && num == boundariesCrossed) accessibleFrom_TypeDecl_values.put(_parameters, Boolean.valueOf(accessibleFrom_TypeDecl_value)); return accessibleFrom_TypeDecl_value; } private boolean accessibleFrom_compute(TypeDecl type) { if(isPublic()) return true; else if(isProtected()) { if(hostPackage().equals(type.hostPackage())) return true; if(type.withinBodyThatSubclasses(hostType()) != null) return true; return false; } else if(isPrivate()) return hostType().topLevelType() == type.topLevelType(); else return hostPackage().equals(type.hostPackage()); } protected boolean exceptions_computed = false; protected Collection exceptions_value; // Declared in AnonymousClasses.jrag at line 112 @SuppressWarnings({"unchecked", "cast"}) public Collection exceptions() { if(exceptions_computed) return exceptions_value; int num = boundariesCrossed; boolean isFinal = this.is$Final(); exceptions_value = exceptions_compute(); if(isFinal && num == boundariesCrossed) exceptions_computed = true; return exceptions_value; } private Collection exceptions_compute() { HashSet set = new HashSet(); if(isInstanceVariable() && hasInit()) { collectExceptions(set, this); for(Iterator iter = set.iterator(); iter.hasNext(); ) { TypeDecl typeDecl = (TypeDecl)iter.next(); if(!getInit().reachedException(typeDecl)) iter.remove(); } } return set; } // Declared in ConstantExpression.jrag at line 479 @SuppressWarnings({"unchecked", "cast"}) public boolean isConstant() { boolean isConstant_value = isConstant_compute(); return isConstant_value; } private boolean isConstant_compute() { return isFinal() && hasInit() && getInit().isConstant() && (type() instanceof PrimitiveType || type().isString()); } // Declared in DataStructures.jrag at line 67 @SuppressWarnings({"unchecked", "cast"}) public int size() { int size_value = size_compute(); return size_value; } private int size_compute() { return 1; } // Declared in DataStructures.jrag at line 68 @SuppressWarnings({"unchecked", "cast"}) public boolean isEmpty() { boolean isEmpty_value = isEmpty_compute(); return isEmpty_value; } private boolean isEmpty_compute() { return false; } // Declared in DataStructures.jrag at line 72 @SuppressWarnings({"unchecked", "cast"}) public boolean contains(Object o) { boolean contains_Object_value = contains_compute(o); return contains_Object_value; } private boolean contains_compute(Object o) { return this == o; } // Declared in DefiniteAssignment.jrag at line 316 @SuppressWarnings({"unchecked", "cast"}) public boolean isDAafter(Variable v) { Object _parameters = v; if(isDAafter_Variable_values == null) isDAafter_Variable_values = new java.util.HashMap(4); if(isDAafter_Variable_values.containsKey(_parameters)) return ((Boolean)isDAafter_Variable_values.get(_parameters)).booleanValue(); int num = boundariesCrossed; boolean isFinal = this.is$Final(); boolean isDAafter_Variable_value = isDAafter_compute(v); if(isFinal && num == boundariesCrossed) isDAafter_Variable_values.put(_parameters, Boolean.valueOf(isDAafter_Variable_value)); return isDAafter_Variable_value; } private boolean isDAafter_compute(Variable v) { if(v == this) return hasInit(); return hasInit() ? getInit().isDAafter(v) : isDAbefore(v); } // Declared in DefiniteAssignment.jrag at line 772 @SuppressWarnings({"unchecked", "cast"}) public boolean isDUafter(Variable v) { Object _parameters = v; if(isDUafter_Variable_values == null) isDUafter_Variable_values = new java.util.HashMap(4); if(isDUafter_Variable_values.containsKey(_parameters)) return ((Boolean)isDUafter_Variable_values.get(_parameters)).booleanValue(); int num = boundariesCrossed; boolean isFinal = this.is$Final(); boolean isDUafter_Variable_value = isDUafter_compute(v); if(isFinal && num == boundariesCrossed) isDUafter_Variable_values.put(_parameters, Boolean.valueOf(isDUafter_Variable_value)); return isDUafter_Variable_value; } private boolean isDUafter_compute(Variable v) { if(v == this) return !hasInit(); return hasInit() ? getInit().isDUafter(v) : isDUbefore(v); } // Declared in Modifiers.jrag at line 214 @SuppressWarnings({"unchecked", "cast"}) public boolean isSynthetic() { boolean isSynthetic_value = isSynthetic_compute(); return isSynthetic_value; } private boolean isSynthetic_compute() { return getModifiers().isSynthetic(); } // Declared in Modifiers.jrag at line 237 @SuppressWarnings({"unchecked", "cast"}) public boolean isPublic() { boolean isPublic_value = isPublic_compute(); return isPublic_value; } private boolean isPublic_compute() { return getModifiers().isPublic() || hostType().isInterfaceDecl(); } // Declared in Modifiers.jrag at line 238 @SuppressWarnings({"unchecked", "cast"}) public boolean isPrivate() { boolean isPrivate_value = isPrivate_compute(); return isPrivate_value; } private boolean isPrivate_compute() { return getModifiers().isPrivate(); } // Declared in Modifiers.jrag at line 239 @SuppressWarnings({"unchecked", "cast"}) public boolean isProtected() { boolean isProtected_value = isProtected_compute(); return isProtected_value; } private boolean isProtected_compute() { return getModifiers().isProtected(); } // Declared in Modifiers.jrag at line 240 @SuppressWarnings({"unchecked", "cast"}) public boolean isStatic() { boolean isStatic_value = isStatic_compute(); return isStatic_value; } private boolean isStatic_compute() { return getModifiers().isStatic() || hostType().isInterfaceDecl(); } // Declared in Modifiers.jrag at line 242 @SuppressWarnings({"unchecked", "cast"}) public boolean isFinal() { boolean isFinal_value = isFinal_compute(); return isFinal_value; } private boolean isFinal_compute() { return getModifiers().isFinal() || hostType().isInterfaceDecl(); } // Declared in Modifiers.jrag at line 243 @SuppressWarnings({"unchecked", "cast"}) public boolean isTransient() { boolean isTransient_value = isTransient_compute(); return isTransient_value; } private boolean isTransient_compute() { return getModifiers().isTransient(); } // Declared in Modifiers.jrag at line 244 @SuppressWarnings({"unchecked", "cast"}) public boolean isVolatile() { boolean isVolatile_value = isVolatile_compute(); return isVolatile_value; } private boolean isVolatile_compute() { return getModifiers().isVolatile(); } // Declared in PrettyPrint.jadd at line 790 @SuppressWarnings({"unchecked", "cast"}) public String dumpString() { String dumpString_value = dumpString_compute(); return dumpString_value; } private String dumpString_compute() { return getClass().getName() + " [" + getID() + "]"; } // Declared in TypeAnalysis.jrag at line 251 @SuppressWarnings({"unchecked", "cast"}) public TypeDecl type() { TypeDecl type_value = type_compute(); return type_value; } private TypeDecl type_compute() { return getTypeAccess().type(); } // Declared in TypeAnalysis.jrag at line 273 @SuppressWarnings({"unchecked", "cast"}) public boolean isVoid() { boolean isVoid_value = isVoid_compute(); return isVoid_value; } private boolean isVoid_compute() { return type().isVoid(); } // Declared in VariableDeclaration.jrag at line 55 @SuppressWarnings({"unchecked", "cast"}) public boolean isClassVariable() { boolean isClassVariable_value = isClassVariable_compute(); return isClassVariable_value; } private boolean isClassVariable_compute() { return isStatic() || hostType().isInterfaceDecl(); } // Declared in VariableDeclaration.jrag at line 56 @SuppressWarnings({"unchecked", "cast"}) public boolean isInstanceVariable() { boolean isInstanceVariable_value = isInstanceVariable_compute(); return isInstanceVariable_value; } private boolean isInstanceVariable_compute() { return (hostType().isClassDecl() || hostType().isAnonymous() )&& !isStatic(); } // Declared in VariableDeclaration.jrag at line 57 @SuppressWarnings({"unchecked", "cast"}) public boolean isMethodParameter() { boolean isMethodParameter_value = isMethodParameter_compute(); return isMethodParameter_value; } private boolean isMethodParameter_compute() { return false; } // Declared in VariableDeclaration.jrag at line 58 @SuppressWarnings({"unchecked", "cast"}) public boolean isConstructorParameter() { boolean isConstructorParameter_value = isConstructorParameter_compute(); return isConstructorParameter_value; } private boolean isConstructorParameter_compute() { return false; } // Declared in VariableDeclaration.jrag at line 59 @SuppressWarnings({"unchecked", "cast"}) public boolean isExceptionHandlerParameter() { boolean isExceptionHandlerParameter_value = isExceptionHandlerParameter_compute(); return isExceptionHandlerParameter_value; } private boolean isExceptionHandlerParameter_compute() { return false; } // Declared in VariableDeclaration.jrag at line 60 @SuppressWarnings({"unchecked", "cast"}) public boolean isLocalVariable() { boolean isLocalVariable_value = isLocalVariable_compute(); return isLocalVariable_value; } private boolean isLocalVariable_compute() { return false; } // Declared in VariableDeclaration.jrag at line 62 @SuppressWarnings({"unchecked", "cast"}) public boolean isBlank() { boolean isBlank_value = isBlank_compute(); return isBlank_value; } private boolean isBlank_compute() { return !hasInit(); } // Declared in VariableDeclaration.jrag at line 64 @SuppressWarnings({"unchecked", "cast"}) public String name() { String name_value = name_compute(); return name_value; } private String name_compute() { return getID(); } protected boolean constant_computed = false; protected Constant constant_value; // Declared in VariableDeclaration.jrag at line 65 @SuppressWarnings({"unchecked", "cast"}) public Constant constant() { if(constant_computed) return constant_value; int num = boundariesCrossed; boolean isFinal = this.is$Final(); constant_value = constant_compute(); if(isFinal && num == boundariesCrossed) constant_computed = true; return constant_value; } private Constant constant_compute() { return type().cast(getInit().constant()); } // Declared in Annotations.jrag at line 287 @SuppressWarnings({"unchecked", "cast"}) public boolean hasAnnotationSuppressWarnings(String s) { boolean hasAnnotationSuppressWarnings_String_value = hasAnnotationSuppressWarnings_compute(s); return hasAnnotationSuppressWarnings_String_value; } private boolean hasAnnotationSuppressWarnings_compute(String s) { return getModifiers().hasAnnotationSuppressWarnings(s); } // Declared in Annotations.jrag at line 325 @SuppressWarnings({"unchecked", "cast"}) public boolean isDeprecated() { boolean isDeprecated_value = isDeprecated_compute(); return isDeprecated_value; } private boolean isDeprecated_compute() { return getModifiers().hasDeprecatedAnnotation(); } protected boolean usesTypeVariable_computed = false; protected boolean usesTypeVariable_value; // Declared in Generics.jrag at line 906 @SuppressWarnings({"unchecked", "cast"}) public boolean usesTypeVariable() { if(usesTypeVariable_computed) return usesTypeVariable_value; int num = boundariesCrossed; boolean isFinal = this.is$Final(); usesTypeVariable_value = usesTypeVariable_compute(); if(isFinal && num == boundariesCrossed) usesTypeVariable_computed = true; return usesTypeVariable_value; } private boolean usesTypeVariable_compute() { return getTypeAccess().usesTypeVariable(); } protected boolean sourceVariableDecl_computed = false; protected Variable sourceVariableDecl_value; // Declared in Generics.jrag at line 1309 @SuppressWarnings({"unchecked", "cast"}) public Variable sourceVariableDecl() { if(sourceVariableDecl_computed) return sourceVariableDecl_value; int num = boundariesCrossed; boolean isFinal = this.is$Final(); sourceVariableDecl_value = sourceVariableDecl_compute(); if(isFinal && num == boundariesCrossed) sourceVariableDecl_computed = true; return sourceVariableDecl_value; } private Variable sourceVariableDecl_compute() { return this; } // Declared in GenericsParTypeDecl.jrag at line 66 @SuppressWarnings({"unchecked", "cast"}) public boolean visibleTypeParameters() { boolean visibleTypeParameters_value = visibleTypeParameters_compute(); return visibleTypeParameters_value; } private boolean visibleTypeParameters_compute() { return !isStatic(); } // Declared in EmitJimple.jrag at line 128 @SuppressWarnings({"unchecked", "cast"}) public int sootTypeModifiers() { int sootTypeModifiers_value = sootTypeModifiers_compute(); return sootTypeModifiers_value; } private int sootTypeModifiers_compute() { int result = 0; if(isPublic()) result |= soot.Modifier.PUBLIC; if(isProtected()) result |= soot.Modifier.PROTECTED; if(isPrivate()) result |= soot.Modifier.PRIVATE; if(isFinal()) result |= soot.Modifier.FINAL; if(isStatic()) result |= soot.Modifier.STATIC; return result; } protected boolean sootRef_computed = false; protected SootFieldRef sootRef_value; // Declared in EmitJimple.jrag at line 346 @SuppressWarnings({"unchecked", "cast"}) public SootFieldRef sootRef() { if(sootRef_computed) return sootRef_value; int num = boundariesCrossed; boolean isFinal = this.is$Final(); sootRef_value = sootRef_compute(); if(isFinal && num == boundariesCrossed) sootRef_computed = true; return sootRef_value; } private SootFieldRef sootRef_compute() { return Scene.v().makeFieldRef(hostType().getSootClassDecl(), name(), type().getSootType(), isStatic()); } // Declared in GenericsCodegen.jrag at line 29 @SuppressWarnings({"unchecked", "cast"}) public FieldDeclaration erasedField() { FieldDeclaration erasedField_value = erasedField_compute(); return erasedField_value; } private FieldDeclaration erasedField_compute() { return this; } // Declared in ExceptionHandling.jrag at line 34 @SuppressWarnings({"unchecked", "cast"}) public boolean handlesException(TypeDecl exceptionType) { boolean handlesException_TypeDecl_value = getParent().Define_boolean_handlesException(this, null, exceptionType); return handlesException_TypeDecl_value; } // Declared in Modifiers.jrag at line 262 public boolean Define_boolean_mayBePrivate(ASTNode caller, ASTNode child) { if(caller == getModifiersNoTransform()) { return true; } return getParent().Define_boolean_mayBePrivate(this, caller); } // Declared in GenericMethodsInference.jrag at line 35 public TypeDecl Define_TypeDecl_assignConvertedType(ASTNode caller, ASTNode child) { if(caller == getInitOptNoTransform()) { return type(); } return getParent().Define_TypeDecl_assignConvertedType(this, caller); } // Declared in ExceptionHandling.jrag at line 143 public boolean Define_boolean_handlesException(ASTNode caller, ASTNode child, TypeDecl exceptionType) { if(caller == getInitOptNoTransform()){ if(hostType().isAnonymous()) return true; if(!exceptionType.isUncheckedException()) return true; for(Iterator iter = hostType().constructors().iterator(); iter.hasNext(); ) { ConstructorDecl decl = (ConstructorDecl)iter.next(); if(!decl.throwsException(exceptionType)) return false; } return true; } return getParent().Define_boolean_handlesException(this, caller, exceptionType); } // Declared in DefiniteAssignment.jrag at line 322 public boolean Define_boolean_isDAbefore(ASTNode caller, ASTNode child, Variable v) { if(caller == getInitOptNoTransform()){ return isDAbefore(v); } return getParent().Define_boolean_isDAbefore(this, caller, v); } // Declared in Modifiers.jrag at line 264 public boolean Define_boolean_mayBeFinal(ASTNode caller, ASTNode child) { if(caller == getModifiersNoTransform()) { return true; } return getParent().Define_boolean_mayBeFinal(this, caller); } // Declared in Annotations.jrag at line 80 public boolean Define_boolean_mayUseAnnotationTarget(ASTNode caller, ASTNode child, String name) { if(caller == getModifiersNoTransform()) { return name.equals("FIELD"); } return getParent().Define_boolean_mayUseAnnotationTarget(this, caller, name); } // Declared in InnerClasses.jrag at line 64 public TypeDecl Define_TypeDecl_expectedType(ASTNode caller, ASTNode child) { if(caller == getInitOptNoTransform()) { return type().componentType(); } return getParent().Define_TypeDecl_expectedType(this, caller); } // Declared in Modifiers.jrag at line 260 public boolean Define_boolean_mayBePublic(ASTNode caller, ASTNode child) { if(caller == getModifiersNoTransform()) { return true; } return getParent().Define_boolean_mayBePublic(this, caller); } // Declared in DefiniteAssignment.jrag at line 39 public boolean Define_boolean_isSource(ASTNode caller, ASTNode child) { if(caller == getInitOptNoTransform()) { return true; } return getParent().Define_boolean_isSource(this, caller); } // Declared in Modifiers.jrag at line 266 public boolean Define_boolean_mayBeVolatile(ASTNode caller, ASTNode child) { if(caller == getModifiersNoTransform()) { return true; } return getParent().Define_boolean_mayBeVolatile(this, caller); } // Declared in Modifiers.jrag at line 261 public boolean Define_boolean_mayBeProtected(ASTNode caller, ASTNode child) { if(caller == getModifiersNoTransform()) { return true; } return getParent().Define_boolean_mayBeProtected(this, caller); } // Declared in Modifiers.jrag at line 265 public boolean Define_boolean_mayBeTransient(ASTNode caller, ASTNode child) { if(caller == getModifiersNoTransform()) { return true; } return getParent().Define_boolean_mayBeTransient(this, caller); } // Declared in TypeAnalysis.jrag at line 260 public TypeDecl Define_TypeDecl_declType(ASTNode caller, ASTNode child) { if(caller == getInitOptNoTransform()) { return type(); } return getParent().Define_TypeDecl_declType(this, caller); } // Declared in SyntacticClassification.jrag at line 78 public NameType Define_NameType_nameType(ASTNode caller, ASTNode child) { if(caller == getTypeAccessNoTransform()) { return NameType.TYPE_NAME; } return getParent().Define_NameType_nameType(this, caller); } // Declared in TypeHierarchyCheck.jrag at line 141 public boolean Define_boolean_inStaticContext(ASTNode caller, ASTNode child) { if(caller == getInitOptNoTransform()) { return isStatic() || hostType().isInterfaceDecl(); } return getParent().Define_boolean_inStaticContext(this, caller); } // Declared in Modifiers.jrag at line 263 public boolean Define_boolean_mayBeStatic(ASTNode caller, ASTNode child) { if(caller == getModifiersNoTransform()) { return true; } return getParent().Define_boolean_mayBeStatic(this, caller); } public ASTNode rewriteTo() { return super.rewriteTo(); } }
gpl-2.0
gowrav-vishwakarma/ffm
administrator/components/com_xcideveloper/system/core/CodeIgniter.php
11743
<?php /*------------------------------------------------------------------------ # com_xcideveloper - Seamless merging of CI Development Style with Joomla CMS # ------------------------------------------------------------------------ # author Xavoc International / Gowrav Vishwakarma # copyright Copyright (C) 2011 xavoc.com. All Rights Reserved. # @license - http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL # Websites: http://www.xavoc.com # Technical Support: Forum - http://xavoc.com/index.php?option=com_discussions&view=index&Itemid=157 -------------------------------------------------------------------------*/ // no direct access defined( '_JEXEC' ) or die( 'Restricted access' ); ?> <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); /** * CodeIgniter * * An open source application development framework for PHP 5.1.6 or newer * * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. * @license http://codeigniter.com/user_guide/license.html * @link http://codeigniter.com * @since Version 1.0 * @filesource */ // ------------------------------------------------------------------------ /** * System Initialization File * * Loads the base classes and executes the request. * * @package CodeIgniter * @subpackage codeigniter * @category Front-controller * @author ExpressionEngine Dev Team * @link http://codeigniter.com/user_guide/ */ /* * ------------------------------------------------------ * Define the CodeIgniter Version * ------------------------------------------------------ */ if(!defined('CI_VERSION')) define('CI_VERSION', '2.0'); /* * ------------------------------------------------------ * Load the global functions * ------------------------------------------------------ */ require(BASEPATH.'core/Common'.EXT); global $xCICurrentExtension; /* * ------------------------------------------------------ * Load the framework constants * ------------------------------------------------------ */ require(constant($xCICurrentExtension.'APPPATH').'config/constants'.EXT); /* * ------------------------------------------------------ * Define a custom error handler so we can log PHP errors * ------------------------------------------------------ */ set_error_handler('_exception_handler'); if ( ! is_php('5.3')) { @set_magic_quotes_runtime(0); // Kill magic quotes } /* * ------------------------------------------------------ * Set the subclass_prefix * ------------------------------------------------------ * * Normally the "subclass_prefix" is set in the config file. * The subclass prefix allows CI to know if a core class is * being extended via a library in the local application * "libraries" folder. Since CI allows config items to be * overriden via data set in the main index. php file, * before proceeding we need to know if a subclass_prefix * override exists. If so, we will set this value now, * before any classes are loaded * Note: Since the config file data is cached it doesn't * hurt to load it here. */ if (isset($assign_to_config['subclass_prefix']) AND $assign_to_config['subclass_prefix'] != '') { get_config(array('subclass_prefix' => $assign_to_config['subclass_prefix'])); } /* * ------------------------------------------------------ * Set a liberal script execution time limit * ------------------------------------------------------ */ if (function_exists("set_time_limit") == TRUE AND @ini_get("safe_mode") == 0) { @set_time_limit(300); } /* * ------------------------------------------------------ * Start the timer... tick tock tick tock... * ------------------------------------------------------ */ $BM =& load_class('Benchmark', 'core'); $GLOBALS['BM']=$BM; $BM->mark('total_execution_time_start'); $BM->mark('loading_time:_base_classes_start'); /* * ------------------------------------------------------ * Instantiate the hooks class * ------------------------------------------------------ */ $EXT =& load_class('Hooks', 'core'); $GLOBALS['EXT']=$EXT; /* * ------------------------------------------------------ * Is there a "pre_system" hook? * ------------------------------------------------------ */ $EXT->_call_hook('pre_system'); /* * ------------------------------------------------------ * Instantiate the config class * ------------------------------------------------------ */ $CFG =& load_class('Config', 'core'); $GLOBALS['CFG']=$CFG; // Do we have any manually set config items in the index.php file? if (isset($assign_to_config)) { $CFG->_assign_to_config($assign_to_config); } /* * ------------------------------------------------------ * Instantiate the UTF-8 class * ------------------------------------------------------ * * Note: Order here is rather important as the UTF-8 * class needs to be used very early on, but it cannot * properly determine if UTf-8 can be supported until * after the Config class is instantiated. * */ $UNI =& load_class('Utf8', 'core'); $GLOBALS['UNI']=$UNI; /* * ------------------------------------------------------ * Instantiate the URI class * ------------------------------------------------------ */ $URI =& load_class('URI', 'core'); $GLOBALS['URI']=$URI; /* * ------------------------------------------------------ * Instantiate the routing class and set the routing * ------------------------------------------------------ */ $RTR =& load_class('Router', 'core'); $GLOBALS['RTR']=$RTR; $RTR->_set_routing(); // Set any routing overrides that may exist in the main index file if (isset($routing)) { $RTR->_set_overrides($routing); } /* * ------------------------------------------------------ * Instantiate the output class * ------------------------------------------------------ */ $OUT =& load_class('Output', 'core'); $GLOBALS['OUT']=$OUT; /* * ------------------------------------------------------ * Is there a valid cache file? If so, we're done... * ------------------------------------------------------ */ if ($EXT->_call_hook('cache_override') === FALSE) { if ($OUT->_display_cache($CFG, $URI) == TRUE) { exit; } } /* * ------------------------------------------------------ * Load the Input class and sanitize globals * ------------------------------------------------------ */ $IN =& load_class('Input', 'core'); $GLOBALS['IN']=$IN; /* * ------------------------------------------------------ * Load the Language class * ------------------------------------------------------ */ $LANG =& load_class('Lang', 'core'); $GLOBALS['LANG']=$LANG; /* * ------------------------------------------------------ * Load the app controller and local controller * ------------------------------------------------------ * */ // Load the base controller class require_once BASEPATH.'core/Controller'.EXT; if(!function_exists('get_instance')){ function &get_instance() { return CI_Controller::get_instance(); } } if (file_exists(constant($xCICurrentExtension.'APPPATH').'core/'.$CFG->config['subclass_prefix'].'Controller'.EXT)) { require constant($xCICurrentExtension.'APPPATH').'core/'.$CFG->config['subclass_prefix'].'Controller'.EXT; } // Load the local application controller // Note: The Router class automatically validates the controller path using the router->_validate_request(). // If this include fails it means that the default controller in the Routes.php file is not resolving to something valid. if ( ! file_exists(constant($xCICurrentExtension.'APPPATH').'controllers/'.$RTR->fetch_directory().$RTR->fetch_class().EXT)) { show_error('Unable to load your default controller. Please make sure the controller specified in your Routes.php file is valid.'); } include_once(constant($xCICurrentExtension.'APPPATH').'controllers/'.$RTR->fetch_directory().$RTR->fetch_class().EXT); // Set a mark point for benchmarking $BM->mark('loading_time:_base_classes_end'); /* * ------------------------------------------------------ * Security check * ------------------------------------------------------ * * None of the functions in the app controller or the * loader class can be called via the URI, nor can * controller functions that begin with an underscore */ $class = $RTR->fetch_class(); $method = $RTR->fetch_method(); if ( ! class_exists($class) OR strncmp($method, '_', 1) == 0 OR in_array(strtolower($method), array_map('strtolower', get_class_methods('CI_Controller'))) ) { show_404("{$class}/{$method}"); } /* * ------------------------------------------------------ * Is there a "pre_controller" hook? * ------------------------------------------------------ */ $EXT->_call_hook('pre_controller'); /* * ------------------------------------------------------ * Instantiate the requested controller * ------------------------------------------------------ */ // Mark a start point so we can benchmark the controller $BM->mark('controller_execution_time_( '.$class.' / '.$method.' )_start'); $CI = new $class(); /* * ------------------------------------------------------ * Is there a "post_controller_constructor" hook? * ------------------------------------------------------ */ $EXT->_call_hook('post_controller_constructor'); /* * ------------------------------------------------------ * Call the requested method * ------------------------------------------------------ */ // Is there a "remap" function? If so, we call it instead if (method_exists($CI, '_remap')) { $CI->_remap($method, array_slice($URI->rsegments, 2)); } else { // is_callable() returns TRUE on some versions of PHP 5 for private and protected // methods, so we'll use this workaround for consistent behavior if ( ! in_array(strtolower($method), array_map('strtolower', get_class_methods($CI)))) { show_404("{$class}/{$method}"); } // Call the requested method. // Any URI segments present (besides the class/function) will be passed to the method for convenience call_user_func_array(array(&$CI, $method), array_slice($URI->rsegments, 2)); } // Mark a benchmark end point $BM->mark('controller_execution_time_( '.$class.' / '.$method.' )_end'); /* * ------------------------------------------------------ * Is there a "post_controller" hook? * ------------------------------------------------------ */ $EXT->_call_hook('post_controller'); /* * ------------------------------------------------------ * Send the final rendered output to the browser * ------------------------------------------------------ */ if ($EXT->_call_hook('display_override') === FALSE) { $OUT->_display(); } /* * ------------------------------------------------------ * Is there a "post_system" hook? * ------------------------------------------------------ */ $EXT->_call_hook('post_system'); /* * ------------------------------------------------------ * Close the DB connection if one exists * ------------------------------------------------------ */ if (class_exists('CI_DB') AND isset($CI->db)) { $CI->db->close(); } /* End of file CodeIgniter.php */ /* Location: ./system/core/CodeIgniter.php */
gpl-2.0
oytunyilmaz/Online-Newspaper
wp-content/themes/forexpress/video.php
440
<div class="videopost"> <div class="videoposttitle"></div> <div class="videoentry"> <?php $video = get_option('fress_video_category'); // Number of other entries to be shown $my_query = new WP_Query('category_name= '. $video .'&showposts=1'); while ($my_query->have_posts()) : $my_query->the_post();$do_not_duplicate = $post->ID; ?> <?php the_content('Continue...'); ?> <?php endwhile; ?> </div> </div> <div class="clear"></div>
gpl-2.0
TheRyuu/ffdshow
src/dialog/Csubtitles.cpp
10723
/* * Copyright (c) 2002-2006 Milan Cutka * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "stdafx.h" #include "Csubtitles.h" #include "TsubtitlesFile.h" #include "TsubtitlesSettings.h" #include "TffdshowPageDec.h" #include "Ttranslate.h" void TsubtitlesPage::init(void) { SendDlgItemMessage(m_hwnd, IDC_CBX_SUB_FLNM, CB_LIMITTEXT, MAX_PATH, 0); edLimitText(IDC_ED_SUB_SEARCH_DIR, MAX_PATH); edLimitText(IDC_ED_SUB_SEARCH_EXT, MAX_PATH); autosubfirsttime = true; addHint(IDC_ED_SUB_SEARCH_EXT, _l("ffdshow searches subtitle files in the folders which are configured in the edit box above.\nFor video.avi, ffdshow searches video.ass, video.ssa,... and use the file which is found at the first time.\nEnumerate extensions in the order you like and separate them by semicolons.\n\nass;ssa;srt;idx;sub;smi;rt;txt;aqt;mpl;sup;utf is the default settings")); addHint(IDC_CHB_SUB_EMBEDDED_PRIORITY, _l("If embedded subtitles are present, use them instead of any detected subtitle file")); setFont(IDC_BT_SUBTITLES_EXPAND, parent->arrowsFont); } static const int idEmbedded[] = {IDC_CHB_SUBCC, IDC_CHB_SUBTEXT_SSA, IDC_CHB_VOBSUB, IDC_CHB_BLURAY, 0}; void TsubtitlesPage::cfg2dlg(void) { sub2dlg(); enable(filterMode & IDFF_FILTERMODE_PLAYER, IDC_BT_SUBTITLES_RESET); setCheck(IDC_CHB_SUB_WATCH, cfgGet(IDFF_subWatch)); setCheck(IDC_CHB_SUB_EMBEDDED_PRIORITY, cfgGet(IDFF_subEmbeddedPriority)); static const int idEmbedd[] = {IDC_CHB_SUBTEXTPIN, IDC_CHB_SUBCC, IDC_CHB_SUBTEXT_SSA, IDC_CHB_VOBSUB, IDC_CHB_BLURAY, 0}; setCheck(IDC_CHB_SUBTEXTPIN, cfgGet(IDFF_subTextpin)); setCheck(IDC_CHB_SUBCC, cfgGet(IDFF_subCC)); setCheck(IDC_CHB_SUBTEXT_SSA, cfgGet(IDFF_subSSA)); setCheck(IDC_CHB_VOBSUB, cfgGet(IDFF_subVobsub)); setCheck(IDC_CHB_BLURAY, cfgGet(IDFF_subPGS)); setCheck(IDC_CHB_SUBTEXT, cfgGet(IDFF_subText)); setCheck(IDC_CHB_SUBTITLES_FILES, cfgGet(IDFF_subFiles)); //enable(getCheck(IDC_CHB_SUBTEXTPIN), idEmbedded, FALSE); enable((filterMode & IDFF_FILTERMODE_VFW) == 0, idEmbedd); } void TsubtitlesPage::sub2dlg(void) { const char_t *subfilename = cfgGetStr(IDFF_subFilename); if (SendDlgItemMessage(m_hwnd, IDC_CBX_SUB_FLNM, CB_SELECTSTRING, WPARAM(-1), LPARAM(subfilename)) == CB_ERR) { SendDlgItemMessage(m_hwnd, IDC_CBX_SUB_FLNM, CB_INSERTSTRING, 0, LPARAM(subfilename)); cbxSetCurSel(IDC_CBX_SUB_FLNM, 0); } int autoflnm = cfgGet(IDFF_subAutoFlnm); setCheck(IDC_RBT_SUB_SEARCHDIR, autoflnm); setCheck(IDC_RBT_SUB_FLNM, !autoflnm); setDlgItemText(m_hwnd, IDC_ED_SUB_SEARCH_DIR, cfgGetStr(IDFF_subSearchDir)); setDlgItemText(m_hwnd, IDC_ED_SUB_SEARCH_EXT, cfgGetStr(IDFF_subSearchExt)); SetDlgItemInt(m_hwnd, IDC_ED_SUB_DELAY , cfgGet(IDFF_subDelay), TRUE); SetDlgItemInt(m_hwnd, IDC_ED_SUB_SPEED , cfgGet(IDFF_subSpeed), FALSE); SetDlgItemInt(m_hwnd, IDC_ED_SUB_SPEED2, cfgGet(IDFF_subSpeed2), FALSE); auto2dlg(); } void TsubtitlesPage::auto2dlg(void) { int a = getCheck(IDC_RBT_SUB_SEARCHDIR); static const int idFile[] = {IDC_CBX_SUB_FLNM, IDC_BT_SUB_LOADFILE, 0}; enable(!a, idFile); setCheck(IDC_CHB_SUB_SEARCHHEURISTIC, cfgGet(IDFF_subSearchHeuristic)); static const int idSearch[] = {IDC_ED_SUB_SEARCH_DIR, IDC_BT_SUB_SEARCHDIR, IDC_CHB_SUB_SEARCHHEURISTIC, 0}; static const int idSearchExt[] = {IDC_ED_SUB_SEARCH_EXT, IDC_TXT_SERCH_ORDER, 0}; enable(a, idSearch); int b = getCheck(IDC_CHB_SUB_SEARCHHEURISTIC); enable(a && !b, idSearchExt); if (a && (filterMode & IDFF_FILTERMODE_PLAYER)) { const char_t *autosubflnm = deciV->findAutoSubflnm3(); /* if (autosubfirsttime) { autosubfirsttime=false; Tsubtitles::findPossibleSubtitles(deci->getSourceName(),autosubfiles); } if (!autosubfiles.empty()) { //enable(1,IDC_CBX_SUB_FLNM); //SendDlgItemMessage(m_hwnd,IDC_CBX_SUB_FLNM,CB_RESETCONTENT,0,0); //for (strings::const_iterator f=autosubfiles.begin();f!=autosubfiles.end();f++) // cbxAdd(IDC_CBX_SUB_FLNM,f->c_str()); */ setDlgItemText(m_hwnd, IDC_CBX_SUB_FLNM, autosubflnm); //} } } void TsubtitlesPage::applySettings(void) { loadSubtitles(); } void TsubtitlesPage::loadSubtitles(void) { if (!cfgGet(IDFF_subAutoFlnm)) { char_t subflnm[1024]; GetDlgItemText(m_hwnd, IDC_CBX_SUB_FLNM, subflnm, 1023); cfgSet(IDFF_subFilename, subflnm); } sub2dlg(); } INT_PTR TsubtitlesPage::msgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) { switch (uMsg) { case WM_COMMAND: switch (LOWORD(wParam)) { /*case IDC_CHB_SUBTEXTPIN: { enable(getCheck(IDC_CHB_SUBTEXTPIN), idEmbedded, FALSE); break; }*/ case IDC_CBX_SUB_FLNM: if (HIWORD(wParam) == CBN_SELCHANGE || HIWORD(wParam) == CBN_EDITUPDATE) { parent->setChange(); } return TRUE; case IDC_BT_SUBTITLES_RESET: if (HIWORD(wParam) == BN_CLICKED) { deciV->resetSubtitleTimes(); return TRUE; } break; case IDC_ED_SUB_SEARCH_DIR: if (HIWORD(wParam) == EN_CHANGE && !isSetWindowText) { char_t sdir[MAX_PATH]; GetDlgItemText(m_hwnd, IDC_ED_SUB_SEARCH_DIR, sdir, MAX_PATH); cfgSet(IDFF_subSearchDir, sdir); return TRUE; } break; case IDC_ED_SUB_SEARCH_EXT: if (HIWORD(wParam) == EN_CHANGE && !isSetWindowText) { char_t sext[MAX_PATH]; GetDlgItemText(m_hwnd, IDC_ED_SUB_SEARCH_EXT, sext, MAX_PATH); cfgSet(IDFF_subSearchExt, sext); return TRUE; } break; case IDC_BT_SUB_LOAD: if (HIWORD(wParam) == BN_CLICKED) { deci->notifyParamStr(IDFF_subFilename, _l("")); return TRUE; } break; } case WM_CTLCOLOREDIT: { HWND hwnd = HWND(lParam); bool ok; switch (getId(hwnd)) { case IDC_ED_SUBTITLES_EXPAND_X: case IDC_ED_SUBTITLES_EXPAND_Y: ok = eval(hwnd, 1, 10000); break; default: goto endColor; } if (!ok) { HDC dc = HDC(wParam); SetBkColor(dc, RGB(255, 0, 0)); return INT_PTR(getRed()); } else { return FALSE; } endColor: ; } } return TconfPageDecVideo::msgProc(uMsg, wParam, lParam); } void TsubtitlesPage::onLoadfile(void) { ffstring dir; extractfilepath(cfgGetStr(IDFF_subFilename), dir); char_t subflnm[MAX_PATH] = _l(""); if (dlgGetFile(false, m_hwnd, _(-IDD_SUBTITLES, _l("Load subtitles file")), TsubtitlesFile::mask, _l("txt"), subflnm, dir.c_str(), 0)) { setDlgItemText(m_hwnd, IDC_CBX_SUB_FLNM, subflnm); parent->setChange(); } } void TsubtitlesPage::onSearchdir(void) { char_t dir[MAX_PATH] = _l(""); if (dlgGetDir(m_hwnd, dir, _(-IDD_SUBTITLES, _l("Select directory where subtitles are stored")))) { char_t sdir[2 * MAX_PATH]; cfgGet(IDFF_subSearchDir, sdir, 2 * MAX_PATH); strncat_s(sdir, countof(sdir), _l(";"), _TRUNCATE); strncat_s(sdir, countof(sdir), dir, _TRUNCATE); cfgSet(IDFF_subSearchDir, sdir); sub2dlg(); } } void TsubtitlesPage::translate(void) { TconfPageBase::translate(); } TsubtitlesPage::TsubtitlesPage(TffdshowPageDec *Iparent, const TfilterIDFF *idff): TconfPageDecVideo(Iparent, idff, 1) { resInter = IDC_CHB_SUBTITLES; helpURL = _l("http://ffdshow-tryout.sourceforge.net/wiki/video:subtitles"); static const TbindCheckbox<TsubtitlesPage> chb[] = { IDC_CHB_SUB_WATCH, IDFF_subWatch, NULL, IDC_CHB_SUB_EMBEDDED_PRIORITY, IDFF_subEmbeddedPriority, NULL, IDC_CHB_SUBTEXTPIN, IDFF_subTextpin, NULL, IDC_CHB_SUB_SEARCHHEURISTIC, IDFF_subSearchHeuristic, &TsubtitlesPage::auto2dlg, IDC_CHB_SUBCC, IDFF_subCC, &TsubtitlesPage::cfg2dlg, IDC_CHB_SUBTEXT_SSA, IDFF_subSSA, NULL, IDC_CHB_VOBSUB, IDFF_subVobsub, NULL, IDC_CHB_BLURAY, IDFF_subPGS, NULL, IDC_CHB_SUBTEXT, IDFF_subText, NULL, IDC_CHB_SUBTITLES_FILES, IDFF_subFiles, NULL, 0, NULL, NULL }; bindCheckboxes(chb); static const TbindRadiobutton<TsubtitlesPage> rbt[] = { IDC_RBT_SUB_SEARCHDIR, IDFF_subAutoFlnm, 1, &TsubtitlesPage::sub2dlg, IDC_RBT_SUB_FLNM, IDFF_subAutoFlnm, 0, &TsubtitlesPage::sub2dlg, 0, 0, 0, NULL }; bindRadioButtons(rbt); static const TbindEditInt<TsubtitlesPage> edInt[] = { IDC_ED_SUB_DELAY , -INT_MAX / 2, INT_MAX / 2, IDFF_subDelay, NULL, IDC_ED_SUB_SPEED , 1, INT_MAX / 2, IDFF_subSpeed , NULL, IDC_ED_SUB_SPEED2, 1, INT_MAX / 2, IDFF_subSpeed2, NULL, 0 }; bindEditInts(edInt); static const TbindButton<TsubtitlesPage> bt[] = { IDC_BT_SUB_LOADFILE, &TsubtitlesPage::onLoadfile, IDC_BT_SUB_SEARCHDIR, &TsubtitlesPage::onSearchdir, 0, NULL }; bindButtons(bt); }
gpl-2.0
illectronic/LeadTracker
wp-content/themes/buddyboss/buddypress/activity/entry.php
570
<?php /** * BuddyPress - Activity Stream File Loader (Single Item) * * This template is used by activity-loop.php and AJAX functions to show * each activity. * * @package BuddyPress * @subpackage buddyboss */ if (BUDDYBOSS_WALL_ENABLED): // If the BuddyBoss wall is enabled, we need the custom entry-wall.php locate_template( array( 'buddypress/activity/entry-wall.php' ), true, false ); else: // If the BuddyBoss wall isn't enabled, load the default entry.php locate_template( array( 'buddypress/activity/entry-default.php' ), true, false ); endif; ?>
gpl-2.0
vbouchet31/panels
panels_ipe/js/panels_ipe.js
8381
/** * @file * Attaches behavior for the Panels IPE module. * */ (function ($, _, Backbone, Drupal, drupalSettings) { 'use strict'; /** * Contains initial Backbone initialization for the IPE. * * @type {Drupal~behavior} */ Drupal.behaviors.panels_ipe = { attach: function (context, settings) { // Perform initial setup of our app. $('body').once('panels-ipe-init').each(Drupal.panels_ipe.init, [settings]); // @todo Make every settings-related thing a generic event, or add a // panels_ipe event command to Drupal.ajax. // We need to add/update a new BlockModel somewhere. Inform the App that // this has occurred. if (settings['panels_ipe']['updated_block']) { var blockData = settings['panels_ipe']['updated_block']; // Remove the setting. delete settings['panels_ipe']['updated_block']; // Create a BlockModel. var block = new Drupal.panels_ipe.BlockModel(blockData); // Trigger the event. Drupal.panels_ipe.app.trigger('addBlockPlugin', block, blockData.region); } // We need to add/update our Layout Inform the App that this has occurred. if (settings['panels_ipe']['updated_layout']) { var layoutData = settings['panels_ipe']['updated_layout']; // Remove the setting. delete settings['panels_ipe']['updated_layout']; // Create a LayoutModel. layoutData = Drupal.panels_ipe.LayoutModel.prototype.parse(layoutData); var layout = new Drupal.panels_ipe.LayoutModel(layoutData); // Trigger the event. Drupal.panels_ipe.app.trigger('changeLayout', layout); } // Toggle the preview - We need to do this with drupalSettings as the // animation won't work if triggered by a form submit. It must occur after // the form is rendered. if (context.classList && context.classList.contains('panels-ipe-block-plugin-form') && context.classList.contains('flip-container') && settings['panels_ipe']['toggle_preview']) { var $form = $('.ipe-block-form'); // Flip the form. $form.toggleClass('flipped'); // Calculate and set new heights, if appropriate. Drupal.panels_ipe.setFlipperHeight($form); // As images can load late on new content, recalculate the flipper // height on image load. $form.find('img').each(function () { $(this).load(function () { Drupal.panels_ipe.setFlipperHeight($form); }); }); delete settings['panels_ipe']['toggle_preview']; } // A new Block Content entity has been created. Trigger an app-level event // to switch tabs and open the placement form. if (settings['panels_ipe']['new_block_content']) { var newBlockData = settings['panels_ipe']['new_block_content']; delete settings['panels_ipe']['new_block_content']; Drupal.panels_ipe.app.trigger('addContentBlock', newBlockData); } // A Block Content entity has been edited. if (settings['panels_ipe']['edit_block_content']) { var editBlockData = settings['panels_ipe']['edit_block_content']; delete settings['panels_ipe']['edit_block_content']; Drupal.panels_ipe.app.trigger('editContentBlockDone', editBlockData); } } }; /** * @namespace */ Drupal.panels_ipe = {}; /** * Setups up our initial Collection and Views based on the current settings. * * @param {Object} settings * The contextual drupalSettings. */ Drupal.panels_ipe.init = function (settings) { settings = settings || drupalSettings; // Set up our initial tabs. var tab_collection = new Drupal.panels_ipe.TabCollection(); if (settings.panels_ipe.user_permission.change_layout) { tab_collection.add(createTabModel(Drupal.t('Change Layout'), 'change_layout')); } tab_collection.add(createTabModel(Drupal.t('Manage Content'), 'manage_content')); // The edit/save/cancel tabs are special, and are tracked by our app. var edit_tab = createTabModel(Drupal.t('Edit'), 'edit'); var save_tab = createTabModel(Drupal.t('Save'), 'save'); var cancel_tab = createTabModel(Drupal.t('Cancel'), 'cancel'); tab_collection.add(edit_tab); tab_collection.add(save_tab); tab_collection.add(cancel_tab); // Create a global(ish) AppModel. Drupal.panels_ipe.app = new Drupal.panels_ipe.AppModel({ tabCollection: tab_collection, editTab: edit_tab, saveTab: save_tab, cancelTab: cancel_tab, unsaved: settings.panels_ipe.unsaved }); // Set up our initial tab views. var tab_views = {}; if (settings.panels_ipe.user_permission.change_layout) { tab_views.change_layout = new Drupal.panels_ipe.LayoutPicker(); } tab_views.manage_content = new Drupal.panels_ipe.BlockPicker(); // Create an AppView instance. Drupal.panels_ipe.app_view = new Drupal.panels_ipe.AppView({ model: Drupal.panels_ipe.app, el: '#panels-ipe-tray', tabContentViews: tab_views }); // Assemble the initial region and block collections. // This logic is a little messy, as traditionally we would never initialize // Backbone with existing HTML content. var region_collection = new Drupal.panels_ipe.RegionCollection(); for (var i in settings.panels_ipe.regions) { if (settings.panels_ipe.regions.hasOwnProperty(i)) { var region = new Drupal.panels_ipe.RegionModel(); region.set(settings.panels_ipe.regions[i]); var block_collection = new Drupal.panels_ipe.BlockCollection(); for (var j in settings.panels_ipe.regions[i].blocks) { if (settings.panels_ipe.regions[i].blocks.hasOwnProperty(j)) { // Add a new block model. var block = new Drupal.panels_ipe.BlockModel(); block.set(settings.panels_ipe.regions[i].blocks[j]); block_collection.add(block); } } region.set({blockCollection: block_collection}); region_collection.add(region); } } // Create the Layout model/view. var layout = new Drupal.panels_ipe.LayoutModel(settings.panels_ipe.layout); layout.set({regionCollection: region_collection}); var layout_view = new Drupal.panels_ipe.LayoutView({ model: layout, el: '#panels-ipe-content' }); Drupal.panels_ipe.app.set({layout: layout}); Drupal.panels_ipe.app_view.layoutView = layout_view; // Trigger a global Backbone event informing other Views that we're done // initializing and ready to render. Backbone.trigger('PanelsIPEInitialized'); // Render our AppView, without rendering the layout. $('body').append(Drupal.panels_ipe.app_view.render(false).$el); // Set our initial URL root. Drupal.panels_ipe.setUrlRoot(settings); function createTabModel(title, id) { return new Drupal.panels_ipe.TabModel({title: title, id: id}); } }; Drupal.panels_ipe.setFlipperHeight = function ($form) { // The preview could be larger than the form. // Manually set the height to be sure that things fit. var $new_side; var $current_side; if ($form.hasClass('flipped')) { $new_side = $form.find('.flipper > .back'); $current_side = $form.find('.flipper > .front'); } else { $new_side = $form.find('.flipper > .front'); $current_side = $form.find('.flipper > .back'); } $current_side.animate({height: $new_side.outerHeight() + 10}, 600); }; /** * Returns the urlRoot for all callbacks. * * @param {Object} settings * The contextual drupalSettings. * * @return {string} * A base path for most other URL callbacks in this App. */ Drupal.panels_ipe.urlRoot = function (settings) { return settings.panels_ipe.url_root; }; /** * Sets the urlRoot for all callbacks. * * @param {Object} settings * The contextual drupalSettings. */ Drupal.panels_ipe.setUrlRoot = function (settings) { var panels_display = settings.panels_ipe.panels_display; settings.panels_ipe.url_root = settings.path.baseUrl + settings.path.pathPrefix + 'admin/panels_ipe/variant/' + panels_display.storage_type + '/' + panels_display.storage_id; }; }(jQuery, _, Backbone, Drupal, drupalSettings));
gpl-2.0
Tatuy/UAServer
data/npc/FORGOTTENSERVER-ORTS/scripts/Nilsor.lua
9856
local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end local function creatureSayCallback(cid, type, msg) if not npcHandler:isFocused(cid) then return false end local player = Player(cid) if msgcontains(msg, "svargrond") or msgcontains(msg, "passage") then npcHandler:say("Do you want to go back to Svargrond?", cid) npcHandler.topic[cid] = 10 elseif msgcontains(msg, "yes") then if npcHandler.topic[cid] == 10 then player:teleportTo(Position(32306, 31082, 7)) player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) npcHandler.topic[cid] = 0 end end if msgcontains(msg, "mission") then if player:getStorageValue(Storage.TheIceIslands.Questline) == 20 then npcHandler:say({ "I am in dire need of help. A plague has befallen my dogs. I even called a druid of Carlin for help but all he could do was to recommend some strong medicine ...", "The thing is the ingredients of the medicine are extremely rare and some only exist in far away and distant lands. If you could help me collecting the ingredients, I would be eternally grateful ...", "Are you willing to help me?" }, cid) npcHandler.topic[cid] = 1 elseif player:getStorageValue(Storage.TheIceIslands.Questline) == 28 then npcHandler:say({ "Thank you. Now I have all necessary ingredients. As a reward I grant you the use of our dog sled, which is located to the east of here. ...", "The dogs can be a bit moody, but if you always carry some ham with you there shouldnt be any problems. Oh, and Hjaern might have a mission for you. So maybe you go and talk to him." }, cid) player:setStorageValue(Storage.TheIceIslands.Questline, 29) player:setStorageValue(Storage.TheIceIslands.Mission07, 1) -- Questlog The Ice Islands Quest, The Secret of Helheim npcHandler.topic[cid] = 0 elseif player:getStorageValue(Storage.TheIceIslands.Questline) > 20 and player:getStorageValue(Storage.TheIceIslands.Questline) < 28 then npcHandler:say("What for ingredient do you have?", cid) npcHandler.topic[cid] = 0 else npcHandler:say("I have now no mission for you.", cid) npcHandler.topic[cid] = 0 end elseif msgcontains(msg, "waterskin") then npcHandler:say("Do you want to buy a waterskin for 25 gold?", cid) npcHandler.topic[cid] = 2 elseif msgcontains(msg, "cactus") then if player:getStorageValue(Storage.TheIceIslands.Questline) == 21 then npcHandler:say("You will find this kind of cactus at places that are called deserts. Only an ordinary kitchen knife will be precise enough to produce the ingredient weneed. Do you have a part of that cactus with you?", cid) npcHandler.topic[cid] = 3 end elseif msgcontains(msg, "water") then if player:getStorageValue(Storage.TheIceIslands.Questline) == 22 then npcHandler:say({ "You will need a specially prepared waterskin to collect the water. You can buy one from me ...", "Use it on a geyser that is NOT active. The water of active geysers is far too hot. You can find inactive geysers on Okolnir. Do you have some geyser water with you?" }, cid) npcHandler.topic[cid] = 4 end elseif msgcontains(msg, "sulphur") then if player:getStorageValue(Storage.TheIceIslands.Questline) == 23 then npcHandler:say("I need fine sulphur of an inactive lava hole. No other sulphur will do. Use an ordinary kitchen spoon on an inactive lava hole. Do you have fine sulphurwith you?", cid) npcHandler.topic[cid] = 5 end elseif msgcontains(msg, "herb") then if player:getStorageValue(Storage.TheIceIslands.Questline) == 24 then npcHandler:say("The frostbite herb is a local plant but its quite rare. You can find it on mountain peaks. You will need to cut it with a fine kitchen knife. Do you have a frostbite herb with you?", cid) npcHandler.topic[cid] = 6 end elseif msgcontains(msg, "blossom") then if player:getStorageValue(Storage.TheIceIslands.Questline) == 25 then npcHandler:say("The purple kiss is a plant that grows in a place called jungle. You will have to use a kitchen knife to harvest its blossom. Do you have a blossom of a purple kiss with you?", cid) npcHandler.topic[cid] = 7 end elseif msgcontains(msg, "hydra tongue") then if player:getStorageValue(Storage.TheIceIslands.Questline) == 26 then npcHandler:say("The hydra tongue is a common pest plant in warmer regions. You might find one in a shop. Do you have a hydra tongue with you?", cid) npcHandler.topic[cid] = 8 end elseif msgcontains(msg, "spores") then if player:getStorageValue(Storage.TheIceIslands.Questline) == 27 then npcHandler:say("The giant glimmercap mushroom exists in caves and other preferably warm and humid places. Use an ordinary kitchen spoon on a mushroom to collectits spores. Do you have the glimmercap spores?", cid) npcHandler.topic[cid] = 9 end elseif msgcontains(msg, "yes") then if npcHandler.topic[cid] == 1 then npcHandler:say({ "A thousand thanks in advance. I need no less than 7 ingredients for the cure. You can ask me about each specifically ...", "I need a part of the sun adorer cactus, a vial of geyser water, sulphur of a lava hole, a frostbite herb, a blossom of a purple kiss, a hydra tongue and spores of a giant glimmercap mushroom ...", "Turn them in individually by talking about them to me. As soon as I obtained them all, talk to me about the medicine. First time bring a Part of the Sun Adorer {Cactus}." }, cid) player:setStorageValue(Storage.TheIceIslands.Questline, 21) player:setStorageValue(Storage.TheIceIslands.Mission06, 1) -- Questlog The Ice Islands Quest, Nibelor 5: Cure the Dogs npcHandler.topic[cid] = 0 elseif npcHandler.topic[cid] == 2 then if player:getMoney() >= 25 then player:removeMoney(25) npcHandler:say("Here you are. A waterskin!", cid) player:addItem(7286, 1) else npcHandler:say("You don't have enough money.", cid) end npcHandler.topic[cid] = 0 elseif npcHandler.topic[cid] == 3 then if player:removeItem(7245, 1) then npcHandler:say("Thank you for this ingredient. Now bring me Geyser {Water} in a Waterskin. ", cid) player:setStorageValue(Storage.TheIceIslands.Questline, 22) player:setStorageValue(Storage.TheIceIslands.Mission06, 2) -- Questlog The Ice Islands Quest, Nibelor 5: Cure the Dogs else npcHandler:say("Come back when you have the ingredient.", cid) end npcHandler.topic[cid] = 0 elseif npcHandler.topic[cid] == 4 then if player:removeItem(7246, 1) then npcHandler:say("Thank you for this ingredient. Now bring me Fine {Sulphur}.", cid) player:setStorageValue(Storage.TheIceIslands.Questline, 23) player:setStorageValue(Storage.TheIceIslands.Mission06, 3) -- Questlog The Ice Islands Quest, Nibelor 5: Cure the Dogs else npcHandler:say("Come back when you have the ingredient.", cid) end npcHandler.topic[cid] = 0 elseif npcHandler.topic[cid] == 5 then if player:removeItem(8301, 1) then npcHandler:say("Thank you for this ingredient. Now bring me the Frostbite {Herb}", cid) player:setStorageValue(Storage.TheIceIslands.Questline, 24) player:setStorageValue(Storage.TheIceIslands.Mission06, 4) -- Questlog The Ice Islands Quest, Nibelor 5: Cure the Dogs else npcHandler:say("Come back when you have the ingredient.", cid) end npcHandler.topic[cid] = 0 elseif npcHandler.topic[cid] == 6 then if player:removeItem(7248, 1) then npcHandler:say("Thank you for this ingredient Now bring me Purple Kiss {Blossom}.", cid) player:setStorageValue(Storage.TheIceIslands.Questline, 25) player:setStorageValue(Storage.TheIceIslands.Mission06, 5) -- Questlog The Ice Islands Quest, Nibelor 5: Cure the Dogs else npcHandler:say("Come back when you have the ingredient.", cid) end npcHandler.topic[cid] = 0 elseif npcHandler.topic[cid] == 7 then if player:removeItem(7249, 1) then npcHandler:say("Thank you for this ingredient. Now bring me the {Hydra Tongue}", cid) player:setStorageValue(Storage.TheIceIslands.Questline, 26) player:setStorageValue(Storage.TheIceIslands.Mission06, 6) -- Questlog The Ice Islands Quest, Nibelor 5: Cure the Dogs else npcHandler:say("Come back when you have the ingredient. ", cid) end npcHandler.topic[cid] = 0 elseif npcHandler.topic[cid] == 8 then if player:removeItem(7250, 1) then npcHandler:say("Thank you for this ingredient. Now bring me {Spores} of a Giant Glimmercap Mushroom.", cid) player:setStorageValue(Storage.TheIceIslands.Questline, 27) player:setStorageValue(Storage.TheIceIslands.Mission06, 7) -- Questlog The Ice Islands Quest, Nibelor 5: Cure the Dogs else npcHandler:say("Come back when you have the ingredient.", cid) end npcHandler.topic[cid] = 0 elseif npcHandler.topic[cid] == 9 then if player:removeItem(7251, 1) then npcHandler:say("Thank you for this ingredient. Now you finish your {mission}", cid) player:setStorageValue(Storage.TheIceIslands.Questline, 28) player:setStorageValue(Storage.TheIceIslands.Mission06, 8) -- Questlog The Ice Islands Quest, Nibelor 5: Cure the Dogs else npcHandler:say("Come back when you have the ingredient.", cid) end npcHandler.topic[cid] = 0 end elseif msgcontains(msg, "no") then if npcHandler.topic[cid] >= 2 then npcHandler:say("Then come back when you have the ingredient.", cid) end end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
gpl-2.0
justintadlock/socially-awkward
misc/loop-meta.php
895
<div <?php hybrid_attr( 'loop-meta' ); ?>> <h1 <?php hybrid_attr( 'loop-title' ); ?>><?php hybrid_loop_title(); ?></h1> <?php if ( !is_paged() && $desc = hybrid_get_loop_description() ) : // Check if we're on page/1. ?> <div <?php hybrid_attr( 'loop-description' ); ?>> <?php echo $desc; ?> </div><!-- .loop-description --> <?php endif; // End paged check. ?> <?php if ( is_home() || is_tax( 'post_format' ) ) : // If viewing the blog page or post format archive. ?> <?php hybrid_get_menu( 'formats' ); // Loads the menu/formats.php template. ?> <?php endif; // End blog and post format archive check. ?> <?php if ( is_post_type_archive( 'portfolio_item' ) || is_tax( 'portfolio' ) ) : // If viewing the portfolio. ?> <?php hybrid_get_menu( 'portfolio' ); // Loads the menu/portfolio.php template. ?> <?php endif; // End portfolio check. ?> </div><!-- .loop-meta -->
gpl-2.0
thebillkidy/desple.com
wp-content/themes/capsule/ui/lib/phpjs/_unported/runkit/runkit_constant_add.js
36
function runkit_constant_add () { }
gpl-2.0
aiga-chicago/chicago.aiga.org
wp-content/plugins/ikit/includes/api.php
5589
<?php /** * API for iKit, includes various functions using the WordPress Ajax framework. * * To make calls to the API, send a POST request to http://mydomain/wp-admin/admin-ajax.php, * replacing mydomain with your own domain. Add the required POST parameter * action, and whatever other parameters are required depending on the action. * Note the action name is just the method name minus the wp_ajax_ prefix. * Methods return data in JSON format. * * E.g. * * http:<mydomain>/wp-admin/admin-ajax.php * * w/post parameters: * action=ikit_api_v1_ikit_event_search * */ /** * Currently takes no parameters, just returns list of upcoming events */ function ikit_api_v1_ikit_event_search() { global $g_options; $imus_chapter = $g_options[IKIT_PLUGIN_OPTION_FILTER_IKIT_IMUS_CHAPTER]; $results = array(); $args = array(); $args['posts_per_page'] = 20; $args['post_type'] = IKIT_POST_TYPE_IKIT_EVENT; $args['order'] = 'ASC'; $args['orderby'] = 'meta_value_num'; $args['meta_key'] = IKIT_CUSTOM_FIELD_GENERIC_ORDERING_DISPLAY_PRIORITY; $args['meta_query'] = array( array('key' => IKIT_CUSTOM_FIELD_IKIT_EVENT_END_DATE, 'value' => date_i18n("Y-m-d"), 'compare' => '>=', 'type' => 'DATE'), array('key' => IKIT_CUSTOM_FIELD_IKIT_EVENT_STATUS, 'value' => 'Closed', 'compare' => '!=', 'type' => 'CHAR') ); query_posts($args); ?> <result> <site> <code><?php echo $imus_chapter; ?></code> <title><![CDATA[<?php echo ikit_get_blog_title(); ?>]]></title> <linkUrl><![CDATA[<?php echo get_bloginfo('url'); ?>]]></linkUrl> </site> <events> <?php while (have_posts()) : the_post(); global $id; $ikit_event_meta = ikit_event_get_meta($id); if($ikit_event_meta->folder_id != IKIT_EVENT_FOLDER_ID_NATIONAL && $ikit_event_meta->folder_id != IKIT_EVENT_FOLDER_ID_NATIONAL_REGISTRATION_TYPE_DISABLED) { // Note may not return the full count, because exludes national events $event_image_url = ikit_event_get_image_url($id, $ikit_event_meta, null); $event_title = null; $event_location = null; if($ikit_event_meta->service == IKIT_EVENT_SERVICE_EVENTBRITE) { $event_title = $ikit_event_meta->title; $event_location = $ikit_event_meta->venue_city; } else if($ikit_event_meta->service == IKIT_EVENT_SERVICE_ETOUCHES) { $event_title = $ikit_event_meta->name; $event_location = $ikit_event_meta->location_city; } ?> <event> <id><?php echo $id ?></id> <title><![CDATA[<?php echo $event_title; ?>]]></title> <startDate><?php echo ikit_date_without_time($ikit_event_meta->start_date); ?></startDate> <endDate><?php echo ikit_date_without_time($ikit_event_meta->end_date); ?></endDate> <startTime><?php echo $ikit_event_meta->start_time; ?></startTime> <endTime><?php echo $ikit_event_meta->end_time; ?></endTime> <imageUrl><![CDATA[<?php echo $event_image_url; ?>]]></imageUrl> <description><![CDATA[<?php echo $ikit_event_meta->description ?>]]></description> <linkUrl><![CDATA[<?php the_permalink() ?>]]></linkUrl> <location><![CDATA[<?php echo $event_location ?>]]></location> </event> <?php } endwhile; ?> </events> </result> <?php die(); } /** * Currently takes no parameters, just returns list of posts */ function ikit_api_v1_post_search() { global $g_options; $imus_chapter = $g_options[IKIT_PLUGIN_OPTION_FILTER_IKIT_IMUS_CHAPTER]; $args = array(); $args['posts_per_page'] = 20; $args['order'] = 'DESC'; $args['orderby'] = 'meta_value_num'; $args['meta_key'] = IKIT_CUSTOM_FIELD_GENERIC_ORDERING_DISPLAY_PRIORITY; query_posts($args); ?> <result> <site> <code><?php echo $imus_chapter; ?></code> <title><![CDATA[<?php echo ikit_get_blog_title(); ?>]]></title> <linkUrl><![CDATA[<?php echo get_bloginfo('url'); ?>]]></linkUrl> </site> <posts> <?php while (have_posts()) : the_post(); global $id; $post = get_post($id); $post_image_url = ikit_post_get_image_url($id, 'full', null); ?> <post> <id><?php echo $id ?></id> <title><![CDATA[<?php the_title(); ?>]]></title> <publishedDate><?php echo mysql2date('Y-m-d H:i:s +0000', get_gmt_from_date($post->post_date), false);?></publishedDate> <linkUrl><![CDATA[<?php the_permalink() ?>]]></linkUrl> <imageUrl><![CDATA[<?php echo $post_image_url; ?>]]></imageUrl> <description><![CDATA[<?php echo get_post_meta($id, IKIT_CUSTOM_FIELD_POST_PREVIEW_DESCRIPTION, true);?>]]></description> <author><![CDATA[<?php echo ikit_post_get_author($id, get_the_author()); ?>]]></author> </post> <?php endwhile; ?> </posts> </result> <?php die(); } // API Methods add_action( 'wp_ajax_ikit_api_v1_post_search', 'ikit_api_v1_post_search' ); add_action( 'wp_ajax_nopriv_ikit_api_v1_post_search', 'ikit_api_v1_post_search' ); add_action( 'wp_ajax_ikit_api_v1_ikit_event_search', 'ikit_api_v1_ikit_event_search' ); add_action( 'wp_ajax_nopriv_ikit_api_v1_ikit_event_search', 'ikit_api_v1_ikit_event_search' ); ?>
gpl-2.0
kactus2/kactus2dev
editors/common/ComponentItemAutoConnector/TableAutoConnector.cpp
7930
//----------------------------------------------------------------------------- // File: TableAutoConnector.cpp //----------------------------------------------------------------------------- // Project: Kactus2 // Author: Mikko Teuho // Date: 12.02.2019 // // Description: // Automatically connects items of two components. //----------------------------------------------------------------------------- #include "TableAutoConnector.h" #include <IPXACTmodels/Component/Component.h> #include <editors/ComponentEditor/busInterfaces/portmaps/JaroWinklerAlgorithm.h> //----------------------------------------------------------------------------- // Function: TableAutoConnector::initializeTable() //----------------------------------------------------------------------------- void TableAutoConnector::initializeTable(QTableWidget* selectedTable, QSharedPointer<Component> firstComponent, QSharedPointer<Component> secondComponent) const { int currentRowCount = selectedTable->rowCount(); QVector<QPair<QString, QString> > combinations = removeExistingCombinations(getCombinations(firstComponent, secondComponent), selectedTable); selectedTable->setRowCount(currentRowCount + combinations.size()); for (int i = 0; i < combinations.size(); ++i) { QTableWidgetItem* firstItem = createTableWidgetItem(combinations.at(i).first, firstComponent); QTableWidgetItem* secondItem = createTableWidgetItem(combinations.at(i).second, secondComponent); selectedTable->setItem(currentRowCount + i, 0, firstItem); selectedTable->setItem(currentRowCount + i, 1, secondItem); } } //----------------------------------------------------------------------------- // Function: TableAutoConnector::getCombinations() //----------------------------------------------------------------------------- QVector<QPair<QString, QString> > TableAutoConnector::getCombinations(QSharedPointer<Component> firstComponent, QSharedPointer<Component> secondComponent) const { QVector<QPair<QString, QString> > combinations; QVector<QPair<QString, QVector<QString> > > possibleCombinations = findPossibleCombinations(firstComponent, secondComponent); if (!possibleCombinations.isEmpty()) { const double JAROWINKLERTRESHOLD = 0.75; for (int i = 0; i < possibleCombinations.size(); ++i) { QString itemToBeConnected = possibleCombinations.at(i).first; QMap<double, QString> possibleConnecedItems; for (auto comparisonItem : possibleCombinations.at(i).second) { double jaroDistance = JaroWinklerAlgorithm::calculateJaroWinklerDistance(itemToBeConnected, comparisonItem); if (jaroDistance >= JAROWINKLERTRESHOLD) { possibleConnecedItems.insertMulti(jaroDistance, comparisonItem); } } if (!possibleConnecedItems.isEmpty()) { QPair<QString, QString> portCombination; portCombination.first = itemToBeConnected; portCombination.second = possibleConnecedItems.last(); combinations.append(portCombination); } } } return combinations; } //----------------------------------------------------------------------------- // Function: TableAutoConnector::removeExistingCombinations() //----------------------------------------------------------------------------- QVector<QPair<QString, QString> > TableAutoConnector::removeExistingCombinations( QVector<QPair<QString, QString> > const& combinations, QTableWidget* targetTable) const { QVector<QPair<QString, QString> > existingCombinations; for (int i = 0; i < targetTable->rowCount(); ++i) { QPair<QString, QString> singleCombination; singleCombination.first = getTextFromTableItem(i, 0, targetTable); singleCombination.second = getTextFromTableItem(i, 1, targetTable); existingCombinations.append(singleCombination); } QVector<QPair<QString, QString> > newCombinations; for (int i = 0; i < combinations.size(); ++i) { QString combinationFirst = combinations.at(i).first; QString combinationSecond = combinations.at(i).second; if (!combinationExistsInTable(combinationFirst, combinationSecond, existingCombinations)) { QPair<QString, QString> singleCombination; singleCombination.first = combinationFirst; singleCombination.second = combinationSecond; newCombinations.append(singleCombination); } } return newCombinations; } //----------------------------------------------------------------------------- // Function: TableAutoConnector::getTextFromTableItem() //----------------------------------------------------------------------------- QString TableAutoConnector::getTextFromTableItem(int const& itemRow, int const& itemColumn, QTableWidget* targetTable) const { QTableWidgetItem* tableItem = targetTable->item(itemRow, itemColumn); if (tableItem) { return tableItem->text(); } else { return QStringLiteral(""); } } //----------------------------------------------------------------------------- // Function: TableAutoConnector::combinationExistsInTable() //----------------------------------------------------------------------------- bool TableAutoConnector::combinationExistsInTable(QString const& combinationFirst, QString const& combinationSecond, QVector<QPair<QString, QString> > const& existingCombinations) const { for (auto const& singleCombination : existingCombinations) { if (singleCombination.first == combinationFirst || singleCombination.second == combinationSecond) { return true; } } return false; } //----------------------------------------------------------------------------- // Function: TableAutoConnector::createTableWidgetItem() //----------------------------------------------------------------------------- QTableWidgetItem* TableAutoConnector::createTableWidgetItem(QString const& itemName, QSharedPointer<Component> ) const { QTableWidgetItem* newItem = new QTableWidgetItem(itemName); return newItem; } //----------------------------------------------------------------------------- // Function: TableAutoConnector::clearTable() //----------------------------------------------------------------------------- void TableAutoConnector::clearTable(QTableWidget* selectedTable) const { selectedTable->setRowCount(0); } //----------------------------------------------------------------------------- // Function: TableAutoConnector::connectSelectedFromLists() //----------------------------------------------------------------------------- void TableAutoConnector::connectSelectedFromLists(QListView* firstList, QListView* secondList, QTableWidget* targetTable) const { QModelIndex firstItemIndex = firstList->currentIndex(); QModelIndex secondItemIndex = secondList->currentIndex(); if (firstItemIndex.isValid() && secondItemIndex.isValid()) { QString firstItemName = firstItemIndex.data(Qt::DisplayRole).toString(); QIcon firstItemIcon = firstItemIndex.data(Qt::DecorationRole).value<QIcon>(); QString secondItemName = secondItemIndex.data(Qt::DisplayRole).toString(); QIcon secondItemIcon = secondItemIndex.data(Qt::DecorationRole).value<QIcon>(); QTableWidgetItem* firstItem = new QTableWidgetItem(firstItemIcon, firstItemName); QTableWidgetItem* secondItem = new QTableWidgetItem(secondItemIcon, secondItemName); int newRow = targetTable->rowCount(); targetTable->setRowCount(newRow + 1); targetTable->setItem(newRow, 0, firstItem); targetTable->setItem(newRow, 1, secondItem); } }
gpl-2.0
logbie/glowing-octo-waffle
includes/libs/MultiHttpClient.php
15895
<?php /** * HTTP service client * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * http://www.gnu.org/copyleft/gpl.html * * @file */ /** * Class to handle concurrent HTTP requests * * HTTP request maps are arrays that use the following format: * - method : GET/HEAD/PUT/POST/DELETE * - url : HTTP/HTTPS URL * - query : <query parameter field/value associative array> (uses RFC 3986) * - headers : <header name/value associative array> * - body : source to get the HTTP request body from; * this can simply be a string (always), a resource for * PUT requests, and a field/value array for POST request; * array bodies are encoded as multipart/form-data and strings * use application/x-www-form-urlencoded (headers sent automatically) * - stream : resource to stream the HTTP response body to * - proxy : HTTP proxy to use * - flags : map of boolean flags which supports: * - relayResponseHeaders : write out header via header() * Request maps can use integer index 0 instead of 'method' and 1 instead of 'url'. * * @author Aaron Schulz * @since 1.23 */ class MultiHttpClient { /** @var resource */ protected $multiHandle = null; // curl_multi handle /** @var string|null SSL certificates path */ protected $caBundlePath; /** @var integer */ protected $connTimeout = 10; /** @var integer */ protected $reqTimeout = 300; /** @var bool */ protected $usePipelining = false; /** @var integer */ protected $maxConnsPerHost = 50; /** @var string|null proxy */ protected $proxy; /** @var string */ protected $userAgent = 'wikimedia/multi-http-client v1.0'; /** * @param array $options * - connTimeout : default connection timeout (seconds) * - reqTimeout : default request timeout (seconds) * - proxy : HTTP proxy to use * - usePipelining : whether to use HTTP pipelining if possible (for all hosts) * - maxConnsPerHost : maximum number of concurrent connections (per host) * - userAgent : The User-Agent header value to send * @throws Exception */ public function __construct( array $options ) { if ( isset( $options['caBundlePath'] ) ) { $this->caBundlePath = $options['caBundlePath']; if ( !file_exists( $this->caBundlePath ) ) { throw new Exception( "Cannot find CA bundle: " . $this->caBundlePath ); } } static $opts = [ 'connTimeout', 'reqTimeout', 'usePipelining', 'maxConnsPerHost', 'proxy', 'userAgent' ]; foreach ( $opts as $key ) { if ( isset( $options[$key] ) ) { $this->$key = $options[$key]; } } } /** * Execute an HTTP(S) request * * This method returns a response map of: * - code : HTTP response code or 0 if there was a serious cURL error * - reason : HTTP response reason (empty if there was a serious cURL error) * - headers : <header name/value associative array> * - body : HTTP response body or resource (if "stream" was set) * - error : Any cURL error string * The map also stores integer-indexed copies of these values. This lets callers do: * @code * list( $rcode, $rdesc, $rhdrs, $rbody, $rerr ) = $http->run( $req ); * @endcode * @param array $req HTTP request array * @param array $opts * - connTimeout : connection timeout per request (seconds) * - reqTimeout : post-connection timeout per request (seconds) * @return array Response array for request */ public function run( array $req, array $opts = [] ) { return $this->runMulti( [ $req ], $opts )[0]['response']; } /** * Execute a set of HTTP(S) requests concurrently * * The maps are returned by this method with the 'response' field set to a map of: * - code : HTTP response code or 0 if there was a serious cURL error * - reason : HTTP response reason (empty if there was a serious cURL error) * - headers : <header name/value associative array> * - body : HTTP response body or resource (if "stream" was set) * - error : Any cURL error string * The map also stores integer-indexed copies of these values. This lets callers do: * @code * list( $rcode, $rdesc, $rhdrs, $rbody, $rerr ) = $req['response']; * @endcode * All headers in the 'headers' field are normalized to use lower case names. * This is true for the request headers and the response headers. Integer-indexed * method/URL entries will also be changed to use the corresponding string keys. * * @param array $reqs Map of HTTP request arrays * @param array $opts * - connTimeout : connection timeout per request (seconds) * - reqTimeout : post-connection timeout per request (seconds) * - usePipelining : whether to use HTTP pipelining if possible * - maxConnsPerHost : maximum number of concurrent connections (per host) * @return array $reqs With response array populated for each * @throws Exception */ public function runMulti( array $reqs, array $opts = [] ) { $chm = $this->getCurlMulti(); // Normalize $reqs and add all of the required cURL handles... $handles = []; foreach ( $reqs as $index => &$req ) { $req['response'] = [ 'code' => 0, 'reason' => '', 'headers' => [], 'body' => '', 'error' => '' ]; if ( isset( $req[0] ) ) { $req['method'] = $req[0]; // short-form unset( $req[0] ); } if ( isset( $req[1] ) ) { $req['url'] = $req[1]; // short-form unset( $req[1] ); } if ( !isset( $req['method'] ) ) { throw new Exception( "Request has no 'method' field set." ); } elseif ( !isset( $req['url'] ) ) { throw new Exception( "Request has no 'url' field set." ); } $req['query'] = isset( $req['query'] ) ? $req['query'] : []; $headers = []; // normalized headers if ( isset( $req['headers'] ) ) { foreach ( $req['headers'] as $name => $value ) { $headers[strtolower( $name )] = $value; } } $req['headers'] = $headers; if ( !isset( $req['body'] ) ) { $req['body'] = ''; $req['headers']['content-length'] = 0; } $req['flags'] = isset( $req['flags'] ) ? $req['flags'] : []; $handles[$index] = $this->getCurlHandle( $req, $opts ); if ( count( $reqs ) > 1 ) { // https://github.com/guzzle/guzzle/issues/349 curl_setopt( $handles[$index], CURLOPT_FORBID_REUSE, true ); } } unset( $req ); // don't assign over this by accident $indexes = array_keys( $reqs ); if ( function_exists( 'curl_multi_setopt' ) ) { // PHP 5.5 if ( isset( $opts['usePipelining'] ) ) { curl_multi_setopt( $chm, CURLMOPT_PIPELINING, (int)$opts['usePipelining'] ); } if ( isset( $opts['maxConnsPerHost'] ) ) { // Keep these sockets around as they may be needed later in the request curl_multi_setopt( $chm, CURLMOPT_MAXCONNECTS, (int)$opts['maxConnsPerHost'] ); } } // @TODO: use a per-host rolling handle window (e.g. CURLMOPT_MAX_HOST_CONNECTIONS) $batches = array_chunk( $indexes, $this->maxConnsPerHost ); $infos = []; foreach ( $batches as $batch ) { // Attach all cURL handles for this batch foreach ( $batch as $index ) { curl_multi_add_handle( $chm, $handles[$index] ); } // Execute the cURL handles concurrently... $active = null; // handles still being processed do { // Do any available work... do { $mrc = curl_multi_exec( $chm, $active ); $info = curl_multi_info_read( $chm ); if ( $info !== false ) { $infos[(int)$info['handle']] = $info; } } while ( $mrc == CURLM_CALL_MULTI_PERFORM ); // Wait (if possible) for available work... if ( $active > 0 && $mrc == CURLM_OK ) { if ( curl_multi_select( $chm, 10 ) == -1 ) { // PHP bug 63411; http://curl.haxx.se/libcurl/c/curl_multi_fdset.html usleep( 5000 ); // 5ms } } } while ( $active > 0 && $mrc == CURLM_OK ); } // Remove all of the added cURL handles and check for errors... foreach ( $reqs as $index => &$req ) { $ch = $handles[$index]; curl_multi_remove_handle( $chm, $ch ); if ( isset( $infos[(int)$ch] ) ) { $info = $infos[(int)$ch]; $errno = $info['result']; if ( $errno !== 0 ) { $req['response']['error'] = "(curl error: $errno)"; if ( function_exists( 'curl_strerror' ) ) { $req['response']['error'] .= " " . curl_strerror( $errno ); } } } else { $req['response']['error'] = "(curl error: no status set)"; } // For convenience with the list() operator $req['response'][0] = $req['response']['code']; $req['response'][1] = $req['response']['reason']; $req['response'][2] = $req['response']['headers']; $req['response'][3] = $req['response']['body']; $req['response'][4] = $req['response']['error']; curl_close( $ch ); // Close any string wrapper file handles if ( isset( $req['_closeHandle'] ) ) { fclose( $req['_closeHandle'] ); unset( $req['_closeHandle'] ); } } unset( $req ); // don't assign over this by accident // Restore the default settings if ( function_exists( 'curl_multi_setopt' ) ) { // PHP 5.5 curl_multi_setopt( $chm, CURLMOPT_PIPELINING, (int)$this->usePipelining ); curl_multi_setopt( $chm, CURLMOPT_MAXCONNECTS, (int)$this->maxConnsPerHost ); } return $reqs; } /** * @param array $req HTTP request map * @param array $opts * - connTimeout : default connection timeout * - reqTimeout : default request timeout * @return resource * @throws Exception */ protected function getCurlHandle( array &$req, array $opts = [] ) { $ch = curl_init(); curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, isset( $opts['connTimeout'] ) ? $opts['connTimeout'] : $this->connTimeout ); curl_setopt( $ch, CURLOPT_PROXY, isset( $req['proxy'] ) ? $req['proxy'] : $this->proxy ); curl_setopt( $ch, CURLOPT_TIMEOUT, isset( $opts['reqTimeout'] ) ? $opts['reqTimeout'] : $this->reqTimeout ); curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1 ); curl_setopt( $ch, CURLOPT_MAXREDIRS, 4 ); curl_setopt( $ch, CURLOPT_HEADER, 0 ); if ( !is_null( $this->caBundlePath ) ) { curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, true ); curl_setopt( $ch, CURLOPT_CAINFO, $this->caBundlePath ); } curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); $url = $req['url']; // PHP_QUERY_RFC3986 is PHP 5.4+ only $query = str_replace( [ '+', '%7E' ], [ '%20', '~' ], http_build_query( $req['query'], '', '&' ) ); if ( $query != '' ) { $url .= strpos( $req['url'], '?' ) === false ? "?$query" : "&$query"; } curl_setopt( $ch, CURLOPT_URL, $url ); curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, $req['method'] ); if ( $req['method'] === 'HEAD' ) { curl_setopt( $ch, CURLOPT_NOBODY, 1 ); } if ( $req['method'] === 'PUT' ) { curl_setopt( $ch, CURLOPT_PUT, 1 ); if ( is_resource( $req['body'] ) ) { curl_setopt( $ch, CURLOPT_INFILE, $req['body'] ); if ( isset( $req['headers']['content-length'] ) ) { curl_setopt( $ch, CURLOPT_INFILESIZE, $req['headers']['content-length'] ); } elseif ( isset( $req['headers']['transfer-encoding'] ) && $req['headers']['transfer-encoding'] === 'chunks' ) { curl_setopt( $ch, CURLOPT_UPLOAD, true ); } else { throw new Exception( "Missing 'Content-Length' or 'Transfer-Encoding' header." ); } } elseif ( $req['body'] !== '' ) { $fp = fopen( "php://temp", "wb+" ); fwrite( $fp, $req['body'], strlen( $req['body'] ) ); rewind( $fp ); curl_setopt( $ch, CURLOPT_INFILE, $fp ); curl_setopt( $ch, CURLOPT_INFILESIZE, strlen( $req['body'] ) ); $req['_closeHandle'] = $fp; // remember to close this later } else { curl_setopt( $ch, CURLOPT_INFILESIZE, 0 ); } curl_setopt( $ch, CURLOPT_READFUNCTION, function ( $ch, $fd, $length ) { $data = fread( $fd, $length ); $len = strlen( $data ); return $data; } ); } elseif ( $req['method'] === 'POST' ) { curl_setopt( $ch, CURLOPT_POST, 1 ); // Don't interpret POST parameters starting with '@' as file uploads, because this // makes it impossible to POST plain values starting with '@' (and causes security // issues potentially exposing the contents of local files). // The PHP manual says this option was introduced in PHP 5.5 defaults to true in PHP 5.6, // but we support lower versions, and the option doesn't exist in HHVM 5.6.99. if ( defined( 'CURLOPT_SAFE_UPLOAD' ) ) { curl_setopt( $ch, CURLOPT_SAFE_UPLOAD, true ); } elseif ( is_array( $req['body'] ) ) { // In PHP 5.2 and later, '@' is interpreted as a file upload if POSTFIELDS // is an array, but not if it's a string. So convert $req['body'] to a string // for safety. $req['body'] = wfArrayToCgi( $req['body'] ); } curl_setopt( $ch, CURLOPT_POSTFIELDS, $req['body'] ); } else { if ( is_resource( $req['body'] ) || $req['body'] !== '' ) { throw new Exception( "HTTP body specified for a non PUT/POST request." ); } $req['headers']['content-length'] = 0; } if ( !isset( $req['headers']['user-agent'] ) ) { $req['headers']['user-agent'] = $this->userAgent; } $headers = []; foreach ( $req['headers'] as $name => $value ) { if ( strpos( $name, ': ' ) ) { throw new Exception( "Headers cannot have ':' in the name." ); } $headers[] = $name . ': ' . trim( $value ); } curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers ); curl_setopt( $ch, CURLOPT_HEADERFUNCTION, function ( $ch, $header ) use ( &$req ) { if ( !empty( $req['flags']['relayResponseHeaders'] ) ) { header( $header ); } $length = strlen( $header ); $matches = []; if ( preg_match( "/^(HTTP\/1\.[01]) (\d{3}) (.*)/", $header, $matches ) ) { $req['response']['code'] = (int)$matches[2]; $req['response']['reason'] = trim( $matches[3] ); return $length; } if ( strpos( $header, ":" ) === false ) { return $length; } list( $name, $value ) = explode( ":", $header, 2 ); $req['response']['headers'][strtolower( $name )] = trim( $value ); return $length; } ); if ( isset( $req['stream'] ) ) { // Don't just use CURLOPT_FILE as that might give: // curl_setopt(): cannot represent a stream of type Output as a STDIO FILE* // The callback here handles both normal files and php://temp handles. curl_setopt( $ch, CURLOPT_WRITEFUNCTION, function ( $ch, $data ) use ( &$req ) { return fwrite( $req['stream'], $data ); } ); } else { curl_setopt( $ch, CURLOPT_WRITEFUNCTION, function ( $ch, $data ) use ( &$req ) { $req['response']['body'] .= $data; return strlen( $data ); } ); } return $ch; } /** * @return resource */ protected function getCurlMulti() { if ( !$this->multiHandle ) { $cmh = curl_multi_init(); if ( function_exists( 'curl_multi_setopt' ) ) { // PHP 5.5 curl_multi_setopt( $cmh, CURLMOPT_PIPELINING, (int)$this->usePipelining ); curl_multi_setopt( $cmh, CURLMOPT_MAXCONNECTS, (int)$this->maxConnsPerHost ); } $this->multiHandle = $cmh; } return $this->multiHandle; } function __destruct() { if ( $this->multiHandle ) { curl_multi_close( $this->multiHandle ); } } }
gpl-2.0
FracturedPlane/CharacterAnimation
bullet3/Demos3/bullet2/FeatherstoneMultiBodyDemo/BulletMultiBodyDemos.cpp
33021
#define ARRAY_SIZE_X 5 #define ARRAY_SIZE_Y 5 #define ARRAY_SIZE_Z 5 static float scaling = 1.f; static float friction = 1.; #include "BulletMultiBodyDemos.h" #include "OpenGLWindow/SimpleOpenGL3App.h" #include "Bullet3Common/b3Vector3.h" #include "assert.h" #include <stdio.h> #include "btBulletDynamicsCommon.h" #include "BulletDynamics/Featherstone/btMultiBody.h" #include "BulletDynamics/Featherstone/btMultiBodyConstraintSolver.h" #include "BulletDynamics/Featherstone/btMultiBodyDynamicsWorld.h" #include "BulletDynamics/Featherstone/btMultiBodyLinkCollider.h" #include "BulletDynamics/Featherstone/btMultiBodyLink.h" #include "BulletDynamics/Featherstone/btMultiBodyJointLimitConstraint.h" #include "BulletDynamics/Featherstone/btMultiBodyJointMotor.h" #include "BulletDynamics/Featherstone/btMultiBodyPoint2Point.h" #include "OpenGLWindow/GLInstancingRenderer.h" #include "BulletCollision/CollisionShapes/btShapeHull.h" #define CONSTRAINT_DEBUG_SIZE 0.2f static bool prevCanSleep = false; struct GraphicsVertex { float pos[4]; float normal[3]; float texcoord[2]; }; static btVector4 colors[4] = { btVector4(1,0,0,1), btVector4(0,1,0,1), btVector4(0,1,1,1), btVector4(1,1,0,1), }; Bullet2MultiBodyDemo::Bullet2MultiBodyDemo(CommonGraphicsApp* app) :m_glApp(app), m_pickedBody(0), m_pickedConstraint(0), m_pickingMultiBodyPoint2Point(0) { app->setUpAxis(1); m_collisionConfiguration = 0; m_dispatcher = 0; m_broadphase = 0; m_solver = 0; m_dynamicsWorld = 0; } void Bullet2MultiBodyDemo::initPhysics() { m_collisionConfiguration = new btDefaultCollisionConfiguration; m_dispatcher = new btCollisionDispatcher(m_collisionConfiguration); m_broadphase = new btDbvtBroadphase(); m_solver = new btMultiBodyConstraintSolver(); m_dynamicsWorld = new btMultiBodyDynamicsWorld(m_dispatcher,m_broadphase,m_solver,m_collisionConfiguration); } void Bullet2MultiBodyDemo::exitPhysics() { delete m_dynamicsWorld; m_dynamicsWorld=0; delete m_solver; m_solver=0; delete m_broadphase; m_broadphase=0; delete m_dispatcher; m_dispatcher=0; delete m_collisionConfiguration; m_collisionConfiguration=0; } Bullet2MultiBodyDemo::~Bullet2MultiBodyDemo() { btAssert(m_collisionConfiguration == 0); btAssert(m_dispatcher == 0); btAssert(m_broadphase == 0); btAssert(m_solver == 0); btAssert(m_dynamicsWorld == 0); } btVector3 Bullet2MultiBodyDemo::getRayTo(int x,int y) { if (!m_glApp->m_renderer) { btAssert(0); return btVector3(0,0,0); } float top = 1.f; float bottom = -1.f; float nearPlane = 1.f; float tanFov = (top-bottom)*0.5f / nearPlane; float fov = b3Scalar(2.0) * b3Atan(tanFov); btVector3 camPos,camTarget; m_glApp->m_renderer->getCameraPosition(camPos); m_glApp->m_renderer->getCameraTargetPosition(camTarget); btVector3 rayFrom = camPos; btVector3 rayForward = (camTarget-camPos); rayForward.normalize(); float farPlane = 10000.f; rayForward*= farPlane; btVector3 rightOffset; btVector3 m_cameraUp=btVector3(0,1,0); btVector3 vertical = m_cameraUp; btVector3 hor; hor = rayForward.cross(vertical); hor.normalize(); vertical = hor.cross(rayForward); vertical.normalize(); float tanfov = tanf(0.5f*fov); hor *= 2.f * farPlane * tanfov; vertical *= 2.f * farPlane * tanfov; b3Scalar aspect; float width = m_glApp->m_renderer->getScreenWidth(); float height = m_glApp->m_renderer->getScreenHeight(); aspect = width / height; hor*=aspect; btVector3 rayToCenter = rayFrom + rayForward; btVector3 dHor = hor * 1.f/width; btVector3 dVert = vertical * 1.f/height; btVector3 rayTo = rayToCenter - 0.5f * hor + 0.5f * vertical; rayTo += btScalar(x) * dHor; rayTo -= btScalar(y) * dVert; return rayTo; } bool Bullet2MultiBodyDemo::mouseMoveCallback(float x,float y) { // if (m_data->m_altPressed!=0 || m_data->m_controlPressed!=0) // return false; if (m_pickedBody && m_pickedConstraint) { btPoint2PointConstraint* pickCon = static_cast<btPoint2PointConstraint*>(m_pickedConstraint); if (pickCon) { //keep it at the same picking distance btVector3 newRayTo = getRayTo(x,y); btVector3 rayFrom; // btVector3 oldPivotInB = pickCon->getPivotInB(); btVector3 newPivotB; m_glApp->m_renderer->getCameraPosition(rayFrom); btVector3 dir = newRayTo-rayFrom; dir.normalize(); dir *= m_oldPickingDist; newPivotB = rayFrom + dir; pickCon->setPivotB(newPivotB); } } if (m_pickingMultiBodyPoint2Point) { //keep it at the same picking distance btVector3 newRayTo = getRayTo(x,y); btVector3 rayFrom; // btVector3 oldPivotInB = m_pickingMultiBodyPoint2Point->getPivotInB(); btVector3 newPivotB; btVector3 camPos; m_glApp->m_renderer->getCameraPosition(camPos); rayFrom = camPos; btVector3 dir = newRayTo-rayFrom; dir.normalize(); dir *= m_oldPickingDist; newPivotB = rayFrom + dir; m_pickingMultiBodyPoint2Point->setPivotInB(newPivotB); } return false; } bool Bullet2MultiBodyDemo::mouseButtonCallback(int button, int state, float x, float y) { if (state==1) { if(button==0)// && (m_data->m_altPressed==0 && m_data->m_controlPressed==0)) { btVector3 camPos; m_glApp->m_renderer->getCameraPosition(camPos); btVector3 rayFrom = camPos; btVector3 rayTo = getRayTo(x,y); btCollisionWorld::ClosestRayResultCallback rayCallback(rayFrom,rayTo); m_dynamicsWorld->rayTest(rayFrom,rayTo,rayCallback); if (rayCallback.hasHit()) { btVector3 pickPos = rayCallback.m_hitPointWorld; btRigidBody* body = (btRigidBody*)btRigidBody::upcast(rayCallback.m_collisionObject); if (body) { //other exclusions? if (!(body->isStaticObject() || body->isKinematicObject())) { m_pickedBody = body; m_pickedBody->setActivationState(DISABLE_DEACTIVATION); //printf("pickPos=%f,%f,%f\n",pickPos.getX(),pickPos.getY(),pickPos.getZ()); btVector3 localPivot = body->getCenterOfMassTransform().inverse() * pickPos; btPoint2PointConstraint* p2p = new btPoint2PointConstraint(*body,localPivot); m_dynamicsWorld->addConstraint(p2p,true); m_pickedConstraint = p2p; btScalar mousePickClamping = 10.f; p2p->m_setting.m_impulseClamp = mousePickClamping; //very weak constraint for picking p2p->m_setting.m_tau = 0.001f; } } else { btMultiBodyLinkCollider* multiCol = (btMultiBodyLinkCollider*)btMultiBodyLinkCollider::upcast(rayCallback.m_collisionObject); if (multiCol && multiCol->m_multiBody) { prevCanSleep = multiCol->m_multiBody->getCanSleep(); multiCol->m_multiBody->setCanSleep(false); btVector3 pivotInA = multiCol->m_multiBody->worldPosToLocal(multiCol->m_link, pickPos); btMultiBodyPoint2Point* p2p = new btMultiBodyPoint2Point(multiCol->m_multiBody,multiCol->m_link,0,pivotInA,pickPos); //if you add too much energy to the system, causing high angular velocities, simulation 'explodes' //see also http://www.bulletphysics.org/Bullet/phpBB3/viewtopic.php?f=4&t=949 //so we try to avoid it by clamping the maximum impulse (force) that the mouse pick can apply //it is not satisfying, hopefully we find a better solution (higher order integrator, using joint friction using a zero-velocity target motor with limited force etc?) p2p->setMaxAppliedImpulse(2*scaling); btMultiBodyDynamicsWorld* world = (btMultiBodyDynamicsWorld*) m_dynamicsWorld; world->addMultiBodyConstraint(p2p); m_pickingMultiBodyPoint2Point =p2p; } } // pickObject(pickPos, rayCallback.m_collisionObject); m_oldPickingPos = rayTo; m_hitPos = pickPos; m_oldPickingDist = (pickPos-rayFrom).length(); // printf("hit !\n"); //add p2p } } } else { if (button==0) { if (m_pickedConstraint) { m_dynamicsWorld->removeConstraint(m_pickedConstraint); delete m_pickedConstraint; m_pickedConstraint=0; m_pickedBody = 0; } if (m_pickingMultiBodyPoint2Point) { m_pickingMultiBodyPoint2Point->getMultiBodyA()->setCanSleep(prevCanSleep); btMultiBodyDynamicsWorld* world = (btMultiBodyDynamicsWorld*) m_dynamicsWorld; world->removeMultiBodyConstraint(m_pickingMultiBodyPoint2Point); delete m_pickingMultiBodyPoint2Point; m_pickingMultiBodyPoint2Point = 0; } //remove p2p } } //printf("button=%d, state=%d\n",button,state); return false; } FeatherstoneDemo1::FeatherstoneDemo1(CommonGraphicsApp* app) :Bullet2MultiBodyDemo(app) { } FeatherstoneDemo1::~FeatherstoneDemo1() { } btMultiBody* FeatherstoneDemo1::createFeatherstoneMultiBody(class btMultiBodyDynamicsWorld* world, const btMultiBodySettings& settings) { int curColor=0; int cubeShapeId = m_glApp->registerCubeShape(1,1,1); int n_links = settings.m_numLinks; float mass = 13.5*scaling; btVector3 inertia = btVector3 (91,344,253)*scaling*scaling; bool isMultiDof = false; btMultiBody * bod = new btMultiBody(n_links, mass, inertia, settings.m_isFixedBase, settings.m_canSleep, isMultiDof); // bod->setHasSelfCollision(false); //btQuaternion orn(btVector3(0,0,1),-0.25*SIMD_HALF_PI);//0,0,0,1); btQuaternion orn(0,0,0,1); bod->setBasePos(settings.m_basePosition); bod->setWorldToBaseRot(orn); btVector3 vel(0,0,0); bod->setBaseVel(vel); { btVector3 joint_axis_hinge(1,0,0); btVector3 joint_axis_prismatic(0,0,1); btQuaternion parent_to_child = orn.inverse(); btVector3 joint_axis_child_prismatic = quatRotate(parent_to_child ,joint_axis_prismatic); btVector3 joint_axis_child_hinge = quatRotate(parent_to_child , joint_axis_hinge); int this_link_num = -1; int link_num_counter = 0; btVector3 pos = btVector3 (0,0,9.0500002)*scaling; btVector3 joint_axis_position = btVector3 (0,0,4.5250001)*scaling; for (int i=0;i<n_links;i++) { float initial_joint_angle=0.3; if (i>0) initial_joint_angle = -0.06f; const int child_link_num = link_num_counter++; if (settings.m_usePrismatic)// && i==(n_links-1)) { bod->setupPrismatic(child_link_num, mass, inertia, this_link_num, parent_to_child, joint_axis_child_prismatic, quatRotate(parent_to_child , pos),settings.m_disableParentCollision); } else { bod->setupRevolute(child_link_num, mass, inertia, this_link_num,parent_to_child, joint_axis_child_hinge, joint_axis_position,quatRotate(parent_to_child , (pos - joint_axis_position)),settings.m_disableParentCollision); } bod->setJointPos(child_link_num, initial_joint_angle); this_link_num = i; if (0)//!useGroundShape && i==4) { btVector3 pivotInAworld(0,20,46); btVector3 pivotInAlocal = bod->worldPosToLocal(i, pivotInAworld); btVector3 pivotInBworld = pivotInAworld; btMultiBodyPoint2Point* p2p = new btMultiBodyPoint2Point(bod,i,&btTypedConstraint::getFixedBody(),pivotInAlocal,pivotInBworld); world->addMultiBodyConstraint(p2p); } //add some constraint limit if (settings.m_usePrismatic) { // btMultiBodyConstraint* con = new btMultiBodyJointLimitConstraint(bod,n_links-1,2,3); if (settings.m_createConstraints) { btMultiBodyConstraint* con = new btMultiBodyJointLimitConstraint(bod,i,-1,1); world->addMultiBodyConstraint(con); } } else { if (settings.m_createConstraints) { if (1) { btMultiBodyJointMotor* con = new btMultiBodyJointMotor(bod,i,0,0,500000); world->addMultiBodyConstraint(con); } btMultiBodyConstraint* con = new btMultiBodyJointLimitConstraint(bod,i,-1,1); world->addMultiBodyConstraint(con); } } } } //add a collider for the base { btAlignedObjectArray<btQuaternion> world_to_local; world_to_local.resize(n_links+1); btAlignedObjectArray<btVector3> local_origin; local_origin.resize(n_links+1); world_to_local[0] = bod->getWorldToBaseRot(); local_origin[0] = bod->getBasePos(); //float halfExtents[3]={7.5,0.05,4.5}; btVector4 halfExtents(7.5,0.45,4.5,1); { // float pos[4]={local_origin[0].x(),local_origin[0].y(),local_origin[0].z(),1}; float quat[4]={-world_to_local[0].x(),-world_to_local[0].y(),-world_to_local[0].z(),world_to_local[0].w()}; if (1) { btCollisionShape* box = new btBoxShape(btVector3(halfExtents[0],halfExtents[1],halfExtents[2])*scaling); btMultiBodyLinkCollider* col= new btMultiBodyLinkCollider(bod,-1); col->setCollisionShape(box); btTransform tr; tr.setIdentity(); tr.setOrigin(local_origin[0]); tr.setRotation(btQuaternion(quat[0],quat[1],quat[2],quat[3])); col->setWorldTransform(tr); btVector4 color = colors[curColor++]; curColor&=3; int index = m_glApp->m_renderer->registerGraphicsInstance(cubeShapeId,tr.getOrigin(),tr.getRotation(),color,halfExtents); col->setUserIndex(index); world->addCollisionObject(col,short(btBroadphaseProxy::DefaultFilter),short(btBroadphaseProxy::AllFilter)); col->setFriction(friction); bod->setBaseCollider(col); } } for (int i=0;i<bod->getNumLinks();i++) { const int parent = bod->getParent(i); world_to_local[i+1] = bod->getParentToLocalRot(i) * world_to_local[parent+1]; local_origin[i+1] = local_origin[parent+1] + (quatRotate(world_to_local[i+1].inverse() , bod->getRVector(i))); } for (int i=0;i<bod->getNumLinks();i++) { btVector3 posr = local_origin[i+1]; //float pos[4]={posr.x(),posr.y(),posr.z(),1}; float quat[4]={-world_to_local[i+1].x(),-world_to_local[i+1].y(),-world_to_local[i+1].z(),world_to_local[i+1].w()}; btCollisionShape* box = new btBoxShape(btVector3(halfExtents[0],halfExtents[1],halfExtents[2])*scaling); btMultiBodyLinkCollider* col = new btMultiBodyLinkCollider(bod,i); col->setCollisionShape(box); btTransform tr; tr.setIdentity(); tr.setOrigin(posr); tr.setRotation(btQuaternion(quat[0],quat[1],quat[2],quat[3])); col->setWorldTransform(tr); col->setFriction(friction); btVector4 color = colors[curColor++]; curColor&=3; int index = m_glApp->m_renderer->registerGraphicsInstance(cubeShapeId,tr.getOrigin(),tr.getRotation(),color,halfExtents); col->setUserIndex(index); world->addCollisionObject(col,short(btBroadphaseProxy::DefaultFilter),short(btBroadphaseProxy::AllFilter)); bod->getLink(i).m_collider=col; //app->drawBox(halfExtents, pos,quat); } } world->addMultiBody(bod); return bod; } void FeatherstoneDemo1::addColliders_testMultiDof(btMultiBody *pMultiBody, btMultiBodyDynamicsWorld *pWorld, const btVector3 &baseHalfExtents, const btVector3 &linkHalfExtents) { } void FeatherstoneDemo1::addBoxes_testMultiDof() { } void FeatherstoneDemo1::createGround() { //create ground int cubeShapeId = m_glApp->registerCubeShape(1,1,1); //float pos[]={0,0,0}; //float orn[]={0,0,0,1}; { btVector4 color(0.3,0.3,1,1); btVector4 halfExtents(50,50,50,1); btTransform groundTransform; groundTransform.setIdentity(); groundTransform.setOrigin(btVector3(0,-50,0)); btBoxShape* groundShape = new btBoxShape(btVector3(btScalar(halfExtents[0]),btScalar(halfExtents[1]),btScalar(halfExtents[2]))); //We can also use DemoApplication::localCreateRigidBody, but for clarity it is provided here: { btScalar mass(0.); //rigidbody is dynamic if and only if mass is non zero, otherwise static bool isDynamic = (mass != 0.f); btVector3 localInertia(0,0,0); if (isDynamic) groundShape->calculateLocalInertia(mass,localInertia); //using motionstate is recommended, it provides interpolation capabilities, and only synchronizes 'active' objects btDefaultMotionState* myMotionState = new btDefaultMotionState(groundTransform); btRigidBody::btRigidBodyConstructionInfo rbInfo(mass,myMotionState,groundShape,localInertia); btRigidBody* body = new btRigidBody(rbInfo); int index = m_glApp->m_renderer->registerGraphicsInstance(cubeShapeId,groundTransform.getOrigin(),groundTransform.getRotation(),color,halfExtents); body ->setUserIndex(index); //add the body to the dynamics world m_dynamicsWorld->addRigidBody(body); } } } void FeatherstoneDemo1::initPhysics() { Bullet2MultiBodyDemo::initPhysics(); createGround(); btMultiBodySettings settings; settings.m_isFixedBase = false; settings.m_basePosition.setValue(0,10,0); settings.m_numLinks = 10; //btMultiBody* mb = createFeatherstoneMultiBody(m_dynamicsWorld,settings); m_glApp->m_renderer->writeTransforms(); } void FeatherstoneDemo1::exitPhysics() { Bullet2MultiBodyDemo::exitPhysics(); } void FeatherstoneDemo1::renderScene() { //sync graphics -> physics world transforms { for (int i=0;i<m_dynamicsWorld->getNumCollisionObjects();i++) { btCollisionObject* col = m_dynamicsWorld->getCollisionObjectArray()[i]; btVector3 pos = col->getWorldTransform().getOrigin(); btQuaternion orn = col->getWorldTransform().getRotation(); int index = col->getUserIndex(); if (index>=0) { m_glApp->m_renderer->writeSingleInstanceTransformToCPU(pos,orn,index); } } m_glApp->m_renderer->writeTransforms(); } m_glApp->m_renderer->renderScene(); } void FeatherstoneDemo1::physicsDebugDraw(int debugDrawFlags) { if (m_dynamicsWorld) { if (m_dynamicsWorld->getDebugDrawer()) m_dynamicsWorld->getDebugDrawer()->setDebugMode(debugDrawFlags); m_dynamicsWorld->debugDrawWorld(); } } void FeatherstoneDemo1::stepSimulation(float deltaTime) { m_dynamicsWorld->stepSimulation(deltaTime);//,0); // CProfileManager::dumpAll(); /* for (int i=0;i<m_dynamicsWorld->getDispatcher()->getNumManifolds();i++) { btPersistentManifold* contact = m_dynamicsWorld->getDispatcher()->getManifoldByIndexInternal(i); for (int c=0;c<contact->getNumContacts();c++) { btManifoldPoint& pt = contact->getContactPoint(c); btScalar dist = pt.getDistance(); if (dist< contact->getContactProcessingThreshold()) { printf("normalImpulse[%d.%d] = %f\n",i,c,pt.m_appliedImpulse); } else { printf("?\n"); } } } */ } FeatherstoneDemo2::FeatherstoneDemo2(CommonGraphicsApp* app) :FeatherstoneDemo1(app) { } FeatherstoneDemo2::~FeatherstoneDemo2() { } class RagDoll2 { enum { BODYPART_PELVIS = 0, BODYPART_SPINE, BODYPART_HEAD, BODYPART_LEFT_UPPER_LEG, BODYPART_LEFT_LOWER_LEG, BODYPART_RIGHT_UPPER_LEG, BODYPART_RIGHT_LOWER_LEG, BODYPART_LEFT_UPPER_ARM, BODYPART_LEFT_LOWER_ARM, BODYPART_RIGHT_UPPER_ARM, BODYPART_RIGHT_LOWER_ARM, BODYPART_COUNT }; enum { JOINT_PELVIS_SPINE = 0, JOINT_SPINE_HEAD, JOINT_LEFT_HIP, JOINT_LEFT_KNEE, JOINT_RIGHT_HIP, JOINT_RIGHT_KNEE, JOINT_LEFT_SHOULDER, JOINT_LEFT_ELBOW, JOINT_RIGHT_SHOULDER, JOINT_RIGHT_ELBOW, JOINT_COUNT }; btDynamicsWorld* m_ownerWorld; btConvexShape* m_shapes[BODYPART_COUNT]; btRigidBody* m_bodies[BODYPART_COUNT]; btTypedConstraint* m_joints[JOINT_COUNT]; SimpleOpenGL3App* m_app;//used to create graphics shapes btRigidBody* localCreateRigidBody (btScalar mass, const btTransform& startTransform, btConvexShape* shape, const btVector3& color=btVector3(1,0,0) ) { bool isDynamic = (mass != 0.f); btVector3 localInertia(0,0,0); if (isDynamic) shape->calculateLocalInertia(mass,localInertia); btDefaultMotionState* myMotionState = new btDefaultMotionState(startTransform); btRigidBody::btRigidBodyConstructionInfo rbInfo(mass,myMotionState,shape,localInertia); btRigidBody* body = new btRigidBody(rbInfo); m_ownerWorld->addRigidBody(body); btVector3 scaling(1,1,1); btShapeHull* hull = new btShapeHull(shape); hull->buildHull(0.01); { // int strideInBytes = 9*sizeof(float); int numVertices = hull->numVertices(); int numIndices =hull->numIndices(); btAlignedObjectArray<GraphicsVertex> gvertices; for (int i=0;i<numVertices;i++) { GraphicsVertex vtx; btVector3 pos =hull->getVertexPointer()[i]; vtx.pos[0] = pos.x(); vtx.pos[1] = pos.y(); vtx.pos[2] = pos.z(); vtx.pos[3] = 1.f; pos.normalize(); vtx.normal[0] =pos.x(); vtx.normal[1] =pos.y(); vtx.normal[2] =pos.z(); vtx.texcoord[0] = 0.5f; vtx.texcoord[1] = 0.5f; gvertices.push_back(vtx); } btAlignedObjectArray<int> indices; for (int i=0;i<numIndices;i++) indices.push_back(hull->getIndexPointer()[i]); int shapeId = m_app->m_instancingRenderer->registerShape(&gvertices[0].pos[0],numVertices,&indices[0],numIndices); int index = m_app->m_instancingRenderer->registerGraphicsInstance(shapeId,body->getWorldTransform().getOrigin(),body->getWorldTransform().getRotation(),color,scaling); body ->setUserIndex(index); } delete hull; return body; } public: RagDoll2 (btDynamicsWorld* ownerWorld, const btVector3& positionOffset,SimpleOpenGL3App* app) : m_ownerWorld (ownerWorld), m_app(app) { // Setup the geometry m_shapes[BODYPART_PELVIS] = new btCapsuleShape(btScalar(0.15), btScalar(0.20)); m_shapes[BODYPART_SPINE] = new btCapsuleShape(btScalar(0.15), btScalar(0.28)); m_shapes[BODYPART_HEAD] = new btCapsuleShape(btScalar(0.10), btScalar(0.05)); m_shapes[BODYPART_LEFT_UPPER_LEG] = new btCapsuleShape(btScalar(0.07), btScalar(0.45)); m_shapes[BODYPART_LEFT_LOWER_LEG] = new btCapsuleShape(btScalar(0.05), btScalar(0.37)); m_shapes[BODYPART_RIGHT_UPPER_LEG] = new btCapsuleShape(btScalar(0.07), btScalar(0.45)); m_shapes[BODYPART_RIGHT_LOWER_LEG] = new btCapsuleShape(btScalar(0.05), btScalar(0.37)); m_shapes[BODYPART_LEFT_UPPER_ARM] = new btCapsuleShape(btScalar(0.05), btScalar(0.33)); m_shapes[BODYPART_LEFT_LOWER_ARM] = new btCapsuleShape(btScalar(0.04), btScalar(0.25)); m_shapes[BODYPART_RIGHT_UPPER_ARM] = new btCapsuleShape(btScalar(0.05), btScalar(0.33)); m_shapes[BODYPART_RIGHT_LOWER_ARM] = new btCapsuleShape(btScalar(0.04), btScalar(0.25)); // Setup all the rigid bodies btTransform offset; offset.setIdentity(); offset.setOrigin(positionOffset); btTransform transform; transform.setIdentity(); transform.setOrigin(btVector3(btScalar(0.), btScalar(1.), btScalar(0.))); //m_bodies[BODYPART_PELVIS] = localCreateRigidBody(btScalar(1.), offset*transform, m_shapes[BODYPART_PELVIS], btVector3(0,1,0)); // btMultiBody * bod = new btMultiBody(n_links, mass, inertia, settings.m_isFixedBase, settings.m_canSleep); int n_links = 0; float mass = 1.f; btVector3 localInertia; m_shapes[BODYPART_PELVIS]->calculateLocalInertia(mass,localInertia); bool isFixedBase = true; bool canSleep = true; bool isMultiDof = false; btMultiBody * bod = new btMultiBody(n_links, mass, localInertia, isFixedBase, canSleep, isMultiDof); btTransform tr; tr = offset*transform; bod->setBasePos(tr.getOrigin()); bod->setWorldToBaseRot(tr.getRotation()); btVector3 vel(0,0,0); bod->setBaseVel(vel); #if 0 transform.setIdentity(); transform.setOrigin(btVector3(btScalar(0.), btScalar(1.2), btScalar(0.))); m_bodies[BODYPART_SPINE] = localCreateRigidBody(btScalar(1.), offset*transform, m_shapes[BODYPART_SPINE],btVector3(0,0,1)); transform.setIdentity(); transform.setOrigin(btVector3(btScalar(0.), btScalar(1.6), btScalar(0.))); m_bodies[BODYPART_HEAD] = localCreateRigidBody(btScalar(1.), offset*transform, m_shapes[BODYPART_HEAD]); transform.setIdentity(); transform.setOrigin(btVector3(btScalar(-0.18), btScalar(0.65), btScalar(0.))); m_bodies[BODYPART_LEFT_UPPER_LEG] = localCreateRigidBody(btScalar(1.), offset*transform, m_shapes[BODYPART_LEFT_UPPER_LEG]); transform.setIdentity(); transform.setOrigin(btVector3(btScalar(-0.18), btScalar(0.2), btScalar(0.))); m_bodies[BODYPART_LEFT_LOWER_LEG] = localCreateRigidBody(btScalar(1.), offset*transform, m_shapes[BODYPART_LEFT_LOWER_LEG]); transform.setIdentity(); transform.setOrigin(btVector3(btScalar(0.18), btScalar(0.65), btScalar(0.))); m_bodies[BODYPART_RIGHT_UPPER_LEG] = localCreateRigidBody(btScalar(1.), offset*transform, m_shapes[BODYPART_RIGHT_UPPER_LEG]); transform.setIdentity(); transform.setOrigin(btVector3(btScalar(0.18), btScalar(0.2), btScalar(0.))); m_bodies[BODYPART_RIGHT_LOWER_LEG] = localCreateRigidBody(btScalar(1.), offset*transform, m_shapes[BODYPART_RIGHT_LOWER_LEG]); transform.setIdentity(); transform.setOrigin(btVector3(btScalar(-0.35), btScalar(1.45), btScalar(0.))); transform.getBasis().setEulerZYX(0,0,M_PI_2); m_bodies[BODYPART_LEFT_UPPER_ARM] = localCreateRigidBody(btScalar(1.), offset*transform, m_shapes[BODYPART_LEFT_UPPER_ARM]); transform.setIdentity(); transform.setOrigin(btVector3(btScalar(-0.7), btScalar(1.45), btScalar(0.))); transform.getBasis().setEulerZYX(0,0,M_PI_2); m_bodies[BODYPART_LEFT_LOWER_ARM] = localCreateRigidBody(btScalar(1.), offset*transform, m_shapes[BODYPART_LEFT_LOWER_ARM]); transform.setIdentity(); transform.setOrigin(btVector3(btScalar(0.35), btScalar(1.45), btScalar(0.))); transform.getBasis().setEulerZYX(0,0,-M_PI_2); m_bodies[BODYPART_RIGHT_UPPER_ARM] = localCreateRigidBody(btScalar(1.), offset*transform, m_shapes[BODYPART_RIGHT_UPPER_ARM]); transform.setIdentity(); transform.setOrigin(btVector3(btScalar(0.7), btScalar(1.45), btScalar(0.))); transform.getBasis().setEulerZYX(0,0,-M_PI_2); m_bodies[BODYPART_RIGHT_LOWER_ARM] = localCreateRigidBody(btScalar(1.), offset*transform, m_shapes[BODYPART_RIGHT_LOWER_ARM]); // Setup some damping on the m_bodies for (int i = 0; i < BODYPART_COUNT; ++i) { m_bodies[i]->setDamping(0.05, 0.85); m_bodies[i]->setDeactivationTime(0.8); m_bodies[i]->setSleepingThresholds(1.6, 2.5); } #endif #if 0 // Now setup the constraints btHingeConstraint* hingeC; btConeTwistConstraint* coneC; btTransform localA, localB; localA.setIdentity(); localB.setIdentity(); localA.getBasis().setEulerZYX(0,M_PI_2,0); localA.setOrigin(btVector3(btScalar(0.), btScalar(0.15), btScalar(0.))); localB.getBasis().setEulerZYX(0,M_PI_2,0); localB.setOrigin(btVector3(btScalar(0.), btScalar(-0.15), btScalar(0.))); hingeC = new btHingeConstraint(*m_bodies[BODYPART_PELVIS], *m_bodies[BODYPART_SPINE], localA, localB); hingeC->setLimit(btScalar(-M_PI_4), btScalar(M_PI_2)); m_joints[JOINT_PELVIS_SPINE] = hingeC; hingeC->setDbgDrawSize(CONSTRAINT_DEBUG_SIZE); m_ownerWorld->addConstraint(m_joints[JOINT_PELVIS_SPINE], true); localA.setIdentity(); localB.setIdentity(); localA.getBasis().setEulerZYX(0,0,M_PI_2); localA.setOrigin(btVector3(btScalar(0.), btScalar(0.30), btScalar(0.))); localB.getBasis().setEulerZYX(0,0,M_PI_2); localB.setOrigin(btVector3(btScalar(0.), btScalar(-0.14), btScalar(0.))); coneC = new btConeTwistConstraint(*m_bodies[BODYPART_SPINE], *m_bodies[BODYPART_HEAD], localA, localB); coneC->setLimit(M_PI_4, M_PI_4, M_PI_2); m_joints[JOINT_SPINE_HEAD] = coneC; coneC->setDbgDrawSize(CONSTRAINT_DEBUG_SIZE); m_ownerWorld->addConstraint(m_joints[JOINT_SPINE_HEAD], true); localA.setIdentity(); localB.setIdentity(); localA.getBasis().setEulerZYX(0,0,-M_PI_4*5); localA.setOrigin(btVector3(btScalar(-0.18), btScalar(-0.10), btScalar(0.))); localB.getBasis().setEulerZYX(0,0,-M_PI_4*5); localB.setOrigin(btVector3(btScalar(0.), btScalar(0.225), btScalar(0.))); coneC = new btConeTwistConstraint(*m_bodies[BODYPART_PELVIS], *m_bodies[BODYPART_LEFT_UPPER_LEG], localA, localB); coneC->setLimit(M_PI_4, M_PI_4, 0); m_joints[JOINT_LEFT_HIP] = coneC; coneC->setDbgDrawSize(CONSTRAINT_DEBUG_SIZE); m_ownerWorld->addConstraint(m_joints[JOINT_LEFT_HIP], true); localA.setIdentity(); localB.setIdentity(); localA.getBasis().setEulerZYX(0,M_PI_2,0); localA.setOrigin(btVector3(btScalar(0.), btScalar(-0.225), btScalar(0.))); localB.getBasis().setEulerZYX(0,M_PI_2,0); localB.setOrigin(btVector3(btScalar(0.), btScalar(0.185), btScalar(0.))); hingeC = new btHingeConstraint(*m_bodies[BODYPART_LEFT_UPPER_LEG], *m_bodies[BODYPART_LEFT_LOWER_LEG], localA, localB); hingeC->setLimit(btScalar(0), btScalar(M_PI_2)); m_joints[JOINT_LEFT_KNEE] = hingeC; hingeC->setDbgDrawSize(CONSTRAINT_DEBUG_SIZE); m_ownerWorld->addConstraint(m_joints[JOINT_LEFT_KNEE], true); localA.setIdentity(); localB.setIdentity(); localA.getBasis().setEulerZYX(0,0,M_PI_4); localA.setOrigin(btVector3(btScalar(0.18), btScalar(-0.10), btScalar(0.))); localB.getBasis().setEulerZYX(0,0,M_PI_4); localB.setOrigin(btVector3(btScalar(0.), btScalar(0.225), btScalar(0.))); coneC = new btConeTwistConstraint(*m_bodies[BODYPART_PELVIS], *m_bodies[BODYPART_RIGHT_UPPER_LEG], localA, localB); coneC->setLimit(M_PI_4, M_PI_4, 0); m_joints[JOINT_RIGHT_HIP] = coneC; coneC->setDbgDrawSize(CONSTRAINT_DEBUG_SIZE); m_ownerWorld->addConstraint(m_joints[JOINT_RIGHT_HIP], true); localA.setIdentity(); localB.setIdentity(); localA.getBasis().setEulerZYX(0,M_PI_2,0); localA.setOrigin(btVector3(btScalar(0.), btScalar(-0.225), btScalar(0.))); localB.getBasis().setEulerZYX(0,M_PI_2,0); localB.setOrigin(btVector3(btScalar(0.), btScalar(0.185), btScalar(0.))); hingeC = new btHingeConstraint(*m_bodies[BODYPART_RIGHT_UPPER_LEG], *m_bodies[BODYPART_RIGHT_LOWER_LEG], localA, localB); hingeC->setLimit(btScalar(0), btScalar(M_PI_2)); m_joints[JOINT_RIGHT_KNEE] = hingeC; hingeC->setDbgDrawSize(CONSTRAINT_DEBUG_SIZE); m_ownerWorld->addConstraint(m_joints[JOINT_RIGHT_KNEE], true); localA.setIdentity(); localB.setIdentity(); localA.getBasis().setEulerZYX(0,0,M_PI); localA.setOrigin(btVector3(btScalar(-0.2), btScalar(0.15), btScalar(0.))); localB.getBasis().setEulerZYX(0,0,M_PI_2); localB.setOrigin(btVector3(btScalar(0.), btScalar(-0.18), btScalar(0.))); coneC = new btConeTwistConstraint(*m_bodies[BODYPART_SPINE], *m_bodies[BODYPART_LEFT_UPPER_ARM], localA, localB); coneC->setLimit(M_PI_2, M_PI_2, 0); coneC->setDbgDrawSize(CONSTRAINT_DEBUG_SIZE); m_joints[JOINT_LEFT_SHOULDER] = coneC; m_ownerWorld->addConstraint(m_joints[JOINT_LEFT_SHOULDER], true); localA.setIdentity(); localB.setIdentity(); localA.getBasis().setEulerZYX(0,M_PI_2,0); localA.setOrigin(btVector3(btScalar(0.), btScalar(0.18), btScalar(0.))); localB.getBasis().setEulerZYX(0,M_PI_2,0); localB.setOrigin(btVector3(btScalar(0.), btScalar(-0.14), btScalar(0.))); hingeC = new btHingeConstraint(*m_bodies[BODYPART_LEFT_UPPER_ARM], *m_bodies[BODYPART_LEFT_LOWER_ARM], localA, localB); // hingeC->setLimit(btScalar(-M_PI_2), btScalar(0)); hingeC->setLimit(btScalar(0), btScalar(M_PI_2)); m_joints[JOINT_LEFT_ELBOW] = hingeC; hingeC->setDbgDrawSize(CONSTRAINT_DEBUG_SIZE); m_ownerWorld->addConstraint(m_joints[JOINT_LEFT_ELBOW], true); localA.setIdentity(); localB.setIdentity(); localA.getBasis().setEulerZYX(0,0,0); localA.setOrigin(btVector3(btScalar(0.2), btScalar(0.15), btScalar(0.))); localB.getBasis().setEulerZYX(0,0,M_PI_2); localB.setOrigin(btVector3(btScalar(0.), btScalar(-0.18), btScalar(0.))); coneC = new btConeTwistConstraint(*m_bodies[BODYPART_SPINE], *m_bodies[BODYPART_RIGHT_UPPER_ARM], localA, localB); coneC->setLimit(M_PI_2, M_PI_2, 0); m_joints[JOINT_RIGHT_SHOULDER] = coneC; coneC->setDbgDrawSize(CONSTRAINT_DEBUG_SIZE); m_ownerWorld->addConstraint(m_joints[JOINT_RIGHT_SHOULDER], true); localA.setIdentity(); localB.setIdentity(); localA.getBasis().setEulerZYX(0,M_PI_2,0); localA.setOrigin(btVector3(btScalar(0.), btScalar(0.18), btScalar(0.))); localB.getBasis().setEulerZYX(0,M_PI_2,0); localB.setOrigin(btVector3(btScalar(0.), btScalar(-0.14), btScalar(0.))); hingeC = new btHingeConstraint(*m_bodies[BODYPART_RIGHT_UPPER_ARM], *m_bodies[BODYPART_RIGHT_LOWER_ARM], localA, localB); // hingeC->setLimit(btScalar(-M_PI_2), btScalar(0)); hingeC->setLimit(btScalar(0), btScalar(M_PI_2)); m_joints[JOINT_RIGHT_ELBOW] = hingeC; hingeC->setDbgDrawSize(CONSTRAINT_DEBUG_SIZE); m_ownerWorld->addConstraint(m_joints[JOINT_RIGHT_ELBOW], true); #endif } virtual ~RagDoll2 () { //int i; /* // Remove all constraints for ( i = 0; i < JOINT_COUNT; ++i) { m_ownerWorld->removeConstraint(m_joints[i]); delete m_joints[i]; m_joints[i] = 0; } */ /* // Remove all bodies and shapes for ( i = 0; i < BODYPART_COUNT; ++i) { m_ownerWorld->removeRigidBody(m_bodies[i]); delete m_bodies[i]->getMotionState(); delete m_bodies[i]; m_bodies[i] = 0; delete m_shapes[i]; m_shapes[i] = 0; } */ } }; void FeatherstoneDemo2::initPhysics() { Bullet2MultiBodyDemo::initPhysics(); createGround(); /* btMultiBodySettings settings; settings.m_isFixedBase = false; settings.m_basePosition.setValue(0,20,0); settings.m_numLinks = 3; settings.m_usePrismatic = true; btMultiBody* mb = createFeatherstoneMultiBody(m_dynamicsWorld,settings); */ // btVector3 offset(0,2,0); //RagDoll2* doll = new RagDoll2(m_dynamicsWorld,offset,m_glApp); m_glApp->m_renderer->writeTransforms(); }
gpl-2.0
digineo/xt-commerce
includes/modules/order_total/ot_gv.php
17141
<?php /* ----------------------------------------------------------------------------------------- $Id: ot_gv.php 71 2007-01-07 15:48:30Z mzanier $ XT-Commerce - community made shopping http://www.xt-commerce.com Copyright (c) 2003 XT-Commerce ----------------------------------------------------------------------------------------- based on: (c) 2000-2001 The Exchange Project (earlier name of osCommerce) (c) 2002-2003 osCommerce(ot_gv.php,v 1.37.3 2004/01/01); www.oscommerce.com Released under the GNU General Public License ----------------------------------------------------------------------------------------- Third Party contributions: Credit Class/Gift Vouchers/Discount Coupons (Version 5.10) http://www.oscommerce.com/community/contributions,282 Copyright (c) Strider | Strider@oscworks.com Copyright (c Nick Stanko of UkiDev.com, nick@ukidev.com Copyright (c) Andre ambidex@gmx.net Copyright (c) 2001,2002 Ian C Wilson http://www.phesis.org Released under the GNU General Public License ---------------------------------------------------------------------------------------*/ class ot_gv { var $title, $output; function ot_gv() { global $xtPrice; $this->code = 'ot_gv'; $this->title = MODULE_ORDER_TOTAL_GV_TITLE; $this->header = MODULE_ORDER_TOTAL_GV_HEADER; $this->description = MODULE_ORDER_TOTAL_GV_DESCRIPTION; $this->user_prompt = MODULE_ORDER_TOTAL_GV_USER_PROMPT; $this->enabled = MODULE_ORDER_TOTAL_GV_STATUS; $this->sort_order = MODULE_ORDER_TOTAL_GV_SORT_ORDER; $this->include_shipping = MODULE_ORDER_TOTAL_GV_INC_SHIPPING; $this->include_tax = MODULE_ORDER_TOTAL_GV_INC_TAX; $this->calculate_tax = MODULE_ORDER_TOTAL_GV_CALC_TAX; $this->credit_tax = MODULE_ORDER_TOTAL_GV_CREDIT_TAX; $this->tax_class = MODULE_ORDER_TOTAL_GV_TAX_CLASS; $this->show_redeem_box = MODULE_ORDER_TOTAL_GV_REDEEM_BOX; $this->credit_class = true; $this->checkbox = $this->user_prompt.'<input type="checkbox" onClick="submitFunction()" name="'.'c'.$this->code.'">'; $this->output = array (); } function process() { global $order, $xtPrice; // if ($_SESSION['cot_gv']) { // old code Strider if (isset ($_SESSION['cot_gv']) && $_SESSION['cot_gv'] == true) { $order_total = $this->get_order_total(); $od_amount = $this->calculate_credit($order_total); if ($this->calculate_tax != "None") { $tod_amount = $this->calculate_tax_deduction($order_total, $od_amount, $this->calculate_tax); $od_amount = $this->calculate_credit($order_total); } $this->deduction = $od_amount; // if (($this->calculate_tax == "Credit Note") && (DISPLAY_PRICE_WITH_TAX != 'true')) { // $od_amount -= $tod_amount; // $order->info['total'] -= $tod_amount; // } $order->info['total'] = $order->info['total'] - $od_amount; if ($od_amount > 0) { $this->output[] = array ('title' => $this->title.':', 'text' => '<b><font color="#ff0000">-'.$xtPrice->xtcFormat($od_amount, true).'</font></b>', 'value' => $xtPrice->xtcFormat($od_amount, false)); } } } function selection_test() { if ($this->user_has_gv_account($_SESSION['customer_id'])) { return true; } else { return false; } } function pre_confirmation_check($order_total) { global $order; // if ($_SESSION['cot_gv']) { // old code Strider $od_amount = 0; // set the default amount we will send back if (isset ($_SESSION['cot_gv']) && $_SESSION['cot_gv'] == true) { // pre confirmation check doesn't do a true order process. It just attempts to see if // there is enough to handle the order. But depending on settings it will not be shown // all of the order so this is why we do this runaround jane. What do we know so far. // nothing. Since we need to know if we process the full amount we need to call get order total // if there has been something before us then if ($this->include_tax == 'false') { $order_total = $order_total - $order->info['tax']; } if ($this->include_shipping == 'false') { $order_total = $order_total - $order->info['shipping_cost']; } $od_amount = $this->calculate_credit($order_total); if ($this->calculate_tax != "None") { $tod_amount = $this->calculate_tax_deduction($order_total, $od_amount, $this->calculate_tax); $od_amount = $this->calculate_credit($order_total) + $tod_amount; } } return $od_amount; } // original code /*function pre_confirmation_check($order_total) { if ($SESSION['cot_gv']) { $gv_payment_amount = $this->calculate_credit($order_total); } return $gv_payment_amount; } */ function use_credit_amount() { // $_SESSION['cot_gv'] = false; // old code - Strider $_SESSION['cot_gv'] = false; if ($this->selection_test()) { $output_string .= ' <td nowrap align="right" class="main">'; $output_string .= '<b>'.$this->checkbox.'</b>'.'</td>'."\n"; } return $output_string; } function update_credit_account($i) { global $order, $insert_id, $REMOTE_ADDR; if (ereg('^GIFT', addslashes($order->products[$i]['model']))) { $gv_order_amount = ($order->products[$i]['final_price']); if ($this->credit_tax == 'true') $gv_order_amount = $gv_order_amount * (100 + $order->products[$i]['tax']) / 100; // $gv_order_amount += 0.001; $gv_order_amount = $gv_order_amount * 100 / 100; if (MODULE_ORDER_TOTAL_GV_QUEUE == 'false') { // GV_QUEUE is false so release amount to account immediately $gv_query = xtc_db_query("select amount from ".TABLE_COUPON_GV_CUSTOMER." where customer_id = '".$_SESSION['customer_id']."'"); $customer_gv = false; $total_gv_amount = 0; if ($gv_result = xtc_db_fetch_array($gv_query)) { $total_gv_amount = $gv_result['amount']; $customer_gv = true; } $total_gv_amount = $total_gv_amount + $gv_order_amount; if ($customer_gv) { $gv_update = xtc_db_query("update ".TABLE_COUPON_GV_CUSTOMER." set amount = '".$total_gv_amount."' where customer_id = '".$_SESSION['customer_id']."'"); } else { $gv_insert = xtc_db_query("insert into ".TABLE_COUPON_GV_CUSTOMER." (customer_id, amount) values ('".$_SESSION['customer_id']."', '".$total_gv_amount."')"); } } else { // GV_QUEUE is true - so queue the gv for release by store owner $gv_insert = xtc_db_query("insert into ".TABLE_COUPON_GV_QUEUE." (customer_id, order_id, amount, date_created, ipaddr) values ('".$_SESSION['customer_id']."', '".$insert_id."', '".$gv_order_amount."', NOW(), '".$REMOTE_ADDR."')"); } } } function credit_selection() { global $currencies; $selection_string = ''; $gv_query = xtc_db_query("select coupon_id from ".TABLE_COUPONS." where coupon_type = 'G' and coupon_active='Y'"); /* if (xtc_db_num_rows($gv_query)) { $selection_string .= '<tr>' . "\n"; $selection_string .= ' <td width="10">' . xtc_draw_separator('pixel_trans.gif', '10', '1') .'</td>'; $selection_string .= ' <td class="main">' . "\n"; $selection_string .= TEXT_ENTER_GV_CODE . xtc_draw_input_field('gv_redeem_code') . '</td>'; $selection_string .= ' <td align="right"></td>'; $selection_string .= ' <td width="10">' . xtc_draw_separator('pixel_trans.gif', '10', '1') . '</td>'; $selection_string .= '</tr>' . "\n"; } */ return $selection_string; } function apply_credit() { global $order, $coupon_no,$xtPrice; if (isset ($_SESSION['cot_gv']) && $_SESSION['cot_gv'] == true) { $gv_query = xtc_db_query("select amount from ".TABLE_COUPON_GV_CUSTOMER." where customer_id = '".$_SESSION['customer_id']."'"); $gv_result = xtc_db_fetch_array($gv_query); $gv_payment_amount = $this->deduction; $gv_amount = $gv_result['amount'] - $xtPrice->xtcRemoveCurr($gv_payment_amount); //prepare for DB insert $gv_amount = str_replace(",", ".", $gv_amount); $gv_update = xtc_db_query("update ".TABLE_COUPON_GV_CUSTOMER." set amount = '".$gv_amount."' where customer_id = '".$_SESSION['customer_id']."'"); } return $gv_payment_amount; } function collect_posts() { global $xtPrice, $coupon_no, $REMOTE_ADDR; if ($_POST['gv_redeem_code']) { $gv_query = xtc_db_query("select coupon_id, coupon_type, coupon_amount from ".TABLE_COUPONS." where coupon_code = '".$_POST['gv_redeem_code']."'"); $gv_result = xtc_db_fetch_array($gv_query); if (xtc_db_num_rows($gv_query) != 0) { $redeem_query = xtc_db_query("select * from ".TABLE_COUPON_REDEEM_TRACK." where coupon_id = '".$gv_result['coupon_id']."'"); if ((xtc_db_num_rows($redeem_query) != 0) && ($gv_result['coupon_type'] == 'G')) { xtc_redirect(xtc_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message='.urlencode(ERROR_NO_INVALID_REDEEM_GV), 'SSL')); } } if ($gv_result['coupon_type'] == 'G') { $gv_amount = $gv_result['coupon_amount']; // Things to set // ip address of claimant // customer id of claimant // date // redemption flag // now update customer account with gv_amount $gv_amount_query = xtc_db_query("select amount from ".TABLE_COUPON_GV_CUSTOMER." where customer_id = '".$_SESSION['customer_id']."'"); $customer_gv = false; $total_gv_amount = $gv_amount; if ($gv_amount_result = xtc_db_fetch_array($gv_amount_query)) { $total_gv_amount = $gv_amount_result['amount'] + $gv_amount; $customer_gv = true; } $gv_update = xtc_db_query("update ".TABLE_COUPONS." set coupon_active = 'N' where coupon_id = '".$gv_result['coupon_id']."'"); $gv_redeem = xtc_db_query("insert into ".TABLE_COUPON_REDEEM_TRACK." (coupon_id, customer_id, redeem_date, redeem_ip) values ('".$gv_result['coupon_id']."', '".$SESSION['customer_id']."', now(),'".$REMOTE_ADDR."')"); if ($customer_gv) { // already has gv_amount so update $gv_update = xtc_db_query("update ".TABLE_COUPON_GV_CUSTOMER." set amount = '".$total_gv_amount."' where customer_id = '".$_SESSION['customer_id']."'"); } else { // no gv_amount so insert $gv_insert = xtc_db_query("insert into ".TABLE_COUPON_GV_CUSTOMER." (customer_id, amount) values ('".$_SESSION['customer_id']."', '".$total_gv_amount."')"); } //xtc_redirect(xtc_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(ERROR_REDEEMED_AMOUNT. $currencies->format($gv_amount)), 'SSL')); } } if ($_POST['submit_redeem_x'] && $gv_result['coupon_type'] == 'G') xtc_redirect(xtc_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message='.urlencode(ERROR_NO_REDEEM_CODE), 'SSL')); } function calculate_credit($amount) { global $order; $gv_query = xtc_db_query("select amount from ".TABLE_COUPON_GV_CUSTOMER." where customer_id = '".$_SESSION['customer_id']."'"); $gv_result = xtc_db_fetch_array($gv_query); $gv_payment_amount = $gv_result['amount']; $gv_amount = $gv_payment_amount; $save_total_cost = $amount; $full_cost = $save_total_cost - $gv_payment_amount; if ($full_cost <= 0) { $full_cost = 0; $gv_payment_amount = $save_total_cost; } return $gv_payment_amount; } function calculate_tax_deduction($amount, $od_amount, $method) { global $order; switch ($method) { case 'Standard' : $ratio1 = number_format($od_amount / $amount, 2); $tod_amount = 0; reset($order->info['tax_groups']); while (list ($key, $value) = each($order->info['tax_groups'])) { $tax_rate = xtc_get_tax_rate_from_desc($key); $total_net += $tax_rate * $order->info['tax_groups'][$key]; } if ($od_amount > $total_net) $od_amount = $total_net; reset($order->info['tax_groups']); while (list ($key, $value) = each($order->info['tax_groups'])) { $tax_rate = xtc_get_tax_rate_from_desc($key); $net = $tax_rate * $order->info['tax_groups'][$key]; if ($net > 0) { $god_amount = $order->info['tax_groups'][$key] * $ratio1; $tod_amount += $god_amount; $order->info['tax_groups'][$key] = $order->info['tax_groups'][$key] - $god_amount; } } $order->info['tax'] -= $tod_amount; $order->info['total'] -= $tod_amount; break; case 'Credit Note' : $tax_rate = xtc_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']); $tax_desc = xtc_get_tax_description($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']); $tod_amount = $this->deduction / (100 + $tax_rate) * $tax_rate; $order->info['tax_groups'][$tax_desc] -= $tod_amount; // $order->info['total'] -= $tod_amount; //// ????? Strider break; default : } return $tod_amount; } function user_has_gv_account($c_id) { $gv_query = xtc_db_query("select amount from ".TABLE_COUPON_GV_CUSTOMER." where customer_id = '".$c_id."'"); if ($gv_result = xtc_db_fetch_array($gv_query)) { if ($gv_result['amount'] > 0) { return true; } } return false; } function get_order_total() { global $order; if ($_SESSION['customers_status']['customers_status_show_price_tax'] != 0) $order_total = $order->info['total']; if ($_SESSION['customers_status']['customers_status_show_price_tax'] == 0 && $_SESSION['customers_status']['customers_status_add_tax_ot'] == 1) $order_total = $order->info['tax'] + $order->info['total']; if ($_SESSION['customers_status']['customers_status_show_price_tax'] == 0 && $_SESSION['customers_status']['customers_status_add_tax_ot'] == 0) $order_total = $order->info['total']; if ($this->include_tax == 'false') $order_total = $order_total - $order->info['tax']; if ($this->include_shipping == 'false') $order_total = $order_total - $order->info['shipping_cost']; return $order_total; } function check() { if (!isset ($this->check)) { $check_query = xtc_db_query("select configuration_value from ".TABLE_CONFIGURATION." where configuration_key = 'MODULE_ORDER_TOTAL_GV_STATUS'"); $this->check = xtc_db_num_rows($check_query); } return $this->check; } function keys() { return array ('MODULE_ORDER_TOTAL_GV_STATUS', 'MODULE_ORDER_TOTAL_GV_SORT_ORDER', 'MODULE_ORDER_TOTAL_GV_QUEUE', 'MODULE_ORDER_TOTAL_GV_INC_SHIPPING', 'MODULE_ORDER_TOTAL_GV_INC_TAX', 'MODULE_ORDER_TOTAL_GV_CALC_TAX', 'MODULE_ORDER_TOTAL_GV_TAX_CLASS', 'MODULE_ORDER_TOTAL_GV_CREDIT_TAX'); } function install() { xtc_db_query("insert into ".TABLE_CONFIGURATION." (configuration_id, configuration_key, configuration_value, configuration_group_id, sort_order, set_function, date_added) values ('', 'MODULE_ORDER_TOTAL_GV_STATUS', 'true', '6', '1','xtc_cfg_select_option(array(\'true\', \'false\'), ', now())"); xtc_db_query("insert into ".TABLE_CONFIGURATION." (configuration_id, configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('', 'MODULE_ORDER_TOTAL_GV_SORT_ORDER', '80', '6', '2', now())"); xtc_db_query("insert into ".TABLE_CONFIGURATION." (configuration_id, configuration_key, configuration_value, configuration_group_id, sort_order, set_function, date_added) values ('', 'MODULE_ORDER_TOTAL_GV_QUEUE', 'true', '6', '3','xtc_cfg_select_option(array(\'true\', \'false\'), ', now())"); xtc_db_query("insert into ".TABLE_CONFIGURATION." (configuration_id, configuration_key, configuration_value, configuration_group_id, sort_order, set_function ,date_added) values ('', 'MODULE_ORDER_TOTAL_GV_INC_SHIPPING', 'true', '6', '5', 'xtc_cfg_select_option(array(\'true\', \'false\'), ', now())"); xtc_db_query("insert into ".TABLE_CONFIGURATION." (configuration_id, configuration_key, configuration_value, configuration_group_id, sort_order, set_function ,date_added) values ('', 'MODULE_ORDER_TOTAL_GV_INC_TAX', 'true', '6', '6','xtc_cfg_select_option(array(\'true\', \'false\'), ', now())"); xtc_db_query("insert into ".TABLE_CONFIGURATION." (configuration_id, configuration_key, configuration_value, configuration_group_id, sort_order, set_function ,date_added) values ('', 'MODULE_ORDER_TOTAL_GV_CALC_TAX', 'None', '6', '7','xtc_cfg_select_option(array(\'None\', \'Standard\', \'Credit Note\'), ', now())"); xtc_db_query("insert into ".TABLE_CONFIGURATION." (configuration_id, configuration_key, configuration_value, configuration_group_id, sort_order, use_function, set_function, date_added) values ('', 'MODULE_ORDER_TOTAL_GV_TAX_CLASS', '0', '6', '0', 'xtc_get_tax_class_title', 'xtc_cfg_pull_down_tax_classes(', now())"); xtc_db_query("insert into ".TABLE_CONFIGURATION." (configuration_id, configuration_key, configuration_value, configuration_group_id, sort_order, set_function ,date_added) values ('', 'MODULE_ORDER_TOTAL_GV_CREDIT_TAX', 'false', '6', '8','xtc_cfg_select_option(array(\'true\', \'false\'), ', now())"); } function remove() { xtc_db_query("delete from ".TABLE_CONFIGURATION." where configuration_key in ('".implode("', '", $this->keys())."')"); } } ?>
gpl-2.0
joshuacoddingyou/php
public/scripts/dojox/highlight/languages/_static.js
133
//>>built define("dojox/highlight/languages/_static",["./cpp","./java","./delphi"],function(){}); //@ sourceMappingURL=_static.js.map
gpl-2.0
hajdam/frinthesia
tools/frinika/src/main/java/com/frinika/FrinikaMain.java
5855
package com.frinika; import com.frinika.frame.WelcomeDialog; import com.frinika.project.dialog.SplashDialog; import com.frinika.global.FrinikaConfig; import com.frinika.global.Toolbox; import static com.frinika.localization.CurrentLocale.getMessage; import com.frinika.base.FrinikaAudioSystem; import com.frinika.project.ProjectContainer; import com.frinika.frame.FrinikaFrame; import com.frinika.frame.action.CreateProjectAction; import com.frinika.frame.action.OpenProjectAction; import com.frinika.project.gui.ProjectFocusListener; import com.frinika.settings.SetupDialog; import com.frinika.tootX.midi.MidiInDeviceManager; import com.jgoodies.looks.plastic.PlasticXPLookAndFeel; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.File; import java.io.IOException; import javax.swing.UIManager; /* * Created on Mar 6, 2006 * * Copyright (c) 2004-2006 Peter Johan Salomonsen (http://www.petersalomonsen.com) * * http://www.frinika.com * * This file is part of Frinika. * * Frinika is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Frinika is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Frinika; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /** * The main entry class for Frinika * * @author Peter Johan Salomonsen */ public class FrinikaMain { static FrinikaExitHandler exitHook = null; /** * @param args */ public static void main(String[] args) throws Exception { prepareRunningFromSingleJar(); configureUI(); try { int n = 1; Object[] options = { getMessage("welcome.new_project"), getMessage("welcome.open_existing"), getMessage("welcome.settings"), getMessage("welcome.quit") }; //String setup = FrinikaConfig.getProperty("multiplexed_audio"); WelcomeDialog welcome= new WelcomeDialog(options); //if (setup == null) { if ( !FrinikaConfig.SETUP_DONE ) { // welcome = new WelcomeDialog(options); welcome.setModal(false); welcome.setVisible(true); SetupDialog.showSettingsModal(); welcome.setVisible(false); } welcome.setModal(true); welcome.addButtonActionListener(2, new ActionListener() { public void actionPerformed(ActionEvent e) { SetupDialog.showSettingsModal(); } }); welcome.setVisible(true); n = welcome.getSelectedOption(); switch (n) { case -1: System.exit(0); break; case 0: // new ProjectFrame(new ProjectContainer()); SplashDialog.showSplash(); new CreateProjectAction().actionPerformed(null); break; case 1: SplashDialog.showSplash(); String lastFile = FrinikaConfig.lastProjectFile(); if (lastFile != null) OpenProjectAction.setSelectedFile(new File(lastFile)); new OpenProjectAction().actionPerformed(null); break; case 3: System.exit(0); break; default: assert (false); } } catch (Exception e) { e.printStackTrace(); System.exit(-1); // new ProjectFrame(new ProjectContainer()); } exitHook = new FrinikaExitHandler(); Runtime.getRuntime().addShutdownHook(exitHook); FrinikaFrame.addProjectFocusListener(new ProjectFocusListener() { public void projectFocusNotify(ProjectContainer project) { FrinikaAudioSystem.installClient(project.getAudioClient()); } }); SplashDialog.closeSplash(); FrinikaAudioSystem.getAudioServer().start(); } public static void configureUI() { String lcOSName = System.getProperty("os.name").toLowerCase(); try { UIManager.setLookAndFeel(new PlasticXPLookAndFeel()); } catch (Exception e) { e.printStackTrace(); } } static class FrinikaExitHandler extends Thread { public void run() { MidiInDeviceManager.close(); FrinikaAudioSystem.close(); // SwingUtilities.invokeLater(new Runnable() { // public void run() { // System.out.println(" Closing ALL midi devices "); // ProjectContainer.closeAllMidiOutDevices(); // } // }); } } /** * Detect whether running from a single .jar-file (e.g. via "java -jar frinika.jar"). * In this case, copy native binary libraries to a file-system accessible location * where the JVM can load them from. * (There is a comparable mechanism already implemented in * com.frinika.priority.Priority, but this here works for all native libraries, * esp. libjjack.so.) * (Jens) */ public static void prepareRunningFromSingleJar() { String classpath = System.getProperty("java.class.path"); if ( classpath.indexOf(File.pathSeparator) == -1 ) { // no pathSeparator: single entry classpath if (classpath.endsWith(".jar")) { File file = new File(classpath); if (file.exists() && file.isFile()) { // yes, running from 1 jar String osarch = System.getProperty("os.arch"); String osname = System.getProperty("os.name"); String libPrefix = "lib/" + osarch + "/" + osname + "/"; String tmp = System.getProperty("java.io.tmpdir"); File tmpdir = new File(tmp); try { System.out.println("extracting files from "+libPrefix+" to "+tmpdir.getAbsolutePath()+":"); Toolbox.extractFromJar(file, libPrefix, tmpdir); System.setProperty("java.library.path", tmp); } catch (IOException ioe) { System.err.println("Native library extraction failed. Problems may occur."); ioe.printStackTrace(); } } } } } }
gpl-2.0
glenux/cryptaffinity
src/lib/key_vigenere.hh
311
#ifndef _CRYPTAFINIY_KEYVIGENERE_HH #define _CRYPTAFINIY_KEYVIGENERE_HH #include "cryptaffinity_global.hh" #include "cryptaffinity_iface.hh" #include "text.hh" #include "key.hh" namespace LibCryptAffinity { class KeyVigenere : public Key, public Text { private: public: KeyVigenere(); }; } #endif
gpl-2.0
DylanPeti/InternationalRescue
wp-content/themes/international-rescue/pages/white.php
306
<?php /* Template Name: White Template */ if (__FILE__ == $_SERVER['SCRIPT_FILENAME']) { die(); } if (CFCT_DEBUG) { cfct_banner(__FILE__); } get_header(); ?> <body style="position:relative; height: auto;"> <div id="about"> <?php cfct_misc('submenu'); ?> </div> <?php cfct_loop(); get_footer(); ?>
gpl-2.0
mikstar/Merlin-a-guardians-quest
Assets/Scripts/InGame/EncounterManeging/Wave.cs
107
using UnityEngine; using System.Collections; public class Wave{ public EnemySpwInfo[] enemySpawns; }
gpl-2.0
tvcnet/pharmtest
sandbox/Sandbox1/wp-content/plugins/better-wp-security/modules/free/ban-users/setup.php
2989
<?php if ( ! class_exists( 'ITSEC_Ban_Users_Setup' ) ) { class ITSEC_Ban_Users_Setup { private $defaults; public function __construct() { global $itsec_setup_action; $this->defaults = array( 'enabled' => false, 'default' => false, 'host_list' => array(), 'agent_list' => array(), 'white_list' => array(), ); if ( isset( $itsec_setup_action ) ) { switch ( $itsec_setup_action ) { case 'activate': $this->execute_activate(); break; case 'upgrade': $this->execute_activate( true ); break; case 'deactivate': $this->execute_deactivate(); break; case 'uninstall': $this->execute_uninstall(); break; } } else { wp_die( 'error' ); } } /** * Execute module activation. * * @since 4.0 * * @param boolean $upgrade true if the plugin is updating * * @return void */ public function execute_activate( $upgrade = false ) { global $itsec_files; $options = get_site_option( 'itsec_ban_users' ); if ( $options === false ) { add_site_option( 'itsec_ban_users', $this->defaults ); } if ( $upgrade === true ) { $this->execute_upgrade(); } if ( ! class_exists( 'ITSEC_Ban_Users_Admin' ) ) { require_once( dirname( __FILE__ ) . '/class-itsec-ban-users-admin.php' ); } $rewrite_rules = ITSEC_Ban_Users_Admin::build_rewrite_rules( array(), null, true ); $itsec_files->set_rewrites( $rewrite_rules ); } /** * Execute module deactivation * * @return void */ public function execute_deactivate() { } /** * Execute module uninstall * * @return void */ public function execute_uninstall() { $this->execute_deactivate(); delete_site_option( 'itsec_ban_users' ); } /** * Execute module upgrade * * @return void */ public function execute_upgrade() { global $itsec_old_version; if ( $itsec_old_version < 4000 ) { global $itsec_bwps_options; $current_options = get_site_option( 'itsec_ban_users' ); $current_options['enabled'] = isset( $itsec_bwps_options['bu_enabled'] ) && $itsec_bwps_options['bu_enabled'] == 1 ? true : false; $current_options['default'] = isset( $itsec_bwps_options['bu_blacklist'] ) && $itsec_bwps_options['bu_blacklist'] == 1 ? true : false; if ( isset( $itsec_bwps_options['bu_banlist'] ) && ! is_array( $itsec_bwps_options['bu_banlist'] ) && strlen( $itsec_bwps_options['bu_banlist'] ) > 1 ) { $current_options['host_list'] = explode( PHP_EOL, $itsec_bwps_options['bu_banlist'] ); } if ( isset( $itsec_bwps_options['bu_banagent'] ) && ! is_array( $itsec_bwps_options['bu_banagent'] ) && strlen( $itsec_bwps_options['bu_banagent'] ) > 1 ) { $current_options['agent_list'] = explode( PHP_EOL, $itsec_bwps_options['bu_banagent'] ); } update_site_option( 'itsec_ban_users', $current_options ); } } } } new ITSEC_Ban_Users_Setup();
gpl-2.0
MinhTrung352/webbanhang
wp-content/themes/golmart/vc_templates/wpo_product_deals.php
10468
<?php /** * $Desc * * @version $Id$ * @package wpbase * @author WPOpal Team <wpopal@gmail.com, support@wpopal.com> * @copyright Copyright (C) 2014 wpopal.com. All Rights Reserved. * @license GNU/GPL v2 or later http://www.gnu.org/licenses/gpl-2.0.html * * @website http://www.wpopal.com * @support http://www.wpopal.com/support/forum.html */ $atts = ( vc_map_get_attributes( str_replace('.php','',basename(__FILE__)) , $atts ) ); extract( $atts ); $deals = array(); $p_deals = wpo_woocommerce_query('deals')->posts; $_id = wpo_makeid(); $_count = 1; switch ($columns_count) { case '4': $class_column='col-sm-6 col-md-3'; break; case '3': $class_column='col-sm-4'; break; case '2': $class_column='col-sm-6'; break; default: $class_column='col-sm-12'; break; } foreach($p_deals as $product){ $date_sale = get_post_meta( $product->ID, '_sale_price_dates_to', true ); if( $date_sale > time() ) $deals[] = $product; } $_total = count($deals); if( $deals && $_total > 0 ) { ?> <?php //register countdown js wp_register_script( 'countdown_js', WPO_THEME_URI.'/js/countdown.js', array( 'jquery' ) ); wp_enqueue_script('countdown_js'); ?> <div class="widget_deals_products widget-<?php echo esc_attr($block_style); ?> widget widget_products <?php echo (($el_class!='')?' '.$el_class:''); ?>"> <?php if($title!=''){ ?> <h3 class="widget-title title-primary"> <span><span><?php echo esc_attr( $title ); ?></span></span> </h3> <?php } ?> <div class="woocommerce woo-deals"> <?php if($layout == 'carousel'):?> <div id="carousel-<?php echo esc_attr($_id); ?>" class="widget-content owl-carousel-play" data-ride="owlcarousel"> <?php if( $_total > $columns_count ) { ?> <div class="carousel-controls-v1 carousel-controls"> <a class="left carousel-control carousel-xs visible" href="#post-slide-<?php the_ID(); ?>" data-slide="prev"> <i class="fa fa-arrow-left"></i> </a> <a class="right carousel-control carousel-xs visible" href="#post-slide-<?php the_ID(); ?>" data-slide="next"> <i class="fa fa-arrow-right"></i> </a> </div> <?php } ?> <div class="owl-carousel rows-products" data-slide="<?php echo esc_attr($columns_count); ?>" data-pagination="false" data-navigation="true"> <?php foreach($deals as $key=>$id ){ $product = get_product( $id ); $time_sale = get_post_meta( $product->id, '_sale_price_dates_to', true ); ?> <div class="item-product <?php echo esc_attr($class_column); if($_count%$columns_count==0) echo ' last'; ?>"> <div class="product-block thumbnail"> <div class="image"> <?php echo ( $product->get_image('image-widgets') ); ?> <div class="time"> <div class="pts-countdown clearfix" data-countdown="countdown" data-date="<?php echo date('m',$time_sale).'-'.date('d',$time_sale).'-'.date('Y',$time_sale).'-'. date('H',$time_sale) . '-' . date('i',$time_sale) . '-' . date('s',$time_sale) ; ?>"> </div> </div> </div> <div class="caption"> <div class="deals-information"> <h3 class="name"> <a href="<?php echo esc_url( get_permalink( $product->id ) ); ?>"><?php echo esc_attr( $product->get_title() ); ?></a> </h3> <div class="rating clearfix "> <?php if ( $rating_html = $product->get_rating_html() ) { ?> <div><?php echo trim($rating_html); ?></div> <?php }else{ ?> <div class="star-rating"></div> <?php } ?> </div> <div class="price"><?php echo ( $product->get_price_html() ) ?></div> </div> <!-- <div class="time"> <div class="sale-off"> <?php $percentage = round( ( ( $product->regular_price - $product->sale_price ) / $product->regular_price ) * 100 ); echo '-' . $percentage . '%'; ?> </div> <div class="pts-countdown clearfix" data-countdown="countdown" data-date="<?php echo date('m',$time_sale).'-'.date('d',$time_sale).'-'.date('Y',$time_sale).'-'. date('H',$time_sale) . '-' . date('i',$time_sale) . '-' . date('s',$time_sale) ; ?>"> </div> </div> --> </div> </div> </div> <?php $_count++; } ?> </div> </div> <?php elseif($layout == 'grid') : ?> <div class="widget-content widget_products" id="<?php echo esc_attr($_id); ?>"> <div class="products-inner"> <?php foreach($deals as $key=>$id ){ $product = get_product( $id ); $time_sale = get_post_meta( $product->id, '_sale_price_dates_to', true ); ?> <?php if( $_count%$columns_count == 1 || $columns_count == 1 ) echo '<div class="item'.(($_count==1)?" active":"").'"><div class="row">'; ?> <div class="item-product <?php echo esc_attr($class_column); if($_count%$columns_count==0) echo ' last'; ?>"> <div class="product-block thumbnail"> <div class="image"> <?php echo ( $product->get_image('image-widgets') ); ?> <div class="time"> <div class="pts-countdown clearfix" data-countdown="countdown" data-date="<?php echo date('m',$time_sale).'-'.date('d',$time_sale).'-'.date('Y',$time_sale).'-'. date('H',$time_sale) . '-' . date('i',$time_sale) . '-' . date('s',$time_sale) ; ?>"> </div> </div> </div> <div class="caption"> <div class="deals-information"> <h3 class="name"> <a href="<?php echo esc_url( get_permalink( $product->id ) ); ?>"><?php echo esc_attr( $product->get_title() ); ?></a> </h3> <div class="rating clearfix "> <?php if ( $rating_html = $product->get_rating_html() ) { ?> <div><?php echo trim($rating_html); ?></div> <?php }else{ ?> <div class="star-rating"></div> <?php } ?> </div> <div class="price"><?php echo ( $product->get_price_html() ); ?></div> </div> </div> </div> </div> <?php if( ($_count%$columns_count==0 && $_count!=1) || $_count== $_total || $columns_count ==1 ) echo '</div></div>'; ?> <?php $_count++; } ?> </div> </div> <?php endif ?> </div> </div> <?php } ?> <script type="text/javascript"> jQuery(document).ready(function() { jQuery('[data-countdown="countdown"]').each(function(index, el) { var $this = jQuery(this); var $date = $this.data('date').split("-"); $this.lofCountDown({ TargetDate:$date[0]+"/"+$date[1]+"/"+$date[2]+" "+$date[3]+":"+$date[4]+":"+$date[5], DisplayFormat:"<div class=\"countdown-times\"><div class=\"day\">%%D%% <?php echo __('Days', TEXTDOMAIN); ?></div><div class=\"hours\">%%H%% <?php echo __('Hrs', TEXTDOMAIN); ?> </div><div class=\"minutes\">%%M%% <?php echo __('Mins', TEXTDOMAIN); ?> </div><div class=\"seconds\">%%S%% <?php echo __('Secs', TEXTDOMAIN); ?> </div></div>", FinishMessage: "<?php echo __('Expired', TEXTDOMAIN); ?>" }); }); }); </script>
gpl-2.0
Automattic/wp-calypso
client/me/account-close/index.js
493
import { isEnabled } from '@automattic/calypso-config'; import page from 'page'; import { makeLayout, render as clientRender } from 'calypso/controller'; import { sidebar } from 'calypso/me/controller'; import { accountClose, accountClosed } from './controller'; export default function () { if ( isEnabled( 'me/account-close' ) ) { page( '/me/account/close', sidebar, accountClose, makeLayout, clientRender ); page( '/me/account/closed', accountClosed, makeLayout, clientRender ); } }
gpl-2.0
Itshalffull/Docademy
profiles/opigno_lms/themes/platon/templates/node--quiz.tpl.php
4130
<div id="node-<?php print $node->nid; ?>" class="<?php print $classes; ?> clearfix"<?php print $attributes; ?>> <?php print render($title_prefix); ?> <?php if (!$page): ?> <h2<?php print $title_attributes; ?>><a href="<?php print $node_url; ?>"><?php print $title; ?></a></h2> <?php endif; ?> <?php print render($title_suffix); ?> <?php if ($display_submitted): ?> <div class="submitted"> <?php print $submitted; ?> </div> <?php endif; ?> <div class="content"<?php print $content_attributes; ?>> <table class="quiz-stats-table"> <thead> <tr> <th><?php print $title; ?></th> <th></th> <th></th> </tr> </thead> <tbody> <?php $rows = 5; $rendered_take = FALSE; ?> <?php if (isset($quiz_type[LANGUAGE_NONE][0]['value'])): ?> <?php $rows++; $rendered_take = TRUE; ?> <tr> <td class="vertical-header"> <?php print t("Type"); ?>: </td> <td> <?php switch($quiz_type[LANGUAGE_NONE][0]['value']) { case 'quiz': print t("Quiz"); break; case 'theory': print t("Theory"); break; default: print t("Mixed"); break; } ?> </td> <td class="take-button-cell" rowspan="<?php print $rows; ?>"> <?php print render($content['take']); ?> <?php if (!$page): ?> <?php print l(t("Read more"), "node/{$node->nid}", array('attributes' => array('class' => array('read-more', 'action-element', 'action-sort-element')))); ?> <?php endif; ?> </td> </tr> <?php endif; ?> <tr> <td class="vertical-header"> <?php print t("Questions"); ?>: </td> <td> <?php print $node->number_of_random_questions + _quiz_get_num_always_questions($node->vid); ?> </td> </tr> <tr> <td class="vertical-header"> <?php print t("Attempts allowed"); ?>: </td> <td> <?php print $node->takes == 0 ? t('Unlimited') : $node->takes; ?> </td> </tr> <tr> <td class="vertical-header"> <?php print t("Available"); ?>: </td> <td> <?php if ($node->quiz_always): ?> <?php print t('Always'); ?> <?php else: ?> <div><?php print t('Opens'); ?> <?php print format_date($node->quiz_open, 'short'); ?></div> <div><?php print t('Closes'); ?> <?php print format_date($node->quiz_close, 'short'); ?></div> <?php endif; ?> </td> </tr> <tr> <td class="vertical-header"> <?php print t("Pass rate"); ?>: </td> <td> <?php print $node->pass_rate; ?>% </td> </tr> <tr> <td class="vertical-header"> <?php print t("Backwards navigation"); ?>: </td> <td> <?php print $node->backwards_navigation ? t('Allowed') : t('Forbidden'); ?> </td> <?php if (!$rendered_take): ?> <td class="take-button-cell" rowspan="<?php print $rows; ?>"> <?php print render($content['take']); ?> <?php if (!$page): ?> <?php print l(t("Read more"), "node/{$node->nid}", array('attributes' => array('class' => array('read-more', 'action-element', 'action-sort-element')))); ?> <?php endif; ?> </td> <?php endif; ?> </tr> </tbody> </table> <?php if ($page): ?> <?php // We hide the comments and links now so that we can render them later. hide($content['comments']); hide($content['links']); hide($content['stats']); print render($content); ?> <?php endif; ?> </div> <?php print render($content['comments']); ?> </div>
gpl-2.0
mrstampy/gameboot
GameBoot/src/test/java/com/github/mrstampy/gameboot/usersession/UserSessionLookupTest.java
7277
/* * ______ ____ __ * / ____/___ _____ ___ ___ / __ )____ ____ / /_ * / / __/ __ `/ __ `__ \/ _ \ / __ / __ \/ __ \/ __/ * / /_/ / /_/ / / / / / / __/ / /_/ / /_/ / /_/ / /_ * \____/\__,_/_/ /_/ /_/\___/ /_____/\____/\____/\__/ * * .-'\ * .-' `/\ * .-' `/\ * \ `/\ * \ `/\ * \ _- `/\ _.--. * \ _- `/`-..--\ ) * \ _- `,',' / ,') * `-_ - ` -- ~ ,',' * `- ,',' * \,--. ____==-~ * \ \_-~\ * `_-~_.-' * \-~ * * http://mrstampy.github.io/gameboot/ * * Copyright (C) 2015, 2016 Burton Alexander * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., 51 * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * */ package com.github.mrstampy.gameboot.usersession; import static org.junit.Assert.fail; import java.lang.invoke.MethodHandles; import java.util.Map.Entry; import java.util.Set; import javax.transaction.Transactional; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.SpringApplicationConfiguration; import org.springframework.cache.Cache; import org.springframework.cache.CacheManager; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import com.codahale.metrics.Timer; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.github.mrstampy.gameboot.TestConfiguration; import com.github.mrstampy.gameboot.exception.GameBootRuntimeException; import com.github.mrstampy.gameboot.metrics.MetricsHelper; import com.github.mrstampy.gameboot.usersession.data.entity.User; import com.github.mrstampy.gameboot.usersession.data.entity.User.UserState; import com.github.mrstampy.gameboot.usersession.data.entity.UserSession; import com.github.mrstampy.gameboot.usersession.data.repository.UserRepository; import com.github.mrstampy.gameboot.usersession.data.repository.UserSessionRepository; /** * The Class UserSessionLookupTest. */ @RunWith(SpringJUnit4ClassRunner.class) @SpringApplicationConfiguration(TestConfiguration.class) @ActiveProfiles(UserSessionConfiguration.USER_SESSION_PROFILE) public class UserSessionLookupTest { private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final String NON_EXISTENT = "usertest"; private static final String USER_NAME = "testuser"; private static final int METRICS_ITR = 100; @Autowired private UserSessionLookup lookup; @Autowired private UserSessionAssist assist; @Autowired private UserRepository userRepo; @Autowired private UserSessionRepository userSessionRepo; @Autowired private MetricsHelper helper; @Autowired private ObjectMapper mapper; private User user; private Long sessionId; @Autowired private CacheManager cacheManager; private Cache cache; /** * Before. * * @throws Exception * the exception */ @Before public void before() throws Exception { User user = createUser(); this.user = userRepo.save(user); createSession(user); cache = cacheManager.getCache(UserSessionAssist.SESSIONS_CACHE); } /** * After. * * @throws Exception * the exception */ @After public void after() throws Exception { if (sessionId != null) { if (assist.hasSession(sessionId)) assist.logout(sessionId); userSessionRepo.delete(sessionId); } sessionId = null; userRepo.delete(user); } /** * Test exceptions. * * @throws Exception * the exception */ @Test @Transactional public void testExceptions() throws Exception { gameBootExcpected(() -> lookup.expected(NON_EXISTENT), "No session for username"); gameBootExcpected(() -> lookup.expected((String) null), "Null username"); gameBootExcpected(() -> lookup.expected((Long) null), "Null id"); gameBootExcpected(() -> lookup.expected(Long.MAX_VALUE), "No session for id"); } /** * Metrics with session id. * * @throws Exception * the exception */ @Test @Transactional public void metricsWithSessionId() throws Exception { generateUncachedStats(); for (int i = 0; i < METRICS_ITR; i++) { lookup.expected(sessionId); } metrics(); } /** * Metrics with user name. * * @throws Exception * the exception */ @Test @Transactional public void metricsWithUserName() throws Exception { generateUncachedStats(); for (int i = 0; i < METRICS_ITR; i++) { lookup.expected(USER_NAME); } metrics(); } /** * Generate uncached stats. */ protected void generateUncachedStats() { for (int i = 0; i < METRICS_ITR; i++) { cache.clear(); assist.activeSessions(); } } private void gameBootExcpected(Runnable r, String failMsg) { try { r.run(); fail(failMsg); } catch (GameBootRuntimeException expected) { } } private User createUser() { User user = new User(); user.setUserName(USER_NAME); user.setState(UserState.ACTIVE); user.setPasswordHash("unimportant"); return user; } private UserSession createSession(User user) { UserSession session = assist.create(user); sessionId = session.getId(); return session; } private void metrics() throws Exception { Set<Entry<String, Timer>> timers = helper.getTimers(); timers.stream().filter(e -> isMetric(e.getKey())).forEach(e -> display(e)); } private boolean isMetric(String key) { return "UncachedSessionTimer".equals(key) || "CachedSessionTimer".equals(key); } private void display(Entry<String, ?> t) { try { log.debug(mapper.writeValueAsString(t)); } catch (JsonProcessingException e) { log.error("Unexpected exception", e); } } }
gpl-2.0
NPLPackages/main
script/ide/Document/CSVDocReader.lua
3359
--[[ Title: Reading CSV based text file Author(s): LiXizhi Date: 2012/11/29 Desc: currently only single worksheet is supported use the lib: ------------------------------------------------------------ NPL.load("(gl)script/ide/Document/CSVDocReader.lua"); local CSVDocReader = commonlib.gettable("commonlib.io.CSVDocReader"); local reader = CSVDocReader:new(); -- schema is optional, which can change the row's keyname to the defined value. reader:SetSchema({ [1] = {name="column_name1"}, [2] = {name="column_name2", type="number"}, [3] = {name="column_name3", validate_func=function(value) return value=="true"; end }, }) -- read from the second row if(reader:LoadFile("temp/some_csv_excel_file.csv", 1)) then local rows = reader:GetRows(); echo(rows); end ------------------------------------------------------------ ]] local CSVDocReader = commonlib.gettable("commonlib.io.CSVDocReader"); function CSVDocReader:new(o) o = o or {} -- create object if user does not provide one setmetatable(o, self) self.__index = self return o end -- set the scheme used when parsing the excel file -- @param schema: if nil, it means no schema is used. it can also be a table mapping from row index to schema table. { [1]={name="my_keyname", type="number"}, {}} function CSVDocReader:SetSchema(schema) self.scheme = schema; end -- @param column_index: starting from 1 -- @return nil if there is no schema defined. otherwise it is a table {type="number", validate_func=function(value) end, } -- the validate_func function() should return value, name. name can be nil. if name is specified, it will replace the schema.name. So that the value itself can define the schema name. function CSVDocReader:GetSchemaByColumn(column_index) self.scheme = self.scheme or {}; return self.scheme[column_index] end -- @param filename: xml based excel document. -- @param nStartRow: default to 1 (first row). one may specify 2 where the row 1 is skipped (usually some comments on the first row). -- @return true if there is data function CSVDocReader:LoadFile(filename, nStartRow) nStartRow = nStartRow or 1; if(not filename) then return filename; end local file = ParaIO.open(filename, "r"); if(file:IsValid()) then LOG.std(nil, "debug", "CSVDocReader", "load file:%s", filename); local rows = {}; self.rows = rows; local index = 1; local line = file:readline(); while(line) do local row = {}; rows[#rows+1] = row; local section; local col_index = 1; local value; local nLength = #line if(line:sub(nLength,nLength) ~= ",") then line = line.."," end for value in string.gmatch(line, "([^,]*),") do local schema = self:GetSchemaByColumn(col_index); if(not schema)then -- if there is no schema, simply use the col_index as key row[col_index] = value; else local name; if(schema.validate_func) then value, name = schema.validate_func(value); elseif(schema.type == "number") then value = tonumber(value); end row[name or schema.name or col_index] = value; end col_index = col_index + 1; end -- read next line line = file:readline(); end file:close(); return true; else LOG.std(nil, "warn", "CSVDocReader", "failed to load file:%s", filename); end end -- get all rows. function CSVDocReader:GetRows() return self.rows; end
gpl-2.0
slushman/super-simple-slider
includes/class-super-simple-slider-deactivator.php
654
<?php /** * Fired during plugin deactivation * * @link http://slushman.com * @since 1.0.0 * * @package Super_Simple_Slider * @subpackage Super_Simple_Slider/includes */ /** * Fired during plugin deactivation. * * This class defines all code necessary to run during the plugin's deactivation. * * @since 1.0.0 * @package Super_Simple_Slider * @subpackage Super_Simple_Slider/includes * @author Slushman <chris@slushman.com> */ class Super_Simple_Slider_Deactivator { /** * Short Description. (use period) * * Long Description. * * @since 1.0.0 */ public static function deactivate() { } }
gpl-2.0
iammyr/Benchmark
src/main/java/org/owasp/benchmark/testcode/BenchmarkTest11620.java
2884
/** * OWASP Benchmark Project v1.1 * * This file is part of the Open Web Application Security Project (OWASP) * Benchmark Project. For details, please see * <a href="https://www.owasp.org/index.php/Benchmark">https://www.owasp.org/index.php/Benchmark</a>. * * The Benchmark is free software: you can redistribute it and/or modify it under the terms * of the GNU General Public License as published by the Free Software Foundation, version 2. * * The Benchmark is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details * * @author Dave Wichers <a href="https://www.aspectsecurity.com">Aspect Security</a> * @created 2015 */ package org.owasp.benchmark.testcode; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @WebServlet("/BenchmarkTest11620") public class BenchmarkTest11620 extends HttpServlet { private static final long serialVersionUID = 1L; @Override public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doPost(request, response); } @Override public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { org.owasp.benchmark.helpers.SeparateClassRequest scr = new org.owasp.benchmark.helpers.SeparateClassRequest( request ); String param = scr.getTheParameter("foo"); String bar = new Test().doSomething(param); try { java.util.Properties Benchmarkprops = new java.util.Properties(); Benchmarkprops.load(this.getClass().getClassLoader().getResourceAsStream("Benchmark.properties")); String algorithm = Benchmarkprops.getProperty("cryptoAlg2", "AES/ECB/PKCS5Padding"); javax.crypto.Cipher c = javax.crypto.Cipher.getInstance(algorithm); } catch (java.security.NoSuchAlgorithmException e) { System.out.println("Problem executing crypto - javax.crypto.Cipher.getInstance(java.lang.String) Test Case"); throw new ServletException(e); } catch (javax.crypto.NoSuchPaddingException e) { System.out.println("Problem executing crypto - javax.crypto.Cipher.getInstance(java.lang.String) Test Case"); throw new ServletException(e); } response.getWriter().println("Crypto Test javax.crypto.Cipher.getInstance(java.lang.String) executed"); } // end doPost private class Test { public String doSomething(String param) throws ServletException, IOException { String bar = org.apache.commons.lang.StringEscapeUtils.escapeHtml(param); return bar; } } // end innerclass Test } // end DataflowThruInnerClass
gpl-2.0
ptitjes/quodlibet
quodlibet/ext/songsmenu/playlist.py
5545
# Copyright 2009 Christoph Reiter # 2014-2017 Nick Boultbee # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # The Unofficial M3U and PLS Specification (Winamp): # http://forums.winamp.com/showthread.php?threadid=65772 import os from gi.repository import Gtk from os.path import relpath from quodlibet.plugins.playlist import PlaylistPlugin from quodlibet import _ from quodlibet import util, qltk from quodlibet.util.path import glib2fsn, get_home_dir from quodlibet.qltk.msg import ConfirmFileReplace from quodlibet.qltk import Icons from quodlibet.plugins.songsmenu import SongsMenuPlugin lastfolder = get_home_dir() class PlaylistExport(PlaylistPlugin, SongsMenuPlugin): PLUGIN_ID = 'Playlist Export' PLUGIN_NAME = _('Export as Playlist') PLUGIN_DESC = _('Exports songs to an M3U or PLS playlist.') PLUGIN_ICON = Icons.DOCUMENT_SAVE_AS REQUIRES_ACTION = True lastfolder = None def plugin_single_playlist(self, playlist): return self.__save_playlist(playlist.songs, playlist.name) def plugin_songs(self, songs): self.__save_playlist(songs) def __save_playlist(self, songs, name=None): dialog = Gtk.FileChooserDialog(self.PLUGIN_NAME, None, Gtk.FileChooserAction.SAVE) dialog.set_show_hidden(False) dialog.set_create_folders(True) dialog.add_button(_("_Cancel"), Gtk.ResponseType.CANCEL) dialog.add_button(_("_Save"), Gtk.ResponseType.OK) dialog.set_default_response(Gtk.ResponseType.OK) if name: dialog.set_current_name(name) ffilter = Gtk.FileFilter() ffilter.set_name("m3u") ffilter.add_mime_type("audio/x-mpegurl") ffilter.add_pattern("*.m3u") dialog.add_filter(ffilter) ffilter = Gtk.FileFilter() ffilter.set_name("pls") ffilter.add_mime_type("audio/x-scpls") ffilter.add_pattern("*.pls") dialog.add_filter(ffilter) dialog.set_current_folder(lastfolder) diag_cont = dialog.get_child() hbox_path = Gtk.HBox() combo_path = Gtk.ComboBoxText() hbox_path.pack_end(combo_path, False, False, 6) diag_cont.pack_start(hbox_path, False, False, 0) diag_cont.show_all() for option_text in [_("Use relative paths"), _("Use absolute paths")]: combo_path.append_text(option_text) combo_path.set_active(0) response = dialog.run() if response == Gtk.ResponseType.OK: file_path = glib2fsn(dialog.get_filename()) dir_path = os.path.dirname(file_path) file_format = dialog.get_filter().get_name() extension = "." + file_format if not file_path.endswith(extension): file_path += extension if os.path.exists(file_path): resp = ConfirmFileReplace(self.plugin_window, file_path).run() if resp != ConfirmFileReplace.RESPONSE_REPLACE: return relative = combo_path.get_active() == 0 files = self.__get_files(songs, dir_path, relative) if file_format == "m3u": self.__m3u_export(file_path, files) elif file_format == "pls": self.__pls_export(file_path, files) self.lastfolder = dir_path dialog.destroy() def __get_files(self, songs, dir_path, relative=False): files = [] for song in songs: f = {} if "~uri" in song: f['path'] = song('~filename') f['title'] = song("title") f['length'] = -1 else: path = song('~filename') if relative: path = relpath(path, dir_path) f['path'] = path f['title'] = "%s - %s" % ( song('~people').replace("\n", ", "), song('~title~version')) f['length'] = song('~#length') files.append(f) return files def __file_error(self, file_path): qltk.ErrorMessage( None, _("Unable to export playlist"), _("Writing to <b>%s</b> failed.") % util.escape(file_path)).run() def __m3u_export(self, file_path, files): try: fhandler = open(file_path, "wb") except IOError: self.__file_error(file_path) else: text = "#EXTM3U\n" for f in files: text += "#EXTINF:%d,%s\n" % (f['length'], f['title']) text += f['path'] + "\n" fhandler.write(text.encode("utf-8")) fhandler.close() def __pls_export(self, file_path, files): try: fhandler = open(file_path, "wb") except IOError: self.__file_error(file_path) else: text = "[playlist]\n" for num, f in enumerate(files): num += 1 text += "File%d=%s\n" % (num, f['path']) text += "Title%d=%s\n" % (num, f['title']) text += "Length%d=%s\n" % (num, f['length']) text += "NumberOfEntries=%d\n" % len(files) text += "Version=2\n" fhandler.write(text.encode("utf-8")) fhandler.close()
gpl-2.0
geodynamics/gale
boost/libs/random/test/test_ranlux64_3_01.cpp
903
/* test_ranlux64_3_01.cpp * * Copyright Steven Watanabe 2011 * 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) * * $Id: test_ranlux64_3_01.cpp 71018 2011-04-05 21:27:52Z steven_watanabe $ * */ #include <boost/random/ranlux.hpp> #include <cmath> #define BOOST_RANDOM_URNG boost::random::ranlux64_3_01 #define BOOST_RANDOM_SEED_WORDS 48 // principal operation validated with CLHEP, values by experiment #define BOOST_RANDOM_VALIDATION_VALUE INT64_C(141789170949364)/std::pow(2.0, 48) #define BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE UINT64_C(97179253367494)/std::pow(2.0, 48) #define BOOST_RANDOM_ITERATOR_VALIDATION_VALUE UINT64_C(101724473226966)/std::pow(2.0, 48) #define BOOST_RANDOM_GENERATE_VALUES { 0xC35F616BU, 0xDC3C4DF1U, 0xF3F90D0AU, 0x206F9C9EU } #include "test_generator.ipp"
gpl-2.0
essamjoubori/eclipse-explorer
JSEX/SE2301.js
88050
// // Besselian Elements for Solar Eclipses from: // "Five Millennium Canon of Solar Eclipses: -1999 to +3000", // Fred Espenak and Jean Meeus, NASA/TP-2006-214141, October 2006 // function SE2301() { calculatefor(new Array( // 2301 5 9 2561611.084014, 14.0, -4.0, 4.0, 719.9, 719.9, 0.2556460, 0.5255338, 4.360e-05, -8.080e-06, -0.6689800, 0.2086337, -6.780e-05, -3.370e-06, 17.2928696, 0.0106470, -4.000e-06, 30.8077507, 15.0017147, 0.000e-00, 0.5399820, -0.0001030, -1.210e-05, -0.0061250, -0.0001024, -1.200e-05, 0.0046375, 0.0046144, // 2301 11 1 2561787.221911, 17.0, -4.0, 4.0, 721.4, 721.4, 0.1719020, 0.4920175, 1.110e-05, -6.590e-06, 0.8088380, -0.2219838, 5.220e-05, 3.170e-06, -14.3579397, -0.0127730, 3.000e-06, 79.1476517, 15.0016565, 0.000e-00, 0.5548610, 0.0001313, -1.120e-05, 0.0086800, 0.0001307, -1.110e-05, 0.0047045, 0.0046810, // 2302 4 29 2561965.532862, 1.0, -4.0, 4.0, 722.9, 722.9, 0.0913890, 0.4841233, 4.940e-05, -6.210e-06, 0.0706050, 0.2210698, -7.680e-05, -3.010e-06, 14.1445303, 0.0125860, -3.000e-06, 195.5641479, 15.0026169, 0.000e-00, 0.5556450, -0.0001229, -1.080e-05, 0.0094600, -0.0001223, -1.070e-05, 0.0046509, 0.0046278, // 2302 10 22 2562141.716155, 5.0, -4.0, 4.0, 724.4, 724.4, -0.0698680, 0.5114176, 2.260e-05, -8.110e-06, 0.1002740, -0.2560118, 6.250e-05, 4.260e-06, -10.7259102, -0.0141360, 2.000e-06, 258.8606567, 15.0030470, 0.000e-00, 0.5399080, 0.0000924, -1.250e-05, -0.0061990, 0.0000919, -1.240e-05, 0.0046899, 0.0046665, // 2303 4 18 2562319.673220, 4.0, -4.0, 4.0, 725.9, 725.9, -0.4265000, 0.4531303, 5.070e-05, -5.060e-06, 0.6684020, 0.2285617, -7.800e-05, -2.720e-06, 10.4225397, 0.0141430, -2.000e-06, 240.0640717, 15.0033979, 0.000e-00, 0.5683650, -0.0000471, -9.900e-06, 0.0221160, -0.0000469, -9.800e-06, 0.0046657, 0.0046424, // 2303 10 11 2562496.387093, 21.0, -4.0, 4.0, 727.4, 727.4, -0.4514610, 0.5150453, 4.750e-05, -8.670e-06, -0.4874040, -0.2743445, 6.770e-05, 4.830e-06, -6.8542399, -0.0150080, 1.000e-06, 138.2645569, 15.0040817, 0.000e-00, 0.5342920, -0.0000019, -1.300e-05, -0.0117870, -0.0000018, -1.290e-05, 0.0046756, 0.0046523, // 2304 3 7 2562643.982218, 12.0, -4.0, 4.0, 728.6, 728.6, 0.8777230, 0.4575166, -6.420e-05, -5.450e-06, -1.1615330, 0.2465765, 7.220e-05, -3.140e-06, -5.3141899, 0.0156140, 1.000e-06, 357.3212891, 15.0034924, 0.000e-00, 0.5652130, 0.0000855, -1.040e-05, 0.0189800, 0.0000851, -1.040e-05, 0.0047183, 0.0046948, // 2304 4 6 2562673.666915, 4.0, -4.0, 4.0, 728.9, 728.9, -0.7086210, 0.4485283, 3.840e-05, -5.040e-06, 1.3171490, 0.2401359, -8.770e-05, -2.850e-06, 6.2967300, 0.0152170, -1.000e-06, 239.3613129, 15.0039482, 0.000e-00, 0.5685030, 0.0000527, -9.900e-06, 0.0222540, 0.0000525, -9.900e-06, 0.0046806, 0.0046573, // 2304 9 1 2562821.630329, 3.0, -4.0, 4.0, 730.1, 730.1, 0.5231770, 0.4882436, -3.390e-05, -6.900e-06, 1.1576160, -0.2540995, -1.082e-04, 3.740e-06, 8.3678598, -0.0144160, -2.000e-06, 224.8551025, 15.0045357, 0.000e-00, 0.5461310, -0.0001130, -1.140e-05, -0.0000060, -0.0001124, -1.140e-05, 0.0046274, 0.0046043, // 2304 9 30 2562851.040476, 13.0, -4.0, 4.0, 730.4, 730.4, -0.6452910, 0.4970528, 5.610e-05, -7.630e-06, -1.2154270, -0.2714308, 7.440e-05, 4.390e-06, -2.8102601, -0.0154560, 0.000e-00, 17.4507999, 15.0047102, 0.000e-00, 0.5408440, -0.0000976, -1.220e-05, -0.0052680, -0.0000971, -1.210e-05, 0.0046618, 0.0046385, // 2305 2 24 2562998.282051, 19.0, -4.0, 4.0, 731.6, 731.6, 0.4203040, 0.4920481, -6.420e-05, -7.040e-06, -0.5411100, 0.2519246, 7.540e-05, -3.820e-06, -9.4815798, 0.0147800, 2.000e-06, 101.8134918, 15.0026503, 0.000e-00, 0.5504020, 0.0001100, -1.180e-05, 0.0042430, 0.0001094, -1.170e-05, 0.0047298, 0.0047062, // 2305 8 21 2563175.941484, 11.0, -4.0, 4.0, 733.1, 733.1, 0.4285670, 0.4666490, -3.570e-05, -5.550e-06, 0.4031420, -0.2263539, -8.570e-05, 2.850e-06, 12.1493101, -0.0132570, -3.000e-06, 344.0610962, 15.0037527, 0.000e-00, 0.5602790, -0.0000962, -1.020e-05, 0.0140720, -0.0000957, -1.010e-05, 0.0046178, 0.0045948, // 2306 2 14 2563352.845704, 8.0, -4.0, 4.0, 734.6, 734.6, -0.1724300, 0.5243786, -3.750e-05, -8.660e-06, -0.0373190, 0.2458920, 8.240e-05, -4.270e-06, -13.2757902, 0.0134460, 3.000e-06, 296.6010742, 15.0015087, 0.000e-00, 0.5392650, 0.0000582, -1.290e-05, -0.0068390, 0.0000579, -1.290e-05, 0.0047391, 0.0047155, // 2306 8 10 2563529.996642, 12.0, -4.0, 4.0, 736.1, 736.1, -0.0452980, 0.4638783, -3.480e-05, -5.130e-06, -0.2073570, -0.2006180, -7.540e-05, 2.370e-06, 15.6394501, -0.0116080, -3.000e-06, 358.4927979, 15.0027246, 0.000e-00, 0.5662720, 0.0000032, -9.700e-06, 0.0200340, 0.0000031, -9.600e-06, 0.0046098, 0.0045868, // 2307 2 4 2563707.505563, 0.0, -4.0, 4.0, 737.6, 737.6, -0.3421670, 0.5357153, -1.830e-05, -8.860e-06, 0.6297310, 0.2199510, 7.570e-05, -3.840e-06, -16.6155605, 0.0116360, 4.000e-06, 176.7291565, 15.0001383, 0.000e-00, 0.5395950, -0.0000494, -1.300e-05, -0.0065100, -0.0000492, -1.290e-05, 0.0047465, 0.0047229, // 2307 7 30 2563884.063376, 14.0, -4.0, 4.0, 739.1, 739.1, -0.0955950, 0.4880793, -4.720e-05, -5.860e-06, -0.9846560, -0.1789062, -6.260e-05, 2.290e-06, 18.5999298, -0.0095140, -4.000e-06, 28.2280998, 15.0016289, 0.000e-00, 0.5588540, 0.0000851, -1.020e-05, 0.0126530, 0.0000846, -1.020e-05, 0.0046037, 0.0045808, // 2307 12 25 2564032.475267, 23.0, -4.0, 4.0, 740.4, 740.4, -0.0474780, 0.5309125, -1.100e-06, -6.990e-06, -1.4247360, 0.0636842, 2.301e-04, -9.200e-07, -23.3638897, 0.0007830, 6.000e-06, 165.2370758, 14.9962997, 0.000e-00, 0.5600240, -0.0001094, -1.110e-05, 0.0138170, -0.0001088, -1.100e-05, 0.0047522, 0.0047285, // 2308 1 24 2564062.065049, 14.0, -4.0, 4.0, 740.7, 740.7, -0.2308180, 0.5232211, -1.290e-05, -7.540e-06, 1.4377260, 0.1771964, 6.120e-05, -2.750e-06, -19.4334106, 0.0093220, 5.000e-06, 27.2361298, 14.9986629, 0.000e-00, 0.5513830, -0.0001293, -1.180e-05, 0.0052190, -0.0001286, -1.180e-05, 0.0047519, 0.0047283, // 2308 6 19 2564209.040198, 13.0, -4.0, 4.0, 741.9, 741.9, 0.0972880, 0.5663661, -3.250e-05, -8.880e-06, 0.9353700, -0.0467511, -2.146e-04, 8.800e-07, 23.3840694, 0.0006690, -5.000e-06, 14.5074997, 14.9991560, 0.000e-00, 0.5372080, 0.0000947, -1.210e-05, -0.0088850, 0.0000942, -1.210e-05, 0.0046039, 0.0045809, // 2308 12 14 2564386.607548, 3.0, -4.0, 4.0, 743.4, 743.4, 0.2412790, 0.5073567, -5.900e-06, -5.780e-06, -0.7576250, 0.0192229, 1.849e-04, -3.100e-07, -23.1361008, -0.0026920, 6.000e-06, 226.5771332, 14.9964991, 0.000e-00, 0.5727800, -0.0000632, -1.000e-05, 0.0265100, -0.0000629, -1.000e-05, 0.0047472, 0.0047236, // 2309 6 9 2564563.723554, 5.0, -4.0, 4.0, 744.9, 744.9, -0.2117340, 0.5842100, 8.400e-06, -9.970e-06, 0.1851700, -0.0052031, -1.758e-04, 2.000e-07, 22.8593998, 0.0035820, -5.000e-06, 255.0748444, 14.9994259, 0.000e-00, 0.5307430, 0.0000162, -1.280e-05, -0.0153180, 0.0000161, -1.280e-05, 0.0046095, 0.0045865, // 2309 12 3 2564740.570892, 2.0, -4.0, 4.0, 746.4, 746.4, 0.1473410, 0.5058096, -6.100e-06, -5.710e-06, -0.0898550, -0.0223850, 1.486e-04, 1.700e-07, -21.9449596, -0.0060500, 6.000e-06, 212.7789764, 14.9974222, 0.000e-00, 0.5729930, 0.0000443, -1.000e-05, 0.0267210, 0.0000441, -9.900e-06, 0.0047390, 0.0047154, // 2310 5 29 2564918.420023, 22.0, -4.0, 4.0, 748.0, 748.0, -0.0104760, 0.5706183, 2.250e-05, -9.140e-06, -0.5617030, 0.0362598, -1.179e-04, -4.700e-07, 21.5920792, 0.0063450, -5.000e-06, 150.5268250, 15.0000134, 0.000e-00, 0.5362660, -0.0000862, -1.230e-05, -0.0098230, -0.0000858, -1.230e-05, 0.0046174, 0.0045944, // 2310 11 22 2565094.683557, 4.0, -4.0, 4.0, 749.5, 749.5, -0.1405570, 0.5275977, 3.400e-06, -6.850e-06, 0.6358400, -0.0634873, 1.078e-04, 7.500e-07, -19.8939896, -0.0089840, 5.000e-06, 243.6469269, 14.9988670, 0.000e-00, 0.5600110, 0.0001283, -1.090e-05, 0.0138040, 0.0001276, -1.090e-05, 0.0047280, 0.0047044, // 2311 4 19 2565243.404039, 22.0, -4.0, 4.0, 750.8, 750.8, -0.2168380, 0.5050702, 4.240e-05, -6.250e-06, 1.4060889, 0.1368315, -1.182e-04, -1.650e-06, 11.0535402, 0.0141370, -2.000e-06, 150.1632233, 15.0033998, 0.000e-00, 0.5605100, -0.0001131, -1.040e-05, 0.0143010, -0.0001126, -1.040e-05, 0.0046631, 0.0046399, // 2311 5 19 2565272.936638, 10.0, -4.0, 4.0, 751.0, 751.0, -0.0758910, 0.5349940, 3.610e-05, -7.230e-06, -1.3843390, 0.0716055, -5.760e-05, -8.700e-07, 19.5848904, 0.0089220, -5.000e-06, 330.7879944, 15.0008354, 0.000e-00, 0.5507830, -0.0001114, -1.100e-05, 0.0046220, -0.0001108, -1.100e-05, 0.0046279, 0.0046048, // 2311 10 13 2565419.691771, 5.0, -4.0, 4.0, 752.3, 752.3, -0.1790390, 0.5534841, 1.680e-05, -9.180e-06, -1.3837340, -0.1675859, 1.268e-04, 2.680e-06, -7.3767099, -0.0151670, 1.000e-06, 258.3537903, 15.0040607, 0.000e-00, 0.5365670, 0.0000538, -1.270e-05, -0.0095230, 0.0000536, -1.270e-05, 0.0046774, 0.0046541, // 2311 11 11 2565449.106473, 15.0, -4.0, 4.0, 752.5, 752.5, 0.4806020, 0.5554616, -1.710e-05, -8.600e-06, 1.2068620, -0.1035255, 5.620e-05, 1.540e-06, -17.2023602, -0.0113360, 4.000e-06, 49.0907402, 15.0004778, 0.000e-00, 0.5440480, 0.0000922, -1.230e-05, -0.0020790, 0.0000918, -1.220e-05, 0.0047154, 0.0046919, // 2312 4 7 2565597.471900, 23.0, -4.0, 4.0, 753.8, 753.8, -0.3645600, 0.4835122, 2.790e-05, -5.400e-06, 0.6457330, 0.1446007, -6.270e-05, -1.550e-06, 6.9954000, 0.0152980, -2.000e-06, 164.4917450, 15.0039616, 0.000e-00, 0.5704610, -0.0000154, -9.800e-06, 0.0242020, -0.0000153, -9.700e-06, 0.0046784, 0.0046551, // 2312 10 1 2565774.380855, 21.0, -4.0, 4.0, 755.3, 755.3, -0.2823730, 0.5543690, 2.740e-05, -9.340e-06, -0.6221350, -0.1752802, 5.400e-05, 2.870e-06, -3.3514700, -0.0156520, 0.000e-00, 137.5651703, 15.0047789, 0.000e-00, 0.5345670, -0.0000345, -1.290e-05, -0.0115130, -0.0000343, -1.280e-05, 0.0046633, 0.0046401, // 2313 3 27 2565951.478832, 23.0, -4.0, 4.0, 756.8, 756.8, -0.2409080, 0.4903319, 2.600e-06, -5.780e-06, -0.0770260, 0.1545336, -1.670e-05, -1.750e-06, 2.6720300, 0.0159530, -1.000e-06, 163.6967163, 15.0042152, 0.000e-00, 0.5665670, 0.0000873, -1.020e-05, 0.0203280, 0.0000869, -1.010e-05, 0.0046933, 0.0046700, // 2313 9 21 2566128.997917, 12.0, -4.0, 4.0, 758.4, 758.4, 0.0388790, 0.5311609, 1.160e-05, -7.900e-06, 0.0301440, -0.1695989, -1.250e-05, 2.440e-06, 0.7586400, -0.0157130, 0.000e-00, 1.6361500, 15.0050602, 0.000e-00, 0.5441210, -0.0001112, -1.180e-05, -0.0020070, -0.0001107, -1.170e-05, 0.0046500, 0.0046268, // 2314 3 17 2566305.716602, 5.0, -4.0, 4.0, 759.9, 759.9, 0.1141150, 0.5192349, -2.540e-05, -7.230e-06, -0.7150230, 0.1652514, 3.680e-05, -2.240e-06, -1.6662900, 0.0160830, 0.000e-00, 252.9131775, 15.0041094, 0.000e-00, 0.5527270, 0.0001224, -1.140e-05, 0.0065570, 0.0001217, -1.130e-05, 0.0047069, 0.0046835, // 2314 9 10 2566483.367487, 21.0, -4.0, 4.0, 761.4, 761.4, 0.3351910, 0.5008477, -8.800e-06, -6.240e-06, 0.7594290, -0.1557674, -6.600e-05, 1.860e-06, 4.9202800, -0.0153440, -1.000e-06, 135.6514130, 15.0049267, 0.000e-00, 0.5585550, -0.0001045, -1.040e-05, 0.0123550, -0.0001040, -1.040e-05, 0.0046377, 0.0046146, // 2315 2 5 2566630.812375, 7.0, -4.0, 4.0, 762.7, 762.7, -0.5455220, 0.5701231, 3.200e-06, -9.670e-06, 1.2139950, 0.1174309, 4.130e-05, -1.900e-06, -16.2150002, 0.0121530, 4.000e-06, 281.6918945, 15.0004101, 0.000e-00, 0.5381640, 0.0000353, -1.310e-05, -0.0079340, 0.0000352, -1.300e-05, 0.0047456, 0.0047220, // 2315 3 6 2566660.240510, 18.0, -4.0, 4.0, 763.0, 763.0, 0.5289940, 0.5493902, -4.980e-05, -8.960e-06, -1.2670701, 0.1699763, 1.034e-04, -2.710e-06, -5.8637400, 0.0157220, 1.000e-06, 87.2453995, 15.0036135, 0.000e-00, 0.5400040, 0.0000648, -1.270e-05, -0.0061040, 0.0000645, -1.260e-05, 0.0047191, 0.0046956, // 2315 8 1 2566807.815645, 8.0, -4.0, 4.0, 764.2, 764.2, 0.0033700, 0.4997810, -2.110e-05, -5.630e-06, -1.2941130, -0.0829397, -5.460e-05, 8.700e-07, 18.1585197, -0.0101160, -4.000e-06, 298.2512207, 15.0018492, 0.000e-00, 0.5652240, 0.0000246, -9.700e-06, 0.0189920, 0.0000245, -9.700e-06, 0.0046047, 0.0045818, // 2316 1 25 2566985.462002, 23.0, -4.0, 4.0, 765.8, 765.8, -0.1423750, 0.5677730, -5.000e-07, -9.210e-06, 0.6389130, 0.0811686, 1.038e-04, -1.230e-06, -19.0875492, 0.0099100, 5.000e-06, 162.1472473, 14.9989634, 0.000e-00, 0.5422170, -0.0000758, -1.270e-05, -0.0039010, -0.0000755, -1.270e-05, 0.0047512, 0.0047276, // 2316 7 20 2567161.941870, 11.0, -4.0, 4.0, 767.3, 767.3, 0.1597960, 0.5255291, -3.440e-05, -6.660e-06, -0.5002630, -0.0525267, -1.050e-04, 5.800e-07, 20.5859795, -0.0077130, -5.000e-06, 343.2431946, 15.0007696, 0.000e-00, 0.5548440, 0.0001010, -1.050e-05, 0.0086630, 0.0001005, -1.050e-05, 0.0046008, 0.0045779, // 2317 1 14 2567339.958079, 11.0, -4.0, 4.0, 768.9, 768.9, 0.0054440, 0.5412231, 7.200e-06, -7.460e-06, -0.0295080, 0.0390062, 1.541e-04, -4.400e-07, -21.3349609, 0.0071570, 6.000e-06, 342.9753113, 14.9975863, 0.000e-00, 0.5562970, -0.0001224, -1.140e-05, 0.0101080, -0.0001218, -1.140e-05, 0.0047546, 0.0047309, // 2317 7 9 2567516.362968, 21.0, -4.0, 4.0, 770.4, 770.4, 0.1711760, 0.5613160, -2.790e-05, -8.510e-06, 0.3028830, -0.0166743, -1.665e-04, 1.600e-07, 22.2704105, -0.0050520, -5.000e-06, 133.5172424, 14.9999228, 0.000e-00, 0.5398300, 0.0001011, -1.180e-05, -0.0062760, 0.0001006, -1.180e-05, 0.0045991, 0.0045762, // 2318 1 3 2567694.157806, 16.0, -4.0, 4.0, 771.9, 771.9, 0.1035850, 0.5121481, 9.100e-06, -5.980e-06, -0.7526190, -0.0035446, 1.864e-04, 1.400e-07, -22.8206997, 0.0039290, 6.000e-06, 59.1328583, 14.9965687, 0.000e-00, 0.5710050, -0.0000816, -1.020e-05, 0.0247430, -0.0000812, -1.020e-05, 0.0047552, 0.0047315, // 2318 5 31 2567841.737886, 6.0, -4.0, 4.0, 773.2, 773.2, 0.5224090, 0.5655766, 1.230e-05, -9.570e-06, -1.3812410, 0.1422732, -7.090e-05, -2.560e-06, 21.8038101, 0.0057250, -5.000e-06, 270.4690857, 14.9998989, 0.000e-00, 0.5312260, -0.0000299, -1.280e-05, -0.0148380, -0.0000297, -1.280e-05, 0.0046161, 0.0045931, // 2318 6 29 2567871.021083, 13.0, -4.0, 4.0, 773.5, 773.5, 0.2445490, 0.5828023, -9.500e-06, -9.890e-06, 1.0451440, 0.0242353, -2.267e-04, -5.200e-07, 23.1952896, -0.0022370, -5.000e-06, 13.9841604, 14.9993839, 0.000e-00, 0.5307270, 0.0000171, -1.280e-05, -0.0153340, 0.0000170, -1.270e-05, 0.0046000, 0.0045771, // 2318 12 23 2568048.130162, 15.0, -4.0, 4.0, 775.0, 775.0, -0.1928060, 0.5019814, 1.770e-05, -5.590e-06, -1.4229300, -0.0459502, 2.120e-04, 6.100e-07, -23.3918095, 0.0003960, 6.000e-06, 45.4928093, 14.9962177, 0.000e-00, 0.5749490, 0.0000275, -9.900e-06, 0.0286680, 0.0000274, -9.800e-06, 0.0047520, 0.0047284, // 2319 5 20 2568196.400962, 22.0, -4.0, 4.0, 776.3, 776.3, 0.4447290, 0.5356670, 3.540e-05, -8.180e-06, -0.6735120, 0.1757569, -8.970e-05, -2.840e-06, 19.9191303, 0.0083070, -5.000e-06, 150.7588348, 15.0006876, 0.000e-00, 0.5400630, -0.0001152, -1.200e-05, -0.0060450, -0.0001146, -1.190e-05, 0.0046261, 0.0046031, // 2319 11 13 2568372.558785, 1.0, -4.0, 4.0, 777.9, 777.9, 0.0941360, 0.5045593, 1.860e-05, -6.830e-06, 0.8554540, -0.1963632, 7.380e-05, 2.850e-06, -17.6064796, -0.0108070, 4.000e-06, 199.0572815, 15.0001392, 0.000e-00, 0.5547460, 0.0001336, -1.130e-05, 0.0085650, 0.0001329, -1.120e-05, 0.0047173, 0.0046939, // 2320 5 9 2568550.836497, 8.0, -4.0, 4.0, 779.4, 779.4, -0.0246160, 0.4929424, 5.750e-05, -6.270e-06, -0.0471150, 0.1959776, -9.450e-05, -2.660e-06, 17.3310699, 0.0106470, -4.000e-06, 300.8029175, 15.0016098, 0.000e-00, 0.5558140, -0.0001144, -1.070e-05, 0.0096280, -0.0001138, -1.060e-05, 0.0046384, 0.0046153, // 2320 11 1 2568727.061325, 13.0, -4.0, 4.0, 781.0, 781.0, -0.2099410, 0.5223371, 3.840e-05, -8.360e-06, 0.1921430, -0.2357850, 8.330e-05, 3.970e-06, -14.4282103, -0.0126990, 3.000e-06, 19.1522999, 15.0017099, 0.000e-00, 0.5400660, 0.0000954, -1.260e-05, -0.0060410, 0.0000949, -1.250e-05, 0.0047036, 0.0046802, // 2321 4 28 2568904.967348, 11.0, -4.0, 4.0, 782.5, 782.5, -0.4040220, 0.4610927, 5.620e-05, -5.140e-06, 0.6195490, 0.2109649, -9.810e-05, -2.520e-06, 14.0838003, 0.0126430, -3.000e-06, 345.5567627, 15.0025654, 0.000e-00, 0.5678670, -0.0000400, -9.800e-06, 0.0216210, -0.0000398, -9.800e-06, 0.0046523, 0.0046291, // 2321 10 22 2569081.730068, 6.0, -4.0, 4.0, 784.1, 784.1, -0.0202300, 0.5221569, 3.770e-05, -8.790e-06, -0.6667440, -0.2597958, 1.025e-04, 4.580e-06, -10.8800802, -0.0140710, 2.000e-06, 273.8763123, 15.0030346, 0.000e-00, 0.5351230, -0.0000277, -1.300e-05, -0.0109600, -0.0000275, -1.290e-05, 0.0046896, 0.0046662, // 2322 3 18 2569229.306846, 19.0, -4.0, 4.0, 785.3, 785.3, 0.5400960, 0.4567079, -4.060e-05, -5.500e-06, -1.3738840, 0.2515737, 5.790e-05, -3.230e-06, -1.0151500, 0.0158870, 0.000e-00, 103.0318680, 15.0040092, 0.000e-00, 0.5636060, 0.0001049, -1.050e-05, 0.0173810, 0.0001043, -1.040e-05, 0.0047055, 0.0046821, // 2322 4 17 2569258.968322, 11.0, -4.0, 4.0, 785.6, 785.6, -0.7584640, 0.4555752, 4.900e-05, -5.170e-06, 1.2354870, 0.2292732, -1.067e-04, -2.750e-06, 10.3101501, 0.0141810, -2.000e-06, 345.0486145, 15.0034142, 0.000e-00, 0.5671440, 0.0000626, -1.000e-05, 0.0209010, 0.0000623, -9.900e-06, 0.0046666, 0.0046434, // 2322 9 12 2569406.938964, 11.0, -4.0, 4.0, 786.9, 786.9, 0.8613260, 0.4813705, -3.710e-05, -6.730e-06, 1.0485500, -0.2622932, -8.100e-05, 3.820e-06, 4.2940698, -0.0151800, -1.000e-06, 345.7934265, 15.0049191, 0.000e-00, 0.5476270, -0.0001271, -1.140e-05, 0.0014820, -0.0001265, -1.130e-05, 0.0046389, 0.0046158, // 2322 10 11 2569436.370582, 21.0, -4.0, 4.0, 787.2, 787.2, -0.5705850, 0.4994402, 6.500e-05, -7.600e-06, -1.2107050, -0.2632669, 9.750e-05, 4.230e-06, -7.0032301, -0.0150040, 1.000e-06, 138.2875671, 15.0040207, 0.000e-00, 0.5423470, -0.0001027, -1.210e-05, -0.0037720, -0.0001022, -1.210e-05, 0.0046759, 0.0046526, // 2323 3 8 2569583.628584, 3.0, -4.0, 4.0, 788.5, 788.5, 0.2868190, 0.4878083, -4.650e-05, -7.050e-06, -0.6300300, 0.2640659, 5.470e-05, -4.030e-06, -5.3093100, 0.0155730, 1.000e-06, 222.3304138, 15.0035591, 0.000e-00, 0.5488940, 0.0001154, -1.180e-05, 0.0027420, 0.0001148, -1.180e-05, 0.0047180, 0.0046945, // 2323 9 1 2569761.226494, 17.0, -4.0, 4.0, 790.0, 790.0, 0.0905490, 0.4579474, -1.600e-05, -5.380e-06, 0.6584000, -0.2398243, -7.400e-05, 2.980e-06, 8.3716402, -0.0144460, -2.000e-06, 74.8457565, 15.0044651, 0.000e-00, 0.5616950, -0.0000744, -1.010e-05, 0.0154800, -0.0000741, -1.010e-05, 0.0046278, 0.0046047, // 2324 2 25 2569938.206616, 17.0, -4.0, 4.0, 791.6, 791.6, 0.0095190, 0.5158150, -3.560e-05, -8.540e-06, 0.0337520, 0.2652487, 5.190e-05, -4.610e-06, -9.3696098, 0.0147770, 2.000e-06, 71.8351288, 15.0027370, 0.000e-00, 0.5384210, 0.0000440, -1.300e-05, -0.0076780, 0.0000438, -1.290e-05, 0.0047290, 0.0047055, // 2324 8 20 2570115.269695, 18.0, -4.0, 4.0, 793.1, 793.1, -0.2699610, 0.4548125, -2.280e-05, -5.020e-06, -0.0092790, -0.2203501, -6.150e-05, 2.590e-06, 12.2488003, -0.0132300, -3.000e-06, 89.0340195, 15.0036993, 0.000e-00, 0.5667310, 0.0000208, -9.700e-06, 0.0204900, 0.0000207, -9.700e-06, 0.0046178, 0.0045948, // 2325 2 14 2570292.869863, 9.0, -4.0, 4.0, 794.7, 794.7, -0.2345030, 0.5236004, -1.650e-05, -8.610e-06, 0.6674520, 0.2457781, 4.720e-05, -4.260e-06, -13.1302996, 0.0135090, 3.000e-06, 311.6132202, 15.0015631, 0.000e-00, 0.5395080, -0.0000613, -1.290e-05, -0.0065970, -0.0000610, -1.290e-05, 0.0047387, 0.0047151, // 2325 8 9 2570469.344720, 20.0, -4.0, 4.0, 796.3, 796.3, -0.4762100, 0.4791674, -3.170e-05, -5.800e-06, -0.7476690, -0.2057601, -5.040e-05, 2.640e-06, 15.7139397, -0.0115490, -3.000e-06, 118.4744797, 15.0027370, 0.000e-00, 0.5583490, 0.0001049, -1.030e-05, 0.0121510, 0.0001044, -1.020e-05, 0.0046093, 0.0045864, // 2326 1 5 2570617.826192, 8.0, -4.0, 4.0, 797.6, 797.6, 0.3750050, 0.5220407, -3.080e-05, -6.810e-06, -1.3702700, 0.1074156, 2.198e-04, -1.510e-06, -22.6444302, 0.0042020, 6.000e-06, 298.9339600, 14.9967098, 0.000e-00, 0.5609210, -0.0001217, -1.100e-05, 0.0147090, -0.0001211, -1.090e-05, 0.0047548, 0.0047311, // 2326 2 3 2570647.422784, 22.0, -4.0, 4.0, 797.8, 797.8, -0.6171180, 0.5098879, 5.300e-06, -7.250e-06, 1.2968910, 0.2082731, 4.430e-05, -3.170e-06, -16.5243492, 0.0117250, 4.000e-06, 146.7259064, 15.0001125, 0.000e-00, 0.5519540, -0.0001172, -1.170e-05, 0.0057870, -0.0001166, -1.170e-05, 0.0047469, 0.0047233, // 2326 6 30 2570794.346252, 20.0, -4.0, 4.0, 799.1, 799.1, -0.0128000, 0.5627178, -3.980e-05, -8.900e-06, 1.0259140, -0.0910464, -2.150e-04, 1.600e-06, 23.1171799, -0.0023480, -5.000e-06, 118.9131699, 14.9993858, 0.000e-00, 0.5362430, 0.0000997, -1.220e-05, -0.0098450, 0.0000992, -1.210e-05, 0.0046000, 0.0045771, // 2326 12 25 2570971.942279, 11.0, -4.0, 4.0, 800.7, 800.7, 0.2880410, 0.5031055, -2.170e-05, -5.690e-06, -0.7479570, 0.0615586, 1.862e-04, -8.000e-07, -23.3650398, 0.0007540, 6.000e-06, 345.2577515, 14.9962254, 0.000e-00, 0.5735240, -0.0000584, -1.000e-05, 0.0272500, -0.0000581, -1.000e-05, 0.0047528, 0.0047291, // 2327 6 20 2571149.038202, 13.0, -4.0, 4.0, 802.3, 802.3, 0.0705830, 0.5821634, -1.870e-05, -9.930e-06, 0.2489660, -0.0510259, -1.832e-04, 1.000e-06, 23.3878002, 0.0005630, -6.000e-06, 14.4778996, 14.9991980, 0.000e-00, 0.5303860, -0.0000013, -1.280e-05, -0.0156730, -0.0000013, -1.280e-05, 0.0046033, 0.0045804, // 2327 12 14 2571325.902625, 10.0, -4.0, 4.0, 803.9, 803.9, 0.1741990, 0.5065706, -1.970e-05, -5.740e-06, -0.0906630, 0.0183078, 1.588e-04, -3.100e-07, -23.1145706, -0.0027900, 6.000e-06, 331.6205750, 14.9965143, 0.000e-00, 0.5731390, 0.0000479, -1.000e-05, 0.0268670, 0.0000476, -9.900e-06, 0.0047471, 0.0047234, // 2328 6 9 2571503.731861, 6.0, -4.0, 4.0, 805.4, 805.4, 0.2426180, 0.5702706, 0.000e-00, -9.060e-06, -0.4956030, -0.0066447, -1.334e-04, 2.200e-07, 22.8961201, 0.0034600, -6.000e-06, 270.0455627, 14.9993734, 0.000e-00, 0.5364410, -0.0001026, -1.220e-05, -0.0096480, -0.0001021, -1.220e-05, 0.0046094, 0.0045865, // 2328 12 2 2571680.025431, 13.0, -4.0, 4.0, 807.0, 807.0, 0.2353160, 0.5323821, -2.030e-05, -6.960e-06, 0.5871010, -0.0247613, 1.269e-04, 2.400e-07, -21.9218597, -0.0060870, 6.000e-06, 17.8022709, 14.9975128, 0.000e-00, 0.5598900, 0.0001119, -1.100e-05, 0.0136830, 0.0001114, -1.090e-05, 0.0047381, 0.0047145, // 2329 4 30 2571828.708308, 5.0, -4.0, 4.0, 808.3, 808.3, -0.3273000, 0.5087815, 4.840e-05, -6.240e-06, 1.4335949, 0.1162726, -1.429e-04, -1.380e-06, 14.6484804, 0.0125650, -3.000e-06, 255.6084595, 15.0025206, 0.000e-00, 0.5605040, -0.0001032, -1.040e-05, 0.0142950, -0.0001027, -1.030e-05, 0.0046498, 0.0046266, // 2329 5 29 2571858.236910, 18.0, -4.0, 4.0, 808.6, 808.6, 0.2523020, 0.5367612, 1.590e-05, -7.190e-06, -1.2872970, 0.0345452, -7.960e-05, -3.600e-07, 21.6289692, 0.0062850, -5.000e-06, 90.5063095, 14.9999037, 0.000e-00, 0.5510460, -0.0001274, -1.090e-05, 0.0048840, -0.0001268, -1.090e-05, 0.0046181, 0.0045951, // 2329 10 23 2572005.033604, 13.0, -4.0, 4.0, 809.9, 809.9, -0.2607620, 0.5589770, 2.730e-05, -9.320e-06, -1.3883220, -0.1516879, 1.546e-04, 2.430e-06, -11.3520498, -0.0141730, 2.000e-06, 18.9318104, 15.0029716, 0.000e-00, 0.5368980, 0.0000540, -1.280e-05, -0.0091940, 0.0000537, -1.270e-05, 0.0046913, 0.0046679, // 2329 11 21 2572034.457870, 23.0, -4.0, 4.0, 810.1, 810.1, 0.1578520, 0.5622341, -5.900e-06, -8.780e-06, 1.2421280, -0.0685758, 7.780e-05, 1.000e-06, -19.9329796, -0.0089240, 5.000e-06, 168.6449127, 14.9989414, 0.000e-00, 0.5439860, 0.0000994, -1.240e-05, -0.0021410, 0.0000989, -1.230e-05, 0.0047270, 0.0047035, // 2330 4 19 2572182.770429, 6.0, -4.0, 4.0, 811.5, 811.5, -0.4402010, 0.4873489, 3.460e-05, -5.440e-06, 0.6832250, 0.1312898, -8.750e-05, -1.410e-06, 10.9629002, 0.0141870, -2.000e-06, 270.1428833, 15.0033627, 0.000e-00, 0.5696850, -0.0000061, -9.800e-06, 0.0234300, -0.0000061, -9.700e-06, 0.0046645, 0.0046413, // 2330 10 13 2572359.717837, 5.0, -4.0, 4.0, 813.1, 813.1, -0.3327310, 0.5564143, 3.820e-05, -9.340e-06, -0.6529390, -0.1658292, 8.210e-05, 2.710e-06, -7.5252500, -0.0151380, 1.000e-06, 258.3814697, 15.0040426, 0.000e-00, 0.5356200, -0.0000378, -1.280e-05, -0.0104660, -0.0000376, -1.280e-05, 0.0046773, 0.0046540, // 2331 4 8 2572536.789689, 7.0, -4.0, 4.0, 814.6, 814.6, 0.0117600, 0.4940084, 0.000e-00, -5.860e-06, 0.0460910, 0.1478072, -4.490e-05, -1.690e-06, 6.8961101, 0.0153150, -2.000e-06, 284.4721680, 15.0039864, 0.000e-00, 0.5650860, 0.0000804, -1.020e-05, 0.0188540, 0.0000800, -1.010e-05, 0.0046791, 0.0046558, // 2331 10 2 2572714.318931, 20.0, -4.0, 4.0, 816.2, 816.2, 0.1802600, 0.5299254, 1.370e-05, -7.810e-06, -0.0668820, -0.1666999, 1.680e-05, 2.380e-06, -3.4896500, -0.0156570, 1.000e-06, 122.5961380, 15.0047112, 0.000e-00, 0.5456990, -0.0001201, -1.170e-05, -0.0004360, -0.0001195, -1.170e-05, 0.0046637, 0.0046404, // 2332 3 27 2572891.049697, 13.0, -4.0, 4.0, 817.8, 817.8, 0.1057050, 0.5214304, -1.690e-05, -7.340e-06, -0.6830730, 0.1650820, 1.040e-05, -2.260e-06, 2.6631000, 0.0159290, -1.000e-06, 13.7028198, 15.0042830, 0.000e-00, 0.5510670, 0.0001215, -1.150e-05, 0.0049040, 0.0001209, -1.140e-05, 0.0046931, 0.0046698, // 2332 9 21 2573068.666089, 4.0, -4.0, 4.0, 819.4, 819.4, 0.2404500, 0.4977275, 1.500e-06, -6.130e-06, 0.7279880, -0.1591974, -4.100e-05, 1.880e-06, 0.7292300, -0.0157340, 0.000e-00, 241.6366272, 15.0049858, 0.000e-00, 0.5601610, -0.0000977, -1.040e-05, 0.0139540, -0.0000972, -1.030e-05, 0.0046503, 0.0046271, // 2333 2 15 2573216.176620, 16.0, -4.0, 4.0, 820.7, 820.7, -0.4596200, 0.5643097, 1.800e-06, -9.590e-06, 1.2331940, 0.1445803, 1.230e-05, -2.370e-06, -12.6705399, 0.0139510, 3.000e-06, 56.6304817, 15.0018282, 0.000e-00, 0.5376170, 0.0000227, -1.310e-05, -0.0084780, 0.0000226, -1.300e-05, 0.0047376, 0.0047140, // 2333 3 17 2573245.590892, 2.0, -4.0, 4.0, 821.0, 821.0, 0.3115740, 0.5485629, -3.030e-05, -9.010e-06, -1.3092160, 0.1765302, 7.860e-05, -2.840e-06, -1.5606101, 0.0160590, 0.000e-00, 207.9418335, 15.0041838, 0.000e-00, 0.5388110, 0.0000703, -1.270e-05, -0.0072900, 0.0000700, -1.270e-05, 0.0047063, 0.0046829, // 2333 8 11 2573393.088057, 14.0, -4.0, 4.0, 822.3, 822.3, -0.3484260, 0.4952308, -1.090e-05, -5.600e-06, -1.3115160, -0.1093259, -3.240e-05, 1.170e-06, 15.1815596, -0.0120850, -3.000e-06, 28.5416203, 15.0029573, 0.000e-00, 0.5652870, 0.0000418, -9.800e-06, 0.0190540, 0.0000416, -9.700e-06, 0.0046107, 0.0045877, // 2333 9 10 2573422.737497, 6.0, -4.0, 4.0, 822.6, 822.6, 0.6007360, 0.4823074, -2.980e-05, -5.400e-06, 1.4151900, -0.1506553, -8.310e-05, 1.620e-06, 4.9990401, -0.0153400, -1.000e-06, 270.6210632, 15.0048828, 0.000e-00, 0.5678260, -0.0000163, -9.700e-06, 0.0215810, -0.0000162, -9.700e-06, 0.0046374, 0.0046143, // 2334 2 5 2573570.826728, 8.0, -4.0, 4.0, 823.9, 823.9, -0.0434200, 0.5608347, -7.600e-06, -9.050e-06, 0.6650790, 0.1147460, 7.740e-05, -1.770e-06, -16.0844307, 0.0122420, 4.000e-06, 296.6972656, 15.0004396, 0.000e-00, 0.5424100, -0.0000867, -1.270e-05, -0.0037090, -0.0000862, -1.260e-05, 0.0047458, 0.0047221, // 2334 7 31 2573747.226773, 17.0, -4.0, 4.0, 825.5, 825.5, -0.3221260, 0.5230895, -2.120e-05, -6.720e-06, -0.5155490, -0.0855911, -8.430e-05, 1.020e-06, 18.2070808, -0.0100650, -4.000e-06, 73.2329712, 15.0018854, 0.000e-00, 0.5540560, 0.0001218, -1.060e-05, 0.0078790, 0.0001212, -1.050e-05, 0.0046041, 0.0045812, // 2335 1 25 2573925.312308, 19.0, -4.0, 4.0, 827.1, 827.1, -0.2617350, 0.5354190, 1.030e-05, -7.300e-06, -0.0624540, 0.0765948, 1.355e-04, -9.600e-07, -19.0312099, 0.0099740, 5.000e-06, 102.1491089, 14.9989071, 0.000e-00, 0.5570140, -0.0001116, -1.130e-05, 0.0108220, -0.0001110, -1.130e-05, 0.0047518, 0.0047282, // 2335 7 21 2574101.665147, 4.0, -4.0, 4.0, 828.7, 828.7, 0.0435320, 0.5606041, -3.110e-05, -8.590e-06, 0.2274000, -0.0564031, -1.469e-04, 7.800e-07, 20.5606995, -0.0077300, -5.000e-06, 238.2340851, 15.0008698, 0.000e-00, 0.5390440, 0.0001047, -1.190e-05, -0.0070580, 0.0001042, -1.190e-05, 0.0046002, 0.0045773, // 2336 1 14 2574279.497704, 0.0, -4.0, 4.0, 830.3, 830.3, 0.0814680, 0.5097483, -2.300e-06, -5.920e-06, -0.7423310, 0.0365728, 1.734e-04, -3.300e-07, -21.3431702, 0.0071420, 6.000e-06, 177.9912567, 14.9975004, 0.000e-00, 0.5715490, -0.0000749, -1.020e-05, 0.0252850, -0.0000745, -1.010e-05, 0.0047551, 0.0047314, // 2336 7 9 2574456.332198, 20.0, -4.0, 4.0, 831.9, 831.9, 0.0485670, 0.5834486, -1.160e-05, -9.930e-06, 0.9587390, -0.0198779, -2.127e-04, 2.400e-07, 22.2219505, -0.0051400, -5.000e-06, 118.4983368, 15.0000057, 0.000e-00, 0.5304540, 0.0000233, -1.280e-05, -0.0156060, 0.0000232, -1.270e-05, 0.0045988, 0.0045759, // 2337 1 2 2574633.465089, 23.0, -4.0, 4.0, 833.5, 833.5, -0.0929370, 0.5043672, -2.000e-07, -5.640e-06, -1.4244790, -0.0040179, 2.079e-04, 1.300e-07, -22.8463707, 0.0038300, 6.000e-06, 164.1756439, 14.9965372, 0.000e-00, 0.5749470, 0.0000328, -9.900e-06, 0.0286660, 0.0000326, -9.900e-06, 0.0047549, 0.0047313, // 2337 5 31 2574781.712459, 5.0, -4.0, 4.0, 834.8, 834.8, 0.1537260, 0.5448255, 4.430e-05, -8.250e-06, -0.8347520, 0.1378194, -1.004e-04, -2.220e-06, 21.8527298, 0.0056400, -5.000e-06, 255.4500580, 14.9998131, 0.000e-00, 0.5403670, -0.0001062, -1.190e-05, -0.0057420, -0.0001057, -1.180e-05, 0.0046166, 0.0045936, // 2337 11 23 2574957.901336, 10.0, -4.0, 4.0, 836.4, 836.4, 0.4466320, 0.5177444, 3.700e-06, -7.080e-06, 0.7489450, -0.1638039, 1.006e-04, 2.420e-06, -20.2567291, -0.0083070, 5.000e-06, 333.5491638, 14.9986191, 0.000e-00, 0.5546750, 0.0001158, -1.140e-05, 0.0084940, 0.0001152, -1.130e-05, 0.0047290, 0.0047055, // 2338 5 20 2575136.134953, 15.0, -4.0, 4.0, 838.0, 838.0, -0.0883970, 0.5022415, 5.920e-05, -6.340e-06, -0.1354890, 0.1652681, -1.117e-04, -2.240e-06, 19.9396591, 0.0083060, -5.000e-06, 45.7502403, 15.0005856, 0.000e-00, 0.5560210, -0.0001081, -1.060e-05, 0.0098350, -0.0001076, -1.050e-05, 0.0046270, 0.0046040, // 2338 11 12 2575312.411732, 22.0, -4.0, 4.0, 839.6, 839.6, 0.1043910, 0.5351338, 2.840e-05, -8.620e-06, 0.0807950, -0.2080972, 1.145e-04, 3.540e-06, -17.6754704, -0.0107190, 4.000e-06, 154.0552216, 15.0001822, 0.000e-00, 0.5403050, 0.0000761, -1.270e-05, -0.0058040, 0.0000757, -1.260e-05, 0.0047168, 0.0046933, // 2339 5 9 2575490.255599, 18.0, -4.0, 4.0, 841.2, 841.2, -0.3102840, 0.4706667, 5.570e-05, -5.250e-06, 0.5946220, 0.1876249, -1.185e-04, -2.250e-06, 17.2809105, 0.0107030, -4.000e-06, 90.7923508, 15.0015678, 0.000e-00, 0.5673450, -0.0000354, -9.800e-06, 0.0211020, -0.0000353, -9.700e-06, 0.0046393, 0.0046162, // 2339 11 2 2575667.077661, 14.0, -4.0, 4.0, 842.8, 842.8, -0.1627620, 0.5318497, 5.410e-05, -8.940e-06, -0.5572400, -0.2382891, 1.229e-04, 4.210e-06, -14.5631504, -0.0126200, 3.000e-06, 34.1621399, 15.0016794, 0.000e-00, 0.5360220, -0.0000246, -1.300e-05, -0.0100660, -0.0000245, -1.300e-05, 0.0047037, 0.0046803, // 2340 3 29 2575814.627517, 3.0, -4.0, 4.0, 844.2, 844.2, 0.6881500, 0.4591846, -3.440e-05, -5.580e-06, -1.3265300, 0.2506631, 3.430e-05, -3.250e-06, 3.3100700, 0.0156580, -1.000e-06, 223.8194427, 15.0041227, 0.000e-00, 0.5620100, 0.0001013, -1.050e-05, 0.0157930, 0.0001008, -1.040e-05, 0.0046915, 0.0046681, // 2340 4 27 2575844.264959, 18.0, -4.0, 4.0, 844.4, 844.4, -0.7432590, 0.4650990, 5.480e-05, -5.320e-06, 1.1856600, 0.2124990, -1.269e-04, -2.570e-06, 13.9844999, 0.0126880, -3.000e-06, 90.5414581, 15.0025969, 0.000e-00, 0.5657570, 0.0000702, -1.000e-05, 0.0195220, 0.0000698, -9.900e-06, 0.0046528, 0.0046296, // 2340 9 22 2575992.251089, 18.0, -4.0, 4.0, 845.8, 845.8, 0.6613830, 0.4777553, -1.640e-05, -6.590e-06, 1.2254540, -0.2642002, -6.620e-05, 3.800e-06, 0.0902000, -0.0155040, 0.000e-00, 91.7850113, 15.0049162, 0.000e-00, 0.5493300, -0.0001163, -1.130e-05, 0.0031770, -0.0001157, -1.130e-05, 0.0046517, 0.0046285, // 2340 10 22 2576021.705188, 5.0, -4.0, 4.0, 846.1, 846.1, -0.5375950, 0.5049522, 7.440e-05, -7.620e-06, -1.1884320, -0.2485156, 1.208e-04, 3.970e-06, -11.0034199, -0.0140550, 2.000e-06, 258.8903809, 15.0029583, 0.000e-00, 0.5438820, -0.0001051, -1.210e-05, -0.0022440, -0.0001045, -1.200e-05, 0.0046901, 0.0046667, // 2341 3 18 2576168.971063, 11.0, -4.0, 4.0, 847.4, 847.4, 0.1969460, 0.4869513, -2.940e-05, -7.110e-06, -0.7067040, 0.2696155, 3.440e-05, -4.150e-06, -0.9912500, 0.0158440, 0.000e-00, 343.0372620, 15.0040760, 0.000e-00, 0.5473390, 0.0001185, -1.190e-05, 0.0011960, 0.0001179, -1.180e-05, 0.0047051, 0.0046817, // 2341 9 12 2576346.515821, 0.0, -4.0, 4.0, 849.0, 849.0, 0.1625240, 0.4518903, -9.000e-06, -5.260e-06, 0.7034690, -0.2476980, -5.460e-05, 3.040e-06, 4.3140998, -0.0152080, -1.000e-06, 180.7801514, 15.0048532, 0.000e-00, 0.5630730, -0.0000709, -1.010e-05, 0.0168510, -0.0000705, -1.000e-05, 0.0046391, 0.0046160, // 2342 3 8 2576523.564050, 2.0, -4.0, 4.0, 850.6, 850.6, 0.2327390, 0.5103115, -3.340e-05, -8.470e-06, 0.1346620, 0.2773375, 2.080e-05, -4.820e-06, -5.1729999, 0.0155600, 1.000e-06, 207.3549652, 15.0036278, 0.000e-00, 0.5375370, 0.0000275, -1.300e-05, -0.0085580, 0.0000274, -1.290e-05, 0.0047177, 0.0046942, // 2342 9 1 2576700.546470, 1.0, -4.0, 4.0, 852.2, 852.2, -0.0739020, 0.4476916, -2.200e-05, -4.930e-06, -0.0155030, -0.2345944, -4.040e-05, 2.750e-06, 8.4652901, -0.0144300, -2.000e-06, 194.8160248, 15.0044336, 0.000e-00, 0.5672400, 0.0000207, -9.700e-06, 0.0209970, 0.0000206, -9.700e-06, 0.0046273, 0.0046042, // 2343 2 25 2576878.230762, 18.0, -4.0, 4.0, 853.9, 853.9, -0.0788200, 0.5137570, -1.320e-05, -8.400e-06, 0.7367790, 0.2640835, 1.750e-05, -4.540e-06, -9.2097797, 0.0148230, 2.000e-06, 86.8587494, 15.0027666, 0.000e-00, 0.5393480, -0.0000752, -1.290e-05, -0.0067560, -0.0000748, -1.280e-05, 0.0047291, 0.0047056, // 2343 8 21 2577054.629919, 3.0, -4.0, 4.0, 855.5, 855.5, -0.4011140, 0.4712323, -2.890e-05, -5.750e-06, -0.6899460, -0.2271284, -3.070e-05, 2.920e-06, 12.3208704, -0.0131800, -3.000e-06, 224.0132446, 15.0037270, 0.000e-00, 0.5580240, 0.0001059, -1.040e-05, 0.0118280, 0.0001054, -1.030e-05, 0.0046169, 0.0045939, // 2344 1 16 2577203.176165, 16.0, -4.0, 4.0, 856.8, 856.8, 0.2786210, 0.5105067, -3.590e-05, -6.570e-06, -1.4047300, 0.1469597, 2.050e-04, -2.010e-06, -21.0318394, 0.0073620, 5.000e-06, 57.8409119, 14.9976931, 0.000e-00, 0.5617460, -0.0001122, -1.090e-05, 0.0155300, -0.0001116, -1.090e-05, 0.0047544, 0.0047307, // 2344 2 15 2577232.776367, 7.0, -4.0, 4.0, 857.1, 857.1, -0.4212380, 0.4976556, 3.300e-06, -7.010e-06, 1.3793150, 0.2322838, 1.600e-05, -3.490e-06, -13.0263901, 0.0135870, 3.000e-06, 281.6243286, 15.0015316, 0.000e-00, 0.5522540, -0.0001307, -1.170e-05, 0.0060850, -0.0001300, -1.160e-05, 0.0047392, 0.0047156, // 2344 7 11 2577379.652252, 4.0, -4.0, 4.0, 858.5, 858.5, 0.4451730, 0.5557726, -7.160e-05, -8.830e-06, 1.0055521, -0.1337798, -2.022e-04, 2.300e-06, 22.0401897, -0.0052430, -5.000e-06, 238.4429321, 15.0000420, 0.000e-00, 0.5355570, 0.0000800, -1.220e-05, -0.0105270, 0.0000796, -1.220e-05, 0.0045991, 0.0045762, // 2344 8 9 2577408.999360, 12.0, -4.0, 4.0, 858.7, 858.7, -0.5788970, 0.5115009, -2.610e-05, -7.470e-06, -1.3810110, -0.2178533, -1.770e-05, 3.320e-06, 15.6917000, -0.0115310, -4.000e-06, 358.4682007, 15.0028276, 0.000e-00, 0.5424910, 0.0001150, -1.160e-05, -0.0036280, 0.0001145, -1.160e-05, 0.0046085, 0.0045856, // 2345 1 4 2577557.278047, 19.0, -4.0, 4.0, 860.1, 860.1, 0.3217300, 0.4955486, -3.550e-05, -5.570e-06, -0.7372090, 0.1028240, 1.783e-04, -1.280e-06, -22.6601391, 0.0041640, 6.000e-06, 103.9664078, 14.9966316, 0.000e-00, 0.5740360, -0.0000531, -1.000e-05, 0.0277590, -0.0000528, -9.900e-06, 0.0047552, 0.0047315, // 2345 6 30 2577734.351589, 20.0, -4.0, 4.0, 861.7, 861.7, -0.1985600, 0.5764063, -1.700e-05, -9.820e-06, 0.3644870, -0.0963926, -1.852e-04, 1.780e-06, 23.0901909, -0.0024510, -5.000e-06, 118.8798981, 14.9994345, 0.000e-00, 0.5302170, 0.0000062, -1.280e-05, -0.0158410, 0.0000061, -1.280e-05, 0.0046000, 0.0045771, // 2345 12 24 2577911.236855, 18.0, -4.0, 4.0, 863.3, 863.3, 0.1718970, 0.5039672, -3.360e-05, -5.720e-06, -0.0882200, 0.0607008, 1.599e-04, -8.100e-07, -23.3706207, 0.0006500, 6.000e-06, 90.3122025, 14.9962320, 0.000e-00, 0.5730740, 0.0000524, -1.000e-05, 0.0268020, 0.0000522, -1.000e-05, 0.0047523, 0.0047287, // 2346 6 20 2578089.040782, 13.0, -4.0, 4.0, 865.0, 865.0, -0.0259290, 0.5664406, 5.000e-07, -8.910e-06, -0.4217880, -0.0511125, -1.418e-04, 9.300e-07, 23.3905602, 0.0004450, -6.000e-06, 14.4441996, 14.9991541, 0.000e-00, 0.5368650, -0.0000960, -1.220e-05, -0.0092260, -0.0000955, -1.210e-05, 0.0046037, 0.0045808, // 2346 12 13 2578265.371945, 21.0, -4.0, 4.0, 866.6, 866.6, 0.0194890, 0.5342919, -2.440e-05, -7.050e-06, 0.5858360, 0.0180138, 1.371e-04, -3.400e-07, -23.1032600, -0.0028380, 6.000e-06, 136.6499634, 14.9966040, 0.000e-00, 0.5595040, 0.0001196, -1.110e-05, 0.0132990, 0.0001190, -1.100e-05, 0.0047460, 0.0047224, // 2347 5 11 2578414.004954, 12.0, -4.0, 4.0, 868.0, 868.0, -0.3255960, 0.5127424, 4.650e-05, -6.240e-06, 1.5014210, 0.0897770, -1.677e-04, -1.050e-06, 17.7547493, 0.0105620, -4.000e-06, 0.8048200, 15.0014954, 0.000e-00, 0.5605050, -0.0000967, -1.030e-05, 0.0142960, -0.0000962, -1.020e-05, 0.0046371, 0.0046140, // 2347 6 10 2578443.531044, 1.0, -4.0, 4.0, 868.2, 868.2, 0.1234140, 0.5359009, 1.080e-05, -7.100e-06, -1.2343100, -0.0057928, -9.410e-05, 1.900e-07, 22.9114704, 0.0034020, -6.000e-06, 195.0273743, 14.9992743, 0.000e-00, 0.5515230, -0.0001243, -1.080e-05, 0.0053580, -0.0001237, -1.080e-05, 0.0046101, 0.0045872, // 2347 11 3 2578590.381469, 21.0, -4.0, 4.0, 869.6, 869.6, -0.4047310, 0.5656296, 3.790e-05, -9.480e-06, -1.3783450, -0.1282564, 1.819e-04, 2.050e-06, -14.9859505, -0.0126580, 3.000e-06, 139.1678619, 15.0015802, 0.000e-00, 0.5372670, 0.0000577, -1.290e-05, -0.0088270, 0.0000574, -1.280e-05, 0.0047052, 0.0046818, // 2347 12 3 2578619.814969, 8.0, -4.0, 4.0, 869.9, 869.9, 0.3094210, 0.5670386, -2.160e-05, -8.910e-06, 1.2223490, -0.0272462, 9.690e-05, 3.400e-07, -21.9477901, -0.0060260, 6.000e-06, 302.7918701, 14.9975920, 0.000e-00, 0.5439540, 0.0000851, -1.240e-05, -0.0021730, 0.0000846, -1.240e-05, 0.0047373, 0.0047137, // 2348 4 29 2578768.061811, 13.0, -4.0, 4.0, 871.2, 871.2, -0.4226220, 0.4923179, 3.560e-05, -5.500e-06, 0.7590170, 0.1118907, -1.131e-04, -1.190e-06, 14.5643597, 0.0126220, -3.000e-06, 15.6029596, 15.0024967, 0.000e-00, 0.5688710, 0.0000000, -9.700e-06, 0.0226200, 0.0000000, -9.700e-06, 0.0046509, 0.0046277, // 2348 10 23 2578945.060371, 13.0, -4.0, 4.0, 872.9, 872.9, -0.4458340, 0.5602102, 5.030e-05, -9.360e-06, -0.6641200, -0.1490469, 1.100e-04, 2.420e-06, -11.4924097, -0.0141290, 2.000e-06, 18.9425907, 15.0029316, 0.000e-00, 0.5367300, -0.0000375, -1.280e-05, -0.0093610, -0.0000373, -1.280e-05, 0.0046915, 0.0046682, // 2349 4 18 2579122.095043, 14.0, -4.0, 4.0, 874.5, 874.5, -0.1637790, 0.4994352, 1.090e-05, -5.980e-06, 0.0489720, 0.1347571, -6.880e-05, -1.550e-06, 10.8682404, 0.0142130, -2.000e-06, 30.1328106, 15.0034037, 0.000e-00, 0.5634930, 0.0000912, -1.020e-05, 0.0172690, 0.0000907, -1.020e-05, 0.0046650, 0.0046418, // 2349 10 13 2579299.645067, 3.0, -4.0, 4.0, 876.1, 876.1, -0.2706880, 0.5306824, 4.110e-05, -7.720e-06, 0.0246170, -0.1570523, 3.870e-05, 2.210e-06, -7.6441898, -0.0151320, 1.000e-06, 228.3996582, 15.0039587, 0.000e-00, 0.5474420, -0.0001024, -1.170e-05, 0.0012980, -0.0001019, -1.160e-05, 0.0046778, 0.0046545, // 2350 4 7 2579476.379201, 21.0, -4.0, 4.0, 877.8, 877.8, 0.1326970, 0.5257703, -1.060e-05, -7.480e-06, -0.6338220, 0.1580253, -1.650e-05, -2.180e-06, 6.8907700, 0.0152920, -2.000e-06, 134.4693756, 15.0040569, 0.000e-00, 0.5493890, 0.0001185, -1.150e-05, 0.0032360, 0.0001179, -1.140e-05, 0.0046789, 0.0046556, // 2350 10 2 2579653.968140, 11.0, -4.0, 4.0, 879.4, 879.4, 0.0972920, 0.4966399, 1.390e-05, -6.060e-06, 0.7170270, -0.1563752, -1.640e-05, 1.830e-06, -3.5011499, -0.0156770, 1.000e-06, 347.5955200, 15.0046358, 0.000e-00, 0.5618100, -0.0000890, -1.040e-05, 0.0155950, -0.0000886, -1.030e-05, 0.0046639, 0.0046407, // 2351 2 27 2579801.539029, 1.0, -4.0, 4.0, 880.8, 880.8, -0.3361450, 0.5593794, 1.900e-06, -9.520e-06, 1.2779050, 0.1639725, -1.820e-05, -2.700e-06, -8.7042599, 0.0151910, 2.000e-06, 191.9073029, 15.0030079, 0.000e-00, 0.5369980, 0.0000090, -1.310e-05, -0.0090940, 0.0000089, -1.300e-05, 0.0047277, 0.0047042, // 2351 3 28 2579830.938160, 11.0, -4.0, 4.0, 881.1, 881.1, 0.6659890, 0.5499366, -3.860e-05, -9.070e-06, -1.1651371, 0.1758742, 4.540e-05, -2.840e-06, 2.7894700, 0.0158920, -1.000e-06, 343.7222900, 15.0043449, 0.000e-00, 0.5376580, 0.0000483, -1.270e-05, -0.0084370, 0.0000481, -1.270e-05, 0.0046925, 0.0046691, // 2351 8 22 2579978.363045, 21.0, -4.0, 4.0, 882.4, 882.4, -0.2261270, 0.4908097, -1.350e-05, -5.570e-06, -1.4217110, -0.1301015, -6.000e-06, 1.410e-06, 11.7181702, -0.0136450, -3.000e-06, 134.1269989, 15.0039206, 0.000e-00, 0.5654540, 0.0000406, -9.800e-06, 0.0192210, 0.0000404, -9.700e-06, 0.0046186, 0.0045956, // 2351 9 21 2580008.023224, 13.0, -4.0, 4.0, 882.7, 882.7, 0.6612750, 0.4805921, -2.580e-05, -5.370e-06, 1.3277420, -0.1544671, -5.720e-05, 1.660e-06, 0.8143200, -0.0157380, 0.000e-00, 16.6149006, 15.0049524, 0.000e-00, 0.5687360, -0.0000126, -9.700e-06, 0.0224860, -0.0000125, -9.700e-06, 0.0046500, 0.0046269, // 2352 2 16 2580156.188955, 17.0, -4.0, 4.0, 884.1, 884.1, 0.0922330, 0.5536978, -1.190e-05, -8.880e-06, 0.7156650, 0.1407971, 4.800e-05, -2.190e-06, -12.5171204, 0.0140230, 3.000e-06, 71.6384506, 15.0018492, 0.000e-00, 0.5424870, -0.0000987, -1.260e-05, -0.0036330, -0.0000982, -1.250e-05, 0.0047378, 0.0047142, // 2352 8 11 2580332.514984, 0.0, -4.0, 4.0, 885.7, 885.7, -0.3228760, 0.5196542, -2.240e-05, -6.740e-06, -0.5810130, -0.1136008, -5.910e-05, 1.390e-06, 15.2306805, -0.0120430, -3.000e-06, 178.5269775, 15.0030041, 0.000e-00, 0.5534980, 0.0001230, -1.070e-05, 0.0073240, 0.0001223, -1.060e-05, 0.0046098, 0.0045869, // 2353 2 5 2580510.664526, 4.0, -4.0, 4.0, 887.4, 887.4, 0.0307310, 0.5282550, -4.800e-06, -7.150e-06, -0.0120150, 0.1080497, 1.097e-04, -1.380e-06, -16.0146103, 0.0123020, 4.000e-06, 236.7027130, 15.0003834, 0.000e-00, 0.5574640, -0.0001242, -1.130e-05, 0.0112690, -0.0001235, -1.120e-05, 0.0047465, 0.0047229, // 2353 7 31 2580686.970211, 11.0, -4.0, 4.0, 889.0, 889.0, -0.1337020, 0.5577470, -2.790e-05, -8.630e-06, 0.1799410, -0.0916094, -1.239e-04, 1.340e-06, 18.1631107, -0.0100830, -4.000e-06, 343.2200928, 15.0019932, 0.000e-00, 0.5384000, 0.0001097, -1.200e-05, -0.0076990, 0.0001092, -1.190e-05, 0.0046034, 0.0045804, // 2354 1 25 2580864.835651, 8.0, -4.0, 4.0, 890.7, 890.7, 0.0763760, 0.5049216, -1.040e-05, -5.830e-06, -0.7354020, 0.0721026, 1.539e-04, -7.500e-07, -19.0455303, 0.0099670, 5.000e-06, 297.1672974, 14.9988155, 0.000e-00, 0.5719160, -0.0000690, -1.010e-05, 0.0256500, -0.0000687, -1.010e-05, 0.0047527, 0.0047290, // 2354 7 21 2581041.644694, 3.0, -4.0, 4.0, 892.3, 892.3, -0.1821410, 0.5809525, -8.800e-06, -9.910e-06, 0.9109020, -0.0606985, -1.938e-04, 9.400e-07, 20.4863605, -0.0078080, -4.000e-06, 223.2124634, 15.0009632, 0.000e-00, 0.5303330, 0.0000302, -1.280e-05, -0.0157250, 0.0000301, -1.270e-05, 0.0045996, 0.0045767, // 2355 1 14 2581218.800233, 7.0, -4.0, 4.0, 894.0, 894.0, -0.0031660, 0.5035233, -1.560e-05, -5.640e-06, -1.4195460, 0.0357012, 1.950e-04, -3.300e-07, -21.3952808, 0.0070510, 5.000e-06, 283.0343323, 14.9974480, 0.000e-00, 0.5747420, 0.0000380, -9.900e-06, 0.0284620, 0.0000378, -9.900e-06, 0.0047553, 0.0047316, // 2355 6 11 2581367.019648, 12.0, -4.0, 4.0, 895.4, 895.4, -0.1027820, 0.5518337, 4.710e-05, -8.280e-06, -0.9512570, 0.0960043, -1.076e-04, -1.560e-06, 23.0265694, 0.0027310, -6.000e-06, 359.9406738, 14.9992571, 0.000e-00, 0.5407920, -0.0000996, -1.180e-05, -0.0053190, -0.0000991, -1.170e-05, 0.0046089, 0.0045859, // 2355 12 4 2581543.249042, 18.0, -4.0, 4.0, 897.0, 897.0, 0.2103100, 0.5300880, 7.600e-06, -7.340e-06, 0.8348740, -0.1253554, 1.147e-04, 1.900e-06, -22.1544991, -0.0053550, 6.000e-06, 92.6552963, 14.9973440, 0.000e-00, 0.5543690, 0.0001231, -1.150e-05, 0.0081900, 0.0001225, -1.140e-05, 0.0047388, 0.0047152, // 2356 5 30 2581721.427295, 22.0, -4.0, 4.0, 898.7, 898.7, -0.0876070, 0.5107758, 5.380e-05, -6.400e-06, -0.2012480, 0.1297172, -1.263e-04, -1.760e-06, 21.8651905, 0.0056300, -5.000e-06, 150.4400482, 14.9997091, 0.000e-00, 0.5563220, -0.0001046, -1.050e-05, 0.0101340, -0.0001041, -1.040e-05, 0.0046176, 0.0045946, // 2356 11 23 2581897.767307, 6.0, -4.0, 4.0, 900.3, 900.3, -0.1880950, 0.5484087, 4.250e-05, -8.910e-06, 0.1976050, -0.1735079, 1.323e-04, 3.000e-06, -20.3006191, -0.0082220, 5.000e-06, 273.5382385, 14.9986773, 0.000e-00, 0.5403870, 0.0000850, -1.270e-05, -0.0057220, 0.0000846, -1.270e-05, 0.0047281, 0.0047046, // 2357 5 20 2582075.537764, 1.0, -4.0, 4.0, 902.0, 902.0, -0.1419500, 0.4808096, 4.870e-05, -5.370e-06, 0.5808690, 0.1588194, -1.376e-04, -1.910e-06, 19.8977909, 0.0083660, -5.000e-06, 195.7515564, 15.0005388, 0.000e-00, 0.5668930, -0.0000334, -9.700e-06, 0.0206520, -0.0000332, -9.700e-06, 0.0046282, 0.0046052, // 2357 11 12 2582252.430820, 22.0, -4.0, 4.0, 903.7, 903.7, -0.3828820, 0.5432685, 7.030e-05, -9.130e-06, -0.4433400, -0.2095392, 1.433e-04, 3.720e-06, -17.7784100, -0.0106280, 4.000e-06, 154.0467377, 15.0001574, 0.000e-00, 0.5368880, -0.0000180, -1.300e-05, -0.0092040, -0.0000179, -1.300e-05, 0.0047165, 0.0046930, // 2358 4 9 2582399.942816, 11.0, -4.0, 4.0, 905.1, 905.1, 0.8837810, 0.4649599, -3.090e-05, -5.710e-06, -1.2652251, 0.2436901, 1.030e-05, -3.190e-06, 7.5070901, 0.0149490, -2.000e-06, 344.5838013, 15.0038424, 0.000e-00, 0.5603800, 0.0000948, -1.050e-05, 0.0141720, 0.0000944, -1.050e-05, 0.0046773, 0.0046540, // 2358 5 9 2582429.556417, 1.0, -4.0, 4.0, 905.3, 905.3, -0.6581170, 0.4763262, 5.480e-05, -5.500e-06, 1.1620100, 0.1898025, -1.474e-04, -2.330e-06, 17.1958599, 0.0107600, -4.000e-06, 195.7847748, 15.0016041, 0.000e-00, 0.5643950, 0.0000753, -1.000e-05, 0.0181670, 0.0000749, -9.900e-06, 0.0046400, 0.0046169, // 2358 10 4 2582577.567116, 2.0, -4.0, 4.0, 906.7, 906.7, 0.8778600, 0.4774268, -1.270e-05, -6.520e-06, 1.1688900, -0.2601647, -4.090e-05, 3.710e-06, -4.1529999, -0.0153760, 1.000e-06, 212.7311096, 15.0045023, 0.000e-00, 0.5509810, -0.0001259, -1.130e-05, 0.0048200, -0.0001252, -1.120e-05, 0.0046655, 0.0046423, // 2358 11 2 2582607.044441, 13.0, -4.0, 4.0, 907.0, 907.0, -0.5506290, 0.5130042, 8.310e-05, -7.680e-06, -1.1522280, -0.2269941, 1.444e-04, 3.620e-06, -14.6731701, -0.0125840, 3.000e-06, 19.1639099, 15.0015926, 0.000e-00, 0.5454310, -0.0001046, -1.200e-05, -0.0007040, -0.0001040, -1.200e-05, 0.0047040, 0.0046806, // 2359 3 29 2582754.308869, 19.0, -4.0, 4.0, 908.4, 908.4, 0.1552580, 0.4896551, -1.430e-05, -7.220e-06, -0.7622470, 0.2686823, 1.390e-05, -4.180e-06, 3.3322599, 0.0156130, -1.000e-06, 103.8274002, 15.0041885, 0.000e-00, 0.5457410, 0.0001187, -1.190e-05, -0.0003940, 0.0001181, -1.190e-05, 0.0046911, 0.0046678, // 2359 9 23 2582931.808822, 7.0, -4.0, 4.0, 910.1, 910.1, 0.1846330, 0.4488894, 9.000e-07, -5.180e-06, 0.7664890, -0.2498919, -3.580e-05, 3.050e-06, 0.1125000, -0.0155360, 0.000e-00, 286.7749939, 15.0048494, 0.000e-00, 0.5645270, -0.0000655, -1.010e-05, 0.0182970, -0.0000651, -1.000e-05, 0.0046521, 0.0046289, // 2360 3 18 2583108.916225, 10.0, -4.0, 4.0, 911.7, 911.7, 0.0139940, 0.5084009, -8.100e-06, -8.470e-06, -0.0125050, 0.2823710, 3.600e-06, -4.920e-06, -0.8540200, 0.0158130, 0.000e-00, 328.0684814, 15.0041342, 0.000e-00, 0.5365550, 0.0000336, -1.300e-05, -0.0095350, 0.0000335, -1.290e-05, 0.0047044, 0.0046810, // 2360 9 11 2583285.828065, 8.0, -4.0, 4.0, 913.4, 913.4, 0.0677640, 0.4431704, -1.760e-05, -4.880e-06, -0.0093880, -0.2432558, -1.990e-05, 2.850e-06, 4.4154501, -0.0152030, -1.000e-06, 300.7534180, 15.0048285, 0.000e-00, 0.5678350, 0.0000226, -9.700e-06, 0.0215890, 0.0000225, -9.700e-06, 0.0046389, 0.0046158, // 2361 3 8 2583463.587449, 2.0, -4.0, 4.0, 915.1, 915.1, -0.3716270, 0.5070069, 1.420e-05, -8.240e-06, 0.5655020, 0.2750770, 1.000e-06, -4.690e-06, -5.0210700, 0.0155840, 1.000e-06, 207.3845825, 15.0036411, 0.000e-00, 0.5391760, -0.0000657, -1.280e-05, -0.0069270, -0.0000654, -1.270e-05, 0.0047175, 0.0046940, // 2361 8 31 2583639.919797, 10.0, -4.0, 4.0, 916.7, 916.7, -0.3685400, 0.4652364, -2.190e-05, -5.720e-06, -0.6210770, -0.2427527, -1.140e-05, 3.140e-06, 8.5441103, -0.0143870, -2.000e-06, 329.7906799, 15.0044689, 0.000e-00, 0.5577870, 0.0001089, -1.040e-05, 0.0115910, 0.0001083, -1.040e-05, 0.0046264, 0.0046034, // 2362 1 27 2583788.524997, 1.0, -4.0, 4.0, 918.2, 918.2, 0.6908470, 0.4975373, -5.510e-05, -6.340e-06, -1.2774349, 0.1814070, 1.782e-04, -2.450e-06, -18.6037102, 0.0101260, 4.000e-06, 192.0665741, 14.9990358, 0.000e-00, 0.5622940, -0.0001249, -1.090e-05, 0.0160760, -0.0001243, -1.080e-05, 0.0047515, 0.0047278, // 2362 2 25 2583818.126421, 15.0, -4.0, 4.0, 918.4, 918.4, -0.6621750, 0.4876324, 2.310e-05, -6.790e-06, 1.2551080, 0.2491185, -2.900e-06, -3.690e-06, -9.1099396, 0.0148850, 2.000e-06, 41.8725014, 15.0027237, 0.000e-00, 0.5525710, -0.0001224, -1.160e-05, 0.0064020, -0.0001218, -1.150e-05, 0.0047296, 0.0047061, // 2362 7 22 2583964.959195, 11.0, -4.0, 4.0, 919.8, 919.8, 0.3349260, 0.5466870, -7.200e-05, -8.750e-06, 1.1025209, -0.1722296, -1.897e-04, 2.940e-06, 20.2134609, -0.0078750, -4.000e-06, 343.1979370, 15.0010157, 0.000e-00, 0.5349260, 0.0000850, -1.230e-05, -0.0111550, 0.0000846, -1.230e-05, 0.0046001, 0.0045772, // 2362 8 20 2583994.304287, 19.0, -4.0, 4.0, 920.1, 920.1, -0.7669930, 0.5032986, -1.090e-05, -7.430e-06, -1.2115060, -0.2408025, -2.000e-06, 3.700e-06, 12.2971201, -0.0131540, -3.000e-06, 104.0115433, 15.0038166, 0.000e-00, 0.5420150, 0.0001210, -1.170e-05, -0.0041020, 0.0001204, -1.170e-05, 0.0046159, 0.0045929, // 2363 1 16 2584142.614661, 3.0, -4.0, 4.0, 921.5, 921.5, 0.3418970, 0.4854562, -4.490e-05, -5.420e-06, -0.7291310, 0.1407785, 1.626e-04, -1.710e-06, -21.0587101, 0.0073350, 5.000e-06, 222.8610992, 14.9976053, 0.000e-00, 0.5743600, -0.0000473, -1.000e-05, 0.0280810, -0.0000471, -9.900e-06, 0.0047552, 0.0047315, // 2363 7 12 2584319.663234, 4.0, -4.0, 4.0, 923.2, 923.2, 0.1426430, 0.5673533, -4.370e-05, -9.640e-06, 0.3780880, -0.1396963, -1.739e-04, 2.530e-06, 21.9841404, -0.0053350, -5.000e-06, 238.4197083, 15.0001078, 0.000e-00, 0.5302030, -0.0000131, -1.280e-05, -0.0158550, -0.0000130, -1.270e-05, 0.0045987, 0.0045758, // 2364 1 5 2584496.574170, 2.0, -4.0, 4.0, 924.9, 924.9, 0.1328790, 0.4980009, -4.470e-05, -5.670e-06, -0.0911780, 0.1024001, 1.519e-04, -1.300e-06, -22.6926003, 0.0040650, 6.000e-06, 209.0113373, 14.9966154, 0.000e-00, 0.5728250, 0.0000582, -1.010e-05, 0.0265540, 0.0000580, -1.000e-05, 0.0047552, 0.0047315, // 2364 6 30 2584674.347078, 20.0, -4.0, 4.0, 926.6, 926.6, -0.2430660, 0.5590403, -1.100e-06, -8.700e-06, -0.3130170, -0.0951225, -1.435e-04, 1.620e-06, 23.0622196, -0.0025680, -5.000e-06, 118.8501511, 14.9994078, 0.000e-00, 0.5374400, -0.0000907, -1.210e-05, -0.0086540, -0.0000903, -1.200e-05, 0.0046003, 0.0045773, // 2364 12 24 2584850.721513, 5.0, -4.0, 4.0, 928.2, 928.2, -0.2359150, 0.5325875, -2.800e-05, -7.090e-06, 0.5513930, 0.0627972, 1.392e-04, -9.500e-07, -23.3722401, 0.0005950, 6.000e-06, 255.3398743, 14.9963112, 0.000e-00, 0.5589610, 0.0001286, -1.120e-05, 0.0127600, 0.0001280, -1.110e-05, 0.0047515, 0.0047279, // 2365 6 20 2585028.822377, 8.0, -4.0, 4.0, 929.9, 929.9, 0.0360010, 0.5318622, 2.300e-06, -6.960e-06, -1.1702050, -0.0477650, -1.016e-04, 7.500e-07, 23.3909798, 0.0003780, -6.000e-06, 299.4188538, 14.9990644, 0.000e-00, 0.5521180, -0.0001223, -1.080e-05, 0.0059510, -0.0001217, -1.070e-05, 0.0046044, 0.0045815, // 2365 11 14 2585175.734414, 6.0, -4.0, 4.0, 931.3, 931.3, -0.0289730, 0.5725318, 1.790e-05, -9.630e-06, -1.4697800, -0.0969432, 2.131e-04, 1.530e-06, -18.1420307, -0.0105980, 4.000e-06, 274.0059509, 15.0000334, 0.000e-00, 0.5376490, 0.0000387, -1.290e-05, -0.0084470, 0.0000385, -1.290e-05, 0.0047179, 0.0046944, // 2365 12 13 2585205.175481, 16.0, -4.0, 4.0, 931.6, 931.6, -0.1598510, 0.5687022, -1.160e-05, -9.010e-06, 1.2184920, 0.0183551, 1.078e-04, -3.900e-07, -23.1137791, -0.0027810, 6.000e-06, 61.6400414, 14.9966908, 0.000e-00, 0.5437270, 0.0000974, -1.250e-05, -0.0023990, 0.0000969, -1.250e-05, 0.0047452, 0.0047216, // 2366 5 10 2585353.348699, 20.0, -4.0, 4.0, 933.0, 933.0, -0.3372260, 0.4976390, 3.090e-05, -5.570e-06, 0.8529050, 0.0865567, -1.381e-04, -9.000e-07, 17.6881504, 0.0106240, -4.000e-06, 120.7894897, 15.0014725, 0.000e-00, 0.5680760, 0.0000042, -9.700e-06, 0.0218290, 0.0000042, -9.700e-06, 0.0046383, 0.0046152, // 2366 11 3 2585530.406995, 22.0, -4.0, 4.0, 934.7, 934.7, -0.0382770, 0.5651816, 3.330e-05, -9.410e-06, -0.7972310, -0.1245890, 1.440e-04, 2.000e-06, -15.1207600, -0.0125890, 3.000e-06, 154.1738739, 15.0015278, 0.000e-00, 0.5378010, -0.0000603, -1.280e-05, -0.0082960, -0.0000600, -1.280e-05, 0.0047053, 0.0046818, // 2367 4 29 2585707.395868, 21.0, -4.0, 4.0, 936.4, 936.4, -0.2856750, 0.5060432, 1.750e-05, -6.120e-06, 0.0837500, 0.1153420, -9.340e-05, -1.320e-06, 14.4829197, 0.0126590, -3.000e-06, 135.5893555, 15.0025463, 0.000e-00, 0.5619060, 0.0000997, -1.030e-05, 0.0156900, 0.0000992, -1.020e-05, 0.0046514, 0.0046282, // 2367 10 24 2585884.975740, 11.0, -4.0, 4.0, 938.1, 938.1, -0.2457080, 0.5331946, 4.570e-05, -7.670e-06, -0.0285290, -0.1404550, 6.740e-05, 1.950e-06, -11.6014204, -0.0141070, 2.000e-06, 348.9562073, 15.0028353, 0.000e-00, 0.5490940, -0.0001055, -1.160e-05, 0.0029410, -0.0001050, -1.160e-05, 0.0046920, 0.0046686, // 2368 4 18 2586061.702525, 5.0, -4.0, 4.0, 939.8, 939.8, 0.2308250, 0.5319236, -9.000e-06, -7.640e-06, -0.5582820, 0.1440826, -4.420e-05, -2.000e-06, 10.8762197, 0.0141890, -3.000e-06, 255.1360931, 15.0034752, 0.000e-00, 0.5477340, 0.0001119, -1.160e-05, 0.0015880, 0.0001113, -1.150e-05, 0.0046647, 0.0046415, // 2368 10 12 2586239.275921, 19.0, -4.0, 4.0, 941.5, 941.5, 0.3773590, 0.4975676, 1.030e-05, -6.020e-06, 0.5841360, -0.1472351, 1.290e-05, 1.710e-06, -7.6701298, -0.0151460, 1.000e-06, 108.4026413, 15.0038795, 0.000e-00, 0.5633690, -0.0000981, -1.030e-05, 0.0171450, -0.0000977, -1.030e-05, 0.0046780, 0.0046547, // 2369 3 9 2586386.896112, 10.0, -4.0, 4.0, 942.9, 942.9, -0.1288980, 0.5561688, -1.000e-07, -9.480e-06, 1.3636600, 0.1755743, -5.020e-05, -2.910e-06, -4.4784899, 0.0158840, 1.000e-06, 327.4719849, 15.0038433, 0.000e-00, 0.5363090, -0.0000081, -1.310e-05, -0.0097800, -0.0000081, -1.300e-05, 0.0047159, 0.0046924, // 2369 4 7 2586416.279288, 19.0, -4.0, 4.0, 943.2, 943.2, 0.5347140, 0.5535742, -2.360e-05, -9.180e-06, -1.1715910, 0.1678206, 1.980e-05, -2.720e-06, 7.0076399, 0.0152450, -2.000e-06, 104.4966278, 15.0041046, 0.000e-00, 0.5364720, 0.0000479, -1.280e-05, -0.0096180, 0.0000477, -1.270e-05, 0.0046784, 0.0046551, // 2369 9 2 2586563.643007, 3.0, -4.0, 4.0, 944.6, 944.6, -0.6391360, 0.4873338, 4.700e-06, -5.560e-06, -1.3776259, -0.1450085, 1.580e-05, 1.580e-06, 7.9025102, -0.0147760, -2.000e-06, 224.9279022, 15.0046148, 0.000e-00, 0.5656430, 0.0000610, -9.800e-06, 0.0194080, 0.0000607, -9.800e-06, 0.0046283, 0.0046053, // 2369 10 1 2586593.314942, 20.0, -4.0, 4.0, 944.9, 944.9, 0.6375920, 0.4808910, -1.850e-05, -5.360e-06, 1.2764940, -0.1522541, -3.220e-05, 1.640e-06, -3.4182000, -0.0156870, 1.000e-06, 122.5704117, 15.0046177, 0.000e-00, 0.5696430, -0.0000063, -9.700e-06, 0.0233880, -0.0000063, -9.700e-06, 0.0046634, 0.0046402, // 2370 2 27 2586741.546556, 1.0, -4.0, 4.0, 946.3, 946.3, -0.2557170, 0.5474931, 1.050e-05, -8.710e-06, 0.6405480, 0.1590189, 2.420e-05, -2.460e-06, -8.5577202, 0.0152390, 2.000e-06, 191.9365845, 15.0030079, 0.000e-00, 0.5425700, -0.0000882, -1.250e-05, -0.0035500, -0.0000878, -1.250e-05, 0.0047279, 0.0047043, // 2370 8 22 2586917.807190, 7.0, -4.0, 4.0, 948.0, 948.0, -0.3724610, 0.5162578, -1.830e-05, -6.770e-06, -0.6342870, -0.1357557, -3.300e-05, 1.700e-06, 11.7738304, -0.0136060, -3.000e-06, 284.1058960, 15.0039721, 0.000e-00, 0.5530480, 0.0001258, -1.080e-05, 0.0068760, 0.0001251, -1.070e-05, 0.0046177, 0.0045947, // 2371 2 16 2587096.013067, 12.0, -4.0, 4.0, 949.7, 949.7, -0.1615440, 0.5210068, 4.300e-06, -6.980e-06, -0.0487270, 0.1321614, 8.530e-05, -1.690e-06, -12.4525805, 0.0140690, 3.000e-06, 356.6516724, 15.0017843, 0.000e-00, 0.5578630, -0.0001159, -1.120e-05, 0.0116670, -0.0001153, -1.110e-05, 0.0047385, 0.0047149, // 2371 8 11 2587272.276437, 19.0, -4.0, 4.0, 951.4, 951.4, 0.2199670, 0.5537640, -4.530e-05, -8.630e-06, 0.0358380, -0.1213114, -9.380e-05, 1.810e-06, 15.1698303, -0.0120550, -3.000e-06, 103.5309525, 15.0031090, 0.000e-00, 0.5380300, 0.0000912, -1.210e-05, -0.0080680, 0.0000907, -1.200e-05, 0.0046092, 0.0045863, // 2372 2 5 2587450.172080, 16.0, -4.0, 4.0, 953.2, 953.2, 0.0811480, 0.4988680, -1.420e-05, -5.730e-06, -0.7286160, 0.1017485, 1.305e-04, -1.090e-06, -16.0454903, 0.0122940, 4.000e-06, 56.7171516, 15.0002937, 0.000e-00, 0.5720530, -0.0000637, -1.010e-05, 0.0257860, -0.0000634, -1.000e-05, 0.0047471, 0.0047235, // 2372 7 31 2587626.957287, 11.0, -4.0, 4.0, 954.9, 954.9, 0.1494500, 0.5762285, -3.070e-05, -9.840e-06, 0.8007420, -0.0968446, -1.672e-04, 1.570e-06, 18.0596104, -0.0101520, -4.000e-06, 343.2215576, 15.0020800, 0.000e-00, 0.5304340, 0.0000116, -1.280e-05, -0.0156250, 0.0000116, -1.280e-05, 0.0046033, 0.0045804, // 2373 1 24 2587804.135408, 15.0, -4.0, 4.0, 956.6, 956.6, 0.0734400, 0.5002557, -2.660e-05, -5.620e-06, -1.4099780, 0.0712009, 1.753e-04, -7.400e-07, -19.1189003, 0.0098900, 5.000e-06, 42.1937218, 14.9987659, 0.000e-00, 0.5743130, 0.0000432, -9.900e-06, 0.0280350, 0.0000430, -9.900e-06, 0.0047527, 0.0047290, // 2373 6 21 2587952.323249, 20.0, -4.0, 4.0, 958.0, 958.0, 0.2272490, 0.5558138, 2.080e-05, -8.280e-06, -0.9784810, 0.0519478, -1.118e-04, -8.700e-07, 23.3910198, -0.0003050, -6.000e-06, 119.3332596, 14.9991350, 0.000e-00, 0.5412480, -0.0001183, -1.170e-05, -0.0048650, -0.0001177, -1.170e-05, 0.0046034, 0.0045805, // 2373 12 15 2588128.601327, 2.0, -4.0, 4.0, 959.7, 959.7, -0.1027360, 0.5401550, 1.020e-05, -7.580e-06, 0.8934080, -0.0822957, 1.229e-04, 1.300e-06, -23.2011795, -0.0020660, 6.000e-06, 211.4672089, 14.9965382, 0.000e-00, 0.5539420, 0.0001327, -1.160e-05, 0.0077650, 0.0001321, -1.150e-05, 0.0047466, 0.0047229, // 2374 6 11 2588306.715233, 5.0, -4.0, 4.0, 961.4, 961.4, -0.0425290, 0.5174032, 4.280e-05, -6.440e-06, -0.2616890, 0.0905420, -1.357e-04, -1.250e-06, 23.0309906, 0.0027110, -6.000e-06, 254.9250946, 14.9991617, 0.000e-00, 0.5566810, -0.0001030, -1.040e-05, 0.0104910, -0.0001025, -1.040e-05, 0.0046096, 0.0045867, // 2374 12 4 2588483.127038, 15.0, -4.0, 4.0, 963.1, 963.1, 0.0059750, 0.5607525, 2.720e-05, -9.180e-06, 0.1480410, -0.1323237, 1.545e-04, 2.330e-06, -22.1866398, -0.0052580, 6.000e-06, 47.6362686, 14.9974012, 0.000e-00, 0.5405100, 0.0000709, -1.280e-05, -0.0056000, 0.0000706, -1.270e-05, 0.0047383, 0.0047147, // 2375 5 31 2588660.815665, 8.0, -4.0, 4.0, 964.9, 964.9, 0.0791910, 0.4903778, 3.540e-05, -5.480e-06, 0.5569380, 0.1251677, -1.530e-04, -1.530e-06, 21.8362503, 0.0056870, -5.000e-06, 300.4389648, 14.9996700, 0.000e-00, 0.5664590, -0.0000331, -9.700e-06, 0.0202200, -0.0000330, -9.700e-06, 0.0046182, 0.0045952, // 2375 11 24 2588837.788122, 7.0, -4.0, 4.0, 966.6, 966.6, -0.1116740, 0.5552357, 5.630e-05, -9.330e-06, -0.5232800, -0.1734757, 1.723e-04, 3.100e-06, -20.3865891, -0.0081080, 5.000e-06, 288.5155945, 14.9986401, 0.000e-00, 0.5377160, -0.0000347, -1.300e-05, -0.0083800, -0.0000346, -1.300e-05, 0.0047283, 0.0047048, // 2376 5 19 2589014.843562, 8.0, -4.0, 4.0, 968.3, 968.3, -0.5128220, 0.4882340, 4.850e-05, -5.700e-06, 1.1499950, 0.1613713, -1.667e-04, -2.010e-06, 19.8313904, 0.0084300, -5.000e-06, 300.7462463, 15.0005836, 0.000e-00, 0.5630800, 0.0000784, -1.000e-05, 0.0168580, 0.0000780, -1.000e-05, 0.0046285, 0.0046054, // 2376 10 14 2589162.887825, 9.0, -4.0, 4.0, 969.7, 969.7, 0.5417360, 0.4803525, 1.300e-05, -6.480e-06, 1.4023380, -0.2499044, -2.710e-05, 3.520e-06, -8.2810202, -0.0147740, 2.000e-06, 318.5079956, 15.0036936, 0.000e-00, 0.5527790, -0.0001102, -1.120e-05, 0.0066090, -0.0001097, -1.110e-05, 0.0046796, 0.0046563, // 2376 11 12 2589192.388262, 21.0, -4.0, 4.0, 970.0, 970.0, -0.6120280, 0.5226834, 8.980e-05, -7.770e-06, -1.1101460, -0.1986505, 1.680e-04, 3.160e-06, -17.8687592, -0.0105770, 4.000e-06, 139.0417938, 15.0000601, 0.000e-00, 0.5469460, -0.0001013, -1.200e-05, 0.0008040, -0.0001007, -1.190e-05, 0.0047170, 0.0046935, // 2377 4 9 2589339.642482, 3.0, -4.0, 4.0, 971.5, 971.5, 0.1546090, 0.4958097, -1.900e-06, -7.390e-06, -0.7978400, 0.2612546, -7.300e-06, -4.110e-06, 7.5313501, 0.0149030, -2.000e-06, 224.5826416, 15.0039034, 0.000e-00, 0.5441660, 0.0001164, -1.200e-05, -0.0019620, 0.0001158, -1.190e-05, 0.0046771, 0.0046538, // 2377 10 3 2589517.106448, 15.0, -4.0, 4.0, 973.2, 973.2, 0.5933780, 0.4491068, -2.200e-06, -5.150e-06, 0.6071700, -0.2464670, -8.600e-06, 2.990e-06, -4.1296101, -0.0154060, 1.000e-06, 47.7233887, 15.0044460, 0.000e-00, 0.5658970, -0.0000779, -1.000e-05, 0.0196610, -0.0000775, -1.000e-05, 0.0046655, 0.0046422, // 2378 3 29 2589694.264157, 18.0, -4.0, 4.0, 974.9, 974.9, -0.1502050, 0.5101323, 1.440e-05, -8.530e-06, -0.1373910, 0.2805997, -1.410e-05, -4.900e-06, 3.4697700, 0.0155720, -1.000e-06, 88.8529892, 15.0042229, 0.000e-00, 0.5355970, 0.0000370, -1.300e-05, -0.0104880, 0.0000368, -1.290e-05, 0.0046910, 0.0046676, // 2378 9 22 2589871.115134, 15.0, -4.0, 4.0, 976.6, 976.6, 0.1486270, 0.4416441, -1.010e-05, -4.870e-06, 0.0206140, -0.2463918, -3.000e-07, 2.880e-06, 0.2171300, -0.0155360, 0.000e-00, 46.7492104, 15.0048447, 0.000e-00, 0.5684330, 0.0000268, -9.800e-06, 0.0221850, 0.0000267, -9.700e-06, 0.0046513, 0.0046281, // 2379 3 19 2590048.938740, 11.0, -4.0, 4.0, 978.4, 978.4, -0.0786450, 0.5037984, 1.400e-05, -8.150e-06, 0.7008260, 0.2790628, -3.030e-05, -4.740e-06, -0.6826000, 0.0158240, 0.000e-00, 343.1027222, 15.0041256, 0.000e-00, 0.5388910, -0.0000850, -1.270e-05, -0.0072100, -0.0000846, -1.270e-05, 0.0047046, 0.0046811, // 2379 9 11 2590225.214951, 17.0, -4.0, 4.0, 980.1, 980.1, -0.3861380, 0.4618317, -1.110e-05, -5.720e-06, -0.5316810, -0.2526343, 6.800e-06, 3.300e-06, 4.5000100, -0.0151630, -1.000e-06, 75.7282791, 15.0048771, 0.000e-00, 0.5576230, 0.0001141, -1.050e-05, 0.0114280, 0.0001135, -1.050e-05, 0.0046376, 0.0046145, // 2380 2 7 2590373.870848, 9.0, -4.0, 4.0, 981.6, 981.6, 0.6219550, 0.4848246, -5.040e-05, -6.100e-06, -1.3104100, 0.2089523, 1.552e-04, -2.770e-06, -15.5056105, 0.0123680, 3.000e-06, 311.6875000, 15.0004969, 0.000e-00, 0.5627720, -0.0001170, -1.080e-05, 0.0165510, -0.0001165, -1.070e-05, 0.0047457, 0.0047221, // 2380 3 7 2590403.470743, 23.0, -4.0, 4.0, 981.8, 981.8, -0.8092330, 0.4805776, 4.090e-05, -6.620e-06, 1.1586370, 0.2590625, -2.230e-05, -3.790e-06, -4.9193401, 0.0156350, 1.000e-06, 162.4101410, 15.0035887, 0.000e-00, 0.5527720, -0.0001171, -1.150e-05, 0.0066010, -0.0001166, -1.140e-05, 0.0047181, 0.0046946, // 2380 8 1 2590550.268248, 18.0, -4.0, 4.0, 983.3, 983.3, 0.2019100, 0.5365707, -6.650e-05, -8.640e-06, 1.2299170, -0.2054802, -1.751e-04, 3.500e-06, 17.7144604, -0.0101700, -4.000e-06, 88.2364731, 15.0021267, 0.000e-00, 0.5344830, 0.0000912, -1.240e-05, -0.0115970, 0.0000908, -1.230e-05, 0.0046040, 0.0045810, // 2380 8 31 2590579.614342, 3.0, -4.0, 4.0, 983.6, 983.6, -0.4964700, 0.4970232, -1.310e-05, -7.390e-06, -1.2691441, -0.2575838, 2.410e-05, 3.980e-06, 8.5015697, -0.0143590, -2.000e-06, 224.7881470, 15.0045557, 0.000e-00, 0.5417880, 0.0001060, -1.180e-05, -0.0043280, 0.0001055, -1.180e-05, 0.0046255, 0.0046025, // 2381 1 26 2590727.949046, 11.0, -4.0, 4.0, 985.0, 985.0, 0.3829030, 0.4741199, -4.980e-05, -5.260e-06, -0.7185250, 0.1736500, 1.415e-04, -2.080e-06, -18.6531906, 0.0100970, 5.000e-06, 342.0913391, 14.9989491, 0.000e-00, 0.5744470, -0.0000425, -9.900e-06, 0.0281680, -0.0000423, -9.900e-06, 0.0047521, 0.0047284, // 2381 7 22 2590904.975713, 11.0, -4.0, 4.0, 986.8, 986.8, -0.0868010, 0.5561172, -3.700e-05, -9.420e-06, 0.5265520, -0.1783948, -1.641e-04, 3.190e-06, 20.1296692, -0.0079570, -4.000e-06, 343.1790161, 15.0010777, 0.000e-00, 0.5303920, -0.0000062, -1.280e-05, -0.0156670, -0.0000062, -1.270e-05, 0.0046002, 0.0045773, // 2382 1 15 2591081.912059, 10.0, -4.0, 4.0, 988.5, 988.5, 0.0884890, 0.4894286, -5.170e-05, -5.580e-06, -0.1036990, 0.1410387, 1.363e-04, -1.760e-06, -21.1172695, 0.0072420, 6.000e-06, 327.9054565, 14.9975805, 0.000e-00, 0.5723500, 0.0000642, -1.010e-05, 0.0260820, 0.0000639, -1.010e-05, 0.0047551, 0.0047314, // 2382 7 12 2591259.651290, 4.0, -4.0, 4.0, 990.2, 990.2, 0.1361290, 0.5485639, -2.770e-05, -8.450e-06, -0.3166780, -0.1367562, -1.321e-04, 2.260e-06, 21.9263802, -0.0054490, -5.000e-06, 238.3930054, 15.0000906, 0.000e-00, 0.5380720, -0.0001105, -1.200e-05, -0.0080260, -0.0001100, -1.190e-05, 0.0045992, 0.0045762, // 2383 1 4 2591436.073906, 14.0, -4.0, 4.0, 992.0, 992.0, 0.0060170, 0.5271684, -4.980e-05, -7.050e-06, 0.5810870, 0.1072862, 1.288e-04, -1.570e-06, -22.7031002, 0.0040160, 6.000e-06, 29.0360699, 14.9966908, 0.000e-00, 0.5583770, 0.0001165, -1.120e-05, 0.0121790, 0.0001159, -1.120e-05, 0.0047544, 0.0047307, // 2383 7 1 2591614.109512, 15.0, -4.0, 4.0, 993.7, 993.7, 0.0129510, 0.5245473, -8.200e-06, -6.780e-06, -1.1048040, -0.0891710, -1.013e-04, 1.290e-06, 23.0478497, -0.0026380, -6.000e-06, 43.8340111, 14.9993267, 0.000e-00, 0.5528330, -0.0001221, -1.070e-05, 0.0066620, -0.0001215, -1.060e-05, 0.0046010, 0.0045781, // 2383 11 25 2591761.092732, 14.0, -4.0, 4.0, 995.2, 995.2, -0.2792850, 0.5783030, 2.440e-05, -9.760e-06, -1.4474210, -0.0590315, 2.358e-04, 8.900e-07, -20.6550903, -0.0080280, 5.000e-06, 33.4187088, 14.9985266, 0.000e-00, 0.5379550, 0.0000488, -1.300e-05, -0.0081420, 0.0000486, -1.290e-05, 0.0047294, 0.0047059, // 2383 12 25 2591790.539630, 1.0, -4.0, 4.0, 995.5, 995.5, -0.1133660, 0.5663935, -2.740e-05, -9.020e-06, 1.2094049, 0.0662489, 1.088e-04, -1.170e-06, -23.3666401, 0.0006610, 6.000e-06, 195.3158264, 14.9964104, 0.000e-00, 0.5434730, 0.0000867, -1.260e-05, -0.0026510, 0.0000863, -1.250e-05, 0.0047506, 0.0047270, // 2384 5 21 2591938.628776, 3.0, -4.0, 4.0, 996.9, 996.9, -0.1526550, 0.5023323, 1.900e-05, -5.630e-06, 0.9591400, 0.0558416, -1.609e-04, -5.500e-07, 20.2129192, 0.0082360, -5.000e-06, 225.7119141, 15.0004482, 0.000e-00, 0.5673170, 0.0000055, -9.700e-06, 0.0210730, 0.0000055, -9.700e-06, 0.0046270, 0.0046040, // 2384 11 14 2592115.759256, 6.0, -4.0, 4.0, 998.7, 998.7, -0.2570740, 0.5701810, 4.320e-05, -9.440e-06, -0.7789400, -0.0930680, 1.698e-04, 1.460e-06, -18.2449799, -0.0105170, 4.000e-06, 273.9906006, 14.9999752, 0.000e-00, 0.5389160, -0.0000539, -1.280e-05, -0.0071850, -0.0000536, -1.280e-05, 0.0047182, 0.0046947, // 2385 5 10 2592292.692230, 5.0, -4.0, 4.0, 1000.4, 1000.4, 0.1628090, 0.5130531, -2.000e-07, -6.260e-06, 0.2378040, 0.0894733, -1.208e-04, -1.010e-06, 17.6291199, 0.0106640, -4.000e-06, 255.7873230, 15.0015249, 0.000e-00, 0.5604450, 0.0000854, -1.030e-05, 0.0142360, 0.0000850, -1.030e-05, 0.0046387, 0.0046155, // 2385 11 3 2592470.310760, 19.0, -4.0, 4.0, 1002.2, 1002.2, -0.2717560, 0.5367615, 4.950e-05, -7.640e-06, -0.0648920, -0.1169050, 9.570e-05, 1.590e-06, -15.2051497, -0.0125570, 3.000e-06, 109.1743393, 15.0014238, 0.000e-00, 0.5507360, -0.0001060, -1.160e-05, 0.0045750, -0.0001054, -1.150e-05, 0.0047058, 0.0046824, // 2386 4 29 2592647.022510, 13.0, -4.0, 4.0, 1003.9, 1003.9, 0.3701360, 0.5392783, -1.210e-05, -7.830e-06, -0.4778550, 0.1232172, -7.170e-05, -1.720e-06, 14.5044603, 0.0126290, -3.000e-06, 15.5882101, 15.0026159, 0.000e-00, 0.5461140, 0.0001031, -1.160e-05, -0.0000240, 0.0001026, -1.160e-05, 0.0046510, 0.0046278, // 2386 10 24 2592824.588002, 2.0, -4.0, 4.0, 1005.7, 1005.7, 0.1035410, 0.5001175, 2.510e-05, -5.990e-06, 0.6208590, -0.1316826, 3.680e-05, 1.510e-06, -11.6083899, -0.0141230, 2.000e-06, 213.9618073, 15.0027561, 0.000e-00, 0.5650150, -0.0000845, -1.030e-05, 0.0187830, -0.0000840, -1.020e-05, 0.0046924, 0.0046690, // 2387 3 20 2592972.249404, 18.0, -4.0, 4.0, 1007.1, 1007.1, -0.4116700, 0.5551075, 2.390e-05, -9.470e-06, 1.2986950, 0.1797105, -7.410e-05, -2.980e-06, -0.1461700, 0.0160550, 0.000e-00, 88.1940689, 15.0042810, 0.000e-00, 0.5355830, -0.0000015, -1.300e-05, -0.0105020, -0.0000015, -1.300e-05, 0.0047027, 0.0046793, // 2387 4 19 2593001.616044, 3.0, -4.0, 4.0, 1007.4, 1007.4, 0.4451150, 0.5590289, -1.240e-05, -9.320e-06, -1.1581841, 0.1525286, -6.600e-06, -2.470e-06, 10.9887199, 0.0141280, -3.000e-06, 225.1462250, 15.0035152, 0.000e-00, 0.5353080, 0.0000447, -1.280e-05, -0.0107750, 0.0000445, -1.270e-05, 0.0046641, 0.0046408, // 2387 10 13 2593178.611856, 3.0, -4.0, 4.0, 1009.2, 1009.2, 0.5400650, 0.4831392, -9.300e-06, -5.380e-06, 1.2560430, -0.1439181, -7.800e-06, 1.540e-06, -7.5695901, -0.0151700, 2.000e-06, 228.3893738, 15.0038738, 0.000e-00, 0.5705560, 0.0000022, -9.800e-06, 0.0242970, 0.0000022, -9.700e-06, 0.0046776, 0.0046543, // 2388 3 9 2593326.900243, 10.0, -4.0, 4.0, 1010.7, 1010.7, 0.0033310, 0.5429978, 6.000e-06, -8.590e-06, 0.7411740, 0.1696713, -7.300e-06, -2.610e-06, -4.3219199, 0.0159150, 1.000e-06, 327.4993896, 15.0038280, 0.000e-00, 0.5424780, -0.0001049, -1.240e-05, -0.0036410, -0.0001043, -1.240e-05, 0.0047161, 0.0046926, // 2388 9 1 2593503.104462, 15.0, -4.0, 4.0, 1012.4, 1012.4, 0.0337840, 0.5136978, -2.950e-05, -6.790e-06, -0.8174810, -0.1517931, -1.700e-06, 1.920e-06, 7.9346800, -0.0147490, -2.000e-06, 44.9146614, 15.0046778, 0.000e-00, 0.5528070, 0.0001091, -1.080e-05, 0.0066360, 0.0001086, -1.080e-05, 0.0046274, 0.0046044, // 2389 2 26 2593681.356854, 21.0, -4.0, 4.0, 1014.2, 1014.2, 0.2219910, 0.5147084, -6.400e-06, -6.840e-06, 0.0724320, 0.1491311, 5.460e-05, -1.910e-06, -8.4716101, 0.0152840, 2.000e-06, 131.9547424, 15.0029411, 0.000e-00, 0.5580270, -0.0001321, -1.110e-05, 0.0118300, -0.0001314, -1.100e-05, 0.0047287, 0.0047051, // 2389 8 22 2593857.587425, 2.0, -4.0, 4.0, 1015.9, 1015.9, -0.0505990, 0.5498390, -2.980e-05, -8.660e-06, 0.0270880, -0.1445342, -6.840e-05, 2.190e-06, 11.7037697, -0.0136080, -2.000e-06, 209.1089020, 15.0040741, 0.000e-00, 0.5376840, 0.0000992, -1.220e-05, -0.0084110, 0.0000987, -1.210e-05, 0.0046169, 0.0045939, // 2390 2 16 2594035.504844, 0.0, -4.0, 4.0, 1017.7, 1017.7, 0.1189430, 0.4927686, -1.500e-05, -5.630e-06, -0.7102460, 0.1247897, 1.049e-04, -1.350e-06, -12.4885197, 0.0140720, 3.000e-06, 176.6620178, 15.0016918, 0.000e-00, 0.5720300, -0.0000599, -1.000e-05, 0.0257640, -0.0000596, -1.000e-05, 0.0047396, 0.0047160, // 2390 8 11 2594212.271841, 19.0, -4.0, 4.0, 1019.5, 1019.5, 0.4327640, 0.5704344, -4.590e-05, -9.740e-06, 0.6660530, -0.1268374, -1.365e-04, 2.080e-06, 15.0444002, -0.0121070, -3.000e-06, 103.5358200, 15.0031958, 0.000e-00, 0.5306670, -0.0000059, -1.280e-05, -0.0153930, -0.0000058, -1.280e-05, 0.0046088, 0.0045858, // 2391 2 4 2594389.468815, 23.0, -4.0, 4.0, 1021.2, 1021.2, 0.1540480, 0.4957215, -3.320e-05, -5.590e-06, -1.3916970, 0.1010583, 1.514e-04, -1.080e-06, -16.1388397, 0.0122330, 4.000e-06, 161.7371979, 15.0002384, 0.000e-00, 0.5736900, 0.0000476, -1.000e-05, 0.0274150, 0.0000474, -9.900e-06, 0.0047476, 0.0047240, // 2391 7 3 2594537.624226, 3.0, -4.0, 4.0, 1022.7, 1022.7, 0.0263010, 0.5561909, 1.770e-05, -8.200e-06, -1.0728910, 0.0082739, -1.046e-04, -2.100e-07, 22.9309998, -0.0033040, -6.000e-06, 223.7545319, 14.9994860, 0.000e-00, 0.5419610, -0.0001146, -1.160e-05, -0.0041550, -0.0001140, -1.160e-05, 0.0046003, 0.0045774, // 2391 8 1 2594566.968424, 11.0, -4.0, 4.0, 1023.0, 1023.0, 0.1200740, 0.5633119, -1.580e-05, -9.010e-06, 1.4940500, -0.0981738, -2.023e-04, 1.460e-06, 17.9537506, -0.0102300, -4.000e-06, 343.2178345, 15.0020943, 0.000e-00, 0.5356740, -0.0000813, -1.230e-05, -0.0104110, -0.0000809, -1.220e-05, 0.0046035, 0.0045806, // 2391 12 26 2594713.956421, 11.0, -4.0, 4.0, 1024.5, 1024.5, 0.0833780, 0.5468529, -1.090e-05, -7.750e-06, 0.8686970, -0.0366087, 1.257e-04, 6.500e-07, -23.3273201, 0.0013890, 6.000e-06, 345.1434937, 14.9963732, 0.000e-00, 0.5534810, 0.0001205, -1.160e-05, 0.0073070, 0.0001199, -1.160e-05, 0.0047516, 0.0047279, // 2392 6 21 2594891.998591, 12.0, -4.0, 4.0, 1026.2, 1026.2, 0.0490160, 0.5211933, 2.740e-05, -6.440e-06, -0.3287200, 0.0495134, -1.378e-04, -7.200e-07, 23.3869305, -0.0003200, -6.000e-06, 359.3216248, 14.9990416, 0.000e-00, 0.5571780, -0.0001032, -1.030e-05, 0.0109860, -0.0001027, -1.030e-05, 0.0046043, 0.0045814, // 2392 12 14 2595068.490582, 0.0, -4.0, 4.0, 1028.0, 1028.0, 0.1521820, 0.5705513, 9.100e-06, -9.400e-06, 0.1337120, -0.0863793, 1.674e-04, 1.570e-06, -23.2134304, -0.0019580, 6.000e-06, 181.4444733, 14.9966116, 0.000e-00, 0.5405070, 0.0000588, -1.290e-05, -0.0056020, 0.0000586, -1.280e-05, 0.0047458, 0.0047222, // 2393 6 10 2595246.089366, 14.0, -4.0, 4.0, 1029.8, 1029.8, -0.1485620, 0.4981513, 3.330e-05, -5.570e-06, 0.4194330, 0.0881568, -1.589e-04, -1.100e-06, 23.0119400, 0.0027780, -6.000e-06, 29.9276009, 14.9991121, 0.000e-00, 0.5661490, -0.0000152, -9.700e-06, 0.0199120, -0.0000151, -9.600e-06, 0.0046106, 0.0045876, // 2393 12 4 2595423.149020, 16.0, -4.0, 4.0, 1031.6, 1031.6, 0.1224050, 0.5660458, 3.830e-05, -9.510e-06, -0.5609840, -0.1312404, 1.946e-04, 2.380e-06, -22.2399693, -0.0051310, 6.000e-06, 62.6041908, 14.9973831, 0.000e-00, 0.5384580, -0.0000492, -1.300e-05, -0.0076410, -0.0000490, -1.300e-05, 0.0047381, 0.0047145, // 2394 5 30 2595600.127119, 15.0, -4.0, 4.0, 1033.3, 1033.3, -0.3171580, 0.4996373, 3.580e-05, -5.890e-06, 1.1342810, 0.1278014, -1.824e-04, -1.620e-06, 21.7893009, 0.0057610, -5.000e-06, 45.4423714, 14.9997082, 0.000e-00, 0.5618360, 0.0000796, -1.010e-05, 0.0156210, 0.0000792, -1.000e-05, 0.0046186, 0.0045956, // 2394 10 25 2595748.213340, 17.0, -4.0, 4.0, 1034.8, 1034.8, 0.6059410, 0.4861668, 2.070e-05, -6.490e-06, 1.4119270, -0.2333973, -2.800e-06, 3.270e-06, -12.1907902, -0.0136660, 3.000e-06, 79.0208511, 15.0025234, 0.000e-00, 0.5544770, -0.0001143, -1.110e-05, 0.0082970, -0.0001137, -1.110e-05, 0.0046939, 0.0046705, // 2394 11 24 2595777.736529, 6.0, -4.0, 4.0, 1035.1, 1035.1, -0.1914340, 0.5328837, 6.980e-05, -7.880e-06, -1.2381001, -0.1633829, 1.979e-04, 2.610e-06, -20.4543800, -0.0080390, 5.000e-06, 273.4981995, 14.9985428, 0.000e-00, 0.5483060, -0.0001192, -1.200e-05, 0.0021570, -0.0001186, -1.190e-05, 0.0047287, 0.0047052, // 2395 4 20 2595924.970315, 11.0, -4.0, 4.0, 1036.6, 1036.6, 0.2154640, 0.5050414, 5.800e-06, -7.610e-06, -0.8078720, 0.2472634, -2.980e-05, -3.930e-06, 11.4697399, 0.0137230, -3.000e-06, 345.2190552, 15.0032816, 0.000e-00, 0.5425970, 0.0001105, -1.200e-05, -0.0035230, 0.0001100, -1.200e-05, 0.0046627, 0.0046395, // 2395 10 14 2596102.409212, 22.0, -4.0, 4.0, 1038.4, 1038.4, 0.4845570, 0.4524512, 1.190e-05, -5.150e-06, 0.7272700, -0.2372449, 9.200e-06, 2.860e-06, -8.2566700, -0.0148060, 2.000e-06, 153.5044403, 15.0036354, 0.000e-00, 0.5673750, -0.0000677, -1.000e-05, 0.0211320, -0.0000674, -1.000e-05, 0.0046799, 0.0046566, // 2396 4 9 2596279.606445, 3.0, -4.0, 4.0, 1040.2, 1040.2, 0.2692460, 0.5154169, 6.600e-06, -8.640e-06, 0.0458860, 0.2719935, -4.790e-05, -4.770e-06, 7.6743398, 0.0148430, -2.000e-06, 224.6154633, 15.0039282, 0.000e-00, 0.5346570, 0.0000109, -1.290e-05, -0.0114230, 0.0000109, -1.290e-05, 0.0046765, 0.0046532, // 2396 10 2 2596456.408411, 22.0, -4.0, 4.0, 1041.9, 1041.9, 0.1598420, 0.4432748, 0.000e-00, -4.900e-06, 0.0824850, -0.2439723, 1.850e-05, 2.860e-06, -4.0108299, -0.0154190, 1.000e-06, 152.6934357, 15.0044518, 0.000e-00, 0.5690580, 0.0000337, -9.800e-06, 0.0228060, 0.0000335, -9.800e-06, 0.0046650, 0.0046417, // 2397 3 29 2596634.284628, 19.0, -4.0, 4.0, 1043.7, 1043.7, -0.2138410, 0.5041817, 3.440e-05, -8.110e-06, 0.5922410, 0.2763111, -4.870e-05, -4.660e-06, 3.6373401, 0.0155620, -1.000e-06, 103.8894577, 15.0041990, 0.000e-00, 0.5386640, -0.0000819, -1.260e-05, -0.0074370, -0.0000815, -1.260e-05, 0.0046908, 0.0046674, // 2397 9 22 2596810.516612, 0.0, -4.0, 4.0, 1045.5, 1045.5, -0.4704410, 0.4614364, 3.300e-06, -5.770e-06, -0.4124720, -0.2567805, 2.370e-05, 3.380e-06, 0.3033700, -0.0155040, 0.000e-00, 181.7225647, 15.0049028, 0.000e-00, 0.5575080, 0.0001222, -1.060e-05, 0.0113140, 0.0001216, -1.060e-05, 0.0046502, 0.0046270, // 2398 2 17 2596959.214048, 17.0, -4.0, 4.0, 1047.0, 1047.0, 0.5743670, 0.4735801, -4.210e-05, -5.900e-06, -1.3493980, 0.2296959, 1.317e-04, -3.010e-06, -11.8700895, 0.0140610, 2.000e-06, 71.6848526, 15.0018559, 0.000e-00, 0.5630980, -0.0001103, -1.070e-05, 0.0168750, -0.0001098, -1.070e-05, 0.0047378, 0.0047142, // 2398 3 19 2596988.810512, 7.0, -4.0, 4.0, 1047.3, 1047.3, -0.8829790, 0.4768909, 5.630e-05, -6.500e-06, 1.0942460, 0.2624234, -4.250e-05, -3.800e-06, -0.5906600, 0.0158640, 0.000e-00, 283.1156616, 15.0040598, 0.000e-00, 0.5528960, -0.0001141, -1.140e-05, 0.0067240, -0.0001135, -1.130e-05, 0.0047052, 0.0046818, // 2398 8 13 2597135.578902, 2.0, -4.0, 4.0, 1048.8, 1048.8, 0.5770190, 0.5265828, -8.100e-05, -8.510e-06, 1.1528400, -0.2330137, -1.483e-04, 3.970e-06, 14.6352901, -0.0120780, -3.000e-06, 208.5929260, 15.0032225, 0.000e-00, 0.5342600, 0.0000734, -1.250e-05, -0.0118190, 0.0000730, -1.240e-05, 0.0046097, 0.0045867, // 2398 9 11 2597164.928168, 10.0, -4.0, 4.0, 1049.1, 1049.1, -0.7523090, 0.4934504, 1.020e-05, -7.410e-06, -1.0595911, -0.2682054, 3.740e-05, 4.190e-06, 4.4574199, -0.0151280, -1.000e-06, 330.7314453, 15.0049620, 0.000e-00, 0.5415480, 0.0001165, -1.190e-05, -0.0045670, 0.0001159, -1.190e-05, 0.0046367, 0.0046136, // 2399 2 6 2597313.282455, 19.0, -4.0, 4.0, 1050.6, 1050.6, 0.4273860, 0.4629308, -4.960e-05, -5.110e-06, -0.7063100, 0.2005213, 1.178e-04, -2.370e-06, -15.5632000, 0.0123550, 4.000e-06, 101.6944733, 15.0004091, 0.000e-00, 0.5743480, -0.0000379, -9.900e-06, 0.0280690, -0.0000378, -9.900e-06, 0.0047467, 0.0047230, // 2399 8 2 2597490.288353, 19.0, -4.0, 4.0, 1052.4, 1052.4, 0.2421480, 0.5438545, -5.390e-05, -9.180e-06, 0.4939880, -0.2117773, -1.409e-04, 3.750e-06, 17.5988007, -0.0102430, -4.000e-06, 103.2380295, 15.0021954, 0.000e-00, 0.5307280, -0.0000247, -1.280e-05, -0.0153330, -0.0000246, -1.270e-05, 0.0046038, 0.0045809, // 2400 1 26 2597667.250115, 18.0, -4.0, 4.0, 1054.2, 1054.2, 0.0439600, 0.4794871, -5.340e-05, -5.480e-06, -0.1246650, 0.1748702, 1.158e-04, -2.160e-06, -18.7316093, 0.0100190, 5.000e-06, 87.1138687, 14.9989166, 0.000e-00, 0.5716740, 0.0000702, -1.010e-05, 0.0254090, 0.0000698, -1.010e-05, 0.0047523, 0.0047286, // 2400 7 22 2597844.954716, 11.0, -4.0, 4.0, 1056.0, 1056.0, -0.0148670, 0.5360805, -2.560e-05, -8.160e-06, -0.2045980, -0.1737035, -1.209e-04, 2.810e-06, 20.0461807, -0.0080610, -5.000e-06, 343.1665344, 15.0010710, 0.000e-00, 0.5389710, -0.0001064, -1.190e-05, -0.0071310, -0.0001059, -1.190e-05, 0.0046006, 0.0045776 )); } recalculate();
gpl-2.0