answer
stringlengths
15
1.25M
<?php namespace Upc\Cards\Bundle\CardsBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Sensio\Bundle\<API key>\Configuration\Route; use Sensio\Bundle\<API key>\Configuration\Template; use Upc\Cards\Bundle\CardsBundle\Entity\GroupCategory; use Symfony\Component\HttpFoundation\Request; /** * Description of <API key> * * @author javier olivares */ class <API key> extends Controller { /** * @Route("/", name="<API key>") * @Template("") */ public function listAction(Request $request) { $form = $this->createForm('gcategory_search', null); $form->handleRequest($request); $criteria = $form->getData() ? $form->getData() : array(); foreach ($criteria as $key => $value) { if (!$value) { unset($criteria[$key]); } } $em = $this->getDoctrine() ->getRepository('CardsBundle:GroupCategory'); $query = $em->findBy($criteria); $paginator = $this->get('knp_paginator'); $pagination = $paginator->paginate( $query, $this->get('request')->query->get('page', 1)/* page number */, 5/* limit per page */ ); return array( 'pagination' => $pagination, 'form' => $form->createView() ); } /** * @Route("/add", name="<API key>") * @Template("") */ public function newAction(Request $request) { $object = new GroupCategory(); $object->setCreatedAt( new \DateTime("now")); $form = $this->createForm('group_category', $object); $form->handleRequest($request); if ($form->isValid()) { $em = $this->getDoctrine()->getManager(); $em->persist($object); $em->flush(); $this->get('session')->getFlashBag()->add( 'gcategoria', 'Registro grabado satisfactoriamente' ); $nextAction = $form->get('saveAndAdd')->isClicked() ? '<API key>' : '<API key>'; return $this->redirect($this->generateUrl($nextAction)); } return array( 'form' => $form->createView() ); } /** * @Route("/{pk}", name="<API key>") * @Template("") */ public function editAction(Request $request, $pk) { $object = $this->getDoctrine()->getRepository('CardsBundle:GroupCategory')->find($pk); $form = $this->createForm('group_category', $object); $form->handleRequest($request); if ($form->isValid()) { $em = $this->getDoctrine()->getManager(); $em->persist($object); $em->flush(); $this->get('session')->getFlashBag()->add( 'gcategoria', 'Registro modificado satisfactoriamente' ); $nextAction = $form->get('saveAndAdd')->isClicked() ? '<API key>' : '<API key>'; return $this->redirect($this->generateUrl($nextAction)); } return array( 'form' => $form->createView() ); } } ?>
var map; var infoWindow; var markersData = [ { lat: -3.741262, lng: -38.539389, nome: "Campus do Pici - Universidade Federal do Ceará", endereco:"Av. Mister Hull, s/n", telefone: "(85) 3366-9500" }, { lat: -3.780833, lng: -38.469656, nome: "Colosso Lake Lounge", endereco:"Rua Hermenegildo Sá Cavalcante, s/n", telefone: "(85) 98160-0088" } ]; function initialize() { var mapOptions = { center: new google.maps.LatLng(40.601203,-8.668173), zoom: 9, mapTypeId: 'roadmap', }; map = new google.maps.Map(document.getElementById('map-slackline'), mapOptions); infoWindow = new google.maps.InfoWindow(); // evento que fecha a infoWindow com click no mapa google.maps.event.addListener(map, 'click', function() { infoWindow.close(); }); displayMarkers(); } google.maps.event.addDomListener(window, 'load', initialize); function displayMarkers(){ var bounds = new google.maps.LatLngBounds(); for (var i = 0; i < markersData.length; i++){ var latlng = new google.maps.LatLng(markersData[i].lat, markersData[i].lng); var nome = markersData[i].nome; var endereco = markersData[i].endereco; var telefone = markersData[i].telefone; createMarker(latlng, nome, endereco, telefone); bounds.extend(latlng); } // Depois de criados todos os marcadores map.fitBounds(bounds); } function createMarker(latlng, nome, endereco, telefone){ var marker = new google.maps.Marker({ map: map, position: latlng, title: nome }); google.maps.event.addListener(marker, 'click', function() { var iwContent = '<div id="iw_container">' + '<div class="iw_title">' + nome + '</div>' + '<div class="iw_content">' + endereco + '<br />' + telefone + '<br />'; infoWindow.setContent(iwContent); infoWindow.open(map, marker); }); }
<?php require_once(APPPATH . 'views/header.php'); ?> <link rel="stylesheet" href="<?= base_url(); ?>assets/css/fullcalendar.css" /> <link rel="stylesheet" href="<?= base_url(); ?>css/mine.css" /> <style> .form-horizontal .controls { margin-left: 12px; } </style> <div class="page-content"> <div class="row-fluid"> <iframe id="frame" name="frame" frameborder="no" border="0" scrolling="no" height="750" width="450" class="span12" src="<?php echo base_url() . "index.php/management/"; ?>"> </iframe> <div class="row-fluid"> <div id="accordion2" class="accordion"> <div class="accordion-group"> <div class="accordion-body collapse" id="collapseOne"> <div class="accordion-inner"> <div class="row-fluid"> <div class="span12"> <!--PAGE CONTENT BEGINS <form class="form-horizontal" > <div class="alert alert-block alert-info span6"> <div class="widget-main"> <input type="file" id="id-input-file-2" /> <input multiple="" type="file" id="id-input-file-3" /> <label> <input type="checkbox" name="file-format" id="id-file-format" /> <span class="lbl"> Allow only images</span> </label> </div> <div class="control-group"> <label class="control-label" for="form-field-username">First name</label> <div class="controls"> <input type="text" id="form-field-username" placeholder="First name" value="<?php echo 'name'; ?>" /> </div> </div> <div class="control-group"> <label class="control-label" for="form-field-first">Last name</label> <div class="controls"> <input class="input-small" type="text" id="form-field-first" placeholder="First Name" /> <input class="input-small" type="text" id="form-field-last" placeholder="Othername" /> </div> </div> <div class="control-group"> <label class="control-label" for="form-field-tags">Please enter your emails one by one</label> <div class="controls"> <label class="text-error">enter primary e-mail first</label> <input type="text" name="tags" id="form-field-tags" placeholder="info@gmail.com" /> </div> </div> <div class="control-group"> <label class="control-label" for="form-field-tags">Please enter your contacts one by one</label> <div class="controls"> <label class="text-error">enter primary contact first</label> <input type="text" name="tags" id="form-field-tags" placeholder="+2567893213394" /> </div> </div></div> <div class="alert alert-block alert-info span6"> <div class="control-group"> <label class="control-label" for="form-field-sex">Sex</label> <div class="controls"> <select data-placeholder="Choose a sex..."> <option value="" /> <option value="male" />male <option value="female" />female </select> </div> </div> <div class="control-group"> <label class="control-label" for="id-date-picker-1">Date of Birth</label> <div class="controls"> <input class="date-picker" id="id-date-picker-1" type="text" data-date-format="dd-mm-yyyy" /> </div> </div> <div class="control-group"> <label class="control-label" for="form-field-sex">Location</label> <div class="controls" id="locationField"> <input id="autocomplete" placeholder="Enter your address" onFocus="geolocate()" type="text"></input> </div> </div> <div class="control-group"> <label class="control-label" for="id-date-picker-1">Country</label> <div class="controls"> <div class="controls" id="address"> <input id="country" type="text" /> <input class="field" id="street_number" type="hidden" disabled="true"></input> <input class="field" id="route"type="hidden" disabled="true"></input> <input class="field" id="locality" type="hidden" disabled="true"></input> <input class="field" type="hidden" id="<API key>" disabled="true"></input> <input class="field" type="hidden" id="postal_code"></input> </div> </div> </div> <div class="control-group"> <label class="control-label" for="form-field-pass1">New Password</label> <div class="controls"> <input type="password" id="form-field-pass1" /> </div> </div> <div class="control-group"> <label class="control-label" for="form-field-pass2">Confirm Password</label> <div class="controls"> <input type="password" id="form-field-pass2" /> </div> </div> <div class=""> <button class="btn btn-info" type="button"> <i class="icon-ok bigger-110"></i> Submit </button> &nbsp; &nbsp; &nbsp; <button class="btn" type="reset"> <i class="icon-undo bigger-110"></i> Reset </button> </div> </div> </form> </div> </div></div> </div><!--PAGE CONTENT ENDS </div><!--/.span--> </div><!--/.row-fluid--> <div class="accordion-group"> <div class="accordion-body collapse " id="collapseTwo"> <div class="accordion-inner"> <div class="widget-box"> <div class="widget-header header-color-blue"> <h5 class="bigger lighter"> <i class="icon-table"></i> Users and cohorts </h5> <div class="widget-toolbar <API key> no-border"> <select id="<API key>" class="hide"> <option selected="" data-class="blue" value="#307ECC" />#307ECC <option data-class="blue2" value="#5090C1" />#5090C1 <option data-class="blue3" value="#6379AA" />#6379AA <option data-class="green" value="#82AF6F" />#82AF6F <option data-class="green2" value="#2E8965" />#2E8965 <option data-class="green3" value="#5FBC47" />#5FBC47 <option data-class="red" value="#E2755F" />#E2755F <option data-class="red2" value="#E04141" />#E04141 <option data-class="red3" value="#D15B47" />#D15B47 <option data-class="orange" value="#FFC657" />#FFC657 <option data-class="purple" value="#7E6EB0" />#7E6EB0 <option data-class="pink" value="#CE6F9E" />#CE6F9E <option data-class="dark" value="#404040" />#404040 <option data-class="grey" value="#848484" />#848484 <option data-class="default" value="#EEE" />#EEE </select> </div> </div> <div class="widget-body"> <div class="widget-main no-padding"> <table class="table table-striped table-bordered table-hover"> <thead> <tr> <th> <i class="icon-user"></i> User </th> <th> <i>@</i> Email </th> <th class="hidden-480">Status</th> </tr> </thead> <tbody> <tr> <td class="">Alex</td> <td> <a href="#">alex@email.com</a> </td> <td class="hidden-480"> <span class="label label-warning">Pending</span> </td> </tr> <tr> <td class="">Fred</td> <td> <a href="#">fred@email.com</a> </td> <td class="hidden-480"> <span class="label label-success arrowed-in arrowed-in-right">Approved</span> </td> </tr> <tr> <td class="">Jack</td> <td> <a href="#">jack@email.com</a> </td> <td class="hidden-480"> <span class="label label-warning">Pending</span> </td> </tr> <tr> <td class="">John</td> <td> <a href="#">john@email.com</a> </td> <td class="hidden-480"> <span class="label label-inverse arrowed">Blocked</span> </td> </tr> <tr> <td class="">James</td> <td> <a href="#">james@email.com</a> </td> <td class="hidden-480"> <span class="label label-info arrowed-in arrowed-in-right">Online</span> </td> </tr> </tbody> </table> </div> </div> </div> </div> </div> </div> <div class="accordion-group"> <div class="accordion-body collapse" id="collapseTracks"> <div class="accordion-inner"> <form class="form-horizontal" > <div class="alert alert-block alert-info span6"> <div class="control-group"> <label class="control-label" for="form-field-username">Name</label> <div class="controls"> <input type="text" id="form-field-username" placeholder="" value="" /> </div> </div> <label for="form-field-8">Details</label> <textarea class="span12" id="form-field-8" placeholder="Default Text"></textarea> <div class="control-group"> <label class="control-label" for="id-date-picker-1">Date of Registration</label> <div class="controls"> <input class="date-picker" id="id-date-picker-1" type="text" data-date-format="dd-mm-yyyy" /> </div> </div> <div class=""> <button class="btn btn-info" type="button"> <i class="icon-ok bigger-110"></i> Submit </button> &nbsp; &nbsp; &nbsp; <button class="btn" type="reset"> <i class="icon-undo bigger-110"></i> Reset </button> </div> </div> </form> </div> </div> </div> <div class="accordion-group"> <div class="accordion-body collapse" id="collapseCohorts"> <div class="accordion-inner"> <form class="form-horizontal" > <div class="alert alert-block alert-info span6"> <div class="control-group"> <label class="control-label" for="form-field-username">Name</label> <div class="controls"> <input type="text" id="form-field-username" placeholder="" value="" /> </div> </div> <label for="form-field-8">Details</label> <textarea class="span12" id="form-field-8" placeholder="Default Text"></textarea> <div class="control-group"> <label class="control-label" for="id-date-picker-1">Date of Registration</label> <div class="controls"> <input class="date-picker" id="id-date-picker-1" type="text" data-date-format="dd-mm-yyyy" /> </div> </div> <div class=""> <button class="btn btn-info" type="button"> <i class="icon-ok bigger-110"></i> Submit </button> &nbsp; &nbsp; &nbsp; <button class="btn" type="reset"> <i class="icon-undo bigger-110"></i> Reset </button> </div> </div> </form> </div> </div> </div> <div class="accordion-group"> <div class="accordion-body collapse" id="collapseAdverts"> <div class="accordion-inner"> <form class="form-horizontal" > <div class="alert alert-block alert-info span6"> <div class="widget-main"> <input type="file" id="id-input-file-2" /> <input multiple="" type="file" id="id-input-file-3" /> <label> <input type="checkbox" name="file-format" id="id-file-format" /> <span class="lbl"> Allow only images</span> </label> </div> <div class="control-group"> <label class="control-label" for="form-field-username">Title</label> <div class="controls"> <input type="text" id="form-field-username" placeholder="" value="" /> </div> </div> <div class="control-group"> <label class="control-label" for="id-date-picker-1">Date of Display</label> <div class="controls"> <input class="date-picker" id="id-date-picker-1" type="text" data-date-format="dd-mm-yyyy" /> </div> </div> <div class=""> <button class="btn btn-info" type="button"> <i class="icon-ok bigger-110"></i> Submit </button> &nbsp; &nbsp; &nbsp; <button class="btn" type="reset"> <i class="icon-undo bigger-110"></i> Reset </button> </div> </div> </form> </div> </div> </div> <div class="accordion-group"> <div class="accordion-body collapse" id="collapseCountry"> <div class="accordion-inner"> <form class="form-horizontal" > <div class="alert alert-block alert-success span6"> <div class="control-group"> <label class="control-label" for="form-field-tags">Select the country flag</label> <div class="controls"> <input type="file" id="id-input-file-2" /> </div> </div> <div class="control-group"> <label class="control-label" for="form-field-tags">Country name</label> <div class="controls"> <input type="text" name="tags" id="form-field-tags" placeholder="Uganda" /> </div> </div> <div class=""> <button class="btn btn-info" type="button"> <i class="icon-ok bigger-110"></i> Submit </button> &nbsp; &nbsp; &nbsp; <button class="btn" type="reset"> <i class="icon-undo bigger-110"></i> Reset </button> </div> </div> </form> </div> </div> </div> <div class="accordion-group"> <div class="accordion-body collapse" id="collapseUser"> <div class="accordion-inner"> <form class="form-horizontal" > <div class="alert alert-block alert-success span6"> <div class="control-group"> <label class="control-label" for="form-field-username">First name</label> <div class="controls"> <input type="text" id="form-field-username" placeholder="First name" value="<?php echo 'name'; ?>" /> </div> </div> <div class="control-group"> <label class="control-label" for="form-field-first">Last name</label> <div class="controls"> <input class="input-small" type="text" id="form-field-first" placeholder="First Name" /> <input class="input-small" type="text" id="form-field-last" placeholder="Othername" /> </div> </div> <div class="control-group"> <label class="control-label" for="form-field-tags">E-mail</label> <div class="controls"> <input type="text" name="tags" id="form-field-tags" placeholder="info@gmail.com" /> </div> </div> <div class="control-group"> <label class="control-label" for="form-field-tags">Contacts</label> <div class="controls"> <input type="text" name="tags" id="form-field-tags" placeholder="+2567893213394" /> </div> </div></div> <div class="alert alert-block alert-info span6"> <div class="control-group"> <label class="control-label" for="form-field-sex">Location</label> <div class="controls" id="locationField"> <input id="autocomplete" placeholder="Select your country" type="text"></input> </div> </div> <div class="control-group"> <label class="control-label" for="form-field-pass1">New Password</label> <div class="controls"> <input type="password" id="form-field-pass1" /> </div> </div> <div class="control-group"> <label class="control-label" for="form-field-pass2">Confirm Password</label> <div class="controls"> <input type="password" id="form-field-pass2" /> </div> </div> <div class=""> <button class="btn btn-info" type="button"> <i class="icon-ok bigger-110"></i> Submit </button> &nbsp; &nbsp; &nbsp; <button class="btn" type="reset"> <i class="icon-undo bigger-110"></i> Reset </button> </div> </div> </form> </div> </div> </div> </div> </div> </div> </div><!--/span--> </div><!--/row--> </div><!--/.page-content--> <div class="<API key>" id="<API key>"> <div class="btn btn-app btn-mini btn-warning ace-settings-btn" id="ace-settings-btn"> <i class="icon-cog bigger-150"></i> </div> <div class="ace-settings-box" id="ace-settings-box"> <div> <div class="pull-left"> <select id="skin-colorpicker" class="hide"> <option data-class="default" value="#438EB9" />#438EB9 <option data-class="skin-1" value="#222A2D" />#222A2D <option data-class="skin-2" value="#C6487E" />#C6487E <option data-class="skin-3" value="#D0D0D0" />#D0D0D0 </select> </div> <span>&nbsp; Choose Skin</span> </div> <div> <input type="checkbox" class="ace-checkbox-2" id="ace-settings-header" /> <label class="lbl" for="ace-settings-header"> Fixed Header</label> </div> <div> <input type="checkbox" class="ace-checkbox-2" id="<API key>" /> <label class="lbl" for="<API key>"> Fixed Sidebar</label> </div> <div> <input type="checkbox" class="ace-checkbox-2" id="<API key>" /> <label class="lbl" for="<API key>"> Fixed Breadcrumbs</label> </div> <div> <input type="checkbox" class="ace-checkbox-2" id="ace-settings-rtl" /> <label class="lbl" for="ace-settings-rtl"> Right To Left (rtl)</label> </div> </div> </div><!--/#<API key>--> </div><!--/.main-content--> <?php require_once(APPPATH . 'views/footer.php'); ?> <script type="text/javascript"> $(function () { $('#id-disable-check').on('click', function () { var inp = $('#form-input-readonly').get(0); if (inp.hasAttribute('disabled')) { inp.setAttribute('readonly', 'true'); inp.removeAttribute('disabled'); inp.value = "This text field is readonly!"; } else { inp.setAttribute('disabled', 'disabled'); inp.removeAttribute('readonly'); inp.value = "This text field is disabled!"; } }); $(".chzn-select").chosen(); $('[data-rel=tooltip]').tooltip({container: 'body'}); $('[data-rel=popover]').popover({container: 'body'}); $('textarea[class*=autosize]').autosize({append: "\n"}); $('textarea[class*=limited]').each(function () { var limit = parseInt($(this).attr('data-maxlength')) || 100; $(this).inputlimiter({ "limit": limit, remText: '%n character%s remaining...', limitText: 'max allowed : %n.' }); }); $.mask.definitions['~'] = '[+-]'; $('.input-mask-date').mask('99/99/9999'); $('.input-mask-phone').mask('(999) 999-9999'); $('.<API key>').mask('~9.99 ~9.99 999'); $(".input-mask-product").mask("a*-999-a999", {placeholder: " ", completed: function () { alert("You typed the following: " + this.val()); }}); $("#input-size-slider").css('width', '200px').slider({ value: 1, range: "min", min: 1, max: 6, step: 1, slide: function (event, ui) { var sizing = ['', 'input-mini', 'input-small', 'input-medium', 'input-large', 'input-xlarge', 'input-xxlarge']; var val = parseInt(ui.value); $('#form-field-4').attr('class', sizing[val]).val('.' + sizing[val]); } }); $("#input-span-slider").slider({ value: 1, range: "min", min: 1, max: 11, step: 1, slide: function (event, ui) { var val = parseInt(ui.value); $('#form-field-5').attr('class', 'span' + val).val('.span' + val).next().attr('class', 'span' + (12 - val)).val('.span' + (12 - val)); } }); $("#slider-range").css('height', '200px').slider({ orientation: "vertical", range: true, min: 0, max: 100, values: [17, 67], slide: function (event, ui) { var val = ui.values[$(ui.handle).index() - 1] + ""; if (!ui.handle.firstChild) { $(ui.handle).append("<div class='tooltip right in' style='display:none;left:15px;top:-8px;'><div class='tooltip-arrow'></div><div class='tooltip-inner'></div></div>"); } $(ui.handle.firstChild).show().children().eq(1).text(val); } }).find('a').on('blur', function () { $(this.firstChild).hide(); }); $("#slider-range-max").slider({ range: "max", min: 1, max: 10, value: 2 }); $("#eq > span").css({width: '90%', 'float': 'left', margin: '15px'}).each(function () { // read initial values from markup and remove that var value = parseInt($(this).text(), 10); $(this).empty().slider({ value: value, range: "min", animate: true }); }); $('#id-input-file-1 , #id-input-file-2').ace_file_input({ no_file: 'No File ...', btn_choose: 'Choose', btn_change: 'Change', droppable: false, onchange: null, thumbnail: false //| true | large //whitelist:'gif|png|jpg|jpeg' //blacklist:'exe|php' //onchange:'' }); $('#id-input-file-3').ace_file_input({ style: 'well', btn_choose: 'Drop files here or click to choose', btn_change: null, no_icon: 'icon-cloud-upload', droppable: true, thumbnail: 'small' //,icon_remove:null//set null, to hide remove/reset button /**,before_change:function(files, dropped) { //Check an example below //or examples/file-upload.html return true; }*/ /**,before_remove : function() { return true; }*/ , preview_error: function (filename, error_code) { //name of the file that failed //error_code values //1 = 'FILE_LOAD_FAILED', //2 = 'IMAGE_LOAD_FAILED', //3 = 'THUMBNAIL_FAILED' //alert(error_code); } }).on('change', function () { //console.log($(this).data('ace_input_files')); //console.log($(this).data('ace_input_method')); }); //dynamically change allowed formats by changing before_change callback function $('#id-file-format').removeAttr('checked').on('change', function () { var before_change var btn_choose var no_icon if (this.checked) { btn_choose = "Drop images here or click to choose"; no_icon = "icon-picture"; before_change = function (files, dropped) { var allowed_files = []; for (var i = 0; i < files.length; i++) { var file = files[i]; if (typeof file === "string") { //IE8 and browsers that don't support File Object if (!(/\.(jpe?g|png|gif|bmp)$/i).test(file)) return false; } else { var type = $.trim(file.type); if ((type.length > 0 && !(/^image\/(jpe?g|png|gif|bmp)$/i).test(type)) || (type.length == 0 && !(/\.(jpe?g|png|gif|bmp)$/i).test(file.name))//for android's default browser which gives an empty string for file.type ) continue;//not an image so don't keep this file } allowed_files.push(file); } if (allowed_files.length == 0) return false; return allowed_files; } } else { btn_choose = "Drop files here or click to choose"; no_icon = "icon-cloud-upload"; before_change = function (files, dropped) { return files; } } var file_input = $('#id-input-file-3'); file_input.ace_file_input('update_settings', {'before_change': before_change, 'btn_choose': btn_choose, 'no_icon': no_icon}) file_input.ace_file_input('reset_input'); }); $('#spinner1').ace_spinner({value: 0, min: 0, max: 200, step: 10, btn_up_class: 'btn-info', btn_down_class: 'btn-info'}) .on('change', function () { //alert(this.value) }); $('#spinner2').ace_spinner({value: 0, min: 0, max: 10000, step: 100, icon_up: 'icon-caret-up', icon_down: 'icon-caret-down'}); $('#spinner3').ace_spinner({value: 0, min: -100, max: 100, step: 10, icon_up: 'icon-plus', icon_down: 'icon-minus', btn_up_class: 'btn-success', btn_down_class: 'btn-danger'}); $('.date-picker').datepicker().next().on(ace.click_event, function () { $(this).prev().focus(); }); $('#<API key>').daterangepicker().prev().on(ace.click_event, function () { $(this).next().focus(); }); $('#timepicker1').timepicker({ minuteStep: 1, showSeconds: true, showMeridian: false }) $('#colorpicker1').colorpicker(); $('#<API key>').ace_colorpicker(); $(".knob").knob(); //we could just set the data-provide="tag" of the element inside HTML, but IE8 fails! var tag_input = $('#form-field-tags'); if (!(/msie\s*(8|7|6)/.test(navigator.userAgent.toLowerCase()))) tag_input.tag({placeholder: tag_input.attr('placeholder')}); else { //display a textarea for old IE, because it doesn't support this plugin or another one I tried! tag_input.after('<textarea id="' + tag_input.attr('id') + '" name="' + tag_input.attr('name') + '" rows="3">' + tag_input.val() + '</textarea>').remove(); //$('#form-field-tags').autosize({append: "\n"}); } $('#modal-form input[type=file]').ace_file_input({ style: 'well', btn_choose: 'Drop files here or click to choose', btn_change: null, no_icon: 'icon-cloud-upload', droppable: true, thumbnail: 'large' }) //chosen plugin inside a modal will have a zero width because the select element is originally hidden //and its width cannot be determined. //so we set the width after modal is show $('#modal-form').on('show', function () { $(this).find('.chzn-container').each(function () { $(this).find('a:first-child').css('width', '200px'); $(this).find('.chzn-drop').css('width', '210px'); $(this).find('.chzn-search input').css('width', '200px'); }); }) /** //or you can activate the chosen plugin after modal is shown //this way select element has a width now and chosen works as expected $('#modal-form').on('shown', function () { $(this).find('.modal-chosen').chosen(); }) */ }); </script>
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = _default; function _default() { return function ({ addUtilities, variants }) { addUtilities({ '.bg-clip-border': { 'background-clip': 'border-box' }, '.bg-clip-padding': { 'background-clip': 'padding-box' }, '.bg-clip-content': { 'background-clip': 'content-box' }, '.bg-clip-text': { 'background-clip': 'text' } }, variants('backgroundClip')); }; }
{% extends 'base.html' %} {% load crispy_forms_tags %} {% block title %}New Company Record{%endblock%} {% block container %} <div class="formbox" style="padding-top: 60px; padding-left: 15px;"> <form class="form" action="." method="POST"> {% csrf_token %} {{ form|crispy }} <button class="btn btn-primary">{% if object %}Update{% else %}Create{% endif %}</button> </form> </div> {% endblock %}
var gulp = require('gulp'); var karma = require('karma').server; var concat = require('gulp-concat'); var uglify = require('gulp-uglify'); var rename = require('gulp-rename'); var path = require('path'); var plumber = require('gulp-plumber'); var runSequence = require('run-sequence'); var jshint = require('gulp-jshint'); /** * File patterns **/ // Root directory var rootDirectory = path.resolve('./'); // Source directory for build process var sourceDirectory = path.join(rootDirectory, './src'); var sourceFiles = [ // Make sure module files are handled first path.join(sourceDirectory, '*.module.js'), // Then add all JavaScript files path.join(sourceDirectory, '*.js') ]; var lintFiles = [ 'gulpfile.js', // Karma configuration 'karma-*.conf.js' ].concat(sourceFiles); gulp.task('build', function() { gulp.src(sourceFiles) .pipe(plumber()) .pipe(concat('df-validator.js')) .pipe(gulp.dest('./dist/')) .pipe(uglify()) .pipe(rename('df-validator.min.js')) .pipe(gulp.dest('./dist')); }); /** * Process */ gulp.task('process-all', function (done) { runSequence(/*'jshint',*/ 'test-src', 'build', done); }); /** * Watch task */ gulp.task('watch', function () { // Watch JavaScript files gulp.watch(sourceFiles, ['process-all']); }); /** * Validate source JavaScript */ gulp.task('jshint', function () { return gulp.src(lintFiles) .pipe(plumber()) .pipe(jshint()) .pipe(jshint.reporter('jshint-stylish')) .pipe(jshint.reporter('fail')); }); /** * Run test once and exit */ gulp.task('test-src', function (done) { karma.start({ configFile: __dirname + '/karma-src.conf.js', singleRun: true }, done); }); /** * Run test once and exit */ gulp.task('<API key>', function (done) { karma.start({ configFile: __dirname + '/<API key>.conf.js', singleRun: true }, done); }); /** * Run test once and exit */ gulp.task('test-dist-minified', function (done) { karma.start({ configFile: __dirname + '/karma-dist-minified.conf.js', singleRun: true }, done); }); gulp.task('default', function () { runSequence('process-all', 'watch'); });
<?php defined('BASEPATH') OR exit('No direct script access allowed'); $hook['pre_system'] = array( 'function' => 'auth_constants', 'filename' => 'auth_constants.php', 'filepath' => 'hooks' );
# <API key>: true module <API key> def <API key>(input) return nil unless input value_field = case input[:pricing_strategy] when 'fixed' :fixed_value when 'scheduled_value' :scheduled_value end PricingStructure.new(pricing_strategy: input[:pricing_strategy], value: input[value_field]) end def <API key>(product, <API key>) (<API key> || []).each_with_index do |<API key>, i| <API key> = <API key>.merge(position: i + 1) variant_id = <API key>.delete(:id) <API key>[:<API key>] = <API key>(<API key>[:<API key>]) if variant_id variant = product.product_variants.find { |v| v.id.to_s == variant_id } variant.update!(<API key>) else product.product_variants.create!(<API key>) end end end end
<html dir="LTR"> <head> <meta http-equiv="Content-Type" content="text/html; charset=Windows-1252" /> <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5" /> <title>BinarizeFilter Constructor</title> <xml> </xml> <link rel="stylesheet" type="text/css" href="MSDN.css" /> </head> <body id="bodyID" class="dtBODY"> <div id="nsbanner"> <div id="bannerrow1"> <table class="bannerparthead" cellspacing="0"> <tr id="hdr"> <td class="runninghead">OCR PreProcessing Imagefilters, Imagesegmentation, OCR Image Creation and Feature Extraction</td> <td class="product"> </td> </tr> </table> </div> <div id="TitleRow"> <h1 class="dtH1">BinarizeFilter Constructor </h1> </div> </div> <div id="nstext"> <p> Defaultconstructor, does nothin' </p> <div class="syntax">public BinarizeFilter();</div> <h4 class="dtH4">See Also</h4> <p> <a href="OCRPreProcessing.BinarizeFilter.html">BinarizeFilter Class</a> | <a href="OCRPreProcessing.html">OCRPreProcessing Namespace</a></p> <object type="application/x-oleobject" classid="clsid:<API key>" viewastext="true" style="display: none;"> <param name="Keyword" value="BinarizeFilter class, constructor"> </param> </object> <hr /> <div id="footer"> <p> <a href="mailto:ocrPreProc@rene-schulte.info?subject=OCR%20PreProcessing%20Imagefilters,%20Imagesegmentation,%20OCR%20Image%20Creation%20and%20Feature%20Extraction%20Documentation%20Feedback:%20BinarizeFilter Constructor ">Send comments on this topic.</a> </p> <p> <a>(c) 2004 Rene Schulte and Torsten Baer</a> </p> <p> </p> </div> </div> </body> </html>
#import "UIView.h" @class NSString, NSTimer, STRunCaloriesLabel, STRunDistanceLabel, STRunPaceLabel, STRunProgressView, STRunTimeLabel, SWRunWorkoutProxy, UIButton, UIImageView, UILabel; @interface STRunView : UIView { id <STRunViewDelegate> _delegate; SWRunWorkoutProxy *_workoutProxy; NSTimer *_subsecondTimer; NSTimer *_workoutInfoTimer; double _elapsedWorkoutTime; double <API key>; double <API key>; UIView *_rotationContainer; long long _orientation; int _interface; UIButton *_leftButton; UIButton *_rightButton; UIButton *_endWorkoutButton; UIButton *<API key>; UIButton *_nextTrackButton; UIImageView *<API key>; STRunTimeLabel *_runTimeLabel; STRunDistanceLabel *_runDistanceLabel; STRunPaceLabel *_runPaceLabel; STRunCaloriesLabel *_runCaloriesLabel; UIView *_labelSeparator; UILabel *<API key>; STRunProgressView *_runProgressView; float _progressToGoal; NSTimer *_considerSeekTimer; long long <API key>; NSString *<API key>; struct { unsigned int timerPaused:1; unsigned int shouldStartTimer:1; unsigned int isLockScreen:1; unsigned int <API key>:1; unsigned int <API key>:1; unsigned int validPaceReceived:1; unsigned int noMusic:1; unsigned int seekHandled:1; unsigned int seekAllowed:1; unsigned int <API key>:1; unsigned int <API key>:1; unsigned int goalCompleted:1; unsigned int useMetricDistance:1; unsigned int <API key>:1; unsigned int <API key>:1; unsigned int shouldControlMusic:1; unsigned int unused:16; } _runFlagsBitfield; } @property(readonly, nonatomic) SWRunWorkoutProxy *workoutProxy; // @synthesize workoutProxy=_workoutProxy; @property(nonatomic) id <STRunViewDelegate> delegate; // @synthesize delegate=_delegate; @property(nonatomic) long long orientation; // @synthesize orientation=_orientation; @property(nonatomic) int interface; // @synthesize interface=_interface; - (void)_nowPlayingChanged:(id)arg1; - (void)<API key>:(id)arg1; - (void)_applicationResumed:(id)arg1; - (void)<API key>:(id)arg1; - (void)<API key>:(id)arg1; - (void)<API key>:(id)arg1; - (void)<API key>:(id)arg1; - (void)<API key>:(id)arg1; - (id)<API key>; - (id)<API key>; - (id)<API key>; - (id)<API key>; - (id)<API key>; - (id)<API key>; - (id)<API key>; - (id)<API key>; - (id)<API key>; - (id)<API key>; - (id)<API key>; - (id)<API key>:(id)arg1 startColor:(id)arg2 startPoint:(struct CGPoint)arg3 endColor:(id)arg4 endPoint:(struct CGPoint)arg5; - (void)_stopUpdateTimers; - (void)_startUpdateTimers; - (id)<API key>:(id)arg1; - (void)<API key>; - (void)<API key>:(id)arg1; - (void)<API key>:(id)arg1; - (void)_subsecondTimerTick:(id)arg1; - (_Bool)_endSeekInDirection:(int)arg1; - (_Bool)<API key>:(int)arg1; - (void)<API key>:(id)arg1; - (void)_endSeeking:(id)arg1; - (void)<API key>:(id)arg1; - (void)<API key>:(id)arg1; - (void)_nextTrack; - (void)_previousTrack; - (void)_stop; - (void)<API key>; - (void)<API key>:(_Bool)arg1; - (void)_resume; - (void)<API key>:(_Bool)arg1; - (void)_pause; - (void)_cancel; - (void)_start; - (void)_changeMusic; - (void)<API key>:(id)arg1; - (_Bool)<API key>; - (void)selectPowerSong; - (void)resumeWorkout; - (void)<API key>; - (void)resumeEventsOnly; - (void)resume; - (void)suspend; @property(nonatomic) _Bool <API key>; @property(nonatomic) _Bool isLockScreen; - (void)updateOrientation; - (void)_layoutLabel:(id)arg1 inPosition:(int)arg2 isLandscape:(_Bool)arg3 <API key>:(_Bool)arg4 hasProgressView:(_Bool)arg5; - (void)<API key>:(int)arg1 isLandscape:(_Bool)arg2 <API key>:(_Bool)arg3 hasProgressView:(_Bool)arg4; - (void)<API key>:(int)arg1 isLandscape:(_Bool)arg2 <API key>:(_Bool)arg3 hasProgressView:(_Bool)arg4; - (void)<API key>:(int)arg1 isLandscape:(_Bool)arg2 <API key>:(_Bool)arg3 hasProgressView:(_Bool)arg4; - (void)<API key>:(int)arg1 isLandscape:(_Bool)arg2 <API key>:(_Bool)arg3 hasProgressView:(_Bool)arg4; - (void)<API key>:(long long)arg1; - (void)<API key>:(long long)arg1; - (void)<API key>:(long long)arg1; - (void)<API key>:(long long)arg1 presetGoal:(id)arg2; - (void)<API key>:(id)arg1; - (void)<API key>; - (void)layoutSubviews; - (void)didMoveToWindow; - (void)<API key>:(id)arg1; - (void)<API key>:(id)arg1; - (void)dealloc; - (id)initWithFrame:(struct CGRect)arg1 workoutProxy:(id)arg2; - (id)initWithFrame:(struct CGRect)arg1; @end
#import <UIKit/<API key>.h> // Not exported @interface <API key> : <API key> { } - (double)<API key>; - (id)backgroundImageName; - (_Bool)<API key>; - (int)cornerStyle; @end
package com.jme.curve; import java.io.IOException; import com.jme.math.Vector3f; import com.jme.scene.Controller; import com.jme.scene.Spatial; import com.jme.util.export.InputCapsule; import com.jme.util.export.JMEExporter; import com.jme.util.export.JMEImporter; import com.jme.util.export.OutputCapsule; /** * <code>CurveController</code> defines a controller that moves a supplied * <code>Spatial</code> object along a curve. Attributes of the curve are set * such as the up vector (if not set, the spacial object will roll along the * curve), the orientation precision defines how accurate the orientation of the * spatial will be. * @author Mark Powell * @version $Id: CurveController.java 4131 2009-03-19 20:15:28Z blaine.dev $ */ public class CurveController extends Controller { private static final long serialVersionUID = 1L; private Spatial mover; private Curve curve; private Vector3f up; private float <API key> = 0.1f; private float currentTime = 0.0f; private float deltaTime = 0.0f; private boolean cycleForward = true; private boolean autoRotation = false; /** * Constructor instantiates a new <code>CurveController</code> object. * The curve object that the controller operates on and the spatial object * that is moved is specified during construction. * @param curve the curve to operate on. * @param mover the spatial to move. */ public CurveController(Curve curve, Spatial mover) { this.curve = curve; this.mover = mover; setUpVector(new Vector3f(0,1,0)); setMinTime(0); setMaxTime(Float.MAX_VALUE); setRepeatType(Controller.RT_CLAMP); setSpeed(1.0f); } /** * Constructor instantiates a new <code>CurveController</code> object. * The curve object that the controller operates on and the spatial object * that is moved is specified during construction. The game time to * start and the game time to finish is also supplied. * @param curve the curve to operate on. * @param mover the spatial to move. * @param minTime the time to start the controller. * @param maxTime the time to end the controller. */ public CurveController( Curve curve, Spatial mover, float minTime, float maxTime) { this.curve = curve; this.mover = mover; setMinTime(minTime); setMaxTime(maxTime); setRepeatType(Controller.RT_CLAMP); } /** * * <code>setUpVector</code> sets the locking vector for the spatials up * vector. This prevents rolling along the curve and allows for a better * tracking. * @param up the vector to lock as the spatials up vector. */ public void setUpVector(Vector3f up) { this.up = up; } /** * * <code><API key></code> sets a precision value for the * spatials orientation. The smaller the number the higher the precision. * By default 0.1 is used, and typically does not require changing. * @param value the precision value of the spatial's orientation. */ public void <API key>(float value) { <API key> = value; } /** * * <code>setAutoRotation</code> determines if the object assigned to * the controller will rotate with the curve or just following the * curve. * @param value true if the object is to rotate with the curve, false * otherwise. */ public void setAutoRotation(boolean value) { autoRotation = value; } /** * * <code>isAutoRotating</code> returns true if the object is rotating with * the curve and false if it is not. * @return true if the object is following the curve, false otherwise. */ public boolean isAutoRotating() { return autoRotation; } /** * <code>update</code> moves a spatial along the given curve for along a * time period. * @see com.jme.scene.Controller#update(float) */ public void update(float time) { if(mover == null || curve == null || up == null) { return; } currentTime += time * getSpeed(); if (currentTime >= getMinTime() && currentTime <= getMaxTime()) { if (getRepeatType() == RT_CLAMP) { deltaTime = currentTime - getMinTime(); mover.setLocalTranslation(curve.getPoint(deltaTime,mover.getLocalTranslation())); if(autoRotation) { mover.setLocalRotation( curve.getOrientation( deltaTime, <API key>, up)); } } else if (getRepeatType() == RT_WRAP) { deltaTime = (currentTime - getMinTime()) % 1.0f; if (deltaTime > 1) { currentTime = 0; deltaTime = 0; } mover.setLocalTranslation(curve.getPoint(deltaTime,mover.getLocalTranslation())); if(autoRotation) { mover.setLocalRotation( curve.getOrientation( deltaTime, <API key>, up)); } } else if (getRepeatType() == RT_CYCLE) { float prevTime = deltaTime; deltaTime = (currentTime - getMinTime()) % 1.0f; if (prevTime > deltaTime) { cycleForward = !cycleForward; } if (cycleForward) { mover.setLocalTranslation(curve.getPoint(deltaTime,mover.getLocalTranslation())); if(autoRotation) { mover.setLocalRotation( curve.getOrientation( deltaTime, <API key>, up)); } } else { mover.setLocalTranslation( curve.getPoint(1.0f - deltaTime,mover.getLocalTranslation())); if(autoRotation) { mover.setLocalRotation( curve.getOrientation( 1.0f - deltaTime, <API key>, up)); } } } else { return; } } } public void reset() { this.currentTime = 0; } public void write(JMEExporter e) throws IOException { super.write(e); OutputCapsule capsule = e.getCapsule(this); capsule.write(mover, "mover", null); capsule.write(curve, "Curve", null); capsule.write(up, "up", null); capsule.write(<API key>, "<API key>", 0.1f); capsule.write(cycleForward, "cycleForward", true); capsule.write(autoRotation, "autoRotation", false); } public void read(JMEImporter e) throws IOException { super.read(e); InputCapsule capsule = e.getCapsule(this); mover = (Spatial)capsule.readSavable("mover", null); curve = (Curve)capsule.readSavable("curve", null); up = (Vector3f)capsule.readSavable("up", null); <API key> = capsule.readFloat("<API key>", 0.1f); cycleForward = capsule.readBoolean("cycleForward", true); autoRotation = capsule.readBoolean("autoRotation", false); } }
# shellcheck disable=SC2148 # Defines transfer alias and provides easy command line file and folder sharing. # Authors: # Remco Verhoef <remco@dutchcoders.io> transfer() { # check if curl is installed if ! curl --version >/dev/null 2>&1; then echo "Could not find curl." return 1 fi # check arguments if [ $# -eq 0 ]; then printf "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md" return 1 fi # get temporarily filename, output is written to this file show progress can be showed tmpfile=$(mktemp -t transferXXX) # upload stdin or file file=$1 if tty -s; then basefile=$(basename "$file" | sed -e 's/[^a-zA-Z0-9._-]/-/g') if [ ! -e "$file" ]; then echo "File $file doesn't exists." return 1 fi if [ -d "$file" ]; then # zip directory and transfer zipfile="$(mktemp -t transferXXX.zip)" # shellcheck disable=SC2086 cd "$(dirname $file)" && zip -r -q - "$(basename $file)" >>"$zipfile" curl --progress-bar --upload-file "$zipfile" "https://transfer.sh/$basefile.zip" >>"$tmpfile" rm -f "$zipfile" else # transfer file curl --progress-bar --upload-file "$file" "https://transfer.sh/$basefile" >>"$tmpfile" fi else # transfer pipe curl --progress-bar --upload-file "-" "https://transfer.sh/$file" >>"$tmpfile" fi # cat output link cat "$tmpfile" # cleanup rm -f "$tmpfile" }
using BizHawk.Common; namespace BizHawk.Emulation.Cores.Nintendo.NES { //AKA half of mapper 034 (the other half is AVE_NINA_001 which is entirely different..) public sealed class BxROM : NES.NESBoardBase { //configuration int prg_bank_mask_32k; int chr_bank_mask_8k; //state int prg_bank_32k; int chr_bank_8k; public override void SyncState(Serializer ser) { base.SyncState(ser); ser.Sync(nameof(prg_bank_32k), ref prg_bank_32k); ser.Sync(nameof(chr_bank_8k), ref chr_bank_8k); } public override bool Configure(NES.EDetectionOrigin origin) { switch (Cart.board_type) { case "AVE-NINA-07": // wally bear and the gang // it's not the NINA_001 but something entirely different; actually a colordreams with VRAM // this actually works AssertPrg(32,128); AssertChr(0,16); AssertWram(0); AssertVram(0,8); break; case "IREM-BNROM": //Mashou (J).nes case "NES-BNROM": //Deadly Towers (U) AssertPrg(128,256); AssertChr(0); AssertWram(0,8); AssertVram(8); break; default: return false; } prg_bank_mask_32k = Cart.prg_size / 32 - 1; chr_bank_mask_8k = Cart.chr_size / 8 - 1; SetMirrorType(Cart.pad_h, Cart.pad_v); return true; } public override byte ReadPRG(int addr) { addr |= (prg_bank_32k << 15); return ROM[addr]; } public override void WritePRG(int addr, byte value) { value = <API key>(addr, value); prg_bank_32k = value & prg_bank_mask_32k; chr_bank_8k = ((value >> 4) & 0xF) & chr_bank_mask_8k; } public override byte ReadPPU(int addr) { if (addr<0x2000) { if (VRAM != null) { return VRAM[addr]; } else { return VROM[addr | (chr_bank_8k << 13)]; } } else { return base.ReadPPU(addr); } } } }
var config = require('./../config'); var redis = require('./redis'); var _ = require('lodash'); function cacheDevice(device){ if(device){ var cloned = _.clone(device); redis.set('DEVICE_' + device.uuid, JSON.stringify(cloned),function(){ //console.log('cached', uuid); }); } } function noop(){} if(config.redis){ module.exports = cacheDevice; } else{ module.exports = noop; }
""" This module is to support *bbox_inches* option in savefig command. """ from __future__ import (absolute_import, division, print_function, unicode_literals) import six import warnings from matplotlib.transforms import Bbox, TransformedBbox, Affine2D def adjust_bbox(fig, bbox_inches, fixed_dpi=None): """ Temporarily adjust the figure so that only the specified area (bbox_inches) is saved. It modifies fig.bbox, fig.bbox_inches, fig.transFigure._boxout, and fig.patch. While the figure size changes, the scale of the original figure is conserved. A function which restores the original values are returned. """ origBbox = fig.bbox origBboxInches = fig.bbox_inches _boxout = fig.transFigure._boxout asp_list = [] locator_list = [] for ax in fig.axes: pos = ax.get_position(original=False).frozen() locator_list.append(ax.get_axes_locator()) asp_list.append(ax.get_aspect()) def _l(a, r, pos=pos): return pos ax.set_axes_locator(_l) ax.set_aspect("auto") def restore_bbox(): for ax, asp, loc in zip(fig.axes, asp_list, locator_list): ax.set_aspect(asp) ax.set_axes_locator(loc) fig.bbox = origBbox fig.bbox_inches = origBboxInches fig.transFigure._boxout = _boxout fig.transFigure.invalidate() fig.patch.set_bounds(0, 0, 1, 1) if fixed_dpi is not None: tr = Affine2D().scale(fixed_dpi) dpi_scale = fixed_dpi / fig.dpi else: tr = Affine2D().scale(fig.dpi) dpi_scale = 1. _bbox = TransformedBbox(bbox_inches, tr) fig.bbox_inches = Bbox.from_bounds(0, 0, bbox_inches.width, bbox_inches.height) x0, y0 = _bbox.x0, _bbox.y0 w1, h1 = fig.bbox.width * dpi_scale, fig.bbox.height * dpi_scale fig.transFigure._boxout = Bbox.from_bounds(-x0, -y0, w1, h1) fig.transFigure.invalidate() fig.bbox = TransformedBbox(fig.bbox_inches, tr) fig.patch.set_bounds(x0 / w1, y0 / h1, fig.bbox.width / w1, fig.bbox.height / h1) return restore_bbox def <API key>(fig, bbox_inches_restore, fixed_dpi=None): """ This need to be called when figure dpi changes during the drawing (e.g., rasterizing). It recovers the bbox and re-adjust it with the new dpi. """ bbox_inches, restore_bbox = bbox_inches_restore restore_bbox() r = adjust_bbox(figure, bbox_inches, fixed_dpi) return bbox_inches, r
// documentation files (the "Software"), to deal in the Software without restriction, including without limitation the // permit persons to whom the Software is furnished to do so, subject to the following conditions: // Software. // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #import <Cocoa/Cocoa.h> @interface MKSidebarLabel : NSTextField @end
# Require any additional compass plugins here. require 'sass-globbing' # Set this to the root of your project when deployed: http_path = "/" css_dir = "_includes/css" sass_dir = "_includes/sass" images_dir = "assets/img" javascripts_dir = "assets/js" relative_assets = true # Compilation pour la prod : environment = :production output_style = :compressed # Compilation durant le dev : # environment = :development #output_style = :expanded # You can select your preferred output style here (can be overridden via the command line): # output_style = :expanded or :nested or :compact or :compressed # To enable relative paths to assets via compass helper functions. Uncomment: # relative_assets = true # To disable debugging comments that display the original location of your selectors. Uncomment: # line_comments = false # If you prefer the indented syntax, you might want to regenerate this # project again passing --syntax sass, or you can uncomment this: # preferred_syntax = :sass # and then run: # sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass
import defaultClasses from "../config/classes.js"; import ChartBase from "./chartBase.js"; import { ChartUtils } from "../utils/utils.js"; /** * Horizontal Bar Chart Implementation * * @extends {ChartBase} */ class HorizontalBarChart extends ChartBase{ /** * Creates an instance of HorizontalBarChart. * * @param {any} options */ constructor(options) { super(options); } /** * @override */ render(options) { var axes = this.axes, yScale = axes.axis("y").scale(), xScale = axes.axis("x").scale(), data = this.data[0].values, chartArea = this.layer, barHeight = yScale.rangeBand(), barPadding = 6, hasNegative = ChartUtils.hasNegative(data), animation = (options && !options.animation) ? false : true;; var getClass = d => { if(hasNegative){ return d >= 0 ? "h-bar-positive" : "h-bar-negative"; } return "h-bar"; }; var draw = selection => { selection.attr("class", getClass) .attr("x", (d) => xScale(Math.min(0, d))) .attr("y", 6) .attr("transform", (d, i) => "translate(0," + i * barHeight + ")") .attr("width", d => animation ? 0 : Math.abs(xScale(d) - xScale(0)) ) .attr("height", barHeight - barPadding); return selection; }; var bar = chartArea.selectAll("rect").data(data); bar.call(draw) .enter().append("rect").call(draw); bar.exit().remove(); if (animation) { bar.transition().duration(300) .attr("width", d => Math.abs(xScale(d) - xScale(0))); } } /** * * * @param {any} index */ onMouseover(index) { this.canvas.svg.selectAll(`.${defaultClasses.CHART_GROUP}.${defaultClasses.FOCUS}-${index}`) .transition() .style("opacity", 0.5); } /** * * * @param {any} index */ onMouseout(index) { this.canvas.svg.selectAll(`.${defaultClasses.CHART_GROUP}.${defaultClasses.FOCUS}-${index}`) .transition() .style("opacity", 1); } /** * * * @param {any} data */ _formatData(data) { var xDomain = this.axes.axis("x").scale().domain(); this._categories = data.map(value => value.name); this.data = xDomain.map(function (series, i) { var item = { series }; item.values = data.map(value => { return { series: series, category: value.name, value: value.values[i], index: value.index }; }); return item; }); } } export default HorizontalBarChart;
<?php namespace Wowo\NewsletterBundle\Newsletter\Placeholders; use Wowo\NewsletterBundle\Newsletter\Placeholders\Exception\<API key>; class <API key> implements <API key> { protected $mapping; protected $referenceClass; protected $<API key> = '{{'; protected $<API key> = '}}'; protected $placeholder_regex = '#delim_lef\s*placeholder\s*delim_right#'; public function setMapping(array $mapping) { $this->mapping = $mapping; } public function setReferenceClass($referenceClass) { if (!class_exists($referenceClass)) { throw new \<API key>(sprintf('Class %s doesn\'t exist!', $referenceClass)); } $this->referenceClass = $referenceClass; } public function process($object, $body) { if (null == $this->mapping) { throw new \<API key>('Placeholders mapping ain\'t configured yet'); } if (get_class($object) != $this->referenceClass) { throw new \<API key>(sprintf('Object passed to method isn\'t an instance of referenceClass (%s != %s)', get_class($object), $this->referenceClass)); } $this-><API key>(); foreach ($this->mapping as $placeholder => $source) { $value = $this->getPlaceholderValue($object, $source); $body = $this->replacePlaceholder($placeholder, $value, $body); } return $body; } /** * Get value from object based on source (property or method). It claims that validation were done * * @param mixed $object * @param mixed $source * @access protected * @return void */ protected function getPlaceholderValue($object, $source) { $rc = new \ReflectionClass(get_class($object)); if ($rc->hasProperty($source)) { return $object->$source; } else { return call_user_func(array($object, $source)); } } protected function replacePlaceholder($placeholder, $value, $body) { $regex = str_replace( array('delim_lef', 'delim_right', 'placeholder'), array($this-><API key>, $this-><API key>, $placeholder), $this->placeholder_regex ); return preg_replace($regex, $value, $body); } /** * It looks firstly for properties, then for method (getter) * */ protected function <API key>() { $rc = new \ReflectionClass($this->referenceClass); foreach ($this->mapping as $placeholder => $source) { if ($rc->hasProperty($source)) { $rp = new \ReflectionProperty($this->referenceClass, $source); if (!$rp->isPublic()) { throw new <API key>( sprintf('A placeholder %s defines source %s as a property, but it isn\'t public visible', $placeholder, $source), <API key>::NON_PUBLIC_PROPERTY); } } elseif($rc->hasMethod($source)) { $rm = new \ReflectionMethod($this->referenceClass, $source); if (!$rm->isPublic()) { throw new <API key>( sprintf('A placeholder %s defines source %s as a method (getter), but it isn\'t public visible', $placeholder, $source), <API key>::NON_PUBLIC_METHOD); } } else { throw new <API key>( sprintf('Unable to map placeholder %s with source %s', $placeholder, $source), <API key>::UNABLE_TO_MAP); } } } }
#pragma once #include <string.h> #include <tuple> #include <boost/uuid/uuid.hpp> #include "Common/StringTools.h" namespace CryptoNote { typedef boost::uuids::uuid uuid; typedef boost::uuids::uuid net_connection_id; typedef uint64_t PeerIdType; #pragma pack (push, 1) struct NetworkAddress { uint32_t ip; uint32_t port; }; struct PeerlistEntry { NetworkAddress adr; PeerIdType id; uint64_t last_seen; }; struct connection_entry { NetworkAddress adr; PeerIdType id; bool is_income; }; #pragma pack(pop) inline bool operator < (const NetworkAddress& a, const NetworkAddress& b) { return std::tie(a.ip, a.port) < std::tie(b.ip, b.port); } inline bool operator == (const NetworkAddress& a, const NetworkAddress& b) { return memcmp(&a, &b, sizeof(a)) == 0; } inline std::ostream& operator << (std::ostream& s, const NetworkAddress& na) { return s << Common::ipAddressToString(na.ip) << ":" << std::to_string(na.port); } inline uint32_t hostToNetwork(uint32_t n) { return (n << 24) | (n & 0xff00) << 8 | (n & 0xff0000) >> 8 | (n >> 24); } inline uint32_t networkToHost(uint32_t n) { return hostToNetwork(n); // the same } }
Rails.application.routes.draw do # The priority is based upon order of creation: first created -> highest priority. # See how all your routes lay out with "rake routes". # You can have the root of your site routed with "root" # root 'application#hello' root 'application#goodbye' # Example of regular route: # get 'products/:id' => 'catalog#view' # Example of named route that can be invoked with purchase_url(id: product.id) # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase # Example resource route (maps HTTP verbs to controller actions automatically): # resources :products # Example resource route with options: # resources :products do # member do # get 'short' # post 'toggle' # end # collection do # get 'sold' # end # end # Example resource route with sub-resources: # resources :products do # resources :comments, :sales # resource :seller # end # Example resource route with more complex sub-resources: # resources :products do # resources :comments # resources :sales do # get 'recent', on: :collection # end # end # Example resource route with concerns: # concern :toggleable do # post 'toggle' # end # resources :posts, concerns: :toggleable # resources :photos, concerns: :toggleable # Example resource route within a namespace: # namespace :admin do
( function( QUnit, bender ) { var total = 0, failed = 0, passed = 0, ignored = 0, errors = 0, result = { success: true, errors: [] }; // prevent QUnit from starting QUnit.config.autostart = false; bender.removeListener( window, 'load', QUnit.load ); function start() { QUnit.testStart( function() { total++; } ); QUnit.testDone( function( details ) { details.success = result.success; details.error = result.errors.length ? result.errors.join( '\n' ) : undefined; details.duration = details.runtime; details.fullName = details.module + ' ' + details.name; bender.result( details ); if ( details.success ) { if ( details.ignored ) { ignored++; } else { passed++; } } else { failed++; errors++; } result.success = true; result.errors = []; } ); QUnit.done( function( details ) { details.duration = details.runtime; bender.next( { coverage: window.__coverage__, duration: details.runtime, passed: passed, failed: failed, errors: errors, ignored: ignored, total: total } ); } ); QUnit.log( function( details ) { // add detailed error message to test result if ( !details.result ) { result.success = false; result.errors.push( [ details.message, 'Expected: ' + details.expected, 'Actual: ' + details.actual, details.source ].join( '\n' ) ); } } ); // manually start the runner QUnit.load(); QUnit.start(); } function stopRunner() { QUnit.stop(); } function isSingle( name ) { return name === decodeURIComponent( window.location.hash.substr( 1 ) ); } var oldTest = QUnit.test; QUnit.test = function( name ) { var module = this.config.currentModule, fullName = module ? module + ' ' + name : name; if ( window.location.hash && window.location.hash !== '#child' && !isSingle( fullName ) ) { return; } oldTest.apply( this, arguments ); }; window.assert = bender.assert = QUnit.assert; bender.runner = QUnit; bender.start = start; bender.stopRunner = stopRunner; } )( window.QUnit || {}, bender );
<!doctype html> <html> <head> <script src="../bower_components/webcomponentsjs/webcomponents.js"></script> <link rel="import" href="../dist/metaroom-markup.html"> </head> <body> <meta-verse> <meta-style> #vrcollab-poster { frame-style: solid; frame-thickness: 2; frame-width: 0.3; frame-color: #F33; padding: 0.1; } #phong-meta-tsurface{ material-color: gold; material-type: phong; } meta-verse{ skybox-style: sun-sphere; } .pretty-pic{ material-color: red; } #that-pic{ material-color: blue; } .light-chocolate{ material-color: #8D6E63; tbottom-padding-top: 0.5; <API key>: 0.3; } #left-wall{ material-color: #d3d3d3; } meta-tbottom{ material-color: #795548; } .chocolate{ material-color: #795548; } .styled-wall { material-color: #E0E0E0; } meta-table{ thickness: 0.1; } </meta-style> <meta-room width='30' height='15' length='20'> <!-- maybe we should make all the left wall and right wall to meta&#45;wall with left , right, top , floor alignement --> <meta-wall align='left' meta-style='material-color: #EEEEEE'> <meta-picture id='vrcollab-poster' src='img/VRcollab.png' width='6' length='3'></meta-picture> <meta-picture src='img/VRcollab.png' width='4' length='2'></meta-picture> <meta-board width='6' length='5'> <meta-picture src='img/VRcollab.png' width='3' length='2'></meta-picture> <meta-picture meta-style='frame-width: 0.5' src='img/VRcollab.png' width='3' length='2'></meta-picture> <meta-text width='3'>A place for you to build future VR websites collaboratively</meta-text> </meta-board> <meta-text width='1'>Yay!</meta-text> <meta-picture id="that-pic" class="pretty-pic" src='img/VRcollab.png' width='5' length='2'></meta-picture> </meta-wall> <meta-wall align='right' class='styled-wall'> <meta-picture meta-style='position: absolute; top: 10; left: 0' src='img/VRcollab.png' width='3' length='2'></meta-picture> <meta-picture meta-style='frame-width: 0.5' src='img/VRcollab.png' width='3' length='2'></meta-picture> <meta-html> <img src='img/VRcollab.png'/> A Place for you to build future VR websites collaboratively </meta-html> </meta-wall> <meta-wall align='front' class='styled-wall'> <meta-board width='3' length='3' meta-style='position: absolute; top: 0; left: 8'></meta-board> <meta-text width='3' length='2' meta-style='position: absolute; top: 3; left: 6'>Hello, Test!</meta-text> <meta-picture src='img/VRcollab.png' width='3' length='2'></meta-picture> </meta-wall> <meta-wall align='back' class='styled-wall'> <meta-picture src='img/VRcollab.png' width='3' length='2'></meta-picture> </meta-wall> <meta-wall align='ceiling' class='styled-wall'> <meta-picture src='img/VRcollab.png' width='3' length='2'></meta-picture> </meta-wall> <meta-floor class='styled-wall'> <meta-table class='light-chocolate' width='5' length='4' height='3'> <meta-tsurface class='light-chocolate'> <meta-tr> <meta-td> </meta-td> </meta-tr> </meta-tsurface> <meta-tbottom class='light-chocolate' align='left'></meta-tbottom> <meta-tbottom class='light-chocolate' align='right'></meta-tbottom> </meta-table> <meta-table class='light-chocolate' width='5' length='4' height='2' > <meta-tsurface class='chocolate'> <meta-item width='4' length='2' height='4' material-src='model/sydney/model_mesh.obj.mtl' geometry-src='model/sydney/model_mesh.obj' id='meta-item-on-floor'></meta-item> </meta-tsurface> <meta-tbottom class='chocolate' align='right'></meta-tbottom> <meta-tbottom align='left'> <meta-label>Contact US</meta-label> </meta-tbottom> </meta-table> <meta-table height='3' meta-style='tbottom-padding-top: 0.5'> <meta-tsurface class='chocolate'> <meta-picture src='img/VRcollab.png' width='3' length='2'></meta-picture> <meta-picture src='img/VRcollab.png' width='3' length='2'></meta-picture> <meta-picture src='img/VRcollab.png' width='2' length='2'></meta-picture> <meta-item width='4' length='2' height='4' material-src='model/sydney/model_mesh.obj.mtl' geometry-src='model/sydney/model_mesh.obj' id='meta-item-on-floor'></meta-item> <meta-picture src='img/VRcollab.png' width='3' length='2'></meta-picture> <meta-picture src='img/VRcollab.png' width='2' length='2'></meta-picture> <meta-picture src='img/VRcollab.png' width='2' length='2'></meta-picture> <meta-picture src='img/VRcollab.png' width='2' length='2'></meta-picture> <meta-picture src='img/VRcollab.png' width='2' length='2'></meta-picture> <meta-picture src='img/VRcollab.png' width='2' length='2'></meta-picture> <meta-picture src='img/VRcollab.png' width='2' length='2'></meta-picture> <meta-item width='2' length='2' height='4' material-src='model/pokka/model_mesh.obj.mtl' geometry-src='model/pokka/model_mesh.obj' id='meta-item-on-floor'></meta-item> <meta-picture src='img/VRcollab.png' width='2' length='2'></meta-picture> </meta-tsurface> <meta-tbottom class='chocolate' align='right'></meta-tbottom> <meta-tbottom align='left'> <meta-label>Contact US</meta-label> </meta-tbottom> </meta-table> <meta-table class='light-chocolate' width='5' length='4' height='3' meta-style='tbottom-padding: 0.5'> <meta-tsurface class='light-chocolate' id="phong-meta-tsurface"> <meta-picture src='img/VRcollab.png' width='3' length='2'></meta-picture> <meta-item width='2' length='2' height='4' material-src='model/pokka/model_mesh.obj.mtl' geometry-src='model/pokka/model_mesh.obj' id='meta-item-on-floor'></meta-item> </meta-tsurface> <meta-tbottom class='light-chocolate' align='left'></meta-tbottom> <meta-tbottom class='light-chocolate' align='right'></meta-tbottom> </meta-table> <meta-table class='light-chocolate' width='5' length='4' height='3' > <meta-tsurface class='light-chocolate' id="phong-meta-tsurface"> <meta-picture src='img/VRcollab.png' width='3' length='2'></meta-picture> <meta-item width='2' length='2' height='4' material-src='model/pokka/model_mesh.obj.mtl' geometry-src='model/pokka/model_mesh.obj' id='meta-item-on-floor'></meta-item> </meta-tsurface> <meta-tbottom class='light-chocolate' align='right'></meta-tbottom> <meta-tbottom class='light-chocolate' align='left'></meta-tbottom> </meta-table> <meta-table class='light-chocolate' width='5' length='4' height='4' meta-style='position: absolute; top: 0; left: 15; rotate-z:45'> <meta-tsurface class='light-chocolate' id="phong-meta-tsurface"> <meta-picture src='img/VRcollab.png' width='3' length='2' meta-style='position: absolute; top: 1; left: 0'></meta-picture> <meta-item width='2' length='2' height='4' material-src='model/pokka/model_mesh.obj.mtl' geometry-src='model/pokka/model_mesh.obj' id='meta-item-on-floor'></meta-item> </meta-tsurface> <meta-tbottom class='light-chocolate' align='right'></meta-tbottom> <meta-tbottom class='light-chocolate' align='left'></meta-tbottom> </meta-table> </meta-floor> </meta-room> </meta-verse> </body> </html>
using System.Net; using FluentAssertions; using JsonApiDotNetCore.Resources; using JsonApiDotNetCore.Serialization.Objects; using Microsoft.Extensions.DependencyInjection; using TestBuildingBlocks; using Xunit; namespace <API key>.IntegrationTests.AtomicOperations.Links; public sealed class <API key> : IClassFixture<<API key><TestableStartup<OperationsDbContext>, OperationsDbContext>> { private const string HostPrefix = "http://localhost"; private readonly <API key><TestableStartup<OperationsDbContext>, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new(); public <API key>(<API key><TestableStartup<OperationsDbContext>, OperationsDbContext> testContext) { _testContext = testContext; testContext.UseController<<API key>>(); // These routes need to be registered in ASP.NET for rendering links to resource/relationship endpoints. testContext.UseController<<API key>>(); testContext.UseController<<API key>>(); testContext.<API key>(services => { services.AddScoped(typeof(<API key><>), typeof(<API key><>)); }); } [Fact] public async Task <API key>() { // Arrange TextLanguage existingLanguage = _fakers.TextLanguage.Generate(); RecordCompany existingCompany = _fakers.RecordCompany.Generate(); await _testContext.RunOnDatabaseAsync(async dbContext => { dbContext.AddInRange(existingLanguage, existingCompany); await dbContext.SaveChangesAsync(); }); var requestBody = new { atomic__operations = new object[] { new { op = "update", data = new { type = "textLanguages", id = existingLanguage.StringId, attributes = new { } } }, new { op = "update", data = new { type = "recordCompanies", id = existingCompany.StringId, attributes = new { } } } } }; const string route = "/operations"; // Act (HttpResponseMessage httpResponse, Document responseDocument) = await _testContext.<API key><Document>(route, requestBody); // Assert httpResponse.Should().HaveStatusCode(HttpStatusCode.OK); responseDocument.Results.ShouldHaveCount(2); responseDocument.Results[0].Data.SingleValue.ShouldNotBeNull().With(resource => { string languageLink = $"{HostPrefix}/textLanguages/{existingLanguage.StringId}"; resource.ShouldNotBeNull(); resource.Links.ShouldNotBeNull(); resource.Links.Self.Should().Be(languageLink); resource.Relationships.ShouldContainKey("lyrics").With(value => { value.ShouldNotBeNull(); value.Links.ShouldNotBeNull(); value.Links.Self.Should().Be($"{languageLink}/relationships/lyrics"); value.Links.Related.Should().Be($"{languageLink}/lyrics"); }); }); responseDocument.Results[1].Data.SingleValue.ShouldNotBeNull().With(resource => { string companyLink = $"{HostPrefix}/recordCompanies/{existingCompany.StringId}"; resource.ShouldNotBeNull(); resource.Links.ShouldNotBeNull(); resource.Links.Self.Should().Be(companyLink); resource.Relationships.ShouldContainKey("tracks").With(value => { value.ShouldNotBeNull(); value.Links.ShouldNotBeNull(); value.Links.Self.Should().Be($"{companyLink}/relationships/tracks"); value.Links.Related.Should().Be($"{companyLink}/tracks"); }); }); } [Fact] public async Task <API key>() { // Arrange Playlist existingPlaylist = _fakers.Playlist.Generate(); await _testContext.RunOnDatabaseAsync(async dbContext => { dbContext.Playlists.Add(existingPlaylist); await dbContext.SaveChangesAsync(); }); var requestBody = new { atomic__operations = new object[] { new { op = "update", data = new { type = "playlists", id = existingPlaylist.StringId, attributes = new { } } } } }; const string route = "/operations"; // Act (HttpResponseMessage httpResponse, Document responseDocument) = await _testContext.<API key><Document>(route, requestBody); // Assert httpResponse.Should().HaveStatusCode(HttpStatusCode.OK); responseDocument.Results.ShouldHaveCount(1); responseDocument.Results[0].Data.SingleValue.ShouldNotBeNull().With(resource => { resource.ShouldNotBeNull(); resource.Links.Should().BeNull(); resource.Relationships.Should().BeNull(); }); } }
<p> comp-1030 works! </p>
#include "WebForm.h" WebForm::WebForm(void) :__pWeb(null), __phonegapCommand(null) { geolocation = null; device = null; accel = null; network = null; console = null; compass = null; contacts = null; } WebForm::~WebForm(void) { } bool WebForm::Initialize() { return true; } result WebForm::OnInitializing(void) { result r = E_SUCCESS; // TODO: Add your initialization code here r = CreateWebControl(); if (IsFailed(r)) { AppLog("CreateMainForm() has failed.\n"); goto CATCH; } __pWeb->LoadUrl("file:///Res/index.html"); //__pWeb->LoadUrl("file:///Res/mobile-spec/index.html"); return r; CATCH: return false; } result WebForm::OnTerminating(void) { result r = E_SUCCESS; // delete __phonegapCommand; // delete geolocation; // delete device; // delete accel; // delete network; // delete console; // delete compass; // delete contacts; // delete notification; // delete camera; return r; } void WebForm::OnActionPerformed(const Osp::Ui::Control& source, int actionId) { switch(actionId) { default: break; } } void WebForm::LaunchBrowser(const String& url) { ArrayList* pDataList = null; pDataList = new ArrayList(); pDataList->Construct(); String* pData = null; pData = new String(L"url:"); pData->Append(url); AppLogDebug("Launching Stock Browser with %S", pData->GetPointer()); pDataList->Add(*pData); AppControl* pAc = AppManager::FindAppControlN(APPCONTROL_BROWSER, ""); if(pAc) { pAc->Start(pDataList, null); delete pAc; } pDataList->RemoveAll(true); delete pDataList; } bool WebForm::OnLoadingRequested (const Osp::Base::String& url, WebNavigationType type) { AppLogDebug("URL REQUESTED %S", url.GetPointer()); if(url.StartsWith("gap: // __phonegapCommand = null; __phonegapCommand = new String(url); // FIXME: for some reason this does not work if we return true. Web freezes. // __pWeb->StopLoading(); // String* test; // test = __pWeb->EvaluateJavascriptN(L"'test'"); // AppLogDebug("String is %S", test->GetPointer()); // delete test; // return true; return false; } else if(url.StartsWith("http: AppLogDebug("Non PhoneGap command. External URL. Launching WebBrowser"); LaunchBrowser(url); return false; } return false; } void WebForm::OnLoadingCompleted() { // Setting DeviceInfo to initialize PhoneGap (should be done only once) and firing onNativeReady event String* deviceInfo; deviceInfo = __pWeb->EvaluateJavascriptN(L"window.device.uuid"); if(deviceInfo->IsEmpty()) { device->SetDeviceInfo(); __pWeb->EvaluateJavascriptN("PhoneGap.onNativeReady.fire();"); } else { //AppLogDebug("DeviceInfo = %S;", deviceInfo->GetPointer()); } delete deviceInfo; // Analyzing PhoneGap command if(__phonegapCommand) { if(__phonegapCommand->StartsWith(L"gap://com.phonegap.Geolocation", 0)) { geolocation->Run(*__phonegapCommand); } else if(__phonegapCommand->StartsWith(L"gap://com.phonegap.Accelerometer", 0)) { accel->Run(*__phonegapCommand); } else if(__phonegapCommand->StartsWith(L"gap://com.phonegap.Network", 0)) { network->Run(*__phonegapCommand); } else if(__phonegapCommand->StartsWith(L"gap://com.phonegap.DebugConsole", 0)) { console->Run(*__phonegapCommand); } else if(__phonegapCommand->StartsWith(L"gap://com.phonegap.Compass", 0)) { compass->Run(*__phonegapCommand); } else if(__phonegapCommand->StartsWith(L"gap://com.phonegap.Contacts", 0)) { contacts->Run(*__phonegapCommand); } else if(__phonegapCommand->StartsWith(L"gap://com.phonegap.Notification", 0)) { notification->Run(*__phonegapCommand); } else if(__phonegapCommand->StartsWith(L"gap://com.phonegap.Camera", 0)) { camera->Run(*__phonegapCommand); } // Tell the JS code that we got this command, and we're ready for another __pWeb->EvaluateJavascriptN(L"PhoneGap.queue.ready = true;"); delete __phonegapCommand; __phonegapCommand = null; } else { AppLogDebug("Non PhoneGap command completed"); } } result WebForm::CreateWebControl(void) { result r = E_SUCCESS; int screen_width = 0; int screen_height = 0; /*screen*/ r = SystemInfo::GetValue("ScreenWidth", screen_width); TryCatch(r == E_SUCCESS, , "SystemInfo: To get a value is failed"); r = SystemInfo::GetValue("ScreenHeight", screen_height); TryCatch(r == E_SUCCESS, , "SystemInfo: To get a value is failed"); /*Web*/ __pWeb = new Web(); r = __pWeb->Construct(Rectangle(0, 0, screen_width, screen_height - 38)); TryCatch(r == E_SUCCESS, ,"Web is not constructed\n "); r = this->AddControl(*__pWeb); TryCatch(r == E_SUCCESS, ,"Web is not attached\n "); __pWeb->SetLoadingListener(this); __pWeb->SetFocus(); if(__pWeb) { geolocation = new GeoLocation(__pWeb); device = new Device(__pWeb); accel = new Accelerometer(__pWeb); network = new Network(__pWeb); console = new DebugConsole(__pWeb); compass = new Compass(__pWeb); contacts = new Contacts(__pWeb); notification = new Notification(__pWeb); camera = new Kamera(__pWeb); } return r; CATCH: AppLog("Error = %s\n", GetErrorMessage(r)); return r; }
# Simple powershell (built-in to Win7/8/10) utility script # to compute sha256 (or md5, sha1 or sha512) of a file # Usage: # C:\> powershell # PS .\Get-Hash filename.ext [sha|md5|sha256|sha512] # May require: Control Panel/System/Admin/Windows Power Shell Modules, then: Set-Executionpolicy RemoteSigned # Based on James Manning's and Mike Wilbur's get-hashes and get-sha256 MSDN scripts param( [string] $file = $(throw "A filename is required. Usage: .\Get-Hash filename.ext [sha|md5|sha256|sha512]"), [string] $algorithm = 'sha256' ) $fileStream = [system.io.file]::openread((resolve-path $file)) $hasher = [System.Security.Cryptography.HashAlgorithm]::create($algorithm) $hash = $hasher.ComputeHash($fileStream) $fileStream.close() $fileStream.dispose() [system.bitconverter]::tostring($hash).ToLower().replace('-','')+" '"+$file+"' "+$algorithm+"`r`n"
<!DOCTYPE html> <html lang='en' ng-app='app'> <head> <meta charset='utf-8'> <meta content='IE=edge' http-equiv='X-UA-Compatible'> <meta content='width=device-width, initial-scale=1.0' name='viewport'> <link href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" media="all" rel="stylesheet" /> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" media="screen" rel="stylesheet" /> <link rel="stylesheet" href="//code.jquery.com/ui/1.11.1/themes/smoothness/jquery-ui.css"> <link href="bower_components/angular-ui-select/dist/select.css" media="screen" rel="stylesheet" /> <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.1/jquery-ui.min.js"></script> <script src="bower_components/underscore/underscore-min.js"></script> <script src="bower_components/angular/angular.js"></script> <script src="bower_components/angular-sanitize/angular-sanitize.min.js"></script> <script src="bower_components/angular-translate/angular-translate.min.js"></script> <script src='bower_components/angular-ui-select/dist/select.js'></script> <script src="bower_components/tv4/tv4.js"></script> <script src="bower_components/objectpath/lib/ObjectPath.js"></script> <script src="bower_components/angular-schema-form/dist/schema-form.min.js"></script> <script src="bower_components/angular-schema-form/dist/bootstrap-decorator.min.js"></script> <script src="bower_components/angular-underscore.js"></script> <script src="ui-sortable.js"></script> <script src="<API key>.js"></script> <script src="app.js"></script> <base href='/'> <style type="text/css" rel="stylesheet"> .short { width: 200px; } .ui-select-bootstrap > .ui-select-match > .caret { display: none; } .ui-state-highlight { display: inline-block; width: 50px; min-height: 100%; } </style> </head> <body ng-controller='SelectController'> <div class="box box-primary ng-cloak"> <div class="box-header"> <h3 class="box-title">{{$root.$state.current.data.label}} - {{model.name}}</h3> </div> <form name="roleForm" ng-submit="submitted(roleForm)"> <div class="box-body"> <div sf-schema="schema" sf-form="form" sf-model="model"></div> </div> <div class="box-footer"> <button type="submit" class="btn btn-primary btn-flat">{{ 'buttons.save' | translate }}</button> <a ui-sref="roles" class="btn btn-warning btn-flat pull-right">{{ 'buttons.cancel' | translate }}</a> </div> </form> </div> </div> </body> </html>
<div class="container"> <form [formGroup]="form" (ngSubmit)="sendEmail()"> <div class="row"> <div class="column large-2 small-2"> <label for="subject" class="right">Получатели: <small *ngIf="selectedUsers?.length == 0"><i>не выбраны</i></small> </label> </div> <div class="column large-1 small-1"> <input class="button hollow" [ngClass]="{'button-signal': form?.controls['users'].hasError('noSelectedUsers') && !userSelecting}" type="button" value="+" (click)="toggleUserSelection()"> </div> <div class="column large-4 small-4" [hidden]="!userSelecting"> <select #userSelector multiple name="users" id="users" size="10"> <option *ngFor="let user of users" [value]="user.id">{{user.lastName}} {{user.firstName}} {{user.patronymic}} </option> </select> </div> <div class="column large-1 small-1" *ngIf="userSelecting"> <input class="button hollow" type="button" [ngClass]="{'button-signal': form?.controls['users'].hasError('noSelectedUsers') && userSelecting}" value=">>" (click)="addUsers(userSelector)"> </div> <div class="column large-4 small-4" *ngIf="!form?.controls['users'].hasError('noSelectedUsers') && userSelecting"> <ul class="list"> <li *ngFor="let user of selectedUsers" (click)="removeFromSelected(user)"> <span data-tooltip aria-haspopup="true" class="top" data-disable-hover="false" tabindex="2" title="Кликните, чтобы удалить"> {{user.lastName}} {{user.firstName}} {{user.patronymic}} </span> </li> </ul> </div> <div class="column large-3 small-3" *ngIf="form?.controls['users'].hasError('noSelectedUsers') && userSelecting"> <div class="callout alert"> Выберите получателя(ей) </div> </div> </div> <div class="row"> <div class="column large-2 small-2"> <label for="subject" class="right">Тема:</label> </div> <div class="column large-9 small-9"> <input id="subject" name="subject" type="text" [formControl]="form.controls['subject']"> </div> </div> <div class="row"> <div class="column large-offset-2 small-offset-2 medium-offset-2 large-10 medium-2 small-10"> <div class="button-group" id="control-panel"> <button class="button hollow background-button" type="button" data-toggle="<API key>">Bg </button> <div class="dropdown-pane" id="<API key>" data-dropdown data-auto-focus="true"> <input class="input-color" type="color" id="backgroundColor" name="backgroundColor" (change)="<API key>()" [formControl]="form.controls['backgroundColor']"> </div> <label for="image" class="button hollow attach-button"><i class="fi-paperclip"></i></label> <input #image type="file" name="image" (change)="fileSelected(image)" id="image" class="show-for-sr" accept="image/jpeg"> <button class="button hollow" type="button" data-toggle="templateDropdown">T</button> <div class="dropdown-pane" id="templateDropdown" data-dropdown data-auto-focus="true"> <select name="template" id="template" [formControl]="form.controls['template']" (change)="changeTemplate()"> <option *ngFor="let t of templates" [value]="t.type"> {{<API key>.get(t.type)}} </option> </select> </div> </div> </div> </div> <div class="row"> <div class="column large-offset-2 small-offset-2 large-4 small-4"> <div class="attachment" *ngIf="file"> <span>{{file?.name}}</span> <button class="close" type="button" (click)="removeAttachment(image)"> <span aria-hidden="true">&times;</span> </button> </div> </div> </div> <div class="row"> <div class="column large-2 small-2"> <label for="textarea-body" class="right" *ngIf="!selectedTemplate.body">Текст:</label> <label for="div-body" class="right" *ngIf="selectedTemplate.body">Текст:</label> </div> <div class="column large-9 small-9"> <textarea id="textarea-body" name="body" [ngStyle]="{'background': selectedTemplate.backgroundColor}" [formControl]="form.controls['body']" cols="30" rows="20" *ngIf="!selectedTemplate.body"></textarea> <div #body id="div-body" [ngStyle]="{'background': selectedTemplate.backgroundColor}" class="email-body" [innerHTML]="selectedTemplate.body" *ngIf="selectedTemplate.body"></div> </div> </div> <div class="column large-11 medium-11 small-11"> <div class="button-right"> <input class="button" type="submit" [disabled]="!form.valid" value="Отправить"> </div> </div> </form> </div> <div class="reveal success" id="modalSizeError" data-reveal> <button class="close-button" type="button" data-close> <span aria-hidden="true">&times;</span> </button> <h5>Размер файла превышает допустимый (5 MB)</h5> </div> <div class="reveal success" id="modal" data-reveal> <button class="close-button" type="button" data-close> <span aria-hidden="true">&times;</span> </button> <div class="text center"> <span>Идёт отправка письма. Подождите </span> <div class="spinner" *ngIf="requestInProgress"> <spinner [size]="15" [tickness]="2"></spinner> </div> </div> <div class="text center"> <span *ngIf="success"><b>Письмо успешно отправлено</b></span> <span *ngIf="fail"><b>Произошёл сбой во время отправки письма. Письмо не было отправлено</b></span> </div> <input type="button" class="button center" value="ОК" data-close *ngIf="success || fail"> </div>
import { flatArgs } from './Query'; import type { Entity } from '../binding'; import type { Filter } from './Filter'; import { JsonMap } from '../util'; import type { GeoPoint } from '../GeoPoint'; /** * The Condition interface defines all existing query filters */ export interface Condition<T extends Entity> { /** * An object that contains filter rules which will be merged with the current filters of this query * * @param conditions - Additional filters for this query * @return The resulting Query */ where(conditions: JsonMap): Filter<T>; /** * Adds a equal filter to the field. All other other filters on the field will be discarded * @param field The field to filter * @param value The value used to filter * @return The resulting Query */ equal(field: string, value: any): Filter<T> notEqual(field: string, value: any): Filter<T> greaterThan(field: string, value: number | string | Date | Entity): Filter<T> <API key>(field: string, value: number | string | Date | Entity): Filter<T> lessThan(field: string, value: number | string | Date | Entity): Filter<T> lessThanOrEqualTo(field: string, value: number | string | Date | Entity): Filter<T> /** * Adds a between filter to the field. This is a shorthand for an less than and greater than filter. * @param field The field to filter * @param greaterValue The field value must be greater than this value * @param lessValue The field value must be less than this value * @return The resulting Query */ between( field: string, greaterValue: number | string | Date | Entity, lessValue: number | string | Date | Entity ): Filter<T> in(field: string, ...args: any[]): Filter<T> in(field: string, ...args: any[]): Filter<T> notIn(field: string, ...args: any[]): Filter<T> isNull(field: string): Filter<T> isNotNull(field: string): Filter<T> containsAll(field: string, ...args: any[]): Filter<T> mod(field: string, divisor: number, remainder: number): Filter<T> matches(field: string, regExp: string | RegExp): Filter<T> size(field: string, size: number): Filter<T> near(field: string, geoPoint: GeoPoint, maxDistance: number): Filter<T> withinPolygon(field: string, ...geoPoints: GeoPoint[] | GeoPoint[][]): Filter<T> /** * Adds a equal filter to the field * * All other other filters on the field will be discarded. * * @method * @param field The field to filter * @param value The value used to filter */ eq(field: string, value: any): Filter<T> ne(field: string, value: any): Filter<T> lt(field: string, value: number | string | Date | Entity): Filter<T> le(field: string, value: number | string | Date | Entity): Filter<T> gt(field: string, value: number | string | Date | Entity): Filter<T> ge(field: string, value: number | string | Date | Entity): Filter<T> containsAny(field: string, ...args: any[]): Filter<T> /** * Adds a filter to this query * * @param field * @param filter * @param value * @return The resulting Query */ addFilter(field: string | null, filter: string | null, value: any): Filter<T> } // <API key> @typescript-eslint/no-redeclare export const Condition: Partial<Condition<any>> = { where(this: Condition<any>, conditions) { return this.addFilter(null, null, conditions); }, equal(this: Condition<any>, field, value) { return this.addFilter(field, null, value); }, notEqual(this: Condition<any>, field, value) { return this.addFilter(field, '$ne', value); }, greaterThan(this: Condition<any>, field, value) { return this.addFilter(field, '$gt', value); }, <API key>(this: Condition<any>, field, value) { return this.addFilter(field, '$gte', value); }, lessThan(this: Condition<any>, field, value) { return this.addFilter(field, '$lt', value); }, lessThanOrEqualTo(this: Condition<any>, field, value) { return this.addFilter(field, '$lte', value); }, between(this: Condition<any>, field, greaterValue, lessValue) { return this .addFilter(field, '$gt', greaterValue) .addFilter(field, '$lt', lessValue); }, in(this: Condition<any>, field: string, ...args: any[]) { return this.addFilter(field, '$in', flatArgs(args)); }, notIn(this: Condition<any>, field, ...args: any[]) { return this.addFilter(field, '$nin', flatArgs(args)); }, isNull(this: Condition<any>, field) { return this.equal(field, null); }, isNotNull(this: Condition<any>, field) { return this.addFilter(field, '$exists', true) .addFilter(field, '$ne', null); }, containsAll(this: Condition<any>, field, ...args: any[]) { return this.addFilter(field, '$all', flatArgs(args)); }, mod(this: Condition<any>, field, divisor, remainder) { return this.addFilter(field, '$mod', [divisor, remainder]); }, matches(this: Condition<any>, field, regExp) { const reg = regExp instanceof RegExp ? regExp : new RegExp(regExp); if (reg.ignoreCase) { throw new Error('RegExp.ignoreCase flag is not supported.'); } if (reg.global) { throw new Error('RegExp.global flag is not supported.'); } if (reg.source.indexOf('^') !== 0) { throw new Error('regExp must be an anchored expression, i.e. it must be started with a ^.'); } const result = this.addFilter(field, '$regex', reg.source); if (reg.multiline) { result.addFilter(field, '$options', 'm'); } return result; }, size(this: Condition<any>, field, size) { return this.addFilter(field, '$size', size); }, near(this: Condition<any>, field, geoPoint, maxDistance) { return this.addFilter(field, '$nearSphere', { $geometry: { type: 'Point', coordinates: [geoPoint.longitude, geoPoint.latitude], }, $maxDistance: maxDistance, }); }, withinPolygon(this: Condition<any>, field, ...args: any[]) { const geoPoints = flatArgs(args); return this.addFilter(field, '$geoWithin', { $geometry: { type: 'Polygon', coordinates: [geoPoints.map((geoPoint) => [geoPoint.longitude, geoPoint.latitude])], }, }); }, }; // aliases Object.assign(Condition, { eq: Condition.equal, ne: Condition.notEqual, lt: Condition.lessThan, le: Condition.lessThanOrEqualTo, gt: Condition.greaterThan, ge: Condition.<API key>, containsAny: Condition.in, });
package googlechat import "time" // ChatMessage is message type from Pub/Sub events type ChatMessage struct { Type string `json:"type"` EventTime time.Time `json:"eventTime"` Token string `json:"token"` Message struct { Name string `json:"name"` Sender struct { Name string `json:"name"` DisplayName string `json:"displayName"` AvatarURL string `json:"avatarUrl"` Email string `json:"email"` Type string `json:"type"` } `json:"sender"` CreateTime time.Time `json:"createTime"` Text string `json:"text"` Thread struct { Name string `json:"name"` RetentionSettings struct { State string `json:"state"` } `json:"retentionSettings"` } `json:"thread"` Space struct { Name string `json:"name"` Type string `json:"type"` } `json:"space"` ArgumentText string `json:"argumentText"` } `json:"message"` User struct { Name string `json:"name"` DisplayName string `json:"displayName"` AvatarURL string `json:"avatarUrl"` Email string `json:"email"` Type string `json:"type"` } `json:"user"` Space struct { Name string `json:"name"` Type string `json:"type"` DisplayName string `json:"displayName"` } `json:"space"` <API key> string `json:"<API key>"` } // ReplyThread is a part of reply messages type ReplyThread struct { Name string `json:"name,omitempty"` } // ReplyMessage is partial hangouts format of messages used // For details see // https://developers.google.com/hangouts/chat/reference/rest/v1/spaces.messages#Message type ReplyMessage struct { Text string `json:"text"` Thread *ReplyThread `json:"thread,omitempty"` }
layout: post title: Serialization, class hierarchy and preserving sessions date: '2011-10-26T08:39:00.000-04:00' author: Bill Schneider tags: modified_time: '2011-10-26T08:39:37.739-04:00' blogger_id: tag:blogger.com,1999:blog-9159309.<API key> blogger_orig_url: http://wrschneider.blogspot.com/2011/10/<API key>.html If you have a class that implements Serializable, superclass fields do NOT get serialized unless the parent class also explicitly implements Serializable. That bit me the other day with session-scoped objects and preserving sessions across restarts, using Glassfish 3.1.1. Glassfish will complain if any objects in session scope or their properties don't implement serializable, but if those objects extend some parent class, the parent class fields are silently ignored and end up being null on session restore. So the source of the problem wasn't immediately clear, like it would have been if individual session objects or properties within them weren't serializable.
var router = require('express').Router({ mergeParams: true }); module.exports = router; // Don't just use, but also export in case another module needs to use these as well. router.callbacks = require('./controllers/hello'); router.models = require('./models'); //-- For increased module encapsulation, you could also serve templates with module-local //-- paths, but using shared layouts and partials may become tricky / impossible //var hbs = require('hbs'); //app.set('views', __dirname + '/views'); //app.set('view engine', 'handlebars'); //app.engine('handlebars', hbs.__express); // Module's Routes. Please note this is actually under /hello, because module is attached under /hello router.get('/', router.callbacks.sayHello);
Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. # In the development environment your application's code is reloaded on # every request. This slows down response time but is perfect for development # since you don't have to restart the web server when you make code changes. config.cache_classes = false # Do not eager load code on boot. config.eager_load = false # Show full error reports and disable caching. config.<API key> = true config.action_controller.perform_caching = false # Don't care if the mailer can't send. config.action_mailer.<API key> = false # Print deprecation notices to the Rails logger. config.active_support.deprecation = :log # Raise an error on page load if there are pending migrations. config.active_record.migration_error = :page_load # Debug mode disables concatenation and preprocessing of assets. # This option may cause significant delays in view rendering with a large # number of complex assets. config.assets.debug = true # Asset digests allow you to set far-future HTTP expiration dates on all assets, # yet still be able to expire them through the digest params. config.assets.digest = true # Adds additional error checking when serving assets at runtime. # Checks for improperly declared sprockets dependencies. # Raises helpful error messages. config.assets.<API key> = true # Raises error for missing translations # config.action_view.<API key> = true config.action_mailer.default_url_options = { host: '127.0.0.1:3000' } end
// <auto-generated/> #nullable disable using System; using System.Linq; using System.Threading; using System.Threading.Tasks; using Azure; using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; using Azure.ResourceManager.Core; using Azure.ResourceManager.Network.Models; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.Network { <summary> A class representing collection of PublicIPAddress and their operations over a ResourceGroup. </summary> public partial class <API key> : ArmContainer { private readonly ClientDiagnostics _clientDiagnostics; private readonly <API key> _restClient; <summary> Initializes a new instance of the <see cref="<API key>"/> class for mocking. </summary> protected <API key>() { } <summary> Initializes a new instance of <API key> class. </summary> <param name="parent"> The resource representing the parent resource. </param> internal <API key>(ArmResource parent) : base(parent) { _clientDiagnostics = new ClientDiagnostics(ClientOptions); _restClient = new <API key>(_clientDiagnostics, Pipeline, ClientOptions, Id.SubscriptionId, BaseUri); } <summary> Gets the valid resource type for this object. </summary> protected override ResourceType ValidResourceType => ResourceGroup.ResourceType; // Container level operations. <summary> Creates or updates a static or dynamic public IP address. </summary> <param name="publicIpAddressName"> The name of the public IP address. </param> <param name="parameters"> Parameters supplied to the create or update public IP address operation. </param> <param name="waitForCompletion"> Waits for the completion of the long running operations. </param> <param name="cancellationToken"> The cancellation token to use. </param> <exception cref="<API key>"> <paramref name="publicIpAddressName"/> or <paramref name="parameters"/> is null. </exception> public virtual <API key> CreateOrUpdate(string publicIpAddressName, PublicIPAddressData parameters, bool waitForCompletion = true, Cancellation<API key> = default) { if (publicIpAddressName == null) { throw new <API key>(nameof(publicIpAddressName)); } if (parameters == null) { throw new <API key>(nameof(parameters)); } using var scope = _clientDiagnostics.CreateScope("<API key>.CreateOrUpdate"); scope.Start(); try { var response = _restClient.CreateOrUpdate(Id.ResourceGroupName, publicIpAddressName, parameters, cancellationToken); var operation = new <API key>(Parent, _clientDiagnostics, Pipeline, _restClient.<API key>(Id.ResourceGroupName, publicIpAddressName, parameters).Request, response); if (waitForCompletion) operation.WaitForCompletion(cancellationToken); return operation; } catch (Exception e) { scope.Failed(e); throw; } } <summary> Creates or updates a static or dynamic public IP address. </summary> <param name="publicIpAddressName"> The name of the public IP address. </param> <param name="parameters"> Parameters supplied to the create or update public IP address operation. </param> <param name="waitForCompletion"> Waits for the completion of the long running operations. </param> <param name="cancellationToken"> The cancellation token to use. </param> <exception cref="<API key>"> <paramref name="publicIpAddressName"/> or <paramref name="parameters"/> is null. </exception> public async virtual Task<<API key>> CreateOrUpdateAsync(string publicIpAddressName, PublicIPAddressData parameters, bool waitForCompletion = true, Cancellation<API key> = default) { if (publicIpAddressName == null) { throw new <API key>(nameof(publicIpAddressName)); } if (parameters == null) { throw new <API key>(nameof(parameters)); } using var scope = _clientDiagnostics.CreateScope("<API key>.CreateOrUpdate"); scope.Start(); try { var response = await _restClient.CreateOrUpdateAsync(Id.ResourceGroupName, publicIpAddressName, parameters, cancellationToken).ConfigureAwait(false); var operation = new <API key>(Parent, _clientDiagnostics, Pipeline, _restClient.<API key>(Id.ResourceGroupName, publicIpAddressName, parameters).Request, response); if (waitForCompletion) await operation.<API key>(cancellationToken).ConfigureAwait(false); return operation; } catch (Exception e) { scope.Failed(e); throw; } } <summary> Gets details for this resource from the service. </summary> <param name="publicIpAddressName"> The name of the public IP address. </param> <param name="expand"> Expands referenced resources. </param> <param name="cancellationToken"> A token to allow the caller to cancel the call to the service. The default value is <see cref="CancellationToken.None" />. </param> public virtual Response<PublicIPAddress> Get(string publicIpAddressName, string expand = null, Cancellation<API key> = default) { using var scope = _clientDiagnostics.CreateScope("<API key>.Get"); scope.Start(); try { if (publicIpAddressName == null) { throw new <API key>(nameof(publicIpAddressName)); } var response = _restClient.Get(Id.ResourceGroupName, publicIpAddressName, expand, cancellation<API key>); if (response.Value == null) throw _clientDiagnostics.<API key>(response.GetRawResponse()); return Response.FromValue(new PublicIPAddress(Parent, response.Value), response.GetRawResponse()); } catch (Exception e) { scope.Failed(e); throw; } } <summary> Gets details for this resource from the service. </summary> <param name="publicIpAddressName"> The name of the public IP address. </param> <param name="expand"> Expands referenced resources. </param> <param name="cancellationToken"> A token to allow the caller to cancel the call to the service. The default value is <see cref="CancellationToken.None" />. </param> public async virtual Task<Response<PublicIPAddress>> GetAsync(string publicIpAddressName, string expand = null, Cancellation<API key> = default) { using var scope = _clientDiagnostics.CreateScope("<API key>.Get"); scope.Start(); try { if (publicIpAddressName == null) { throw new <API key>(nameof(publicIpAddressName)); } var response = await _restClient.GetAsync(Id.ResourceGroupName, publicIpAddressName, expand, cancellation<API key>).ConfigureAwait(false); if (response.Value == null) throw await _clientDiagnostics.<API key>(response.GetRawResponse()).ConfigureAwait(false); return Response.FromValue(new PublicIPAddress(Parent, response.Value), response.GetRawResponse()); } catch (Exception e) { scope.Failed(e); throw; } } <summary> Tries to get details for this resource from the service. </summary> <param name="publicIpAddressName"> The name of the public IP address. </param> <param name="expand"> Expands referenced resources. </param> <param name="cancellationToken"> A token to allow the caller to cancel the call to the service. The default value is <see cref="CancellationToken.None" />. </param> public virtual Response<PublicIPAddress> GetIfExists(string publicIpAddressName, string expand = null, Cancellation<API key> = default) { using var scope = _clientDiagnostics.CreateScope("<API key>.GetIfExists"); scope.Start(); try { if (publicIpAddressName == null) { throw new <API key>(nameof(publicIpAddressName)); } var response = _restClient.Get(Id.ResourceGroupName, publicIpAddressName, expand, cancellation<API key>); return response.Value == null ? Response.FromValue<PublicIPAddress>(null, response.GetRawResponse()) : Response.FromValue(new PublicIPAddress(this, response.Value), response.GetRawResponse()); } catch (Exception e) { scope.Failed(e); throw; } } <summary> Tries to get details for this resource from the service. </summary> <param name="publicIpAddressName"> The name of the public IP address. </param> <param name="expand"> Expands referenced resources. </param> <param name="cancellationToken"> A token to allow the caller to cancel the call to the service. The default value is <see cref="CancellationToken.None" />. </param> public async virtual Task<Response<PublicIPAddress>> GetIfExistsAsync(string publicIpAddressName, string expand = null, Cancellation<API key> = default) { using var scope = _clientDiagnostics.CreateScope("<API key>.GetIfExists"); scope.Start(); try { if (publicIpAddressName == null) { throw new <API key>(nameof(publicIpAddressName)); } var response = await _restClient.GetAsync(Id.ResourceGroupName, publicIpAddressName, expand, cancellation<API key>).ConfigureAwait(false); return response.Value == null ? Response.FromValue<PublicIPAddress>(null, response.GetRawResponse()) : Response.FromValue(new PublicIPAddress(this, response.Value), response.GetRawResponse()); } catch (Exception e) { scope.Failed(e); throw; } } <summary> Tries to get details for this resource from the service. </summary> <param name="publicIpAddressName"> The name of the public IP address. </param> <param name="expand"> Expands referenced resources. </param> <param name="cancellationToken"> A token to allow the caller to cancel the call to the service. The default value is <see cref="CancellationToken.None" />. </param> public virtual Response<bool> CheckIfExists(string publicIpAddressName, string expand = null, Cancellation<API key> = default) { using var scope = _clientDiagnostics.CreateScope("<API key>.CheckIfExists"); scope.Start(); try { if (publicIpAddressName == null) { throw new <API key>(nameof(publicIpAddressName)); } var response = GetIfExists(publicIpAddressName, expand, cancellation<API key>); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) { scope.Failed(e); throw; } } <summary> Tries to get details for this resource from the service. </summary> <param name="publicIpAddressName"> The name of the public IP address. </param> <param name="expand"> Expands referenced resources. </param> <param name="cancellationToken"> A token to allow the caller to cancel the call to the service. The default value is <see cref="CancellationToken.None" />. </param> public async virtual Task<Response<bool>> CheckIfExistsAsync(string publicIpAddressName, string expand = null, Cancellation<API key> = default) { using var scope = _clientDiagnostics.CreateScope("<API key>.CheckIfExists"); scope.Start(); try { if (publicIpAddressName == null) { throw new <API key>(nameof(publicIpAddressName)); } var response = await GetIfExistsAsync(publicIpAddressName, expand, cancellation<API key>).ConfigureAwait(false); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) { scope.Failed(e); throw; } } <summary> Gets all public IP addresses in a resource group. </summary> <param name="cancellationToken"> The cancellation token to use. </param> <returns> A collection of <see cref="PublicIPAddress" /> that may take multiple service requests to iterate over. </returns> public virtual Pageable<PublicIPAddress> GetAll(Cancellation<API key> = default) { Page<PublicIPAddress> FirstPageFunc(int? pageSizeHint) { using var scope = _clientDiagnostics.CreateScope("<API key>.GetAll"); scope.Start(); try { var response = _restClient.GetAll(Id.ResourceGroupName, cancellation<API key>); return Page.FromValues(response.Value.Value.Select(value => new PublicIPAddress(Parent, value)), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) { scope.Failed(e); throw; } } Page<PublicIPAddress> NextPageFunc(string nextLink, int? pageSizeHint) { using var scope = _clientDiagnostics.CreateScope("<API key>.GetAll"); scope.Start(); try { var response = _restClient.GetAllNextPage(nextLink, Id.ResourceGroupName, cancellation<API key>); return Page.FromValues(response.Value.Value.Select(value => new PublicIPAddress(Parent, value)), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) { scope.Failed(e); throw; } } return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc); } <summary> Gets all public IP addresses in a resource group. </summary> <param name="cancellationToken"> The cancellation token to use. </param> <returns> An async collection of <see cref="PublicIPAddress" /> that may take multiple service requests to iterate over. </returns> public virtual AsyncPageable<PublicIPAddress> GetAllAsync(Cancellation<API key> = default) { async Task<Page<PublicIPAddress>> FirstPageFunc(int? pageSizeHint) { using var scope = _clientDiagnostics.CreateScope("<API key>.GetAll"); scope.Start(); try { var response = await _restClient.GetAllAsync(Id.ResourceGroupName, cancellation<API key>).ConfigureAwait(false); return Page.FromValues(response.Value.Value.Select(value => new PublicIPAddress(Parent, value)), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) { scope.Failed(e); throw; } } async Task<Page<PublicIPAddress>> NextPageFunc(string nextLink, int? pageSizeHint) { using var scope = _clientDiagnostics.CreateScope("<API key>.GetAll"); scope.Start(); try { var response = await _restClient.GetAllNextPageAsync(nextLink, Id.ResourceGroupName, cancellation<API key>).ConfigureAwait(false); return Page.FromValues(response.Value.Value.Select(value => new PublicIPAddress(Parent, value)), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) { scope.Failed(e); throw; } } return PageableHelpers.<API key>(FirstPageFunc, NextPageFunc); } <summary> Filters the list of <see cref="PublicIPAddress" /> for this resource group represented as generic resources. </summary> <param name="nameFilter"> The filter used in this operation. </param> <param name="expand"> Comma-separated list of additional properties to be included in the response. Valid values include `createdTime`, `changedTime` and `provisioningState`. </param> <param name="top"> The number of results to return. </param> <param name="cancellationToken"> A token to allow the caller to cancel the call to the service. The default value is <see cref="CancellationToken.None" />. </param> <returns> A collection of resource that may take multiple service requests to iterate over. </returns> public virtual Pageable<GenericResource> <API key>(string nameFilter, string expand = null, int? top = null, Cancellation<API key> = default) { using var scope = _clientDiagnostics.CreateScope("<API key>.<API key>"); scope.Start(); try { var filters = new <API key>(PublicIPAddress.ResourceType); filters.SubstringFilter = nameFilter; return <API key>.GetAtContext(Parent as ResourceGroup, filters, expand, top, cancellationToken); } catch (Exception e) { scope.Failed(e); throw; } } <summary> Filters the list of <see cref="PublicIPAddress" /> for this resource group represented as generic resources. </summary> <param name="nameFilter"> The filter used in this operation. </param> <param name="expand"> Comma-separated list of additional properties to be included in the response. Valid values include `createdTime`, `changedTime` and `provisioningState`. </param> <param name="top"> The number of results to return. </param> <param name="cancellationToken"> A token to allow the caller to cancel the call to the service. The default value is <see cref="CancellationToken.None" />. </param> <returns> An async collection of resource that may take multiple service requests to iterate over. </returns> public virtual AsyncPageable<GenericResource> <API key>(string nameFilter, string expand = null, int? top = null, Cancellation<API key> = default) { using var scope = _clientDiagnostics.CreateScope("<API key>.<API key>"); scope.Start(); try { var filters = new <API key>(PublicIPAddress.ResourceType); filters.SubstringFilter = nameFilter; return <API key>.GetAtContextAsync(Parent as ResourceGroup, filters, expand, top, cancellationToken); } catch (Exception e) { scope.Failed(e); throw; } } // Builders. // public ArmBuilder<ResourceIdentifier, PublicIPAddress, PublicIPAddressData> Construct() { } } }
# Contributing to Tesspathy We want to make contributing to this project as easy and transparent as possible. Hopefully this document makes the process for contributing clear and answers any questions you may have. If not, feel free to open an issue. ## Pull Requests We will be monitoring for pull requests. Before submitting a pull request, please make sure the following is done: 1. Fork the repo and create your branch from ```master```. 2. If you've added code that should be tested, add tests. 3. If you've changed APIs, update the documentation. 4. Ensure the test suite passes. ## Bugs Where to Find Known Issues We will be using GitHub Issues for our public bugs. We will keep a close eye on this and try to make it clear when we have an internal fix in progress. Before filing a new task, try to make sure your problem doesn't already exist. Reporting New Issues Please ensure your bug description is clear and has sufficient instructions to be able to reproduce the issue. The best way is to provide a reduced test case on jsFiddle or jsBin. ## Coding Style * 2 spaces for indentation (no tabs) * Prefer ```'``` over ```"``` * Use semicolons By contributing to Tesspathy, you agree that your contributions will be licensed under its MIT license.
import WebhookNotification, { LinkClick, LinkClickCount, MessageTrackingData, WebhookDelta, <API key>, WebhookObjectData, } from '../src/models/<API key>'; import { WebhookTriggers } from '../src/models/webhook'; describe('Webhook Notification', () => { test('Should deserialize from JSON properly', done => { const <API key> = { deltas: [ { date: 1602623196, object: 'message', type: 'message.created', object_data: { namespace_id: '<API key>', account_id: '<API key>', object: 'message', attributes: { action: 'save_draft', job_status_id: 'abc1234', thread_id: '<API key>', received_date: 1602623166, }, id: '<API key>', metadata: { sender_app_id: 64280, link_data: [ { url: 'https://nylas.com/', count: 1, }, ], timestamp: 1602623966, recents: [ { ip: '24.243.155.85', link_index: 0, id: 0, user_agent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.75 Safari/537.36', timestamp: 1602623980, }, ], message_id: '<API key>', payload: 'Tracking enabled', }, }, }, ], }; const webhookNotification = new WebhookNotification().fromJSON( <API key> ); expect(webhookNotification.deltas.length).toBe(1); const webhookDelta = webhookNotification.deltas[0]; expect(webhookDelta instanceof WebhookDelta).toBe(true); expect(webhookDelta.date).toEqual(new Date(1602623196 * 1000)); expect(webhookDelta.object).toEqual('message'); expect(webhookDelta.type).toEqual(WebhookTriggers.MessageCreated); const <API key> = webhookDelta.objectData; expect(<API key> instanceof WebhookObjectData).toBe(true); expect(<API key>.id).toEqual('<API key>'); expect(<API key>.accountId).toEqual( '<API key>' ); expect(<API key>.namespaceId).toEqual( '<API key>' ); expect(<API key>.object).toEqual('message'); const <API key> = <API key>.objectAttributes; expect( <API key> instanceof <API key> ).toBe(true); expect(<API key>.action).toEqual('save_draft'); expect(<API key>.jobStatusId).toEqual('abc1234'); expect(<API key>.threadId).toEqual( '<API key>' ); expect(<API key>.receivedDate).toEqual( new Date(1602623166 * 1000) ); const <API key> = <API key>.metadata; expect(<API key> instanceof MessageTrackingData).toBe( true ); expect(<API key>.messageId).toEqual( '<API key>' ); expect(<API key>.payload).toEqual('Tracking enabled'); expect(<API key>.timestamp).toEqual( new Date(1602623966 * 1000) ); expect(<API key>.senderAppId).toBe(64280); expect(<API key>.linkData.length).toBe(1); expect(<API key>.recents.length).toBe(1); const linkData = <API key>.linkData[0]; expect(linkData instanceof LinkClickCount).toBe(true); expect(linkData.url).toEqual('https://nylas.com/'); expect(linkData.count).toBe(1); const recents = <API key>.recents[0]; expect(recents instanceof LinkClick).toBe(true); expect(recents.id).toBe(0); expect(recents.ip).toEqual('24.243.155.85'); expect(recents.userAgent).toEqual( 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.75 Safari/537.36' ); expect(recents.timestamp).toEqual(new Date(1602623980 * 1000)); expect(recents.linkIndex).toBe(0); done(); }); });
using HoloToolkit.Unity; using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement; using UnityEngine.Networking; public class <API key> : Singleton<<API key>> { [SerializeField] private string clientId = "<API key>"; private string clientSecret; [SerializeField] private string debugToken; private string accessToken; private string authorizationCode; const string learningLayers<API key> = "https://api.learning-layers.eu/o/oauth2/authorize"; const string <API key> = "https://api.learning-layers.eu/o/oauth2/token"; const string <API key> = "https://api.learning-layers.eu/o/oauth2/userinfo"; const string scopes = "openid%20profile%20email"; const string gamrRedirectURI = "gamr: public string AccessToken { get { return accessToken; } } private void Start() { // skip the login by using the debug token if (Application.isEditor) { if (accessToken == null || accessToken == "") { accessToken = debugToken; <API key>(); RestManager.Instance.GET(<API key> + "?access_token=" + accessToken, <API key>); } } else // else: fetch the client secret { TextAsset secretAsset = (TextAsset)Resources.Load("values/client_secret"); clientSecret = secretAsset.text; } } private void <API key>(UnityWebRequest req) { if (req.responseCode == 200) { string json = req.downloadHandler.text; Debug.Log(json); UserInfo info = JsonUtility.FromJson<UserInfo>(json); InformationManager.Instance.UserInfo = info; } else if (req.responseCode == 401) { Debug.LogError("Unauthorized: access token is wrong"); } } public void Login() { if (Application.isEditor) { SceneManager.LoadScene("Scene", LoadSceneMode.Single); return; } Application.OpenURL(learningLayers<API key> + "?response_type=code&scope=" + scopes + "&client_id=" + clientId + "&redirect_uri=" + gamrRedirectURI); } public void Logout() { accessToken = ""; SceneManager.LoadScene("Login", LoadSceneMode.Single); } private void StartedByProtocol(Uri uri) { if (uri.Fragment != null) { char[] splitters = { '?', '&' }; string[] arguments = uri.AbsoluteUri.Split(splitters); foreach (string argument in arguments) { if (argument.StartsWith("code=")) { authorizationCode = argument.Replace("code=", ""); Debug.Log("authorizationCode: " + authorizationCode); // now exchange authorization code for access token RestManager.Instance.POST(<API key> + "?code=" + authorizationCode + "&client_id=" + clientId + "&client_secret=" + clientSecret + "&redirect_uri=" + gamrRedirectURI + "&grant_type=authorization_code", (req) => { string json = req.downloadHandler.text; Debug.Log("Token json: " + json); <API key> answer = JsonUtility.FromJson<<API key>>(json); if (!string.IsNullOrEmpty(answer.error)) { MessageBox.Show(answer.error_description, MessageBoxType.ERROR); } else { // extract access token and check it accessToken = answer.access_token; Debug.Log("The access token is " + accessToken); <API key>(); CheckAccessToken(); } } ); break; } } } } private void <API key>() { if (RestManager.Instance.StandardHeader.ContainsKey("access_token")) { RestManager.Instance.StandardHeader["access_token"] = accessToken; } else { RestManager.Instance.StandardHeader.Add("access_token", accessToken); } } private void CheckAccessToken() { RestManager.Instance.GET(<API key> + "?access_token=" + accessToken, OnLogin); } private void OnLogin(UnityWebRequest result) { if (result.responseCode == 200) { string json = result.downloadHandler.text; Debug.Log(json); UserInfo info = JsonUtility.FromJson<UserInfo>(json); InformationManager.Instance.UserInfo = info; <API key>.Instance.ValidateLogin(LoginValidated); } else { MessageBox.Show(LocalizationManager.Instance.ResolveString("Error while retrieving the user data. Login failed"), MessageBoxType.ERROR); } } private void LoginValidated(UnityWebRequest req) { if (req.responseCode == 200) { SceneManager.LoadScene("Scene", LoadSceneMode.Single); } else if (req.responseCode == 401) { MessageBox.Show(LocalizationManager.Instance.ResolveString("The login could not be validated"), MessageBoxType.ERROR); } else { MessageBox.Show(LocalizationManager.Instance.ResolveString("An error concerning the user data occured. The login failed.\nCode: ") + req.responseCode + "\n" + req.downloadHandler.text, MessageBoxType.ERROR); } } }
<!DOCTYPE html> <html ng-app="cookieDemo"> <head> <meta charset="utf-8"> <title>ch6</title> <link rel="stylesheet" href="../bower_components/bootstrap/dist/css/bootstrap.min.css" /> <script type="text/javascript" src="../bower_components/angular/angular.min.js"></script> <script type="text/javascript" src="../bower_components/angular-cookies/angular-cookies.min.js"></script> <script type="text/javascript" src="cookieDemo.js"></script> </head> <body> <div ng-controller="mainCtrl"> <h1>Cookie </h1> <p>test : {{value}}</p> <button ng-click="getValue()"> </button> <br/> <input type="text" ng-model="iValue"><button ng-click="putValue(iValue)"></button> </div> </body> </html>
require 'test_helper' class <API key> < ActionController::TestCase def <API key> # We send invalid value but it validates anyway because their is no schema. get :basic, format: 'json', param1: 51 assert_response :success assert !response.has_schema? end end
import deepFreeze from 'deep-freeze'; import { arrayToMap, mapKeysToArray } from './mapUtils'; describe('arrayToMap', () => { it('should create map from 2D array', () => { const a = [ ['key1', 'value1'], ['key2', 'value2'] ]; deepFreeze(a); const result = arrayToMap(a); expect(result.size).toBe(2); expect(result.get('key1')).toBe('value1'); expect(result.get('key2')).toBe('value2'); }); it('should create empty map from empty array', () => { const result = arrayToMap([]); expect(result.size).toBe(0); }); }); describe('mapKeysToArray', () => { it('should create array from map keys in order', () => { const map = new Map(); map.set('a', 'value1'); map.set('c', 'value2'); map.set('1', 'value3'); map.set('b', 'value4'); map.set('2', 'value5'); const result = mapKeysToArray(map); expect(result).toEqual(['a', 'c', '1', 'b', '2']); }); it('should create empty array from new map', () => { const map = new Map(); const result = mapKeysToArray(map); expect(result).toEqual([]); }); });
namespace SimShift.Data { public enum Ets2DataAuxilliary : int { CruiseControl = 0, Wipers = 1, ParkBrake = 2, MotorBrake = 3, ElectricEnabled = 4, EngineEnabled = 5, BlinkerLeftActive = 6, BlinkerRightActive = 7, BlinkerLeftOn = 8, BlinkerRightOn = 9, LightsParking = 10, LightsBeamLow = 11, LightsBeamHigh = 12, LightsAuxFront = 13, LightsAuxRoof = 14, LightsBeacon = 15, LightsBrake = 16, LightsReverse = 17, <API key> = 18, AirPressureWarning = 19, <API key> = 20, AdblueWarning = 21, OilPressureWarning = 22, <API key> = 23, } }
2015-12-20 #objective-c * <img src='https://avatars3.githubusercontent.com/u/433320?v=3&s=40' height='20' width='20'>[ yulingtianxia / TBActionSheet ](https://github.com/yulingtianxia/TBActionSheet): A Custom Action Sheet * <img src='https://avatars3.githubusercontent.com/u/7830226?v=3&s=40' height='20' width='20'>[ zpz1237 / NirZhihuDaily2.0 ](https://github.com/zpz1237/NirZhihuDaily2.0): SwiftiOS * <img src='https://avatars1.githubusercontent.com/u/1468993?v=3&s=40' height='20' width='20'>[ krzysztofzablocki / DetailsMatter ](https://github.com/krzysztofzablocki/DetailsMatter): * <img src='https://avatars1.githubusercontent.com/u/5310542?v=3&s=40' height='20' width='20'>[ Aufree / ESTMusicPlayer ](https://github.com/Aufree/ESTMusicPlayer): An elegant and simple iOS music player. * <img src='https://avatars1.githubusercontent.com/u/432536?v=3&s=40' height='20' width='20'>[ ReactiveCocoa / ReactiveCocoa ](https://github.com/ReactiveCocoa/ReactiveCocoa): Streams of values over time * <img src='https://avatars3.githubusercontent.com/u/1509815?v=3&s=40' height='20' width='20'>[ Guidebook / <API key> ](https://github.com/Guidebook/<API key>): Inspired by Apple’s download progress buttons in the app store * <img src='https://avatars1.githubusercontent.com/u/3631397?v=3&s=40' height='20' width='20'>[ exis-io / Exis ](https://github.com/exis-io/Exis): Exis client libraries, sample projects, and demos. * <img src='https://avatars1.githubusercontent.com/u/839283?v=3&s=40' height='20' width='20'>[ ibireme / YYKit ](https://github.com/ibireme/YYKit): A collection of iOS components. * <img src='https://avatars0.githubusercontent.com/u/4415086?v=3&s=40' height='20' width='20'>[ poboke / ActivatePowerMode ](https://github.com/poboke/ActivatePowerMode): ActivatePowerMode is a plugin for Xcode. This plugin will make your code powerful. * <img src='https://avatars2.githubusercontent.com/u/714?v=3&s=40' height='20' width='20'>[ postmates / PMKVObserver ](https://github.com/postmates/PMKVObserver): A type-safe Swift/ObjC KVO wrapper * <img src='https://avatars1.githubusercontent.com/u/839283?v=3&s=40' height='20' width='20'>[ ibireme / YYText ](https://github.com/ibireme/YYText): Powerful text framework for iOS to display and edit rich text. * <img src='https://avatars1.githubusercontent.com/u/627285?v=3&s=40' height='20' width='20'>[ alcatraz / Alcatraz ](https://github.com/alcatraz/Alcatraz): Package manager for Xcode * <img src='https://avatars3.githubusercontent.com/u/598870?v=3&s=40' height='20' width='20'>[ SnapKit / Masonry ](https://github.com/SnapKit/Masonry): Harness the power of AutoLayout NSLayoutConstraints with a simplified, chainable and expressive syntax. Supports iOS and OSX Auto Layout * <img src='https://avatars3.githubusercontent.com/u/7659?v=3&s=40' height='20' width='20'>[ AFNetworking / AFNetworking ](https://github.com/AFNetworking/AFNetworking): A delightful networking framework for iOS, OS X, watchOS, and tvOS. * <img src='https://avatars2.githubusercontent.com/u/1724674?v=3&s=40' height='20' width='20'>[ ViccAlexander / Chameleon ](https://github.com/ViccAlexander/Chameleon): Flat Color Framework for iOS (Obj-C & Swift) * <img src='https://avatars1.githubusercontent.com/u/565251?v=3&s=40' height='20' width='20'>[ facebook / AsyncDisplayKit ](https://github.com/facebook/AsyncDisplayKit): Smooth asynchronous user interfaces for iOS apps. * <img src='https://avatars0.githubusercontent.com/u/10654142?v=3&s=40' height='20' width='20'>[ Pluto-Y / iOS-Echarts ](https://github.com/Pluto-Y/iOS-Echarts): * <img src='https://avatars2.githubusercontent.com/u/627915?v=3&s=40' height='20' width='20'>[ git-up / GitUp ](https://github.com/git-up/GitUp): The Git interface you've been missing all your life has finally arrived. * <img src='' height='20' width='20'>[ Akateason / <API key> ](https://github.com/Akateason/<API key>): <API key> * <img src='https://avatars3.githubusercontent.com/u/91322?v=3&s=40' height='20' width='20'>[ jdg / MBProgressHUD ](https://github.com/jdg/MBProgressHUD): MBProgressHUD + Customizations * <img src='https://avatars2.githubusercontent.com/u/3831495?v=3&s=40' height='20' width='20'>[ hackiftekhar / IQKeyboardManager ](https://github.com/hackiftekhar/IQKeyboardManager): Codeless drop-in universal library allows to prevent issues of keyboard sliding up and cover UITextField/UITextView. Neither need to write any code nor any setup required and much more. * <img src='https://avatars2.githubusercontent.com/u/10044430?v=3&s=40' height='20' width='20'>[ LeoiOS / LCTabBarController ](https://github.com/LeoiOS/LCTabBarController): A amazing and highly customized tabBarController! You could almost customize 100% of the properties with LCTabBarController! * <img src='https://avatars3.githubusercontent.com/u/1093321?v=3&s=40' height='20' width='20'>[ CEWendel / SWTableViewCell ](https://github.com/CEWendel/SWTableViewCell): An easy-to-use UITableViewCell subclass that implements a swippable content view which exposes utility buttons (similar to iOS 7 Mail Application) * <img src='https://avatars0.githubusercontent.com/u/605277?v=3&s=40' height='20' width='20'>[ uranusjr / macdown ](https://github.com/uranusjr/macdown): Open source Markdown editor for OS X. * <img src='https://avatars2.githubusercontent.com/u/68232?v=3&s=40' height='20' width='20'>[ rs / SDWebImage ](https://github.com/rs/SDWebImage): Asynchronous image downloader with cache support as a UIImageView category * <img src='https://avatars2.githubusercontent.com/u/3039877?v=3&s=40' height='20' width='20'>[ google / git-appraise ](https://github.com/google/git-appraise): Distributed code review system for Git repos * <img src='https://avatars3.githubusercontent.com/u/1386065?v=3&s=40' height='20' width='20'>[ NYTimes / gizmo ](https://github.com/NYTimes/gizmo): A Microservice Toolkit from The New York Times * <img src='https://avatars1.githubusercontent.com/u/45629?v=3&s=40' height='20' width='20'>[ davidlazar / vuvuzela ](https://github.com/davidlazar/vuvuzela): Private messaging system that hides metadata * <img src='https://avatars1.githubusercontent.com/u/749551?v=3&s=40' height='20' width='20'>[ docker / containerd ](https://github.com/docker/containerd): Standalone Container Daemon * <img src='https://avatars3.githubusercontent.com/u/1445228?v=3&s=40' height='20' width='20'>[ jfrazelle / onion ](https://github.com/jfrazelle/onion): Tor networking plugin for docker containers. * <img src='https://avatars1.githubusercontent.com/u/5000654?v=3&s=40' height='20' width='20'>[ getlantern / lantern ](https://github.com/getlantern/lantern): Open Internet for everyone. Lantern is a free desktop application that delivers fast, reliable and secure access to the open Internet for users in censored regions. It uses a variety of techniques to stay unblocked, including P2P and domain fronting. Lantern relies on users in uncensored regions acting as access points to the open Internet. * <img src='https://avatars0.githubusercontent.com/u/14110142?v=3&s=40' height='20' width='20'>[ v2ray / v2ray-core ](https://github.com/v2ray/v2ray-core): Building blocks for developing proxy servers in golang. * <img src='https://avatars1.githubusercontent.com/u/62991?v=3&s=40' height='20' width='20'>[ Masterminds / glide ](https://github.com/Masterminds/glide): Vendor Package Management for Golang * <img src='https://avatars1.githubusercontent.com/u/749551?v=3&s=40' height='20' width='20'>[ docker / docker ](https://github.com/docker/docker): Docker - the open-source application container engine * <img src='https://avatars3.githubusercontent.com/u/394382?v=3&s=40' height='20' width='20'>[ spf13 / hugo ](https://github.com/spf13/hugo): A Fast and Flexible Static Site Generator built with love by spf13 in GoLang * <img src='https://avatars0.githubusercontent.com/u/1128849?v=3&s=40' height='20' width='20'>[ mholt / caddy ](https://github.com/mholt/caddy): Fast, cross-platform HTTP/2 web server with automatic HTTPS * <img src='https://avatars0.githubusercontent.com/u/2946214?v=3&s=40' height='20' width='20'>[ gogits / gogs ](https://github.com/gogits/gogs): Gogs (Go Git Service) is a painless self-hosted Git service. * <img src='https://avatars3.githubusercontent.com/u/31996?v=3&s=40' height='20' width='20'>[ avelino / awesome-go ](https://github.com/avelino/awesome-go): A curated list of awesome Go frameworks, libraries and software * <img src='https://avatars2.githubusercontent.com/u/114509?v=3&s=40' height='20' width='20'>[ go-kit / kit ](https://github.com/go-kit/kit): A standard library for microservices. * <img src='https://avatars3.githubusercontent.com/u/104030?v=3&s=40' height='20' width='20'>[ golang / go ](https://github.com/golang/go): The Go programming language * <img src='https://avatars1.githubusercontent.com/u/4566?v=3&s=40' height='20' width='20'>[ RobotsAndPencils / buford ](https://github.com/RobotsAndPencils/buford): A push notification delivery engine for the new HTTP/2 APNS service. * <img src='https://avatars2.githubusercontent.com/u/8446613?v=3&s=40' height='20' width='20'>[ golang / example ](https://github.com/golang/example): Go example projects * <img src='https://avatars0.githubusercontent.com/u/1366124?v=3&s=40' height='20' width='20'>[ otium / ytdl ](https://github.com/otium/ytdl): YouTube download library and CLI written in Go * <img src='https://avatars1.githubusercontent.com/u/993322?v=3&s=40' height='20' width='20'>[ go-ozzo / ozzo-dbx ](https://github.com/go-ozzo/ozzo-dbx): A Go package that enhances the standard database/sql package by providing powerful data retrieval methods as well as DB-agnostic query building capabilities. * <img src='https://avatars2.githubusercontent.com/u/1070920?v=3&s=40' height='20' width='20'>[ go-python / gopy ](https://github.com/go-python/gopy): gopy generates a CPython extension module from a go package. * <img src='https://avatars3.githubusercontent.com/u/1080370?v=3&s=40' height='20' width='20'>[ pingcap / tidb ](https://github.com/pingcap/tidb): TiDB is a distributed SQL database compatible with MySQL protocol * <img src='https://avatars0.githubusercontent.com/u/233907?v=3&s=40' height='20' width='20'>[ astaxie / beego ](https://github.com/astaxie/beego): beego is an open-source, high-performance web framework for the Go programming language. * <img src='https://avatars1.githubusercontent.com/u/283442?v=3&s=40' height='20' width='20'>[ valyala / fasthttp ](https://github.com/valyala/fasthttp): Fast HTTP package for Go. Tuned for high performance. Zero memory allocations in hot paths. Up to 10x faster than net/http * <img src='https://avatars2.githubusercontent.com/u/1299?v=3&s=40' height='20' width='20'>[ hashicorp / terraform ](https://github.com/hashicorp/terraform): Terraform is a tool for building, changing, and combining infrastructure safely and efficiently. * <img src='https://avatars0.githubusercontent.com/u/578256?v=3&s=40' height='20' width='20'>[ xenolf / lego ](https://github.com/xenolf/lego): Let's Encrypt client and ACME library written in Go #javascript * <img src='https://avatars1.githubusercontent.com/u/985197?v=3&s=40' height='20' width='20'>[ FreeCodeCamp / FreeCodeCamp ](https://github.com/FreeCodeCamp/FreeCodeCamp): The http://FreeCodeCamp.com open source codebase and curriculum. Learn to code and help nonprofits. * <img src='https://avatars3.githubusercontent.com/u/810438?v=3&s=40' height='20' width='20'>[ heroku / react-refetch ](https://github.com/heroku/react-refetch): A simple, declarative, and composable way to fetch data for React components * <img src='https://avatars0.githubusercontent.com/u/2044842?v=3&s=40' height='20' width='20'>[ jlmakes / scrollreveal.js ](https://github.com/jlmakes/scrollreveal.js): Easy scroll animations for web and mobile browsers. * <img src='https://avatars1.githubusercontent.com/u/948896?v=3&s=40' height='20' width='20'>[ oneuijs / <API key> ](https://github.com/oneuijs/<API key>): Examples of how to do query, style, dom, ajax, event etc like jQuery with plain javascript. * <img src='https://avatars2.githubusercontent.com/u/250480?v=3&s=40' height='20' width='20'>[ google / blockly ](https://github.com/google/blockly): The web-based visual programming editor. * <img src='https://avatars1.githubusercontent.com/u/203725?v=3&s=40' height='20' width='20'>[ aframevr / aframe ](https://github.com/aframevr/aframe): Building Blocks for the VR Web * <img src='https://avatars1.githubusercontent.com/u/729873?v=3&s=40' height='20' width='20'>[ howdyai / botkit ](https://github.com/howdyai/botkit): Botkit is a toolkit for making bot applications * <img src='https://avatars0.githubusercontent.com/u/6550035?v=3&s=40' height='20' width='20'>[ schollz / musicsaur ](https://github.com/schollz/musicsaur): Music synchronization using browsers and a Python server - great for LAN systems! * <img src='https://avatars3.githubusercontent.com/u/253398?v=3&s=40' height='20' width='20'>[ NARKOZ / hacker-scripts ](https://github.com/NARKOZ/hacker-scripts): Based on a true story * <img src='https://avatars0.githubusercontent.com/u/113087?v=3&s=40' height='20' width='20'>[ liferay / senna.js ](https://github.com/liferay/senna.js): A blazing-fast Single Page Application engine * <img src='https://avatars3.githubusercontent.com/u/173661?v=3&s=40' height='20' width='20'>[ WebAssembly / binaryen ](https://github.com/WebAssembly/binaryen): Compiler infrastructure and toolchain library for WebAssembly, in C++ * <img src='https://avatars3.githubusercontent.com/u/810438?v=3&s=40' height='20' width='20'>[ rackt / redux ](https://github.com/rackt/redux): Predictable state container for JavaScript apps * <img src='https://avatars0.githubusercontent.com/u/197597?v=3&s=40' height='20' width='20'>[ facebook / react-native ](https://github.com/facebook/react-native): A framework for building native apps with React. * <img src='https://avatars0.githubusercontent.com/u/6352327?v=3&s=40' height='20' width='20'>[ FormidableLabs / victory ](https://github.com/FormidableLabs/victory): A collection of composable React components for building interactive data visualizations * <img src='https://avatars0.githubusercontent.com/u/150330?v=3&s=40' height='20' width='20'>[ getify / You-Dont-Know-JS ](https://github.com/getify/You-Dont-Know-JS): A book series on JavaScript. @YDKJS on twitter. * <img src='https://avatars1.githubusercontent.com/u/16724?v=3&s=40' height='20' width='20'>[ meteor / meteor ](https://github.com/meteor/meteor): Meteor, the JavaScript App Platform * <img src='https://avatars3.githubusercontent.com/u/216296?v=3&s=40' height='20' width='20'>[ angular / angular.js ](https://github.com/angular/angular.js): HTML enhanced for web apps * <img src='https://avatars1.githubusercontent.com/u/406631?v=3&s=40' height='20' width='20'>[ buunguyen / octotree ](https://github.com/buunguyen/octotree): Code tree for GitHub and GitLab * <img src='https://avatars1.githubusercontent.com/u/499550?v=3&s=40' height='20' width='20'>[ vuejs / vue ](https://github.com/vuejs/vue): Simple yet powerful library for building modern web interfaces. * <img src='https://avatars3.githubusercontent.com/u/8445?v=3&s=40' height='20' width='20'>[ facebook / react ](https://github.com/facebook/react): A declarative, efficient, and flexible JavaScript library for building user interfaces. * <img src='https://avatars3.githubusercontent.com/u/6104558?v=3&s=40' height='20' width='20'>[ mohebifar / lebab ](https://github.com/mohebifar/lebab): Turn your ES5 code into readable ES6. It does the opposite of what Babel does. * <img src='https://avatars1.githubusercontent.com/u/339208?v=3&s=40' height='20' width='20'>[ airbnb / javascript ](https://github.com/airbnb/javascript): JavaScript Style Guide * <img src='https://avatars0.githubusercontent.com/u/23123?v=3&s=40' height='20' width='20'>[ Semantic-Org / Semantic-UI ](https://github.com/Semantic-Org/Semantic-UI): Semantic is a UI component framework based around useful principles from natural language. * <img src='https://avatars1.githubusercontent.com/u/80?v=3&s=40' height='20' width='20'>[ nodejs / node ](https://github.com/nodejs/node): Node.js JavaScript runtime * <img src='https://avatars0.githubusercontent.com/u/6236424?v=3&s=40' height='20' width='20'>[ samiskin / <API key> ](https://github.com/samiskin/<API key>): A redux implementation that synchronizes itself between Electron processes #ruby * <img src='https://avatars2.githubusercontent.com/u/206662?v=3&s=40' height='20' width='20'>[ OpenHunting / openhunt ](https://github.com/OpenHunting/openhunt): discover new products, give feedback, help each other * <img src='https://avatars1.githubusercontent.com/u/1589480?v=3&s=40' height='20' width='20'>[ Homebrew / homebrew ](https://github.com/Homebrew/homebrew): The missing package manager for OS X. * <img src='https://avatars1.githubusercontent.com/u/3124?v=3&s=40' height='20' width='20'>[ rails / rails ](https://github.com/rails/rails): Ruby on Rails * <img src='https://avatars3.githubusercontent.com/u/3999?v=3&s=40' height='20' width='20'>[ github / scientist ](https://github.com/github/scientist): A Ruby library for carefully refactoring critical paths. * <img src='https://avatars2.githubusercontent.com/u/237985?v=3&s=40' height='20' width='20'>[ jekyll / jekyll ](https://github.com/jekyll/jekyll): Jekyll is a blog-aware, static site generator in Ruby * <img src='https://avatars2.githubusercontent.com/u/1529246?v=3&s=40' height='20' width='20'>[ codelittinc / slacked ](https://github.com/codelittinc/slacked): A simple and easy way to send notifications to Slack from your Ruby or Rails application. * <img src='https://avatars0.githubusercontent.com/u/29154?v=3&s=40' height='20' width='20'>[ cerebris / jsonapi-resources ](https://github.com/cerebris/jsonapi-resources): A resource-focused Rails library for developing JSON API compliant servers. * <img src='https://avatars0.githubusercontent.com/u/5382?v=3&s=40' height='20' width='20'>[ chriseidhof / pomotv ](https://github.com/chriseidhof/pomotv): * <img src='https://avatars3.githubusercontent.com/u/83390?v=3&s=40' height='20' width='20'>[ jondot / <API key> ](https://github.com/jondot/<API key>): An "awesome" type curated list of React Native components, news, tools, and learning material * <img src='https://avatars2.githubusercontent.com/u/4723115?v=3&s=40' height='20' width='20'>[ dkhamsing / awesome_bot ](https://github.com/dkhamsing/awesome_bot): Validate links in awesome projects * <img src='https://avatars1.githubusercontent.com/u/17579?v=3&s=40' height='20' width='20'>[ Thibaut / devdocs ](https://github.com/Thibaut/devdocs): API Documentation Browser * <img src='https://avatars1.githubusercontent.com/u/216339?v=3&s=40' height='20' width='20'>[ twbs / bootstrap-sass ](https://github.com/twbs/bootstrap-sass): Official Sass port of Bootstrap 2 and 3. * <img src='https://avatars1.githubusercontent.com/u/305940?v=3&s=40' height='20' width='20'>[ gitlabhq / gitlabhq ](https://github.com/gitlabhq/gitlabhq): GitLab is version control for your server * <img src='https://avatars0.githubusercontent.com/u/727482?v=3&s=40' height='20' width='20'>[ caskroom / homebrew-cask ](https://github.com/caskroom/homebrew-cask): A CLI workflow for the administration of Mac applications distributed as binaries * <img src='https://avatars2.githubusercontent.com/u/869950?v=3&s=40' height='20' width='20'>[ fastlane / fastlane ](https://github.com/fastlane/fastlane): Connect all iOS deployment tools into one streamlined workflow * <img src='https://avatars1.githubusercontent.com/u/83835?v=3&s=40' height='20' width='20'>[ cantino / huginn ](https://github.com/cantino/huginn): Build agents that monitor and act on your behalf. Your agents are standing by! * <img src='https://avatars2.githubusercontent.com/u/16700?v=3&s=40' height='20' width='20'>[ ruby / ruby ](https://github.com/ruby/ruby): The Ruby Programming Language * <img src='https://avatars1.githubusercontent.com/u/474794?v=3&s=40' height='20' width='20'>[ realm / jazzy ](https://github.com/realm/jazzy): Soulful docs for Swift & Objective-C * <img src='https://avatars1.githubusercontent.com/u/1153134?v=3&s=40' height='20' width='20'>[ muan / emoji-cli ](https://github.com/muan/emoji-cli): Emoji searcher but as a CLI app. * <img src='https://avatars2.githubusercontent.com/u/3356474?v=3&s=40' height='20' width='20'>[ skywinder / <API key> ](https://github.com/skywinder/<API key>): Automatically generate change log from your tags, issues, labels and pull requests on GitHub. * <img src='https://avatars0.githubusercontent.com/u/10308?v=3&s=40' height='20' width='20'>[ intridea / omniauth ](https://github.com/intridea/omniauth): OmniAuth is a flexible authentication system utilizing Rack middleware. * <img src='https://avatars1.githubusercontent.com/u/150632?v=3&s=40' height='20' width='20'>[ bundler / gemstash ](https://github.com/bundler/gemstash): * <img src='https://avatars2.githubusercontent.com/u/869950?v=3&s=40' height='20' width='20'>[ fastlane / match ](https://github.com/fastlane/match): Easily sync your certificates and profiles across your team using git * <img src='https://avatars3.githubusercontent.com/u/1926764?v=3&s=40' height='20' width='20'>[ rapid7 / <API key> ](https://github.com/rapid7/<API key>): Metasploit Framework * <img src='https://avatars3.githubusercontent.com/u/81859?v=3&s=40' height='20' width='20'>[ fgrehm / vagrant-cachier ](https://github.com/fgrehm/vagrant-cachier): Caffeine reducer
#!/bin/sh # CYBERWATCH SAS - 2016 # Security fix for RHSA-2015:1686 # Operating System: Red Hat 7 # Architecture: x86_64 # - python-django.noarch:1.6.11-2.el7ost # - <API key>.noarch:1.6.11-2.el7ost # - python-django-doc.noarch:1.6.11-2.el7ost # Last versions recommanded by security team: # - python-django.noarch:1.8.4-1.el7 # - <API key>.noarch:1.8.4-1.el7 # - python-django-doc.noarch:1.8.4-1.el7 # CVE List: # - CVE-2015-5143 # More details: sudo yum install python-django.noarch-1.8.4 -y sudo yum install <API key>.noarch-1.8.4 -y sudo yum install python-django-doc.noarch-1.8.4 -y
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8"> <title>Akimages</title> </head> <body bgcolor="#CCCCCC"> <p></p> <p>Original</p> <img src="../../images/lenna256.jpg"/> <div id = "porID" style="relative; top:100px; left:100px;"> <canvas id="canvas1"></canvas> </div> <div id = "porID" style="relative; top:100px; left:100px;"> <canvas id="canvas2"></canvas> </div> <div id = "porOB" style="relative; top:100px; left:100px;"> <canvas id="canvas3"></canvas> <div id = "porOB" style="relative; top:100px; left:100px;"> <canvas id="canvas4"></canvas> </div> </body> </html> <script type="text/javascript" src="../../libs/build/compilated/akimage.js"> </script> <script type="text/javascript" src="js/AkPaddingZero.js"></script>
<h2>This is my home page</h2> <p>some text here</p>
package com.kant.datastructure.queues; import com.kant.sortingnsearching.MyUtil; /** * @author shaskant * */ public class <API key> { /** * * @param n * @return * @throws OverFlowException * @throws UnderFlowException */ public String[] solve(int n) throws OverFlowException, UnderFlowException { String[] result = new String[n]; System.out.println("input Queue<String> dequeue = new <API key><String>(); dequeue.enQueue("1"); for (int count = 0; count < n; count++) { result[count] = dequeue.deQueue(); dequeue.enQueue(result[count]+"0"); dequeue.enQueue(result[count]+"1"); } return result; } /** * * @param args * @throws OverFlowException * @throws UnderFlowException */ public static void main(String[] args) throws OverFlowException, UnderFlowException { <API key> prob = new <API key>(); System.out.print("output MyUtil.printArrayType(prob.solve(10)); } }
// Binary-search solution for balance. // O(n * log (max coordinate / epsilon)) // David Garcia Soriano. #include <algorithm> #include <cstdio> #include <cmath> using namespace std; const int maxn = 50000; const double eps = 1e-11, infinity = 1e300; double px[maxn], py[maxn]; int n; bool possible(double d, double& px1, double& px2) { double x1 = -infinity, x2 = infinity; for (int i = 0; i < n; ++i) { if (d < py[i]) return false; double p = sqrt(d * d - py[i] * py[i]), a = px[i] - p, b = px[i] + p; x1 = max(x1, a); x2 = min(x2, b); if (x1 > x2) return false; } px1 = x1; px2 = x2; return true; } int main() { while (scanf("%i", &n) == 1 && n > 0) { double a, b = 0, x1, x2; for (int i = 0; i < n; ++i) { scanf("%lf%lf", &px[i], &py[i]); if (py[i] < 0) py[i] = -py[i]; b = max(b, py[i]); } if (b == 0) { if (n == 1) { printf("%.9lf %.9lf\n", px[0], .0); continue; } b = 1; } while (!possible(b, x1, x2)) b *= 2; a = b / 2; while (possible(a, x1, x2)) a /= 2; for (int i = 0; i < 100 && (b - a > eps || x2 - x1 > eps); ++i) { double m = (a + b) / 2; if (possible(m, x1, x2)) b = m; else a = m; } printf("%.9lf %.9lf\n", (x1 + x2) / 2, b); } return 0; }
layout: post title: "DockerMysqlPhpmyadmin" tagline: "" description: "MySQL MariaDB Web, , " date: '2017-12-27 13:09:08 +0800' category: docker tags: docker phpmyadmin mysql linux > {{ page.description }} bash $ docker search phpmyadmin NAME DESCRIPTION STARS OFFICIAL AUTOMATED phpmyadmin/phpmyadmin A web interface for MySQL and MariaDB. 441 [OK] nazarpc/phpmyadmin phpMyAdmin as Docker container, based on o... 56 [OK] ... # , (:latest) $ docker pull phpmyadmin/phpmyadmin # phpmyadmin bash # msyql $ docker run -d \ --name myadmin \ --link mysql:db \ -p 8080:80 \ phpmyadmin/phpmyadmin ****: - `-d` - - `--name myadmin` - `myadmin`, ( - `--link mysql:db` - , `mysql` , `db` - `-p 8080:80` - , :, : `http://ip:8080` - `phpmyadmin/phpmyadmin` - # mysql bash # msyql $ docker run -d \ --name myadmin_aliyun \ -e PMA_HOST=xxx.mysql.rds.aliyuncs.com \ -e PMA_PORT=3xx6 \ -p 8081:80 \ phpmyadmin/phpmyadmin ****: - `-e PMA_HOST=xxxx` - : mysqlIP - `-e PMA_PORT=3xx6` - : mysql , `PMA_USER` `PMA_PASSWORD` (), - [phpmyadmin/phpmyadmin ](https://hub.docker.com/r/phpmyadmin/phpmyadmin/)
require 'log4r' module VagrantPlugins module G5K module Network class Nat def initialize(env, driver, oar_driver) @logger = Log4r::Logger.new("vagrant::network::nat") # command driver is unused @env = env @driver = driver @oar_driver = oar_driver @net = env[:machine].provider_config.net end def generate_net() fwd_ports = @net[:ports].map do |p| "hostfwd=tcp:: end.join(',') net = "-net nic,model=virtio -net user,#{fwd_ports}" @logger.debug("Generated net string : #{net}") return "NAT #{net}" end def check_state(job_id) return nil end def attach() # noop end def detach() # noop end def vm_ssh_info(vmid) # get forwarded port 22 ports = @net[:ports] ssh_fwd = ports.select{ |x| x.split(':')[1] == '22'}.first if ssh_fwd.nil? @env[:ui].error "SSH port 22 must be forwarded" raise Error "SSh port 22 isn't forwarded" end ssh_fwd = ssh_fwd.split('-:')[0] # get node hosting the vm job = @oar_driver.check_job(@env[:machine].id) ssh_info = { :host => job["<API key>"].first, :port => ssh_fwd } @logger.debug(ssh_info) ssh_info end end end end end
<?php namespace Gitlab\Clients; class DeployKeyClient extends AbstractClient { /** * @param int $projectId * @return \Psr\Http\Message\ResponseInterface */ public function listDeployKeys($projectId) { return $this->getRequest(sprintf('projects/%u/keys', $projectId)); } /** * @param int $projectId * @param int $keyId * @return \Psr\Http\Message\ResponseInterface */ public function getDeployKey($projectId, $keyId) { return $this->getRequest(sprintf('projects/%u/keys/%u', $projectId, $keyId)); } /** * @param int $projectId * @param array|null $data * @return \Psr\Http\Message\ResponseInterface */ public function createDeployKey($projectId, array $data = null) { return $this->postRequest(sprintf('projects/%u/keys', $projectId), $data); } /** * @param int $projectId * @param int $keyId * @return \Psr\Http\Message\ResponseInterface */ public function deleteDeployKey($projectId, $keyId) { return $this->deleteRequest(sprintf('projects/%u/keys/%u', $projectId, $keyId)); } }
{% extends "layouts/_block_content.html" %} {% set page_title = "Account email change link expired " %} {% block main %} <h1 class="u-fs-xl">Your verification link has expired</h1> <div> <p> You will need to sign back into your account and <a href="{{ url_for('account_bp.<API key>', token=token) }}">request another verification email</a>. </p> <p> <p>If you need help, please <a href="{{ url_for('contact_us_bp.contact_us') }}" rel="noopener">contact us</a>.</p> </p> </div> {% endblock main %}
from django.db import models import warnings from django.utils import timezone import requests from image_cropping import ImageRatioField class CompMember(models.Model): """A member of compsoc""" class Meta: verbose_name = 'CompSoc Member' verbose_name_plural = 'CompSoc Members' index = models.IntegerField(blank=False, help_text="This field is present just for ordering members based on their posts. President = 2, VPs = 1, Gen. Sec. = 0, Everyone else = -1", default=-1) name = models.CharField(max_length=50, help_text='Enter your full name') image = models.ImageField(blank=False, upload_to='member_images/', help_text='Please select a display image for yourself. This is necessary.') cropping = ImageRatioField('image', '500x500') alumni = models.BooleanField(default=False, help_text='Are you an alumni?') role = models.CharField(max_length=100, help_text="Enter your post if you hold one. If not, enter 'Member'") batch_of = models.CharField(max_length=4, default='2015', help_text='Enter the year you will graduate') social_link = models.CharField(blank=True, max_length=256, help_text='Enter a link to your Facebook, Twitter, GitHub or any other social network profile. You can leave this blank if you wish!') def get_social_link(self): ''' Returns the social_link if present. Otherwise, sends javascript:void(0) ''' if self.social_link == '': return 'javascript:void(0)' else: return self.social_link def __str__(self): return self.name class Variable(models.Model): ##NOTE: This should not be used anymore def __str__(self): warnings.warn('''You are using a "General Variable". Stop doing that. This is bad design on Arjoonn's part so don't fall into the same trap. If you are using this for Orfik, that has already been fixed. If you are using this for logos, same thing. Over a few cycles this entire table will be removed. ''') return self.name name = models.CharField(max_length=100) time = models.DateTimeField() # Receive the pre_delete signal and delete the image associated with the model instance. from django.db.models.signals import pre_delete from django.dispatch.dispatcher import receiver @receiver(pre_delete, sender=CompMember) def <API key>(sender, instance, **kwargs): # Pass false so ImageField doesn't save the model. instance.image.delete(False)
import complexism as cx import complexism.agentbased.statespace as ss import epidag as dag dbp = cx.read_dbp_script(cx.load_txt('../scripts/SIR_BN.txt')) pc = dag.<API key>(cx.load_txt('../scripts/pSIR.txt')) dc = dbp.generate_model('M1', **pc.get_samplers()) ag = ss.StSpAgent('Helen', dc['Sus'], pc) model = cx.SingleIndividualABM('M1', ag) model.<API key>('State') print(cx.simulate(model, None, 0, 10, 1))
from __future__ import division, print_function from abc import ABCMeta, abstractmethod import matplotlib as mpl mpl.use('TkAgg') from matplotlib.ticker import MaxNLocator, Formatter, Locator from matplotlib.widgets import Slider, Button import matplotlib.patches as patches import matplotlib.pyplot as plt from matplotlib.colors import <API key> from tadtool.tad import GenomicRegion, sub_matrix_regions, sub_data_regions, \ data_array, insulation_index, sub_vector_regions, sub_regions, \ <API key>, <API key>, <API key>, <API key> import math import copy import numpy as np from bisect import bisect_left from future.utils import string_types try: import Tkinter as tk import tkFileDialog as filedialog except ImportError: import tkinter as tk from tkinter import filedialog class BasePlotter(object): __metaclass__ = ABCMeta def __init__(self, title): self._ax = None self.cax = None self.title = title @abstractmethod def _plot(self, region=None, **kwargs): raise NotImplementedError("Subclasses need to override _plot function") @abstractmethod def plot(self, region=None, **kwargs): raise NotImplementedError("Subclasses need to override plot function") @property def fig(self): return self._ax.figure @property def ax(self): if not self._ax: _, self._ax = plt.subplots() return self._ax @ax.setter def ax(self, value): self._ax = value class <API key>(Formatter): """ Process axis tick labels to give nice representations of genomic coordinates """ def __init__(self, chromosome, display_scale=True): """ :param chromosome: :class:`~kaic.data.genomic.GenomicRegion` or string :param display_scale: Boolean Display distance scale at bottom right """ if isinstance(chromosome, GenomicRegion): self.chromosome = chromosome.chromosome else: self.chromosome = chromosome self.display_scale = display_scale def _format_val(self, x, prec_offset=0): if x == 0: oom_loc = 0 else: oom_loc = int(math.floor(math.log10(abs(x)))) view_range = self.axis.axes.get_xlim() oom_range = int(math.floor(math.log10(abs(view_range[1] - view_range[0])))) if oom_loc >= 3: return "{:.{prec}f}kb".format(x/1000, prec=max(0, 3 + prec_offset - oom_range)) return "{:.0f}b".format(x) def __call__(self, x, pos=None): """ Return label for tick at coordinate x. Relative position of ticks can be specified with pos. First tick gets chromosome name. """ s = self._format_val(x, prec_offset=1) if pos == 0 or x == 0: return "{}:{}".format(self.chromosome, s) return s def get_offset(self): """ Return information about the distances between tick bars and the size of the view window. Is called by matplotlib and displayed in lower right corner of plots. """ if not self.display_scale: return "" view_range = self.axis.axes.get_xlim() view_dist = abs(view_range[1] - view_range[0]) tick_dist = self.locs[2] - self.locs[1] minor_tick_dist = tick_dist/5 minor_tick_dist_str = self._format_val(minor_tick_dist, prec_offset=2) tick_dist_str = self._format_val(tick_dist, prec_offset=1) view_dist_str = self._format_val(view_dist) return "{}|{}|{}".format(minor_tick_dist_str, tick_dist_str, view_dist_str) class GenomeCoordLocator(MaxNLocator): """ Choose locations of genomic coordinate ticks on the plot axis. Behaves like default Matplotlib locator, except that it always places a tick at the start and the end of the window. """ def __call__(self): vmin, vmax = self.axis.get_view_interval() ticks = self.tick_values(vmin, vmax) # Make sure that first and last tick are the start # and the end of the genomic range plotted. If next # ticks are too close, remove them. ticks[0] = vmin ticks[-1] = vmax if ticks[1] - vmin < (vmax - vmin)/(self._nbins*3): ticks = np.delete(ticks, 1) if vmax - ticks[-2] < (vmax - vmin)/(self._nbins*3): ticks = np.delete(ticks, -2) return self.raise_if_exceeds(np.array(ticks)) class <API key>(Locator): """ Choose locations of minor tick marks between major tick labels. Modification of the Matplotlib AutoMinorLocator, except that it uses the distance between 2nd and 3rd major mark as reference, instead of 2nd and 3rd. """ def __init__(self, n): self.ndivs = n def __call__(self): majorlocs = self.axis.get_majorticklocs() try: majorstep = majorlocs[2] - majorlocs[1] except IndexError: # Need at least two major ticks to find minor tick locations # TODO: Figure out a way to still be able to display minor # ticks without two major ticks visible. For now, just display # no ticks at all. majorstep = 0 if self.ndivs is None: if majorstep == 0: # TODO: Need a better way to figure out ndivs ndivs = 1 else: x = int(np.round(10 ** (np.log10(majorstep) % 1))) if x in [1, 5, 10]: ndivs = 5 else: ndivs = 4 else: ndivs = self.ndivs minorstep = majorstep / ndivs vmin, vmax = self.axis.get_view_interval() if vmin > vmax: vmin, vmax = vmax, vmin if len(majorlocs) > 0: t0 = majorlocs[1] tmin = ((vmin - t0) // minorstep + 1) * minorstep tmax = ((vmax - t0) // minorstep + 1) * minorstep locs = np.arange(tmin, tmax, minorstep) + t0 cond = np.abs((locs - t0) % majorstep) > minorstep / 10.0 locs = locs.compress(cond) else: locs = [] return self.raise_if_exceeds(np.array(locs)) class BasePlotter1D(BasePlotter): __metaclass__ = ABCMeta def __init__(self, title): BasePlotter.__init__(self, title=title) def plot(self, region=None, ax=None, **kwargs): if isinstance(region, string_types): region = GenomicRegion.from_string(region) if ax: self.ax = ax # set genome tick formatter self.ax.xaxis.set_major_formatter(<API key>(region)) self.ax.xaxis.set_major_locator(GenomeCoordLocator(nbins=5)) self.ax.xaxis.set_minor_locator(<API key>(n=5)) self.ax.set_title(self.title) self._plot(region, **kwargs) self.ax.set_xlim(region.start, region.end) return self.fig, self.ax def <API key>(norm="lin", vmin=None, vmax=None): if isinstance(norm, mpl.colors.Normalize): norm.vmin = vmin norm.vmax = vmax return norm if norm == "log": return mpl.colors.LogNorm(vmin=vmin, vmax=vmax) elif norm == "lin": return mpl.colors.Normalize(vmin=vmin, vmax=vmax) else: raise ValueError("'{}'' not a valid normalization method.".format(norm)) class BasePlotterHic(object): __metaclass__ = ABCMeta def __init__(self, hic_matrix, regions=None, colormap='RdBu', norm="log", vmin=None, vmax=None, show_colorbar=True, blend_masked=False): if regions is None: for i in range(hic_matrix.shape[0]): regions.append(GenomicRegion(chromosome='', start=i, end=i)) self.regions = regions self.hic_matrix = hic_matrix self.colormap = copy.copy(mpl.cm.get_cmap(colormap)) if blend_masked: self.colormap.set_bad(self.colormap(0)) self._vmin = vmin self._vmax = vmax self.norm = <API key>(norm=norm, vmin=vmin, vmax=vmax) self.colorbar = None self.slider = None self.show_colorbar = show_colorbar def add_colorbar(self, ax=None): ax = self.cax if ax is None else ax cmap_data = mpl.cm.ScalarMappable(norm=self.norm, cmap=self.colormap) cmap_data.set_array([self.vmin, self.vmax]) self.colorbar = plt.colorbar(cmap_data, cax=ax, orientation="vertical") @property def vmin(self): return self._vmin if self._vmin else np.nanmin(self.hic_matrix) @property def vmax(self): return self._vmax if self._vmax else np.nanmax(self.hic_matrix) class HicPlot(BasePlotter1D, BasePlotterHic): def __init__(self, hic_matrix, regions=None, title='', colormap='viridis', max_dist=None, norm="log", vmin=None, vmax=None, show_colorbar=True, blend_masked=False): BasePlotter1D.__init__(self, title=title) BasePlotterHic.__init__(self, hic_matrix, regions=regions, colormap=colormap, vmin=vmin, vmax=vmax, show_colorbar=show_colorbar, norm=norm, blend_masked=blend_masked) self.max_dist = max_dist self.hicmesh = None def _plot(self, region=None, cax=None): if region is None: raise ValueError("Cannot plot triangle plot for whole genome.") hm, sr = sub_matrix_regions(self.hic_matrix, self.regions, region) hm[np.tril_indices(hm.shape[0])] = np.nan # Remove part of matrix further away than max_dist if self.max_dist is not None: for i in range(hm.shape[0]): i_region = sr[i] for j in range(hm.shape[1]): j_region = sr[j] if j_region.start-i_region.end > self.max_dist: hm[i, j] = np.nan hm_masked = np.ma.MaskedArray(hm, mask=np.isnan(hm)) # prepare an array of the corner coordinates of the Hic-matrix # Distances have to be scaled by sqrt(2), because the diagonals of the bins # are sqrt(2)*len(bin_size) sqrt2 = math.sqrt(2) bin_coords = np.r_[[(x.start - 1) for x in sr], sr[-1].end]/sqrt2 X, Y = np.meshgrid(bin_coords, bin_coords) # rotatate coordinate matrix 45 degrees sin45 = math.sin(math.radians(45)) X_, Y_ = X*sin45 + Y*sin45, X*sin45 - Y*sin45 # shift x coords to correct start coordinate and center the diagonal directly on the # x-axis X_ -= X_[1, 0] - (sr[0].start - 1) Y_ -= .5*np.min(Y_) + .5*np.max(Y_) # create plot self.hicmesh = self.ax.pcolormesh(X_, Y_, hm_masked, cmap=self.colormap, norm=self.norm) # set limits and aspect ratio #self.ax.set_aspect(aspect="equal") ylim_max = 0.5*(region.end-region.start) if self.max_dist is not None and self.max_dist/2 < ylim_max: ylim_max = self.max_dist/2 self.ax.set_ylim(0, ylim_max) # remove y ticks self.ax.set_yticks([]) # hide background patch self.ax.patch.set_visible(False) if self.show_colorbar: self.add_colorbar(cax) def set_clim(self, vmin, vmax): self.hicmesh.set_clim(vmin=vmin, vmax=vmax) if self.colorbar is not None: self.colorbar.vmin = vmin self.colorbar.vmax = vmax self.colorbar.draw_all() class DataArrayPlot(BasePlotter1D): def __init__(self, data, window_sizes=None, regions=None, title='', midpoint=None, colormap='coolwarm_r', vmax=None, current_window_size=0, log_y=True): if regions is None: regions = [] for i in range(data.shape[1]): regions.append(GenomicRegion(chromosome='', start=i, end=i)) self.regions = regions BasePlotter1D.__init__(self, title=title) self.da = data if window_sizes is None: window_sizes = [] try: l = len(data) except TypeError: l = data.shape[0] for i in range(l): window_sizes.append(i) self.window_sizes = window_sizes self.colormap = colormap self.midpoint = midpoint self.mesh = None self.vmax = vmax self.window_size_line = None self.current_window_size = current_window_size self.log_y = log_y def _plot(self, region=None, cax=None): da_sub, regions_sub = sub_data_regions(self.da, self.regions, region) da_sub_masked = np.ma.MaskedArray(da_sub, mask=np.isnan(da_sub)) bin_coords = np.r_[[(x.start - 1) for x in regions_sub], regions_sub[-1].end] x, y = np.meshgrid(bin_coords, self.window_sizes) self.mesh = self.ax.pcolormesh(x, y, da_sub_masked, cmap=self.colormap, vmax=self.vmax) self.colorbar = plt.colorbar(self.mesh, cax=cax, orientation="vertical") self.window_size_line = self.ax.axhline(self.current_window_size, color='red') if self.log_y: self.ax.set_yscale("log") self.ax.set_ylim((np.nanmin(self.window_sizes), np.nanmax(self.window_sizes))) def set_clim(self, vmin, vmax): self.mesh.set_clim(vmin=vmin, vmax=vmax) if self.colorbar is not None: self.colorbar.vmin = vmin self.colorbar.vmax = vmax self.colorbar.draw_all() def update(self, window_size): self.window_size_line.set_ydata(window_size) class TADPlot(BasePlotter1D): def __init__(self, regions, title='', color='black'): BasePlotter1D.__init__(self, title=title) self.regions = regions self.color = color self.current_region = None def _plot(self, region=None, cax=None): self.current_region = region try: sr, start_ix, end_ix = sub_regions(self.regions, region) trans = self.ax.get_xaxis_transform() for r in sr: region_patch = patches.Rectangle( (r.start, .2), width=abs(r.end - r.start), height=.6, transform=trans, facecolor=self.color, edgecolor='white', linewidth=2. ) self.ax.add_patch(region_patch) except ValueError: pass self.ax.axis('off') def update(self, regions): self.regions = regions self.ax.cla() self.plot(region=self.current_region, ax=self.ax) class DataLinePlot(BasePlotter1D): def __init__(self, data, regions=None, title='', init_row=0, is_symmetric=False): BasePlotter1D.__init__(self, title=title) if regions is None: regions = [] for i in range(len(data)): regions.append(GenomicRegion(chromosome='', start=i, end=i)) self.init_row = init_row self.data = data self.sr = None self.da_sub = None self.regions = regions self.current_region = None self.line = None self.current_ix = init_row self.current_cutoff = None self.cutoff_line = None self.cutoff_line_mirror = None self.is_symmetric = is_symmetric def _new_region(self, region): self.current_region = region self.da_sub, self.sr = sub_data_regions(self.data, self.regions, region) def _plot(self, region=None, cax=None): self._new_region(region) bin_coords = [(x.start - 1) for x in self.sr] ds = self.da_sub[self.init_row] self.line, = self.ax.plot(bin_coords, ds) if not self.is_symmetric: self.current_cutoff = (self.ax.get_ylim()[1] - self.ax.get_ylim()[0]) / 2 + self.ax.get_ylim()[0] else: self.current_cutoff = self.ax.get_ylim()[1]/ 2 self.ax.axhline(0.0, linestyle='dashed', color='grey') self.cutoff_line = self.ax.axhline(self.current_cutoff, color='r') if self.is_symmetric: self.cutoff_line_mirror = self.ax.axhline(-1*self.current_cutoff, color='r') self.ax.set_ylim((np.nanmin(ds), np.nanmax(ds))) def update(self, ix=None, cutoff=None, region=None, update_canvas=True): if region is not None: self._new_region(region) if ix is not None and ix != self.current_ix: ds = self.da_sub[ix] self.current_ix = ix self.line.set_ydata(ds) self.ax.set_ylim((np.nanmin(ds), np.nanmax(ds))) if cutoff is None: if not self.is_symmetric: self.update(cutoff=(self.ax.get_ylim()[1]-self.ax.get_ylim()[0])/2 + self.ax.get_ylim()[0], update_canvas=False) else: self.update(cutoff=self.ax.get_ylim()[1] / 2, update_canvas=False) if update_canvas: self.fig.canvas.draw() if cutoff is not None and cutoff != self.current_cutoff: if self.is_symmetric: self.current_cutoff = abs(cutoff) else: self.current_cutoff = cutoff self.cutoff_line.set_ydata(self.current_cutoff) if self.is_symmetric: self.cutoff_line_mirror.set_ydata(-1*self.current_cutoff) if update_canvas: self.fig.canvas.draw() class TADtoolPlot(object): def __init__(self, hic_matrix, regions=None, data=None, window_sizes=None, norm='lin', max_dist=3000000, max_percentile=99.99, algorithm='insulation', matrix_colormap=None, data_colormap=None, log_data=True): self.hic_matrix = hic_matrix if regions is None: regions = [] for i in range(hic_matrix.shape[0]): regions.append(GenomicRegion(chromosome='', start=i, end=i)) self.regions = regions self.norm = norm self.fig = None self.max_dist = max_dist self.algorithm = algorithm self.svmax = None self.min_value = np.nanmin(self.hic_matrix[np.nonzero(self.hic_matrix)]) self.min_value_data = None self.hic_plot = None self.tad_plot = None self.data_plot = None self.line_plot = None self.sdata = None self.data_ax = None self.line_ax = None self.da = None self.ws = None self.current_window_size = None self.window_size_text = None self.tad_cutoff_text = None self.max_percentile = max_percentile self.tad_regions = None self.current_da_ix = None self.button_save_tads = None self.button_save_vector = None self.button_save_matrix = None self.log_data = log_data if algorithm == 'insulation': self.tad_algorithm = insulation_index self.<API key> = <API key> self.is_symmetric = False if matrix_colormap is None: self.matrix_colormap = <API key>.from_list('myreds', ['white', 'red']) if data_colormap is None: self.data_plot_color = 'plasma' elif algorithm == 'ninsulation': self.tad_algorithm = <API key> self.<API key> = <API key> self.is_symmetric = True if matrix_colormap is None: self.matrix_colormap = <API key>.from_list('myreds', ['white', 'red']) if data_colormap is None: self.data_plot_color = <API key>.from_list('myreds', ['blue', 'white', 'red']) elif algorithm == 'directionality': self.tad_algorithm = <API key> self.<API key> = <API key> self.is_symmetric = True if matrix_colormap is None: self.matrix_colormap = <API key>.from_list('myreds', ['white', 'red']) if data_colormap is None: self.data_plot_color = <API key>.from_list('myreds', ['blue', 'white', 'red']) if data is None: self.da, self.ws = data_array(hic_matrix=self.hic_matrix, regions=self.regions, tad_method=self.tad_algorithm, window_sizes=window_sizes) else: self.da = data if window_sizes is None: raise ValueError("window_sizes parameter cannot be None when providing data!") self.ws = window_sizes def vmax_slider_update(self, val): self.hic_plot.set_clim(self.min_value, val) def data_slider_update(self, val): if self.is_symmetric: self.data_plot.set_clim(-1*val, val) else: self.data_plot.set_clim(self.min_value_data, val) def on_click_save_tads(self, event): tk.Tk().withdraw() # Close the root window save_path = filedialog.asksaveasfilename() if save_path is not None: with open(save_path, 'w') as o: for region in self.tad_regions: o.write("%s\t%d\t%d\n" % (region.chromosome, region.start-1, region.end)) def <API key>(self, event): tk.Tk().withdraw() # Close the root window save_path = filedialog.asksaveasfilename() if save_path is not None: da_sub = self.da[self.current_da_ix] with open(save_path, 'w') as o: for i, region in enumerate(self.regions): o.write("%s\t%d\t%d\t.\t%e\n" % (region.chromosome, region.start-1, region.end, da_sub[i])) def <API key>(self, event): tk.Tk().withdraw() # Close the root window save_path = filedialog.asksaveasfilename() if save_path is not None: with open(save_path, 'w') as o: # write regions for i, region in enumerate(self.regions): o.write("%s:%d-%d" % (region.chromosome, region.start-1, region.end)) if i < len(self.regions)-1: o.write("\t") else: o.write("\n") # write matrix n_rows = self.da.shape[0] n_cols = self.da.shape[1] for i in range(n_rows): window_size = self.ws[i] o.write("%d\t" % window_size) for j in range(n_cols): o.write("%e" % self.da[i, j]) if j < n_cols-1: o.write("\t") else: o.write("\n") def plot(self, region=None): # set up plotting grid self.fig = plt.figure(figsize=(10, 10)) # main plots grid_size = (32, 15) hic_vmax_slider_ax = plt.subplot2grid(grid_size, (0, 0), colspan=13) hic_ax = plt.subplot2grid(grid_size, (1, 0), rowspan=9, colspan=13) hp_cax = plt.subplot2grid(grid_size, (1, 14), rowspan=9, colspan=1) tad_ax = plt.subplot2grid(grid_size, (10, 0), rowspan=1, colspan=13, sharex=hic_ax) line_ax = plt.subplot2grid(grid_size, (12, 0), rowspan=6, colspan=13, sharex=hic_ax) line_cax = plt.subplot2grid(grid_size, (12, 13), rowspan=6, colspan=2) data_vmax_slider_ax = plt.subplot2grid(grid_size, (19, 0), colspan=13) data_ax = plt.subplot2grid(grid_size, (20, 0), rowspan=9, colspan=13, sharex=hic_ax) da_cax = plt.subplot2grid(grid_size, (20, 14), rowspan=9, colspan=1) # buttons save_tads_ax = plt.subplot2grid(grid_size, (31, 0), rowspan=1, colspan=4) self.button_save_tads = Button(save_tads_ax, 'Save TADs') self.button_save_tads.on_clicked(self.on_click_save_tads) save_vector_ax = plt.subplot2grid(grid_size, (31, 5), rowspan=1, colspan=4) self.button_save_vector = Button(save_vector_ax, 'Save current values') self.button_save_vector.on_clicked(self.<API key>) save_matrix_ax = plt.subplot2grid(grid_size, (31, 10), rowspan=1, colspan=4) self.button_save_matrix = Button(save_matrix_ax, 'Save matrix') self.button_save_matrix.on_clicked(self.<API key>) # add subplot content max_value = np.nanpercentile(self.hic_matrix, self.max_percentile) init_value = .2*max_value # HI-C VMAX SLIDER self.svmax = Slider(hic_vmax_slider_ax, 'vmax', self.min_value, max_value, valinit=init_value, color='grey') self.svmax.on_changed(self.vmax_slider_update) # HI-C self.hic_plot = HicPlot(self.hic_matrix, self.regions, max_dist=self.max_dist, norm=self.norm, vmax=init_value, vmin=self.min_value, colormap=self.matrix_colormap) self.hic_plot.plot(region, ax=hic_ax, cax=hp_cax) # generate data array self.min_value_data = np.nanmin(self.da[np.nonzero(self.da)]) max_value_data = np.nanpercentile(self.da, self.max_percentile) init_value_data = .5*max_value_data # LINE PLOT da_ix = int(self.da.shape[0]/2) self.current_da_ix = da_ix self.line_plot = DataLinePlot(self.da, regions=self.regions, init_row=da_ix, is_symmetric=self.is_symmetric) self.line_plot.plot(region, ax=line_ax) self.line_ax = line_ax # line info self.current_window_size = self.ws[da_ix] line_cax.text(.1, .8, 'Window size', fontweight='bold') self.window_size_text = line_cax.text(.3, .6, str(self.current_window_size)) line_cax.text(.1, .4, 'TAD cutoff', fontweight='bold') self.tad_cutoff_text = line_cax.text(.3, .2, "%.5f" % self.line_plot.current_cutoff) line_cax.axis('off') # TAD PLOT self.tad_regions = self.<API key>(self.da[da_ix], self.line_plot.current_cutoff, self.regions) self.tad_plot = TADPlot(self.tad_regions) self.tad_plot.plot(region=region, ax=tad_ax) # DATA ARRAY self.data_plot = DataArrayPlot(self.da, self.ws, self.regions, vmax=init_value_data, colormap=self.data_plot_color, current_window_size=self.ws[da_ix], log_y=self.log_data) self.data_plot.plot(region, ax=data_ax, cax=da_cax) # DATA ARRAY SLIDER if self.is_symmetric: self.sdata = Slider(data_vmax_slider_ax, 'vmax', 0.0, max_value_data, valinit=init_value_data, color='grey') else: self.sdata = Slider(data_vmax_slider_ax, 'vmax', self.min_value_data, max_value_data, valinit=init_value_data, color='grey') self.sdata.on_changed(self.data_slider_update) self.data_slider_update(init_value_data) # clean up hic_ax.xaxis.set_visible(False) line_ax.xaxis.set_visible(False) # enable hover self.data_ax = data_ax cid = self.fig.canvas.mpl_connect('button_press_event', self.on_click) return self.fig, (hic_vmax_slider_ax, hic_ax, line_ax, data_ax, hp_cax, da_cax) def on_click(self, event): if event.inaxes == self.data_ax or event.inaxes == self.line_ax: if event.inaxes == self.data_ax: ws_ix = bisect_left(self.ws, event.ydata) self.current_window_size = self.ws[ws_ix] self.current_da_ix = ws_ix self.data_plot.update(window_size=self.ws[ws_ix]) self.line_plot.update(ix=ws_ix, update_canvas=False) self.tad_cutoff_text.set_text("%.5f" % self.line_plot.current_cutoff) self.window_size_text.set_text(str(self.current_window_size)) elif event.inaxes == self.line_ax: if self.is_symmetric: self.line_plot.update(cutoff=abs(event.ydata), update_canvas=False) else: self.line_plot.update(cutoff=abs(event.ydata), update_canvas=False) self.tad_cutoff_text.set_text("%.5f" % self.line_plot.current_cutoff) # update TADs self.tad_regions = self.<API key>(self.da[self.current_da_ix], self.line_plot.current_cutoff, self.regions) self.tad_plot.update(self.tad_regions) self.fig.canvas.draw()
#define BOOST_TEST_NO_LIB #include <boost/test/auto_unit_test.hpp> #include "dormouse-engine/essentials/Formatter.hpp" using namespace dormouse_engine::essentials; namespace { <API key>(FormatterTestSuite); <API key>(FormatsEmptyString) { std::string s; Formatter f(Formatter::FormatterChars('$', '{', '}', '\\')); Formatter::FormatList result; f.format(result, s); BOOST_CHECK(result.empty()); } <API key>(FormatsNoSpecial) { std::string s = "No special characters here ({} is not special if no dollar sign before)"; Formatter f(Formatter::FormatterChars('$', '{', '}', '\\')); Formatter::FormatList result; f.format(result, s); BOOST_REQUIRE(result.size() == 1); BOOST_CHECK_EQUAL(result.front().function, '\0'); BOOST_CHECK_EQUAL(result.front().opts, s); } <API key>(FormatsAllEscaped) { std::string s = "No special characters here (neither \\$f nor \\${opts}f is not special if \\$ is preceded by \\\\)"; std::string escaped = "No special characters here (neither $f nor ${opts}f is not special if $ is preceded by \\)"; Formatter f(Formatter::FormatterChars('$', '{', '}', '\\')); Formatter::FormatList result; f.format(result, s); BOOST_REQUIRE(result.size() == 1); BOOST_CHECK_EQUAL(result.front().function, '\0'); BOOST_CHECK_EQUAL(result.front().opts, escaped); } <API key>(FormatsOnlySpecial) { std::string s = "%1%[opts]2%3"; Formatter f(Formatter::FormatterChars('%', '[', ']', '\\')); Formatter::FormatList result; f.format(result, s); BOOST_REQUIRE(result.size() == 3); Formatter::FormatList::iterator it = result.begin(); BOOST_CHECK_EQUAL(it->function, '1'); BOOST_CHECK_EQUAL(it->opts, ""); ++it; BOOST_CHECK_EQUAL(it->function, '2'); BOOST_CHECK_EQUAL(it->opts, "opts"); ++it; BOOST_CHECK_EQUAL(it->function, '3'); BOOST_CHECK_EQUAL(it->opts, ""); } <API key>(FormatsMixed) { std::string s = "This is a mixed %s with opts %(012\\(\\)3)d and an escaped \\% char"; Formatter f(Formatter::FormatterChars('%', '(', ')', '\\')); Formatter::FormatList result; f.format(result, s); BOOST_REQUIRE(result.size() == 5); Formatter::FormatList::iterator it = result.begin(); BOOST_CHECK_EQUAL(it->function, '\0'); BOOST_CHECK_EQUAL(it->opts, "This is a mixed "); ++it; BOOST_CHECK_EQUAL(it->function, 's'); BOOST_CHECK_EQUAL(it->opts, ""); ++it; BOOST_CHECK_EQUAL(it->function, '\0'); BOOST_CHECK_EQUAL(it->opts, " with opts "); ++it; BOOST_CHECK_EQUAL(it->function, 'd'); BOOST_CHECK_EQUAL(it->opts, "012()3"); ++it; BOOST_CHECK_EQUAL(it->function, '\0'); BOOST_CHECK_EQUAL(it->opts, " and an escaped % char"); } <API key>(<API key>) { Formatter f(Formatter::FormatterChars('$', '{', '}', '\\')); Formatter::FormatList result; std::string s = "$"; BOOST_CHECK_THROW(f.format(result, s), FormatterError); s = "${}"; BOOST_CHECK_THROW(f.format(result, s), FormatterError); s = "$$a"; BOOST_CHECK_THROW(f.format(result, s), FormatterError); } <API key>(<API key>) { Formatter f(Formatter::FormatterChars('$', '{', '}', '\\')); Formatter::FormatList result; std::string s = "${opts$n"; BOOST_CHECK_THROW(f.format(result, s), FormatterError); } <API key>(ThrowsOnExtraEscape) { Formatter f(Formatter::FormatterChars('$', '{', '}', '!')); Formatter::FormatList result; std::string s = "Just a text with an extra ! char"; BOOST_CHECK_THROW(f.format(result, s), FormatterError); s = "Text and format with escaped {: $!{"; BOOST_CHECK_THROW(f.format(result, s), FormatterError); } <API key>(); } // anonymous namespace
<?php class NamesiloDomainsDns { /** * @var NamesiloApi */ private $api; /** * Sets the API to use for communication * * @param NamesiloApi $api The API to use for communication */ public function __construct(NamesiloApi $api) { $this->api = $api; } /** * Sets domain to use our default DNS servers. Required for free services * like Host record management, URL forwarding, email forwarding, dynamic * dns and other value added services. * * @param array $vars An array of input params including: * - SLD SLD of the DomainName * - TLD TLD of the DomainName * @return NamesiloResponse */ public function setDefault(array $vars) { return $this->api->submit("namesilo.domains.dns.setDefault", $vars); } public function setCustom(array $vars) { return $this->api->submit("changeNameServers", $vars); } public function getList(array $vars) { return $this->api->submit("getDomainInfo", $vars); } public function getHosts(array $vars) { return $this->api->submit("dnsListRecords", $vars); } public function setHosts(array $vars) { return $this->api->submit("dnsAddRecord", $vars); } public function getEmailForwarding(array $vars) { return $this->api->submit("listEmailForwards", $vars); } public function setEmailForwarding(array $vars) { return $this->api->submit("<API key>", $vars); } } ?>
namespace Pioneer.Blog.Models { public class Contact { public int ContactId { get; set; } public string Email { get; set; } } }
package com.baomidou.hibernateplus.spring.vo; import java.io.Serializable; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import com.baomidou.hibernateplus.entity.Convert; /** * <p> * Vdemo * </p> * * @author Caratacus * @date 2016-12-2 */ public class Vdemo extends Convert implements Serializable { protected Long id; private String demo1; private String demo2; private String demo3; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getDemo1() { return demo1; } public void setDemo1(String demo1) { this.demo1 = demo1; } public String getDemo2() { return demo2; } public void setDemo2(String demo2) { this.demo2 = demo2; } public String getDemo3() { return demo3; } public void setDemo3(String demo3) { this.demo3 = demo3; } }
import cProfile from pathlib import Path def main(args, results_dir: Path, scenario_dir: Path): try: scenario_dir.mkdir(parents=True) except FileExistsError: pass cProfile.runctx( 'from dmprsim.scenarios.python_profile import main;' 'main(args, results_dir, scenario_dir)', globals=globals(), locals=locals(), filename=str(results_dir / 'profile.pstats'), )
using System; using System.Collections.Generic; using System.Xml.Serialization; namespace Trafikverket.NET { <summary> Timetable information, represents a single train at a location </summary> public class TrainAnnouncement { <summary> Get ObjectType as string </summary> public static string ObjectTypeName { get { return "TrainAnnouncement"; } } <summary> Get or set unique id for the activity </summary> [XmlElement("ActivityId")] public string ActivityId { get; set; } <summary> Get or set type of activity, either "Ankomst" or "Angang" </summary> [XmlElement("ActivityType")] public string ActivityType { get; set; } <summary> Get or set if the activity is advertised in the time table </summary> [XmlElement("Advertised")] public bool Advertised { get; set; } <summary> Get or set advertised time in time table </summary> [XmlElement("<API key>")] public DateTime <API key> { get; set; } <summary> Get or set announced train number </summary> [XmlElement("<API key>")] public string <API key> { get; set; } <summary> Get or set booking information, e.g. "Vagn 4 obokad" </summary> [XmlElement("Booking")] public List<string> Booking { get; set; } <summary> Get or set if the activity is cancelled </summary> [XmlElement("Canceled")] public bool Canceled { get; set; } <summary> Get or set if this data post has been deleted </summary> [XmlElement("Deleted")] public bool Deleted { get; set; } <summary> Get or set possible deviation texts, e.g. "Buss ersätter" </summary> [XmlElement("Deviation")] public List<string> Deviation { get; set; } <summary> Get or set estimated time for arrival or departure </summary> [XmlElement("<API key>")] public DateTime? <API key> { get; set; } <summary> Get or set if the estimated time is preliminary </summary> [XmlElement("<API key>")] public bool <API key> { get; set; } <summary> Get or set from stations, sorted by order and priority to be displayed </summary> [XmlElement("FromLocation")] public List<string> FromLocation { get; set; } <summary> Get or set name of traffic information owner </summary> [XmlElement("InformationOwner")] public string InformationOwner { get; set; } <summary> Get or set signature for the station </summary> [XmlElement("LocationSignature")] public string LocationSignature { get; set; } <summary> Get or set url to traffic owners mobile website </summary> [XmlElement("MobileWebLink")] public string MobileWebLink { get; set; } <summary> Get or set modified time for this data post </summary> [XmlElement("ModifiedTime")] public DateTime Modified { get; set; } <summary> Get or set other announcement text, e.g. "Trevlig resa!", "Ingen påstigning", etc. </summary> [XmlElement("OtherInformation")] public List<string> OtherInformation { get; set; } <summary> Get or set description of the train, e.g. "Tågkompaniet", "SJ", "InterCity" etc. </summary> [XmlElement("ProductInformation")] public List<string> ProductInformation { get; set; } <summary> Get or set announced departure date </summary> [XmlElement("<API key>")] public DateTime? ScheduledDeparture { get; set; } <summary> Get or set additional product information, e.g. "Bistro" etc. </summary> [XmlElement("Service")] public List<string> Service { get; set; } <summary> Get or set when train arrived or departed </summary> [XmlElement("TimeAtLocation")] public DateTimeOffset TimeAtLocation { get; set; } <summary> Get or set to locations, in order after priority in which to be displayed </summary> [XmlElement("ToLocation")] public List<string> ToLocation { get; set; } <summary> Get or set track at the station </summary> [XmlElement("TrackAtLocation")] public string TrackAtLocation { get; set; } <summary> Get or set train compisition, e.g. "Vagnsordning 7, 6, 5, 4, 2, 1" </summary> [XmlElement("TrainComposition")] public List<string> TrainComposition { get; set; } <summary> Get or set type of traffic, values "Tåg", "Direktbuss", "Extrabuss", "Ersättningsbuss", or "Taxi". </summary> [XmlElement("TypeOfTraffic")] public string TypeOfTraffic { get; set; } <summary> Get or set url to traffic owners website </summary> [XmlElement("WebLink")] public string WebLink { get; set; } } }
<!DOCTYPE html> <html lang="ru" > <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="shortcut icon" href="/static/img/favicon.ico" /> <title>Redmine 2.x обнуление пароля admin-a - Cyberflow</title> <meta name="author" content="Cyberflow" /> <meta name="description" content="Redmine 2.x обнуление пароля admin-a" /> <meta name="keywords" content="Redmine 2.x обнуление пароля admin-a, Cyberflow, notice" /> <link rel="alternate" type="application/rss+xml" title="RSS" href="/feed.xml"> <!-- syntax highlighting CSS --> <link rel="stylesheet" href="/static/css/syntax.css"> <!-- Bootstrap core CSS --> <link href="/static/css/bootstrap.min.css" rel="stylesheet"> <!-- Fonts --> <link href="//fonts.googleapis.com/css?family=Roboto+Condensed:400,300italic,300,400italic,700&amp;subset=latin,latin-ext" rel="stylesheet" type="text/css"> <!-- Custom CSS --> <link rel="stylesheet" href="/static/css/super-search.css"> <link rel="stylesheet" href="/static/css/main.css"> <!-- Google Analytics --> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-31213444-1']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https: var s = document.<API key>('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> </head> <body> <div class="container"> <div class="col-sm-3"> <a href="/"><img id="about" src="https: <h1 class="author-name">Cyberflow</h1> <div id="about"> I am linux system administrator. </div> <hr /> <div class="search" id="js-search"> <input type="text" placeholder="(sitemap)~$ type to search" class="search__input form-control" id="js-search__input"> <ul class="search__results" id="js-search__results"></ul> </div> <hr /> <strong>Navigation</strong><br /> &raquo; <a href="/">Home</a> <br /> &raquo; <a class="about" href="/category/">Categories</a><br /> &raquo; <a class="about" href="/code/">Code</a><br /> &raquo; <a class="about" href="/feed.xml">XML Feed</a><br /> </div> <div class="col-sm-8 col-offset-1"> <h1>Redmine 2.x обнуление пароля admin-a</h1> <span class="time">13 Dec 2012</span> <span class="categories"> &raquo; <a href="/category/notice">notice</a> </span> <div class="content"> <div class="post"><p>Для обнуления пароля от пользователя admin в redmine 2.x выполните следующую команду из консоли находясь в директории с redmine</p> <figure class="highlight"><pre><code class="language-bash" data-lang="bash">ruby script/rails runner <span class="s1">'user = User.find(:first, :conditions =&gt; {:admin =&gt; true}) ; user.password, user.<API key> = "password"; user.save!'</span> <span class="nt">-e</span> production</code></pre></figure> </div> </div> <div class="panel-body"> <h4>Related Posts</h4> <ul> <li class="relatedPost"> <a href="https: (Categories: <a href="/category/notice">notice</a>, <a href="/category/linux">linux</a>) </li> <li class="relatedPost"> <a href="https: (Categories: <a href="/category/notice">notice</a>, <a href="/category/linux">linux</a>, <a href="/category/elasticsearch">elasticsearch</a>) </li> </ul> </div> <div class="PageNavigation"> <a class="prev" href="/2012/10/<API key>.html">&laquo; Установка chef solo на debian 6 squeeze</a> <a class="next" href="/2013/02/<API key>.html">Установка node.js на Linux (deb base) &raquo;</a> </div> <div class="disqus-comments"> <div id="disqus_thread"></div> <script type="text/javascript"> /* <![CDATA[ */ var disqus_shortname = "cyberflowblog"; var disqus_identifier = "https: var disqus_title = "Redmine 2.x обнуление пароля admin-a"; /* * * DON'T EDIT BELOW THIS LINE * * */ (function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js'; (document.<API key>('head')[0] || document.<API key>('body')[0]).appendChild(dsq); })(); </script> </div> <footer> &copy; Cyberflow - <a href="https: </footer> </div><!-- end /.col-sm-8 --> </div><!-- end /.container --> <!-- Bootstrap core JavaScript =============================================== <!-- Placed at the end of the document so the pages load faster --> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> <script src="/static/js/bootstrap.min.js"></script> <script src="/static/js/super-search.js"></script> </body> </html>
using System.Collections; using System.Collections.Generic; using UnityEngine; public class Pasteurizer : Clickable { [SerializeField] private Transform positionMark; private Vector3 initial; [SerializeField] private GameObject milkObject; public override void OnStart() { base.OnStart(); initial = transform.position; } public void Show() { StartCoroutine(Coroutines.AnimatePosition(gameObject, positionMark.position, 20f)); } public void Hide() { StartCoroutine(Coroutines.AnimatePosition(gameObject, initial, 20f)); } public void MilkDragged() { GetComponent<Animator>().Play("<API key>"); AkSoundEngine.PostEvent("PasturisingMachine", gameObject); } public void <API key>() { milkObject.SetActive(true); } }
<?php namespace Terion\PackageInstaller; use Illuminate\Filesystem\Filesystem; use Illuminate\Foundation\Application; use Symfony\Component\Finder\Finder; class ConfigUpdater { /** * Path to config file. * * @var string */ protected $configFile; /** * Working environment. * * @var string */ protected $env; /** * Filesystem object. * * @var Filesystem */ protected $file; /** * Default quote type. * * @var string */ protected $defaultQuoteType = "'"; /** * Default separator between config items. * * @var string */ protected $defaultSeparator = ",\r\n "; /** * @var Application */ private $app; /** * @param Filesystem $filesystem * @param Application $app */ public function __construct(Filesystem $filesystem, Application $app) { $this->app = $app; $this->env = $this->app->environment(); $this->file = $filesystem; $this->configFile = $this->app['path'] . '/config/app.php'; } /** * List installed service providers. * * @return mixed */ public function getServiceProviders() { $cfg = $this->file->getRequire($this->configFile); return array_get($cfg, 'providers'); } /** * List installed facades. * * @return mixed */ public function getAliases() { $cfg = $this->file->getRequire($this->configFile); return array_get($cfg, 'aliases'); } /** * Add specified provider. * * @param $provider */ public function addProvider($provider) { if (!in_array($provider, $this->getServiceProviders())) { $quote = $this->getQuoteType('providers'); $separator = $this-><API key>('providers'); $anchor = $this->getInsertPoint('providers'); $insert = $separator . $quote . $provider . $quote . ','; $this->write($insert, $anchor); } } /** * Detect quote type used in selected config item (providers, aliases). * * @param $item * * @return string */ protected function getQuoteType($item) { $bounds = $this->getConfigItemBounds($item); if (!$bounds[0] or !$bounds[1]) { return $this->defaultQuoteType; } $file = $this->getFileContents(); $substr = substr($file, $bounds[0], $bounds[1] - $bounds[0] + 1); return substr_count($substr, '"') > substr_count($substr, "'") ? '"' : "'"; } /** * Get bite bounds of selected config item (providers, aliases) in file. * * @param $item * * @return array */ protected function getConfigItemBounds($item) { $file = $this->getFileContents(); if (!$file) { return [null, null]; } $searchStart = '/[\'"]' . $item . '[\'"]/'; preg_match($searchStart, $file, $matchStart, PREG_OFFSET_CAPTURE); $start = array_get(reset($matchStart), 1); $end = $start + 1; // search for array closing that is not commented $match = [')', ']']; for ($i = $start; $i <= strlen($file); ++$i) { $char = $file[$i]; if (in_array($char, $match)) { if (!$this->isCharInComment($file, $i)) { $end = $i; break; } } } return [$start, $end]; } /** * Detect config items separator used in selected config item (providers, aliases). * * @param $item * * @return string */ protected function <API key>($item) { $cfg = $this->file->getRequire($this->configFile); if (!$cfg) { return $this->defaultSeparator; } $file = $this->getFileContents(); $arr = array_get($cfg, $item); $lastItem = end($arr); $preLastItem = prev($arr); if (!$lastItem or !$preLastItem) { return $this->defaultSeparator; } preg_match('/\,/', $file, $matchStart, PREG_OFFSET_CAPTURE, strpos($file, $preLastItem)); $start = array_get(reset($matchStart), 1); $searchEnd = preg_match('/[\'"]/', $file, $matchEnd, PREG_OFFSET_CAPTURE, $start); $end = array_get(reset($matchEnd), 1); $separator = substr($file, $start, $end - $start); // remove comments $separator = preg_replace('/\/\/.*/ui', '', $separator); $separator = preg_replace('/#.*/ui', '', $separator); $separator = preg_replace('/\/\*(.*)\*\//ui', '', $separator); return $separator; } /** * Detect point where to insert new data for selected config item (providers, aliases). * * @param $for * * @return array */ protected function getInsertPoint($for) { $bound = $this->getConfigItemBounds($for); $file = $this->getFileContents(); $match = ['\'', '"', ',']; $matches = []; for ($i = $bound[0]; $i <= $bound[1]; ++$i) { $char = $file[$i]; if (in_array($char, $match)) { if (!$this->isCharInComment($file, $i)) { $matches[] = ['position' => $i + 1, 'symbol' => $char]; } } } return end($matches); } /** * Detect is character at specified position is inside of a comment * * @param $haystack * @param $charPosition * * @return bool */ protected function isCharInComment($haystack, $charPosition) { // check for line comment for ($c = $charPosition; $c > 0; if ($haystack[$c] === PHP_EOL) { break; } elseif ($haystack[$c] === ' and ($haystack[$c + 1] === '/' or $haystack[$c - 1] === '/')) ) { return true; } } // check for block comment $openingsCount = 0; $closingsCount = 0; for ($c = $charPosition; $c > 0; if ($haystack[$c] === '*' and $haystack[$c - 1] === '/') { ++$openingsCount; } if ($haystack[$c] === '/' and $haystack[$c - 1] === '*') { ++$closingsCount; } } if ($openingsCount !== $closingsCount) { return true; } return false; } /** * Write new data to config file for selected config item (providers, aliases). * * @param $text * @param $anchor */ protected function write($text, $anchor) { $this->backup(); $file = $this->getFileContents(); if ($anchor['symbol'] === ',') { $text = ltrim($text, ','); } $file = substr_replace($file, $text, $anchor['position'], 0); $this->file->put($this->configFile, $file); $this->cleanup(); } /** * Backup config file */ protected function backup() { $from = $this->configFile; $pathinfo = pathinfo($from); $to = $pathinfo['dirname'] . DIRECTORY_SEPARATOR . $pathinfo['filename'] . '.bak.php'; $this->file->copy($from, $to); } /** * Cleanup backup */ protected function cleanup() { $pathinfo = pathinfo($this->configFile); $backup = $pathinfo['dirname'] . DIRECTORY_SEPARATOR . $pathinfo['filename'] . '.bak.php'; $this->file->delete($backup); } /** * Add specified facade. * * @param $alias * @param $facade */ public function addAlias($alias, $facade) { if ($facadeCurrent = array_get($this->getAliases(), $alias)) { if ($facadeCurrent === $facade) { return; } $this->commentOut($alias, 'aliases'); } $quote = $this->getQuoteType('aliases'); $separator = $this-><API key>('aliases'); $anchor = $this->getInsertPoint('aliases'); $insert = $separator . $quote . $alias . $quote . ' => ' . $quote . $facade . $quote . ','; $this->write($insert, $anchor); } /** * Comment item * * @param $search * @param $from */ protected function commentOut($search, $from) { $bounds = $this->getConfigItemBounds($from); $file = $this->getFileContents(); $cutted = substr($file, 0, $bounds[1]); preg_match_all( '/[\'"]' . preg_quote($search) . '[\'"]/', $cutted, $matchFacade, PREG_OFFSET_CAPTURE | PREG_SET_ORDER ); foreach ($matchFacade as $match) { if (!$this->isCharInComment($cutted, $match[0][1])) { $commentFrom = $match[0][1]; $comma = strpos($cutted, ',', $commentFrom); while ($this->isCharInComment($cutted, $comma)) { $comma = strpos($cutted, ',', $comma); } $commentTill = $comma + 1; $this->write('*/', ['position' => $commentTill, 'symbol' => '']); /** * Get contents of config file * * @return string */ protected function getFileContents() { return $this->file->get($this->configFile); } }
require('./node') require('./console')
var m = require("mraa") console.log("mraa version: " + m.getVersion()); var x = new m.Gpio(8) x.dir(m.DIR_OUT) x.write(1)
<?php $view->extend('EmVistaBundle::base.html.php'); ?> <?php $view['slots']->start('body') ?> <div class="container"> <form method="post" action="<?php echo $view['router']->generate('submissao_iniciar') ?>"> <div class="row"> <div class="col-sm-12"> <h3>Termos de uso</h3> <p class="text-info">Antes de continuar, é necessário que leia e concorde com os termos de uso do cultura crowdfunding.</p> </div> </div> <div class="row"> <div class="col-sm-12" style="height: 300px;overflow: auto; "> <?php echo $termosUso->getTermoUso(); ?> </div> </div> <div class="form-actions" style="text-align: center"> <button type="submit" class="btn btn-success">Li e concordo com os termos acima.</button> </div> </form> </div> <?php $view['slots']->stop(); ?>
< .SYNOPSIS Gets reader mode. .DESCRIPTION Gets the reader mode for all readers or the reader mode for a single reader if a panel id and reader id is specified. If the result returns null, try the parameter "-Verbose" to get more details. .EXAMPLE Get-ReaderMode .LINK https://github.com/erwindevreugd/PSDataConduIT .EXTERNALHELP PSDataConduIT-help.xml function Get-ReaderMode { [CmdletBinding()] param ( [Parameter( Position = 0, Mandatory = $false, <API key> = $true, HelpMessage = 'The name of the server where the DataConduIT service is running or localhost.')] [string] $Server = $Script:Server, [Parameter( Position = 1, Mandatory = $false, <API key> = $true, HelpMessage = 'The credentials used to authenticate the user to the DataConduIT service.')] [PSCredential] $Credential = $Script:Credential, [Parameter( Mandatory = $false, <API key> = $true, HelpMessage = 'The panel id parameter.')] [int] $PanelID, [Parameter( Mandatory = $false, <API key> = $true, HelpMessage = 'The reader id parameter.')] [int] $ReaderID ) process { $parameters = @{ Server = $Server; } if ($Credential -ne $null) { $parameters.Add("Credential", $Credential) } if (($panels = Get-Panel @parameters -PanelID $PanelID) -eq $null) { Write-Verbose -Message ("No panels found") return } foreach ($panel in $panels) { # Update panel hardware status so we can get the current reader mode $panel | <API key> } if (($readers = Get-Reader @parameters -PanelID $PanelID -ReaderID $ReaderID) -eq $null) { Write-Verbose -Message ("No readers found") return } foreach ($reader in $readers) { $mode = MapEnum ([ReaderMode].AsType()) $reader.GetReaderMode.Invoke().Mode Write-Verbose -Message ("Reader '$($reader.Name)' on Panel '$($panel.Name)' reader mode is '$($mode)'") New-Object PSObject -Property @{ PanelID = $reader.PanelID; ReaderID = $reader.ReaderID; Name = $reader.Name; Mode = $mode; } | Add-ObjectType -TypeName "DataConduIT.LnlReaderMode" } } }
package main import ( "flag" "fmt" "github.com/ammario/fastpass" ) func cmdGet(fp *fastpass.FastPass) { search := flag.Arg(0) if len(flag.Args()) != 1 { usage() } results := fp.Entries.SortByName() if search != "" { results = fp.Entries.SortByBestMatch(search) } if len(results) == 0 { fail("no results found") } e := results[0] e.Stats.Hit() if len(results) > 1 { fmt.Printf("similar: ") for i, r := range results[1:] { //show a maximum of five suggestions if i > 5 { break } fmt.Printf("%v ", r.Name) } fmt.Printf("\n") } copyPassword(e) }
from django.http import HttpResponse from django.core.servers.basehttp import FileWrapper from django.contrib.auth.models import User from django.shortcuts import render_to_response, redirect, get_object_or_404 from requests import get from urllib import urlretrieve from common.models import Repository from common.util import get_context def cgit_url(user_name, repo_name, method, path, query=None): url = 'http://localhost:8080/view' if method == 'summary': base = '%s/%s/%s' %(url, user_name, repo_name) else: base = '%s/%s/%s/%s' %(url, user_name, repo_name, method) if path is not None: base = '%s/%s' %(base, path) if query is not None and len(query)>1: base = "%s?%s" % (base, query) print base return base def cumulative_path(path): if path is None or len(path) == 0: return path c = [path[0]] for part in path[1:]: c.append('%s/%s'%(c[-1], part)) return c def view_index(request): return redirect('index') def user_index(request, user_name): return redirect('repo_list', user_name) def repo_plain(request, user_name, repo_name, path, prefix='plain'): user = request.user owner = get_object_or_404(User, username=user_name) repo = get_object_or_404(Repository, owner=owner, name=repo_name) collaborators = repo.collaborators.all() access = repo.user_access(user) if access is None: return HttpResponse('Not authorized', status=401) query = request.GET.urlencode() print query url = cgit_url(user_name, repo_name, prefix, path, query) (fname, info) = urlretrieve(url) response = HttpResponse(FileWrapper(open(fname)), content_type='text/plain') return response def repo_snapshot(request, user_name, repo_name, path): user = request.user owner = get_object_or_404(User, username=user_name) repo = get_object_or_404(Repository, owner=owner, name=repo_name) collaborators = repo.collaborators.all() access = repo.user_access(user) if access is None: return HttpResponse('Not authorized', status=401) query = request.GET.urlencode() filename = path.split('/')[-1] url = cgit_url(user_name, repo_name, 'snapshot', path, query) (fname, info) = urlretrieve(url) response = HttpResponse(FileWrapper(open(fname)), content_type='application/force-download') response['Content-Disposition'] = 'attachment; filename="%s"' % filename return response def repo_browse(request, user_name, repo_name, method='summary', path=None): user = request.user owner = get_object_or_404(User, username=user_name) repo = get_object_or_404(Repository, owner=owner, name=repo_name) collaborators = repo.collaborators.all() access = repo.user_access(user) if access is None: return HttpResponse('Not authorized', status=401) commit_id = request.GET.get('id') q = request.GET.get('q', '') qtype = request.GET.get('qt', 'grep') messages = { 'grep' : 'Log Message', 'author': 'Author', 'committer' : 'Committer', 'range' : 'Range' } search_text = messages.get(qtype, messages['grep']) if method == 'tree': file_path = path.split('/') path_parts = cumulative_path(file_path) file_path = zip(file_path, path_parts) else: file_path = None query = request.GET.urlencode() url = cgit_url(user_name, repo_name, method, path, query) text = get(url) context = get_context(request, {'owner': owner, 'repo_html':text.text, 'repo':repo, 'access':access, 'id':commit_id, 'method':method, 'q':q, 'qtype':qtype, 'search_text':search_text, 'file_path':file_path}) return render_to_response('viewer/repo_view.html', context)
import {Component, OnInit} from '@angular/core'; @Component({ selector: 'sqap-about', templateUrl: './about.component.html', styleUrls: ['./about.component.scss'] }) export class AboutComponent implements OnInit { constructor() { } ngOnInit() { console.log('hello `About` component'); } }
-- PCT19H. NONRELATIVES BY HOUSEHOLD TYPE (HISPANIC OR LATINO) -- designed to work with the IRE Census bulk data exports -- see http://census.ire.org/data/bulkdata.html CREATE TABLE ire_pct19h ( geoid VARCHAR(11) NOT NULL, sumlev VARCHAR(3) NOT NULL, state VARCHAR(2) NOT NULL, county VARCHAR(3), cbsa VARCHAR(5), csa VARCHAR(3), necta VARCHAR(5), cnecta VARCHAR(3), name VARCHAR(90) NOT NULL, pop100 INTEGER NOT NULL, hu100 INTEGER NOT NULL, pop100_2000 INTEGER, hu100_2000 INTEGER, pct019h001 INTEGER, pct019h001_2000 INTEGER, pct019h002 INTEGER, pct019h002_2000 INTEGER, pct019h003 INTEGER, pct019h003_2000 INTEGER, pct019h004 INTEGER, pct019h004_2000 INTEGER, pct019h005 INTEGER, pct019h005_2000 INTEGER, pct019h006 INTEGER, pct019h006_2000 INTEGER, pct019h007 INTEGER, pct019h007_2000 INTEGER, pct019h008 INTEGER, pct019h008_2000 INTEGER, pct019h009 INTEGER, pct019h009_2000 INTEGER, pct019h010 INTEGER, pct019h010_2000 INTEGER, pct019h011 INTEGER, pct019h011_2000 INTEGER, PRIMARY KEY (geoid) );
import classnames from 'classnames'; import cloneDeep from 'lodash/cloneDeep'; import React from 'react'; import { HTMLFieldProps, connectField, filterDOMProps, joinName, useField, } from 'uniforms'; export type ListAddFieldProps = HTMLFieldProps< unknown, HTMLSpanElement, { initialCount?: number } >; function ListAdd({ disabled, initialCount, name, readOnly, value, props }: ListAddFieldProps) { const nameParts = joinName(null, name); const parentName = joinName(nameParts.slice(0, -1)); const parent = useField< { initialCount?: number; maxCount?: number }, unknown[] >(parentName, { initialCount }, { absoluteName: true })[0]; const limitNotReached = !disabled && !(parent.maxCount! <= parent.value!.length); function onAction(event: React.KeyboardEvent | React.MouseEvent) { if ( limitNotReached && !readOnly && (!('key' in event) || event.key === 'Enter') ) { parent.onChange(parent.value!.concat([cloneDeep(value)])); } } return ( <i {...filterDOMProps(props)} className={classnames( 'ui', props.className, limitNotReached ? 'link' : 'disabled', 'fitted add icon', )} onClick={onAction} onKeyDown={onAction} role="button" tabIndex={0} /> ); } export default connectField<ListAddFieldProps>(ListAdd, { initialValue: false, kind: 'leaf', });
<link rel="import" href="../color.html"> <dom-module id="<API key>"> <template> <style> [part="label"] { display: block; position: absolute; top: 8px; font-size: 1em; line-height: 1; height: 20px; margin-bottom: -4px; white-space: nowrap; overflow-x: hidden; text-overflow: ellipsis; color: var(--<API key>); transform-origin: 0 75%; transform: scale(0.75); } :host([required]) [part="label"]::after { content: " *"; color: inherit; } :host([invalid]) [part="label"] { color: var(--<API key>); } [part="error-message"] { font-size: .75em; line-height: 1; color: var(--<API key>); margin-top: 6px; } :host(:not([invalid])) [part="error-message"] { margin-top: 0; max-height: 0; overflow: hidden; } :host([invalid]) [part="error-message"] { animation: reveal 0.2s; } @keyframes reveal { 0% { opacity: 0; } } </style> </template> </dom-module>
import * as Lint from 'tslint'; import * as ts from 'typescript'; const RULE_FAILURE = `Undecorated class defines fields with Angular decorators. Undecorated ` + `classes with Angular fields cannot be extended in Ivy since no definition is generated. ` + `Add a "@Directive" decorator to fix this.`; /** * Rule that doesn't allow undecorated class declarations with fields using Angular * decorators. */ export class Rule extends Lint.Rules.TypedRule { applyWithProgram(sourceFile: ts.SourceFile, program: ts.Program): Lint.RuleFailure[] { return this.applyWithWalker( new Walker(sourceFile, this.getOptions(), program.getTypeChecker())); } } class Walker extends Lint.RuleWalker { constructor( sourceFile: ts.SourceFile, options: Lint.IOptions, private _typeChecker: ts.TypeChecker) { super(sourceFile, options); } <API key>(node: ts.ClassDeclaration) { if (this.<API key>(node)) { return; } for (let member of node.members) { if (member.decorators && this.<API key>(member)) { this.addFailureAtNode(node, RULE_FAILURE); return; } } } /** Checks if the specified node has an Angular decorator. */ private <API key>(node: ts.Node): boolean { return !!node.decorators && node.decorators.some(d => { if (!ts.isCallExpression(d.expression) || !ts.isIdentifier(d.expression.expression)) { return false; } const moduleImport = this.<API key>(d.expression.expression); return moduleImport ? moduleImport.startsWith('@angular/core') : false; }); } /** Gets the module import of the given identifier if imported. */ private <API key>(node: ts.Identifier): string | null { const symbol = this._typeChecker.getSymbolAtLocation(node); if (!symbol || !symbol.declarations || !symbol.declarations.length) { return null; } const decl = symbol.declarations[0]; if (!ts.isImportSpecifier(decl)) { return null; } const importDecl = decl.parent.parent.parent; const moduleSpecifier = importDecl.moduleSpecifier; return ts.isStringLiteral(moduleSpecifier) ? moduleSpecifier.text : null; } }
function(global, $){ 'use strict'; /** * width: carousel width * height: carousel height * margin: tabpanel margin * count: how many tabpanels will move when you click button * col: how many columns in carousel mask * row: how many rows in carousel mask * infinite: infinite carousel or not(true or false) * index: index of active tabpanel */ // Default Options var defaults = { 'width': 1240, 'height': 390, 'margin': 0, 'count': 1, 'col': 1, 'row': 1, 'infinite': false, 'index': 0 }; // Constructor Function var Carousel = function(widget, options) { // Public this.$widget = $(widget); this.settings = $.extend({}, defaults, options); this.carousel_infinite = false; this.carousel_row = 0; this.carousel_width = 0; this.carousel_height = 0; this.carousel_count = 0; this.carousel_col = 0; this.<API key> = 0; this.active_index = 0; this.carousel_one_tab = 0; this.<API key> = 0; this.<API key>= 0; this.$carousel = null; this.$carousel_headline = null; this.$carousel_tablist = null; this.$carousel_tabs = null; this.$<API key> = null; this.$carousel_mask = null; this.$carousel_tabpanels = null; this.$<API key> = null; this.$<API key> = null; this.<API key> = 0; this.init(); this.events(); }; // Prototype Object Carousel.prototype = { 'init': function() { var $this = this; var $widget = this.$widget; this.$carousel = $widget; this.$carousel_headline = this.$carousel.children(':header:first'); this.$carousel_tablist = this.$carousel.children('ul').wrap('<div/>').parent(); this.$carousel_tabs = this.$carousel_tablist.find('a'); this.$carousel_tabpanels = this.$carousel.children().find('figure'); this.$carousel_content = this.$carousel_tabpanels.children().parent(); this.$<API key> = this.$carousel.children().last().find('img').not('.icon'); this.$<API key> = this.$carousel.children().last().find('iframe'); this.setResponsive(); this.carousel_width = this.settings.width; this.carousel_height = this.settings.height; this.carousel_infinite = this.settings.infinite; this.carousel_row = this.settings.row; this.carousel_count = this.settings.count; this.carousel_col = this.settings.col; this.<API key> = this.settings.margin; this.<API key> = this.settings.index; this.<API key>(); this.createCarouselMask(); this.settingClass(); this.settingSliding(); }, '<API key>': function() { var button_group = ['<div>', '<button type="button"></button>', '<button type="button"></button>', '</div>'].join(''); this.$<API key> = $(button_group).insertAfter( this.$carousel_tablist ); }, 'createCarouselMask': function() { this.$carousel_tabpanels.parent().closest('div').wrap('<div/>'); this.$carousel_mask = this.$carousel.children().last(); }, 'settingClass': function() { this.$carousel.addClass('ui-carousel'); this.$carousel_headline.addClass('<API key>'); this.$carousel_tablist.addClass('ui-carousel-tablist'); this.$carousel_tabs.addClass('ui-carousel-tab'); this.$<API key>.addClass('<API key>'); this.$<API key>.children().first().addClass('<API key>'); this.$<API key>.children().last().addClass('<API key>'); this.$carousel_tabpanels.addClass('<API key>'); this.$carousel_tabpanels.parent().closest('div').addClass('<API key>'); this.$carousel_mask.addClass('ui-carousel-mask'); this.$<API key>.addClass('ui-carousel-image'); this.$<API key>.addClass('ui-carousel-video'); if(this.carousel_row === 2) { var j = 1; var j2 = 1; for(var i = 0, l = this.$carousel_tabpanels.length; i < l; i++) { if(i%2===1){ this.$carousel_tabpanels.eq(i).addClass('top-2'); this.$carousel_tabpanels.eq(i).addClass('left-' + j); j++; } else { this.$carousel_tabpanels.eq(i).addClass('top-1'); this.$carousel_tabpanels.eq(i).addClass('left-' + j2); j2++; } } } }, 'settingSliding': function() { var $carousel = this.$carousel; var $tabpanel = this.$carousel_tabpanels; var $tabpanel_wrapper = $tabpanel.parent(); var $carousel_mask = this.$carousel_mask; var <API key> = ($carousel_mask.width() - (this.carousel_col - 1) * this.<API key>) / this.carousel_col; this.<API key> = this.$<API key>.eq(0).width(); // carousel $carousel.height(this.carousel_height); // Set carousel tabpanel(div or img) size and margin if(this.settings.col === 1) { $tabpanel.width($carousel.width()); } else { $tabpanel .width(this.<API key>) .css('margin-right', this.<API key>); } // Set carousel tabpanel wrapper width $tabpanel_wrapper.width(($tabpanel.width() + this.<API key>) * ($tabpanel.length + 1)); // Set carousel one tab mask width this.carousel_one_tab = ($tabpanel.width() + this.<API key>) * this.carousel_count; if(this.<API key> !== 0) { for(var i = 0, l = this.<API key> + 1; i < l; i++) { this.$carousel_tabpanels.last().parent().prepend(this.$carousel_tabpanels.eq($tabpanel.length - (i + 1))); } } // Carousel if(this.carousel_infinite === true) { // tabpanel active this.$carousel_tabpanels.eq(this.active_index).radioClass('active'); // tabpanel wrapper $tabpanel_wrapper.css('left', -this.carousel_one_tab); } else if(this.carousel_col !== 1){ // Infinite Carousel // prevBtn this.prevBtnDisable(); } // active this.$carousel_tabs.eq(this.active_index).parent().radioClass('active'); }, 'prevBtnActive': function() { this.$carousel.find('.<API key>') .attr('aria-disabled', 'false') .css({'opacity': 1, 'display': 'block'}); }, 'prevBtnDisable': function() { this.$carousel.find('.<API key>') .attr('aria-disabled', 'true') .css({'opacity': 0, 'display': 'none'}); }, 'events': function() { var widget = this; var $carousel = widget.$carousel; var $tabs = widget.$carousel_tabs; var $buttons = widget.$<API key>.children(); // buttons event $buttons.on('click', function() { if ( this.className === '<API key>' ) { widget.prevPanel(); } else { widget.nextPanel(); } }); // tabs event $.each($tabs, function(index) { var $tab = $tabs.eq(index); $tab.on('click', $.proxy(widget.viewTabpanel, widget, index, null)); }); }, 'setActiveIndex': function(index) { this.active_index = index; // tab var carousel_tabs_max = (this.$carousel_tabpanels.length / (this.carousel_count * this.carousel_row)) - 1; if((this.$carousel_tabpanels.length % (this.carousel_count * this.carousel_row)) !== 0) { carousel_tabs_max = carousel_tabs_max + 1; } if ( this.active_index < 0 ) { this.active_index = carousel_tabs_max; } if ( this.active_index > carousel_tabs_max ) { this.active_index = 0; } return this.active_index; }, 'nextPanel': function() { if(!this.$carousel_tabpanels.parent().is(':animated')) { var active_index = this.setActiveIndex(this.active_index + 1); this.viewTabpanel(active_index, 'next'); } }, 'prevPanel': function() { if(!this.$carousel_tabpanels.parent().is(':animated')) { var active_index = this.setActiveIndex(this.active_index - 1); this.viewTabpanel(active_index, 'prev'); } }, 'viewTabpanel': function(index, btn, e) { if (e) { e.preventDefault(); } this.active_index = index; var $carousel_wrapper = this.$carousel_tabpanels.eq(index).parent(); var one_width = this.carousel_one_tab; // Infinite Carousel if(this.carousel_infinite === true) { // index this.$carousel_tabpanels.eq(index).radioClass('active'); // next if(btn === 'next') { $carousel_wrapper.stop().animate({ 'left': -one_width * 2 }, 500, 'easeOutExpo', function() { $carousel_wrapper.append($carousel_wrapper.children().first()); $carousel_wrapper.css('left', -one_width); this.animating = false; }); // prev } else if(btn === 'prev') { $carousel_wrapper.stop().animate({ 'left': 0 }, 500, 'easeOutExpo', function() { $carousel_wrapper.prepend($carousel_wrapper.children().last()); $carousel_wrapper.css('left', -one_width); }); } } else if(this.carousel_infinite === false) { if(this.carousel_col !== 1) { if(index === 0) { this.prevBtnDisable(); } else { this.prevBtnActive(); } } $carousel_wrapper.stop().animate({ 'left': index * -this.carousel_one_tab }, 600, 'easeOutExpo'); } this.$carousel_tabs.eq(index).parent().radioClass('active'); }, 'setResponsive': function() { if(global.innerWidth <= 750) { this.settings.width = this.settings.width.mobile || this.settings.width; this.settings.height = this.settings.height.mobile || this.settings.height; this.settings.margin = this.settings.margin.mobile || this.settings.margin; this.settings.count = this.settings.count.mobile || this.settings.count; this.settings.col = this.settings.col.mobile || this.settings.col; this.settings.row = this.settings.row.mobile || this.settings.row; if(this.settings.infinite.mobile !== undefined) { this.settings.infinite = this.settings.infinite.mobile; } this.settings.index = 0; } else if(global.innerWidth <= 1024) { this.settings.width = this.settings.width.tablet || this.settings.width; this.settings.height = this.settings.height.tablet || this.settings.height; this.settings.margin = this.settings.margin.tablet || this.settings.margin; this.settings.count = this.settings.count.tablet || this.settings.count; this.settings.col = this.settings.col.tablet || this.settings.col; this.settings.row = this.settings.row.tablet || this.settings.row; if(this.settings.infinite.tablet !== undefined) { this.settings.infinite = this.settings.infinite.tablet; } this.settings.index = this.settings.index.tablet || this.settings.index; } else { this.settings.width = this.settings.width.desktop || this.settings.width; this.settings.height = this.settings.height.desktop || this.settings.height; this.settings.margin = this.settings.margin.desktop || this.settings.margin; this.settings.count = this.settings.count.desktop || this.settings.count; this.settings.col = this.settings.col.desktop || this.settings.col; this.settings.row = this.settings.row.desktop || this.settings.row; if(this.settings.infinite.desktop !== undefined) { this.settings.infinite = this.settings.infinite.desktop; } this.settings.index = this.settings.index.desktop || this.settings.index; } } }; // jQuery Plugin $.fn.fingoCarousel = function(options){ var $collection = this; // jQuery {} return $.each($collection, function(idx){ var $this = $collection.eq(idx); var _instance = new Carousel( this, options ); $this.data('fingoCarousel', _instance); }); }; })(this, this.jQuery);
#include <stdlib.h> #include <stdio.h> #include <string.h> #include <unistd.h> #include <pthread.h> #include "cqi_pool.h" /** returns a fresh connection queue item. */ <API key> * cqi_pool_get_item(cqi_pool_t *pool) { int i = 0, ret = 0; <API key> *newpool = NULL; <API key> *item = NULL; ret = pthread_mutex_lock(&(pool->lock)); if (ret != 0) { LOG_ERROR(("pthread_mutex_lock() failed.")); return NULL; } if (pool->curr != NULL) { item = pool->curr; pool->curr = item->next; } if (NULL == item) { if (pool->allocs == ITEMS_MAX_ALLOC){ ret = <API key>(&(pool->lock)); if (ret != 0) { LOG_ERROR(("<API key>() failed.")); return NULL; } LOG_ERROR(("connection item pool allocated too many times.")); return NULL; } /* allocate a bunch of items at once to reduce fragmentation */ newpool = (<API key> *) malloc( sizeof(<API key>) * ITEMS_PER_ALLOC); if (NULL == newpool) { LOG_ERROR(("cqi_pool_get_item() failed due to out of memory.")); return NULL; } else { memset(newpool, 0, sizeof(<API key>) * (ITEMS_PER_ALLOC)); for (i = 1; i < ITEMS_PER_ALLOC; i++) newpool[i - 1].next = &newpool[i]; newpool[ITEMS_PER_ALLOC - 1].next = NULL; pool->memo[pool->allocs++] = newpool; pool->curr = newpool; item = pool->curr; pool->curr = item->next; pool->size += ITEMS_PER_ALLOC; } } ret = <API key>(&(pool->lock)); if (ret != 0) { LOG_ERROR(("<API key>() failed.")); return NULL; } return item; } /** return a connection queue item pool. */ cqi_pool_t * cqi_pool_new(void) { int i = 0, ret = 0; cqi_pool_t *pool = NULL; pool = (cqi_pool_t *) malloc(sizeof(cqi_pool_t)); if (pool == NULL) { exit(-1); } ret = pthread_mutex_init(&(pool->lock), NULL); if (ret != 0) { LOG_ERROR(("pthread_mutex_init() failed.")); return NULL; } pool->pool = (<API key> *) malloc(sizeof(<API key>) * <API key>); if (pool->pool == NULL) { LOG_ERROR(("cqi_pool_new() failed due to out of memory.")); return NULL; } else { pool->curr = pool->pool; pool->size = <API key>; pool->allocs = 0; memset(pool->memo, 0, sizeof(<API key> *) * ITEMS_MAX_ALLOC); for (i = 1; i < <API key>; i++) (pool->pool)[i - 1].next= &(pool->pool)[i]; (pool->pool)[<API key> - 1].next = NULL; } return pool; } /* * release a connection queue item back to the pool. */ void <API key>(cqi_pool_t *pool, <API key> *item) { int index = -1, ret = 0; ret = pthread_mutex_lock(&(pool->lock)); if (ret != 0) LOG_ERROR(("pthread_mutex_lock() failed.")); item->next = pool->curr; pool->curr = item; ret = <API key>(&(pool->lock)); if (ret != 0) LOG_ERROR(("<API key>() failed.")); } /** free a connection queue item pool. */ void cqi_pool_free(cqi_pool_t *pool) { int i = 0; if (pool != NULL) { <API key>(&(pool->lock)); if (pool->pool != NULL) { free(pool->pool); pool->pool = NULL; } for (i = 0; i < pool->allocs; i++) { free(pool->memo[i]); } free(pool); } } #ifdef LLDB_CQI_POOL_TEST #define WORKER_THREAD_SIZE 64 void * worker_thread(void *arg) { cqi_pool_t *pool = (cqi_pool_t *)arg; <API key> *item = cqi_pool_get_item(pool); if (item != NULL) { item->sfd = pthread_self(); item->active_flag = pthread_self(); sleep(1); <API key>(pool, item); } } cqi_pool_t *pool = NULL; int main() { pool = cqi_pool_new(); <API key> *curr = NULL; pthread_t thead[WORKER_THREAD_SIZE]; log_set_debug_level(<API key>); for (int i = 0; i < WORKER_THREAD_SIZE; i++) { pthread_create(&thead[i], NULL, worker_thread, pool); } for (int i = 0; i < WORKER_THREAD_SIZE; i++) { pthread_join(thead[i], NULL); } printf("pool size: %d\n", pool->size); cqi_pool_free(pool); } #endif // LLDB_CQI_POOL_TEST
<?php use \SeedDataInterface as SeedDataInterface; abstract class BaseSeedData implements SeedDataInterface{ public function markMigration(){ $data = []; $data['class_name'] = get_called_class(); $seedMigration = SeedMigrationModel::createObject($data,SeedMigrationModel::$attributes); SeedMigrationModel::getMapper()->setModel($seedMigration)->save(); } }
class upnp_soaprequest { constructor() { } // System.Runtime.Remoting.ObjRef CreateObjRef(type requestedType) CreateObjRef() { } // bool Equals(System.Object obj) Equals() { } // int GetHashCode() GetHashCode() { } // System.Object GetLifetimeService() GetLifetimeService() { } // type GetType() GetType() { } // System.Object <API key>() <API key>() { } // string ToString() ToString() { } } module.exports = upnp_soaprequest;
module.exports = { schedule_inputError: "Not all required inputs are present in the request", <API key>: "A new mail has been successfully saved and scheduled", schedule_ShdlError: "The scheduleAt should be a timestamp (like : 1411820580000) and should be in the future", gbl_oops: "Oops something went wrong", gbl_success: "success" };
package xsmeral.semnet.sink; import java.util.Properties; import org.openrdf.repository.Repository; import org.openrdf.repository.RepositoryException; import org.openrdf.repository.sail.SailRepository; import org.openrdf.sail.rdbms.RdbmsStore; public class RdbmsStoreFactory extends RepositoryFactory { @Override public void initialize() throws RepositoryException { Properties props = getProperties(); String jdbcDriver = props.getProperty("driver"); String url = props.getProperty("url"); String user = props.getProperty("user"); String pwd = props.getProperty("password"); if (jdbcDriver == null || url == null || user == null || pwd == null) { throw new RepositoryException("Invalid parameters for repository"); } else { Repository repo = new SailRepository(new RdbmsStore(jdbcDriver, url, user, pwd)); repo.initialize(); setRepository(repo); } } }
#pragma once #include "base/Ref.h" #include "math/vec3.h" #include "math/mat4.h" #include "math/quat.h" #include "base/component/BaseComponent.h" #include "base/Vector.h" class Transform : public BaseComponent { public: Transform(GameObject* owner = nullptr); virtual ~Transform(); public: virtual void Update(float dt); Vector<Transform*>& getChildren(); public: Vec3& getPosition() { return _position; } void setPosition(const Vec3& pos); Vec3& getScale() { return _scale; } void setScale(const Vec3& scale); void setScale(float scale); Quat& getRotation() { return _rotation; } void setRotation(const Quat& rot); Vec3& getLocalPosition() { return _localPosition; } void setLocalPosition(const Vec3& pos); Vec3& getLocalScale() { return _localScale; } void setLocalScale(const Vec3& scale); Quat& getLocalRotation() { return _localRotation; } void setLocalRotation(const Quat& rot); Transform* getParent() { return _parent; } void setParent(Transform* parent); const Mat4& apply(); protected: Vec3 _position, _localPosition; Vec3 _scale, _localScale; Quat _rotation, _localRotation; Mat4 _modleMatrix; Transform* _parent; Vector<Transform*> _children; protected: bool _transformDirty = true; bool <API key> = false; };
package com.test.SERVICE; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.test.DAO.IMercaderiaDAO; import com.test.BEAN.Mercaderia; @Service public class MercaderiaService implements IMercaderiaService{ @Autowired private IMercaderiaDAO mercaderiaDAO; @Override public List<Mercaderia> getAllMercaderia() { return mercaderiaDAO.getAllMercaderia(); } @Override public Mercaderia getMercaderiaById(int mercaderiaId) { Mercaderia merc = mercaderiaDAO.getMercaderiaById(mercaderiaId); return merc; } @Override public boolean createMercaderia(Mercaderia mercaderia) { if (mercaderiaDAO.mercaderiaExists(mercaderia.getNombre())) { return false; } else { mercaderiaDAO.createMercaderia(mercaderia); return true; } } @Override public void updateMercaderia(Mercaderia mercaderia) { // TODO Auto-generated method stub mercaderiaDAO.updateMercaderia(mercaderia); } }
<?php namespace Tecnotek\ExpedienteBundle\Controller; use Tecnotek\ExpedienteBundle\Entity\User; use Tecnotek\ExpedienteBundle\Entity\Route; use Tecnotek\ExpedienteBundle\Entity\Buseta; use Tecnotek\ExpedienteBundle\Entity\Period; use Tecnotek\ExpedienteBundle\Entity\Grade; use Tecnotek\ExpedienteBundle\Entity\Course; use Tecnotek\ExpedienteBundle\Entity\CourseEntry; use Tecnotek\ExpedienteBundle\Entity\CourseClass; use Tecnotek\ExpedienteBundle\Entity\<API key>; use Tecnotek\ExpedienteBundle\Entity\SubCourseEntry; use Tecnotek\ExpedienteBundle\Entity\AssignedTeacher; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\HttpFoundation\Response; class <API key> extends Controller { public function indexAction($name = "John Doe") { return $this->render('<API key>::index.html.twig', array('name' => $name)); } public function <API key>($rowsPerPage = 10) { $em = $this->getDoctrine()->getEntityManager(); $dql = "SELECT users FROM <API key>:User users JOIN users.roles r WHERE r.role = 'ROLE_ADMIN'"; $query = $em->createQuery($dql); $param = $this->get('request')->query->get('rowsPerPage'); if(isset($param) && $param != "") $rowsPerPage = $param; $dql2 = "SELECT count(users) FROM <API key>:User users JOIN users.roles r WHERE r.role = 'ROLE_ADMIN'"; $page = $this->getPaginationPage($dql2, $this->get('request')->query->get('page', 1), $rowsPerPage); $paginator = $this->get('knp_paginator'); $pagination = $paginator->paginate( $query, $page/*page number*/, $rowsPerPage/*limit per page*/ ); return $this->render('<API key>:SuperAdmin:Administrador/list.html.twig', array( 'pagination' => $pagination, 'isTeacher' => true, 'rowsPerPage' => $rowsPerPage )); } public function <API key>() { $entity = new User(); $form = $this->createForm(new \Tecnotek\ExpedienteBundle\Form\UserFormType(), $entity); return $this->render('<API key>:SuperAdmin:Administrador/new.html.twig', array('entity' => $entity, 'form' => $form->createView())); } public function <API key>($id) { $em = $this->getDoctrine()->getEntityManager(); $entity = $em->getRepository("<API key>:User")->find($id); $form = $this->createForm(new \Tecnotek\ExpedienteBundle\Form\UserFormType(), $entity); return $this->render('<API key>:SuperAdmin:Administrador/show.html.twig', array('entity' => $entity, 'form' => $form->createView())); } public function <API key>(){ $entity = new User(); $request = $this->getRequest(); $form = $this->createForm(new \Tecnotek\ExpedienteBundle\Form\UserFormType(), $entity); $form->bindRequest($request); if ($form->isValid()) { $em = $this->getDoctrine()->getEntityManager(); $role = $em->getRepository('<API key>:Role')-> findOneBy(array('role' => 'ROLE_ADMIN')); $entity->getUserRoles()->add($role); $em->persist($entity); $em->flush(); return $this->redirect($this->generateUrl('<API key>', array('id' => $entity->getId()))); } else { return $this->render('<API key>:SuperAdmin:Administrador/new.html.twig', array( 'entity' => $entity, 'form' => $form->createView() )); } } public function <API key>($id){ $em = $this->getDoctrine()->getEntityManager(); $entity = $em->getRepository("<API key>:User")->find( $id ); if ( isset($entity) ) { $em->remove($entity); $em->flush(); } return $this->redirect($this->generateUrl('<API key>')); } public function <API key>(){ $em = $this->getDoctrine()->getEntityManager(); $request = $this->get('request')->request; $entity = $em->getRepository("<API key>:User")->find( $request->get('userId')); if ( isset($entity) ) { $entity->setFirstname($request->get('firstname')); $entity->setLastname($request->get('lastname')); $entity->setUsername($request->get('username')); $entity->setEmail($request->get('email')); $entity->setActive(($request->get('active') == "on")); $em->persist($entity); $em->flush(); $form = $this->createForm(new \Tecnotek\ExpedienteBundle\Form\UserFormType(), $entity); return $this->render('<API key>:SuperAdmin:Administrador/show.html.twig', array('entity' => $entity, 'form' => $form->createView())); } else { return $this->redirect($this->generateUrl('<API key>')); } } /* Metodos para CRUD de Coordinador */ public function <API key>($rowsPerPage = 10) { $em = $this->getDoctrine()->getEntityManager(); $dql = "SELECT users FROM <API key>:User users JOIN users.roles r WHERE r.role = 'ROLE_COORDINADOR'"; $query = $em->createQuery($dql); $param = $this->get('request')->query->get('rowsPerPage'); if(isset($param) && $param != "") $rowsPerPage = $param; $dql2 = "SELECT count(users) FROM <API key>:User users JOIN users.roles r WHERE r.role = 'ROLE_COORDINADOR'"; $page = $this->getPaginationPage($dql2, $this->get('request')->query->get('page', 1), $rowsPerPage); $paginator = $this->get('knp_paginator'); $pagination = $paginator->paginate( $query, $page/*page number*/, $rowsPerPage/*limit per page*/ ); return $this->render('<API key>:SuperAdmin:Coordinador/list.html.twig', array( 'pagination' => $pagination, 'isTeacher' => true, 'rowsPerPage' => $rowsPerPage )); } public function <API key>() { $entity = new User(); $form = $this->createForm(new \Tecnotek\ExpedienteBundle\Form\UserFormType(), $entity); return $this->render('<API key>:SuperAdmin:Coordinador/new.html.twig', array('entity' => $entity, 'form' => $form->createView())); } public function <API key>($id) { $em = $this->getDoctrine()->getEntityManager(); $entity = $em->getRepository("<API key>:User")->find($id); $form = $this->createForm(new \Tecnotek\ExpedienteBundle\Form\UserFormType(), $entity); return $this->render('<API key>:SuperAdmin:Coordinador/show.html.twig', array('entity' => $entity, 'form' => $form->createView())); } public function <API key>(){ $entity = new User(); $request = $this->getRequest(); $form = $this->createForm(new \Tecnotek\ExpedienteBundle\Form\UserFormType(), $entity); $form->bindRequest($request); if ($form->isValid()) { $em = $this->getDoctrine()->getEntityManager(); $role = $em->getRepository('<API key>:Role')-> findOneBy(array('role' => 'ROLE_COORDINADOR')); $entity->getUserRoles()->add($role); $em->persist($entity); $em->flush(); return $this->redirect($this->generateUrl('<API key>', array('id' => $entity->getId()))); } else { return $this->render('<API key>:SuperAdmin:Coordinador/new.html.twig', array( 'entity' => $entity, 'form' => $form->createView() )); } } public function <API key>($id){ $em = $this->getDoctrine()->getEntityManager(); $entity = $em->getRepository("<API key>:User")->find( $id ); if ( isset($entity) ) { $em->remove($entity); $em->flush(); } return $this->redirect($this->generateUrl('<API key>')); } public function <API key>(){ $em = $this->getDoctrine()->getEntityManager(); $request = $this->get('request')->request; $entity = $em->getRepository("<API key>:User")->find( $request->get('userId')); if ( isset($entity) ) { $entity->setFirstname($request->get('firstname')); $entity->setLastname($request->get('lastname')); $entity->setUsername($request->get('username')); $entity->setEmail($request->get('email')); $entity->setActive(($request->get('active') == "on")); $em->persist($entity); $em->flush(); $form = $this->createForm(new \Tecnotek\ExpedienteBundle\Form\UserFormType(), $entity); return $this->render('<API key>:SuperAdmin:Coordinador/show.html.twig', array('entity' => $entity, 'form' => $form->createView())); } else { return $this->redirect($this->generateUrl('<API key>')); } } /* Final de los metodos para CRUD de Coordinador*/ /* Metodos para CRUD de Profesor */ public function profesorListAction($rowsPerPage = 10) { $em = $this->getDoctrine()->getEntityManager(); $dql = "SELECT users FROM <API key>:User users JOIN users.roles r WHERE r.role = 'ROLE_PROFESOR'"; $query = $em->createQuery($dql); $param = $this->get('request')->query->get('rowsPerPage'); if(isset($param) && $param != "") $rowsPerPage = $param; $dql2 = "SELECT count(users) FROM <API key>:User users JOIN users.roles r WHERE r.role = 'ROLE_PROFESOR'"; $page = $this->getPaginationPage($dql2, $this->get('request')->query->get('page', 1), $rowsPerPage); $paginator = $this->get('knp_paginator'); $pagination = $paginator->paginate( $query, $page/*page number*/, $rowsPerPage/*limit per page*/ ); return $this->render('<API key>:SuperAdmin:Profesor/list.html.twig', array( 'pagination' => $pagination, 'isTeacher' => true, 'rowsPerPage' => $rowsPerPage )); } public function <API key>() { $entity = new User(); $form = $this->createForm(new \Tecnotek\ExpedienteBundle\Form\UserFormType(), $entity); return $this->render('<API key>:SuperAdmin:Profesor/new.html.twig', array('entity' => $entity, 'form' => $form->createView())); } public function profesorShowAction($id) { $em = $this->getDoctrine()->getEntityManager(); $entity = $em->getRepository("<API key>:User")->find($id); $form = $this->createForm(new \Tecnotek\ExpedienteBundle\Form\UserFormType(), $entity); return $this->render('<API key>:SuperAdmin:Profesor/show.html.twig', array('entity' => $entity, 'form' => $form->createView())); } public function profesorSaveAction(){ $entity = new User(); $request = $this->getRequest(); $form = $this->createForm(new \Tecnotek\ExpedienteBundle\Form\UserFormType(), $entity); $form->bindRequest($request); if ($form->isValid()) { $em = $this->getDoctrine()->getEntityManager(); $role = $em->getRepository('<API key>:Role')-> findOneBy(array('role' => 'ROLE_PROFESOR')); $entity->getUserRoles()->add($role); $em->persist($entity); $em->flush(); return $this->redirect($this->generateUrl('<API key>', array('id' => $entity->getId()))); } else { return $this->render('<API key>:SuperAdmin:Profesor/new.html.twig', array( 'entity' => $entity, 'form' => $form->createView() )); } } public function <API key>($id){ $em = $this->getDoctrine()->getEntityManager(); $entity = $em->getRepository("<API key>:User")->find( $id ); if ( isset($entity) ) { $em->remove($entity); $em->flush(); } return $this->redirect($this->generateUrl('<API key>')); } public function <API key>(){ $em = $this->getDoctrine()->getEntityManager(); $request = $this->get('request')->request; $entity = $em->getRepository("<API key>:User")->find( $request->get('userId')); if ( isset($entity) ) { $entity->setFirstname($request->get('firstname')); $entity->setLastname($request->get('lastname')); $entity->setUsername($request->get('username')); $entity->setEmail($request->get('email')); $entity->setActive(($request->get('active') == "on")); $em->persist($entity); $em->flush(); $form = $this->createForm(new \Tecnotek\ExpedienteBundle\Form\UserFormType(), $entity); return $this->render('<API key>:SuperAdmin:Profesor/show.html.twig', array('entity' => $entity, 'form' => $form->createView())); } else { return $this->redirect($this->generateUrl('<API key>')); } } /* Final de los metodos para CRUD de Profesor*/ /* Metodos para CRUD de routes */ public function routeListAction($rowsPerPage = 10) { $em = $this->getDoctrine()->getEntityManager(); $dql = "SELECT routes FROM <API key>:Route routes"; $query = $em->createQuery($dql); $param = $this->get('request')->query->get('rowsPerPage'); if(isset($param) && $param != "") $rowsPerPage = $param; $dql2 = "SELECT count(routes) FROM <API key>:Route routes"; $page = $this->getPaginationPage($dql2, $this->get('request')->query->get('page', 1), $rowsPerPage); $paginator = $this->get('knp_paginator'); $pagination = $paginator->paginate( $query, $page/*page number*/, $rowsPerPage/*limit per page*/ ); return $this->render('<API key>:SuperAdmin:Ruta/list.html.twig', array( 'pagination' => $pagination, 'rowsPerPage' => $rowsPerPage, 'menuIndex' => 2 )); } public function routeCreateAction() { $entity = new Route(); $form = $this->createForm(new \Tecnotek\ExpedienteBundle\Form\RouteFormType(), $entity); return $this->render('<API key>:SuperAdmin:Ruta/new.html.twig', array('entity' => $entity, 'form' => $form->createView(), 'menuIndex' => 2)); } public function routeShowAction($id) { $em = $this->getDoctrine()->getEntityManager(); $entity = $em->getRepository("<API key>:Route")->find($id); $form = $this->createForm(new \Tecnotek\ExpedienteBundle\Form\RouteFormType(), $entity); if($entity->getRouteType() == 1) { $students = $entity->getStudents(); } else { //Get Students From Other Table $students = $em->getRepository("<API key>:StudentToRoute")->findByRoute($id); } $routes = $em->getRepository("<API key>:Route")->findAll(); return $this->render('<API key>:SuperAdmin:Ruta/show.html.twig', array('entity' => $entity, 'form' => $form->createView(), 'menuIndex' => 2, 'students' => $students, 'routes' => $routes)); } public function routeSaveAction(){ $entity = new Route(); $request = $this->getRequest(); $form = $this->createForm(new \Tecnotek\ExpedienteBundle\Form\RouteFormType(), $entity); $form->bindRequest($request); if ($form->isValid()) { $em = $this->getDoctrine()->getEntityManager(); $em->persist($entity); $em->flush(); return $this->redirect($this->generateUrl('<API key>', array('id' => $entity->getId()))); } else { return $this->render('<API key>:SuperAdmin:Ruta/new.html.twig', array( 'entity' => $entity, 'form' => $form->createView(), 'menuIndex' => 2 )); } } public function routeDeleteAction($id){ $em = $this->getDoctrine()->getEntityManager(); $entity = $em->getRepository("<API key>:Route")->find( $id ); if ( isset($entity) ) { $em->remove($entity); $em->flush(); } return $this->redirect($this->generateUrl('<API key>')); } public function routeEditAction($id) { $em = $this->getDoctrine()->getEntityManager(); $entity = $em->getRepository("<API key>:Route")->find($id); $form = $this->createForm(new \Tecnotek\ExpedienteBundle\Form\RouteFormType(), $entity); return $this->render('<API key>:SuperAdmin:Ruta/edit.html.twig', array('entity' => $entity, 'form' => $form->createView(), 'menuIndex' => 2)); } public function routeUpdateAction(){ $em = $this->getDoctrine()->getEntityManager(); $request = $this->get('request')->request; $entity = $em->getRepository("<API key>:Route")->find( $request->get('id')); if ( isset($entity) ) { $request = $this->getRequest(); $form = $this->createForm(new \Tecnotek\ExpedienteBundle\Form\RouteFormType(), $entity); $form->bindRequest($request); if ($form->isValid()) { $em->persist($entity); $em->flush(); return $this->redirect($this->generateUrl('<API key>') . "/" . $entity->getId()); } else { return $this->render('<API key>:SuperAdmin:Ruta/edit.html.twig', array( 'entity' => $entity, 'form' => $form->createView(), 'menuIndex' => 2 )); } } else { return $this->redirect($this->generateUrl('<API key>')); } } /* Final de los metodos para CRUD de routes*/ /* Metodos para CRUD de buses */ public function busListAction($rowsPerPage = 10) { $em = $this->getDoctrine()->getEntityManager(); $dql = "SELECT buses FROM <API key>:Buseta buses"; $query = $em->createQuery($dql); $param = $this->get('request')->query->get('rowsPerPage'); if(isset($param) && $param != "") $rowsPerPage = $param; $dql2 = "SELECT count(buses) FROM <API key>:Buseta buses"; $page = $this->getPaginationPage($dql2, $this->get('request')->query->get('page', 1), $rowsPerPage); $paginator = $this->get('knp_paginator'); $pagination = $paginator->paginate( $query, $page/*page number*/, $rowsPerPage/*limit per page*/ ); return $this->render('<API key>:SuperAdmin:Bus/list.html.twig', array( 'pagination' => $pagination, 'rowsPerPage' => $rowsPerPage, 'menuIndex' => 2 )); } public function busCreateAction() { $entity = new Buseta(); $form = $this->createForm(new \Tecnotek\ExpedienteBundle\Form\BusFormType(), $entity); return $this->render('<API key>:SuperAdmin:Bus/new.html.twig', array('entity' => $entity, 'form' => $form->createView(), 'menuIndex' => 2)); } public function busShowAction($id) { $em = $this->getDoctrine()->getEntityManager(); $entity = $em->getRepository("<API key>:Buseta")->find($id); $form = $this->createForm(new \Tecnotek\ExpedienteBundle\Form\BusFormType(), $entity); return $this->render('<API key>:SuperAdmin:Bus/show.html.twig', array('entity' => $entity, 'form' => $form->createView(), 'menuIndex' => 2)); } public function busEditAction($id) { $em = $this->getDoctrine()->getEntityManager(); $entity = $em->getRepository("<API key>:Buseta")->find($id); $form = $this->createForm(new \Tecnotek\ExpedienteBundle\Form\BusFormType(), $entity); return $this->render('<API key>:SuperAdmin:Bus/edit.html.twig', array('entity' => $entity, 'form' => $form->createView(), 'menuIndex' => 2)); } public function busSaveAction(){ $entity = new Buseta(); $request = $this->getRequest(); $form = $this->createForm(new \Tecnotek\ExpedienteBundle\Form\BusFormType(), $entity); $form->bindRequest($request); if ($form->isValid()) { $em = $this->getDoctrine()->getEntityManager(); $em->persist($entity); $em->flush(); return $this->redirect($this->generateUrl('<API key>', array('id' => $entity->getId(), 'menuIndex' => 2))); } else { return $this->render('<API key>:SuperAdmin:Bus/new.html.twig', array( 'entity' => $entity, 'form' => $form->createView(), 'menuIndex' => 2 )); } } public function busDeleteAction($id){ $em = $this->getDoctrine()->getEntityManager(); $entity = $em->getRepository("<API key>:Buseta")->find( $id ); if ( isset($entity) ) { $em->remove($entity); $em->flush(); } return $this->redirect($this->generateUrl('<API key>')); } public function busUpdateAction(){ $em = $this->getDoctrine()->getEntityManager(); $request = $this->getRequest(); $entity = $em->getRepository("<API key>:Buseta")->find($request->get('id')); if ( isset($entity) ) { $form = $this->createForm(new \Tecnotek\ExpedienteBundle\Form\BusFormType(), $entity); $form->bindRequest($request); if ($form->isValid()) { $em->persist($entity); $em->flush(); return $this->redirect($this->generateUrl('<API key>') . "/" . $entity->getId()); } else { return $this->render('<API key>:SuperAdmin:Bus/edit.html.twig', array( 'entity' => $entity, 'form' => $form->createView(), 'updateRejected' => true, 'menuIndex' => 2 )); } } else { return $this->redirect($this->generateUrl('<API key>')); } } /* Final de los metodos para CRUD de buses*/ /* Metodos para CRUD de periods */ public function periodListAction($rowsPerPage = 10) { $em = $this->getDoctrine()->getEntityManager(); $dql = "SELECT period FROM <API key>:Period period"; $query = $em->createQuery($dql); $param = $this->get('request')->query->get('rowsPerPage'); if(isset($param) && $param != "") $rowsPerPage = $param; $dql2 = "SELECT count(periods) FROM <API key>:Period periods"; $page = $this->getPaginationPage($dql2, $this->get('request')->query->get('page', 1), $rowsPerPage); $paginator = $this->get('knp_paginator'); $pagination = $paginator->paginate( $query, $page/*page number*/, $rowsPerPage/*limit per page*/ ); return $this->render('<API key>:SuperAdmin:Period/list.html.twig', array( 'pagination' => $pagination, 'rowsPerPage' => $rowsPerPage, 'menuIndex' => 5 )); } public function periodCreateAction() { $entity = new Period(); $form = $this->createForm(new \Tecnotek\ExpedienteBundle\Form\PeriodFormType(), $entity); return $this->render('<API key>:SuperAdmin:Period/new.html.twig', array('entity' => $entity, 'form' => $form->createView(), 'menuIndex' => 5)); } public function periodShowAction($id) { $em = $this->getDoctrine()->getEntityManager(); $entity = $em->getRepository("<API key>:Period")->find($id); $form = $this->createForm(new \Tecnotek\ExpedienteBundle\Form\PeriodFormType(), $entity); return $this->render('<API key>:SuperAdmin:Period/show.html.twig', array('entity' => $entity, 'form' => $form->createView(), 'menuIndex' => 5)); } public function periodEditAction($id) { $em = $this->getDoctrine()->getEntityManager(); $entity = $em->getRepository("<API key>:Period")->find($id); $form = $this->createForm(new \Tecnotek\ExpedienteBundle\Form\PeriodFormType(), $entity); return $this->render('<API key>:SuperAdmin:Period/edit.html.twig', array('entity' => $entity, 'form' => $form->createView(), 'menuIndex' => 5)); } public function periodSaveAction(){ $entity = new Period(); $request = $this->getRequest(); $form = $this->createForm(new \Tecnotek\ExpedienteBundle\Form\PeriodFormType(), $entity); $form->bindRequest($request); if ($form->isValid()) { $em = $this->getDoctrine()->getEntityManager(); $em->persist($entity); $em->flush(); return $this->redirect($this->generateUrl('<API key>', array('id' => $entity->getId(), 'menuIndex' => 5))); } else { return $this->render('<API key>:SuperAdmin:Period/new.html.twig', array( 'entity' => $entity, 'form' => $form->createView(), 'menuIndex' => 5 )); } } public function periodDeleteAction($id){ $em = $this->getDoctrine()->getEntityManager(); $entity = $em->getRepository("<API key>:Period")->find( $id ); if ( isset($entity) ) { $em->remove($entity); $em->flush(); } return $this->redirect($this->generateUrl('<API key>')); } public function periodUpdateAction(){ $em = $this->getDoctrine()->getEntityManager(); $request = $this->getRequest(); $entity = $em->getRepository("<API key>:Period")->find($request->get('id')); if ( isset($entity) ) { $form = $this->createForm(new \Tecnotek\ExpedienteBundle\Form\PeriodFormType(), $entity); $form->bindRequest($request); if ($form->isValid()) { $em->persist($entity); $em->flush(); return $this->redirect($this->generateUrl('<API key>') . "/" . $entity->getId()); } else { return $this->render('<API key>:SuperAdmin:Period/edit.html.twig', array( 'entity' => $entity, 'form' => $form->createView(), 'updateRejected' => true, 'menuIndex' => 5 )); } } else { return $this->redirect($this->generateUrl('<API key>')); } } /* Final de los metodos para CRUD de periods */ /* Metodos para CRUD de grades */ public function gradeListAction($rowsPerPage = 10) { $em = $this->getDoctrine()->getEntityManager(); $dql = "SELECT entity FROM <API key>:Grade entity"; $query = $em->createQuery($dql); $param = $this->get('request')->query->get('rowsPerPage'); if(isset($param) && $param != "") $rowsPerPage = $param; $dql2 = "SELECT count(entity) FROM <API key>:Grade entity"; $page = $this->getPaginationPage($dql2, $this->get('request')->query->get('page', 1), $rowsPerPage); $paginator = $this->get('knp_paginator'); $pagination = $paginator->paginate( $query, $page/*page number*/, $rowsPerPage/*limit per page*/ ); return $this->render('<API key>:SuperAdmin:Grade/list.html.twig', array( 'pagination' => $pagination, 'rowsPerPage' => $rowsPerPage, 'menuIndex' => 5 )); } public function gradeCreateAction() { $entity = new Grade(); $form = $this->createForm(new \Tecnotek\ExpedienteBundle\Form\GradeFormType(), $entity); return $this->render('<API key>:SuperAdmin:Grade/new.html.twig', array('entity' => $entity, 'form' => $form->createView(), 'menuIndex' => 5)); } public function gradeShowAction($id) { $em = $this->getDoctrine()->getEntityManager(); $entity = $em->getRepository("<API key>:Grade")->find($id); $form = $this->createForm(new \Tecnotek\ExpedienteBundle\Form\GradeFormType(), $entity); return $this->render('<API key>:SuperAdmin:Grade/show.html.twig', array('entity' => $entity, 'form' => $form->createView(), 'menuIndex' => 5)); } public function gradeEditAction($id) { $em = $this->getDoctrine()->getEntityManager(); $entity = $em->getRepository("<API key>:Grade")->find($id); $form = $this->createForm(new \Tecnotek\ExpedienteBundle\Form\GradeFormType(), $entity); return $this->render('<API key>:SuperAdmin:Grade/edit.html.twig', array('entity' => $entity, 'form' => $form->createView(), 'menuIndex' => 5)); } public function gradeSaveAction(){ $entity = new Grade(); $request = $this->getRequest(); $form = $this->createForm(new \Tecnotek\ExpedienteBundle\Form\GradeFormType(), $entity); $form->bindRequest($request); if ($form->isValid()) { $em = $this->getDoctrine()->getEntityManager(); $em->persist($entity); $em->flush(); return $this->redirect($this->generateUrl('<API key>', array('id' => $entity->getId(), 'menuIndex' => 5))); } else { return $this->render('<API key>:SuperAdmin:Grade/new.html.twig', array( 'entity' => $entity, 'form' => $form->createView(), 'menuIndex' => 5 )); } } public function gradeDeleteAction($id){ $em = $this->getDoctrine()->getEntityManager(); $entity = $em->getRepository("<API key>:Grade")->find( $id ); if ( isset($entity) ) { $em->remove($entity); $em->flush(); } return $this->redirect($this->generateUrl('<API key>')); } public function gradeUpdateAction(){ $em = $this->getDoctrine()->getEntityManager(); $request = $this->getRequest(); $entity = $em->getRepository("<API key>:Grade")->find($request->get('id')); if ( isset($entity) ) { $form = $this->createForm(new \Tecnotek\ExpedienteBundle\Form\GradeFormType(), $entity); $form->bindRequest($request); if ($form->isValid()) { $em->persist($entity); $em->flush(); return $this->redirect($this->generateUrl('<API key>') . "/" . $entity->getId()); } else { return $this->render('<API key>:SuperAdmin:Grade/edit.html.twig', array( 'entity' => $entity, 'form' => $form->createView(), 'updateRejected' => true, 'menuIndex' => 5 )); } } else { return $this->redirect($this->generateUrl('<API key>')); } } /* Final de los metodos para CRUD de Grades */ /* Metodos para CRUD de courses */ public function courseListAction($rowsPerPage = 10) { $em = $this->getDoctrine()->getEntityManager(); $dql = "SELECT entity FROM <API key>:Course entity"; $query = $em->createQuery($dql); $param = $this->get('request')->query->get('rowsPerPage'); if(isset($param) && $param != "") $rowsPerPage = $param; $dql2 = "SELECT count(entity) FROM <API key>:Course entity"; $page = $this->getPaginationPage($dql2, $this->get('request')->query->get('page', 1), $rowsPerPage); $paginator = $this->get('knp_paginator'); $pagination = $paginator->paginate( $query, $page/*page number*/, $rowsPerPage/*limit per page*/ ); return $this->render('<API key>:SuperAdmin:Course/list.html.twig', array( 'pagination' => $pagination, 'rowsPerPage' => $rowsPerPage, 'menuIndex' => 5 )); } public function courseCreateAction() { $entity = new Course(); $form = $this->createForm(new \Tecnotek\ExpedienteBundle\Form\CourseFormType(), $entity); return $this->render('<API key>:SuperAdmin:Course/new.html.twig', array('entity' => $entity, 'form' => $form->createView(), 'menuIndex' => 5)); } public function courseShowAction($id) { $em = $this->getDoctrine()->getEntityManager(); $entity = $em->getRepository("<API key>:Course")->find($id); $form = $this->createForm(new \Tecnotek\ExpedienteBundle\Form\CourseFormType(), $entity); return $this->render('<API key>:SuperAdmin:Course/show.html.twig', array('entity' => $entity, 'form' => $form->createView(), 'menuIndex' => 5)); } public function courseEditAction($id) { $em = $this->getDoctrine()->getEntityManager(); $entity = $em->getRepository("<API key>:Course")->find($id); $form = $this->createForm(new \Tecnotek\ExpedienteBundle\Form\CourseFormType(), $entity); return $this->render('<API key>:SuperAdmin:Course/edit.html.twig', array('entity' => $entity, 'form' => $form->createView(), 'menuIndex' => 5)); } public function courseSaveAction(){ $entity = new Course(); $request = $this->getRequest(); $form = $this->createForm(new \Tecnotek\ExpedienteBundle\Form\CourseFormType(), $entity); $form->bindRequest($request); if ($form->isValid()) { $em = $this->getDoctrine()->getEntityManager(); $em->persist($entity); $em->flush(); return $this->redirect($this->generateUrl('<API key>', array('id' => $entity->getId(), 'menuIndex' => 5))); } else { return $this->render('<API key>:SuperAdmin:Course/new.html.twig', array( 'entity' => $entity, 'form' => $form->createView(), 'menuIndex' => 5 )); } } public function courseDeleteAction($id){ $em = $this->getDoctrine()->getEntityManager(); $entity = $em->getRepository("<API key>:Course")->find( $id ); if ( isset($entity) ) { $em->remove($entity); $em->flush(); } return $this->redirect($this->generateUrl('<API key>')); } public function courseUpdateAction(){ $em = $this->getDoctrine()->getEntityManager(); $request = $this->getRequest(); $entity = $em->getRepository("<API key>:Course")->find($request->get('id')); if ( isset($entity) ) { $form = $this->createForm(new \Tecnotek\ExpedienteBundle\Form\CourseFormType(), $entity); $form->bindRequest($request); if ($form->isValid()) { $em->persist($entity); $em->flush(); return $this->redirect($this->generateUrl('<API key>') . "/" . $entity->getId()); } else { return $this->render('<API key>:SuperAdmin:Course/edit.html.twig', array( 'entity' => $entity, 'form' => $form->createView(), 'updateRejected' => true, 'menuIndex' => 5 )); } } else { return $this->redirect($this->generateUrl('<API key>')); } } /* Final de los metodos para CRUD de Courses */ public function adminPeriodAction($id) { $em = $this->getDoctrine()->getEntityManager(); $entity = $em->getRepository("<API key>:Period")->find($id); $grades = $em->getRepository("<API key>:Grade")->findAll(); $institutions = $em->getRepository("<API key>:Institution")->findAll(); $dql = "SELECT users FROM <API key>:User users JOIN users.roles r WHERE r.role = 'ROLE_PROFESOR' ORDER BY users.firstname"; $query = $em->createQuery($dql); $teachers = $query->getResult(); return $this->render('<API key>:SuperAdmin:Period/admin.html.twig', array('entity' => $entity, 'grades' => $grades, 'teachers' => $teachers, 'institutions' => $institutions, 'menuIndex' => 5)); } public function <API key>(){ $logger = $this->get('logger'); if ($this->get('request')->isXmlHttpRequest())// Is the request an ajax one? { try { $request = $this->get('request')->request; $name = $request->get('name'); $teacherId = $request->get('teacherId'); $groupId = $request->get('groupId'); $periodId = $request->get('periodId'); $gradeId = $request->get('gradeId'); $institutionId = $request->get('institutionId'); $translator = $this->get("translator"); if( isset($name) && isset($teacherId) && isset($groupId) && isset($gradeId) && isset($periodId)) { //Validate Parameters if( strlen(trim($name)) < 1) { return new Response(json_encode(array('error' => true, 'message' =>$translator->trans("error.paramateres.missing")))); } else { $em = $this->getDoctrine()->getEntityManager(); if($groupId == 0) {//New Group $group = new \Tecnotek\ExpedienteBundle\Entity\Group(); $group->setPeriod($em->getRepository("<API key>:Period")->find($periodId)); $group->setGrade($em->getRepository("<API key>:Grade")->find($gradeId)); } else {//Edit Group $group = $em->getRepository("<API key>:Group")->find($groupId); } $group->setName($name); $teacher = $em->getRepository("<API key>:User")->find($teacherId); $group->setTeacher($teacher); $institution = $em->getRepository("<API key>:Institution")->find($institutionId); $group->setInstitution($institution); $em->persist($group); if($groupId == 0) {//New Group //Get groups of period-grade to assigned teacher $dql = "SELECT g FROM <API key>:CourseClass g WHERE g.period = " . $periodId . " AND g.grade = " . $gradeId; $query = $em->createQuery($dql); $courses = $query->getResult(); foreach( $courses as $courseClass ) { $assignedTeacher = new \Tecnotek\ExpedienteBundle\Entity\AssignedTeacher(); $assignedTeacher->setCourseClass($courseClass); $assignedTeacher->setGroup($group); $assignedTeacher->setTeacher($teacher); $em->persist($assignedTeacher); } } $em->flush(); return new Response(json_encode(array('error' => false, 'message' =>$translator->trans("messages.confirmation.password.change") ,'groupId' => $group->getId() ))); } } else { return new Response(json_encode(array('error' => true, 'message' =>$translator->trans("error.paramateres.missing")))); } } catch (Exception $e) { $info = toString($e); $logger->err('SuperAdmin::<API key> [' . $info . "]"); return new Response(json_encode(array('error' => true, 'message' => $info))); } }// endif this is an ajax request else { return new Response("<b>Not an ajax call!!!" . "</b>"); } } public function <API key>(){ $logger = $this->get('logger'); if ($this->get('request')->isXmlHttpRequest())// Is the request an ajax one? { try { $request = $this->get('request')->request; $periodId = $request->get('periodId'); $gradeId = $request->get('gradeId'); $translator = $this->get("translator"); if( isset($gradeId) && isset($periodId)) { $em = $this->getDoctrine()->getEntityManager(); //Get Groups $sql = "SELECT g.id, g.name, g.user_id as 'teacherId', CONCAT(u.firstname,' ',u.lastname) as 'teacherName', institution.name as 'institutionName', institution.id as 'institutionId'" . " FROM tek_groups g" . " JOIN tek_users u ON u.id = g.user_id" . " LEFT JOIN tek_institutions institution ON institution.id = g.institution_id" . " WHERE g.period_id = " . $periodId . " AND g.grade_id = " . $gradeId . " ORDER BY g.name"; $stmt = $em->getConnection()->prepare($sql); $stmt->execute(); $groups = $stmt->fetchAll(); //Get Courses $sql = "SELECT cc.id, c.name, cc.user_id as 'teacherId', (CONCAT(u.firstname, ' ', u.lastname)) as 'teacherName', c.id as 'courseId' " . " FROM tek_courses c, tek_course_class cc, tek_users u" . " WHERE cc.period_id = " . $periodId . " AND cc.grade_id = " . $gradeId . " AND cc.course_id = c.id AND u.id = cc.user_id" . " ORDER BY c.name"; $stmt = $em->getConnection()->prepare($sql); $stmt->execute(); $courses = $stmt->fetchAll(); return new Response(json_encode(array('error' => false, 'groups' => $groups, 'courses' => $courses))); } else { return new Response(json_encode(array('error' => true, 'message' =>$translator->trans("error.paramateres.missing")))); } } catch (Exception $e) { $info = toString($e); $logger->err('SuperAdmin::<API key> [' . $info . "]"); return new Response(json_encode(array('error' => true, 'message' => $info))); } }// endif this is an ajax request else { return new Response("<b>Not an ajax call!!!" . "</b>"); } } public function removeGroupAction(){ $logger = $this->get('logger'); if ($this->get('request')->isXmlHttpRequest())// Is the request an ajax one? { try { $request = $this->get('request')->request; $groupId = $request->get('groupId'); $translator = $this->get("translator"); if( isset($groupId) ) { $em = $this->getDoctrine()->getEntityManager(); $entity = $em->getRepository("<API key>:Group")->find( $groupId ); if ( isset($entity) ) { $em->remove($entity); $em->flush(); } return new Response(json_encode(array('error' => false))); } else { return new Response(json_encode(array('error' => true, 'message' =>$translator->trans("error.paramateres.missing")))); } } catch (Exception $e) { $info = toString($e); $logger->err('SuperAdmin::removeGroupAction [' . $info . "]"); return new Response(json_encode(array('error' => true, 'message' => $info))); } }// endif this is an ajax request else { return new Response("<b>Not an ajax call!!!" . "</b>"); } } public function removeEntryAction(){ $logger = $this->get('logger'); if ($this->get('request')->isXmlHttpRequest())// Is the request an ajax one? { try { $request = $this->get('request')->request; $entryId = $request->get('entryId'); $translator = $this->get("translator"); if( isset($entryId) ) { $em = $this->getDoctrine()->getEntityManager(); $entity = $em->getRepository("<API key>:CourseEntry")->find( $entryId ); if ( isset($entity) ) { $em->remove($entity); $em->flush(); } return new Response(json_encode(array('error' => false))); } else { return new Response(json_encode(array('error' => true, 'message' =>$translator->trans("error.paramateres.missing")))); } } catch (Exception $e) { $info = toString($e); $logger->err('SuperAdmin::removeEntryAction [' . $info . "]"); return new Response(json_encode(array('error' => true, 'message' => $info))); } }// endif this is an ajax request else { return new Response("<b>Not an ajax call!!!" . "</b>"); } } public function <API key>(){ $logger = $this->get('logger'); if ($this->get('request')->isXmlHttpRequest())// Is the request an ajax one? { try { $request = $this->get('request')->request; $associationId = $request->get('associationId'); $translator = $this->get("translator"); if( isset($associationId) ) { $em = $this->getDoctrine()->getEntityManager(); $entity = $em->getRepository("<API key>:CourseClass")->find( $associationId ); if ( isset($entity) ) { $em->remove($entity); $em->flush(); } return new Response(json_encode(array('error' => false))); } else { return new Response(json_encode(array('error' => true, 'message' =>$translator->trans("error.paramateres.missing")))); } } catch (Exception $e) { $info = toString($e); $logger->err('SuperAdmin::removeGroupAction [' . $info . "]"); return new Response(json_encode(array('error' => true, 'message' => $info))); } }// endif this is an ajax request else { return new Response("<b>Not an ajax call!!!" . "</b>"); } } public function <API key>(){ $logger = $this->get('logger'); if ($this->get('request')->isXmlHttpRequest())// Is the request an ajax one? { try { $request = $this->get('request')->request; $periodId = $request->get('periodId'); $gradeId = $request->get('gradeId'); $translator = $this->get("translator"); if( isset($gradeId) && isset($periodId)) { $em = $this->getDoctrine()->getEntityManager(); //Get Courses $sql = "SELECT c.id, c.name" . " FROM tek_courses c" . " WHERE c.id not in (select cc.course_id from tek_course_class cc where cc.period_id = " . $periodId . " AND cc.grade_id = " . $gradeId . ")" . " ORDER BY c.name"; $stmt = $em->getConnection()->prepare($sql); $stmt->execute(); $courses = $stmt->fetchAll(); return new Response(json_encode(array('error' => false, 'courses' => $courses))); } else { return new Response(json_encode(array('error' => true, 'message' =>$translator->trans("error.paramateres.missing")))); } } catch (Exception $e) { $info = toString($e); $logger->err('SuperAdmin::<API key> [' . $info . "]"); return new Response(json_encode(array('error' => true, 'message' => $info))); } }// endif this is an ajax request else { return new Response("<b>Not an ajax call!!!" . "</b>"); } } public function <API key>(){ $logger = $this->get('logger'); if ($this->get('request')->isXmlHttpRequest())// Is the request an ajax one? { try { $request = $this->get('request')->request; $periodId = $request->get('periodId'); $gradeId = $request->get('gradeId'); $courseId = $request->get('courseId'); $teacherId = $request->get('teacherId'); $translator = $this->get("translator"); if( isset($gradeId) && isset($periodId) && isset($courseId) && isset($teacherId)) { $courseClass = new \Tecnotek\ExpedienteBundle\Entity\CourseClass(); $em = $this->getDoctrine()->getEntityManager(); $teacher = $em->getRepository("<API key>:User")->find($teacherId); $courseClass->setPeriod($em->getRepository("<API key>:Period")->find($periodId)); $courseClass->setGrade($em->getRepository("<API key>:Grade")->find($gradeId)); $courseClass->setTeacher($teacher); $courseClass->setCourse($em->getRepository("<API key>:Course")->find($courseId)); $em->persist($courseClass); //Get groups of period-grade to assigned teacher $dql = "SELECT g FROM <API key>:Group g WHERE g.period = " . $periodId . " AND g.grade = " . $gradeId; $query = $em->createQuery($dql); $groups = $query->getResult(); foreach( $groups as $group ) { $assignedTeacher = new \Tecnotek\ExpedienteBundle\Entity\AssignedTeacher(); $assignedTeacher->setCourseClass($courseClass); $assignedTeacher->setGroup($group); $assignedTeacher->setTeacher($teacher); $em->persist($assignedTeacher); } $em->flush(); return new Response(json_encode(array('error' => false, 'courseClass' => $courseClass->getId()))); } else { return new Response(json_encode(array('error' => true, 'message' =>$translator->trans("error.paramateres.missing")))); } } catch (Exception $e) { $info = toString($e); $logger->err('SuperAdmin::<API key> [' . $info . "]"); return new Response(json_encode(array('error' => true, 'message' => $info))); } }// endif this is an ajax request else { return new Response("<b>Not an ajax call!!!" . "</b>"); } } public function <API key>(){ //2016 - 4 $logger = $this->get('logger'); if ($this->get('request')->isXmlHttpRequest())// Is the request an ajax one? { try { $request = $this->get('request')->request; $periodId = $request->get('periodId'); //$gradeId = $request->get('gradeId'); $translator = $this->get("translator"); if(isset($periodId)) { $em = $this->getDoctrine()->getEntityManager(); //Get Courses $sql = "SELECT c.id, c.name" . " FROM tek_courses c" //. " WHERE c.id not in (select cc.course_id from tek_course_class cc where cc.period_id = " . $periodId . " AND cc.grade_id = " . $gradeId . ")" . " ORDER BY c.name"; $stmt = $em->getConnection()->prepare($sql); $stmt->execute(); $courses = $stmt->fetchAll(); return new Response(json_encode(array('error' => false, 'courses' => $courses))); } else { return new Response(json_encode(array('error' => true, 'message' =>$translator->trans("error.paramateres.missing")))); } } catch (Exception $e) { $info = toString($e); $logger->err('SuperAdmin::<API key> [' . $info . "]"); return new Response(json_encode(array('error' => true, 'message' => $info))); } }// endif this is an ajax request else { return new Response("<b>Not an ajax call!!!" . "</b>"); } } public function <API key>(){ //2016 -4 $logger = $this->get('logger'); if ($this->get('request')->isXmlHttpRequest())// Is the request an ajax one? { try { $request = $this->get('request')->request; $periodId = $request->get('periodId'); $groupId = $request->get('groupId'); $keywords = preg_split("/[\s-]+/", $groupId); $groupId = $keywords[0]; $gradeId = $keywords[1]; $translator = $this->get("translator"); if( isset($gradeId) && isset($periodId)) { $em = $this->getDoctrine()->getEntityManager(); //Get Courses $sql = "SELECT cc.id as courseclass, c.id as course, c.name as name" . " FROM tek_courses c, tek_course_class cc" . " WHERE cc.course_id = c.id and cc.period_id = " . $periodId . " AND cc.grade_id = " . $gradeId . " " . " ORDER BY c.name"; $stmt = $em->getConnection()->prepare($sql); $stmt->execute(); $courses = $stmt->fetchAll(); return new Response(json_encode(array('error' => false, 'courses' => $courses))); } else { return new Response(json_encode(array('error' => true, 'message' =>$translator->trans("error.paramateres.missing")))); } } catch (Exception $e) { $info = toString($e); $logger->err('SuperAdmin::<API key> [' . $info . "]"); return new Response(json_encode(array('error' => true, 'message' => $info))); } }// endif this is an ajax request else { return new Response("<b>Not an ajax call!!!" . "</b>"); } } public function <API key>(){ //2016 -5 $logger = $this->get('logger'); if ($this->get('request')->isXmlHttpRequest())// Is the request an ajax one? { try { $request = $this->get('request')->request; $periodId = $request->get('periodId'); /*$keywords = preg_split("/[\s-]+/", $groupId); $groupId = $keywords[0]; $gradeId = $keywords[1];*/ $translator = $this->get("translator"); if( isset($periodId)) { $em = $this->getDoctrine()->getEntityManager(); //Get Courses $sql = "SELECT c.id, c.name as name" . " FROM tek_courses c" //. " WHERE cc.course_id = c.id and cc.period_id = " . $periodId . " AND cc.grade_id = " . $gradeId . " " . " ORDER BY c.name"; $stmt = $em->getConnection()->prepare($sql); $stmt->execute(); $courses = $stmt->fetchAll(); return new Response(json_encode(array('error' => false, 'courses' => $courses))); } else { return new Response(json_encode(array('error' => true, 'message' =>$translator->trans("error.paramateres.missing")))); } } catch (Exception $e) { $info = toString($e); $logger->err('SuperAdmin::<API key> [' . $info . "]"); return new Response(json_encode(array('error' => true, 'message' => $info))); } }// endif this is an ajax request else { return new Response("<b>Not an ajax call!!!" . "</b>"); } } public function <API key>(){ //2016 - 4 $logger = $this->get('logger'); if ($this->get('request')->isXmlHttpRequest())// Is the request an ajax one? { try { $request = $this->get('request')->request; $periodId = $request->get('periodId'); $teacherId = $request->get('teacherId'); $translator = $this->get("translator"); if( isset($periodId) && isset($teacherId)) { $em = $this->getDoctrine()->getEntityManager(); /* $dql = "SELECT a FROM <API key>:AssignedTeacher a WHERE a.period = $periodId AND a.user = $teacherId"; $query = $em->createQuery($dql); $entries = $query->getResult(); */ $stmt = $this->getDoctrine()->getEntityManager() ->getConnection() ->prepare('SELECT t.id as id, t.group_id, c.id as course, c.name as name, cc.id as courseclass, concat(g.grade_id,"-",g.name) as groupname FROM `<API key>` t, tek_courses c, tek_course_class cc, tek_groups g where cc.course_id = c.id and t.course_class_id = cc.id and g.id = t.group_id and cc.period_id = "'.$periodId.'" and t.user_id = "'.$teacherId.'"'); $stmt->execute(); $entity = $stmt->fetchAll(); $colors = array( "one" => "#38255c", "two" => "#04D0E6" ); $html = ""; $groupOptions = ""; foreach( $entity as $entry ){ $html .= '<div id="courseTeacherRows_' . $entry['id'] . '" class="row userRow tableRowOdd">'; $html .= ' <div id="entryNameField_' . $entry['courseclass'] . '" name="entryNameField_' . $entry['courseclass'] . '" class="option_width" style="float: left; width: 150px;">' . $entry['name'] . '</div>'; $html .= ' <div id="entryCodeField_' . $entry['group_id'] . '" name="entryCodeField_' . $entry['group_id'] . '" class="option_width" style="float: left; width: 100px;">' . $entry['groupname'] . '</div>'; $html .= ' <div class="right imageButton deleteButton <API key>" style="height: 16px;" title="Eliminar" rel="' . $entry['id'] . '"></div>'; $html .= ' <div class="clear"></div>'; $html .= '</div>'; } $dql = "SELECT g FROM <API key>:Group g WHERE g.period = $periodId"; $query = $em->createQuery($dql); $results = $query->getResult(); $courseClassId = 0; $groupOptions .= '<option value="0"></option>'; foreach( $results as $result ){ $groupOptions .= '<option value="' . $result->getId() . '-' . $result->getGrade()->getId() . '">'. $result->getGrade() . '-'. $result->getName() . '</option>'; } return new Response(json_encode(array('error' => false, 'groupOptions' => $groupOptions, 'entriesHtml' => $html))); } else { return new Response(json_encode(array('error' => true, 'message' =>$translator->trans("error.paramateres.missing")))); } } catch (Exception $e) { $info = toString($e); $logger->err('SuperAdmin::<API key> [' . $info . "]"); return new Response(json_encode(array('error' => true, 'message' => $info))); } }// endif this is an ajax request else { return new Response("<b>Not an ajax call!!!" . "</b>"); } } public function <API key>(){ /// 2016 - 4 $logger = $this->get('logger'); if ($this->get('request')->isXmlHttpRequest())// Is the request an ajax one? { try { $request = $this->get('request')->request; $teacherAssignedId = $request->get('teacherAssignedId'); $translator = $this->get("translator"); if( isset($teacherAssignedId) ) { $em = $this->getDoctrine()->getEntityManager(); $entity = $em->getRepository("<API key>:AssignedTeacher")->find( $teacherAssignedId ); if ( isset($entity) ) { $em->remove($entity); $em->flush(); } return new Response(json_encode(array('error' => false))); } else { return new Response(json_encode(array('error' => true, 'message' =>$translator->trans("error.paramateres.missing")))); } } catch (Exception $e) { $info = toString($e); $logger->err('SuperAdmin::<API key> [' . $info . "]"); return new Response(json_encode(array('error' => true, 'message' => $info))); } }// endif this is an ajax request else { return new Response("<b>Not an ajax call!!!" . "</b>"); } } public function <API key>(){ //2016 - 4 temp $logger = $this->get('logger'); if ($this->get('request')->isXmlHttpRequest())// Is the request an ajax one? { try { $request = $this->get('request')->request; $periodId = $request->get('periodId'); $teacherId = $request->get('teacherId'); $courseClassId = $request->get('courseClassId'); $groupId = $request->get('groupId'); $keywords = preg_split("/[\s-]+/", $groupId); $groupId = $keywords[0]; $gradeId = $keywords[1]; $translator = $this->get("translator"); if( isset($courseClassId) && isset($groupId) && isset($teacherId)) { $em = $this->getDoctrine()->getEntityManager(); $assignedTeacher = new AssignedTeacher(); $assignedTeacher->setCourseClass($em->getRepository("<API key>:CourseClass")->find($courseClassId)); $assignedTeacher->setGroup($em->getRepository("<API key>:Group")->find($groupId)); $assignedTeacher->setTeacher($em->getRepository("<API key>:User")->find($teacherId)); $em->persist($assignedTeacher); $em->flush(); return new Response(json_encode(array('error' => false))); } else { return new Response(json_encode(array('error' => true, 'message' =>$translator->trans("error.paramateres.missing")))); } } catch (Exception $e) { $info = toString($e); $logger->err('SuperAdmin::<API key> [' . $info . "]"); return new Response(json_encode(array('error' => true, 'message' => $info))); } }// endif this is an ajax request else { return new Response("<b>Not an ajax call!!!" . "</b>"); } } public function getPaginationPage($dql, $currentPage, $rowsPerPage){ if(isset($currentPage) == false || $currentPage <= 1){ return 1; } else { $em = $this->getDoctrine()->getEntityManager(); $query = $em->createQuery($dql); $total = $query-><API key>(); //Check if current page has Results if( $total > (($currentPage - 1) * $rowsPerPage)){//the page has results return $currentPage; } else { $x = intval($total / $rowsPerPage); if($x == 0){ return 1; } else { if( $total % ($x * $rowsPerPage) > 0){ return $x+1; } else { return $x; } } } } } public function <API key>(){ $logger = $this->get('logger'); if ($this->get('request')->isXmlHttpRequest())// Is the request an ajax one? { try { $request = $this->get('request')->request; $newPassword = $request->get('newPassword'); $confirmPassword = $request->get('confirmPassword'); $userId = $request->get('userId'); $em = $this->getDoctrine()->getEntityManager(); $user = $em->getRepository("<API key>:User")->find($userId); $translator = $this->get("translator"); if ( isset($user) ) { $defaultController = new DefaultController(); $error = $defaultController-><API key>($newPassword, $confirmPassword, $translator); if ( isset($error) ) { return new Response(json_encode(array('error' => true, 'message' => $error))); } else { $user->setPassword($newPassword); $em->persist($user); $em->flush(); return new Response(json_encode(array('error' => false, 'message' =>$translator->trans("messages.confirmation.password.change")))); } } else { return new Response(json_encode(array('error' => true, 'message' =>$translator->trans("error.entity.not.found")))); } } catch (Exception $e) { $info = toString($e); $logger->err('SuperAdmin::<API key> [' . $info . "]"); return new Response($info); } }// endif this is an ajax request else { return new Response("<b>Not an ajax call!!!" . "</b>"); } } public function <API key>(){ $logger = $this->get("logger"); $em = $this->getDoctrine()->getEntityManager(); $dql = "SELECT p FROM <API key>:Period p ORDER BY p.year"; $query = $em->createQuery($dql); $periods = $query->getResult(); return $this->render('<API key>:SuperAdmin:Qualification/index.html.twig', array('periods' => $periods, 'menuIndex' => 5)); } public function <API key>(){ $logger = $this->get("logger"); $em = $this->getDoctrine()->getEntityManager(); $dql = "SELECT e FROM <API key>:CourseEntry e WHERE e.parent IS NULL ORDER BY e.sortOrder"; $query = $em->createQuery($dql); $logger->err(" $entries = $query->getResult(); $logger->err(" $temp = new \Tecnotek\ExpedienteBundle\Entity\CourseEntry(); $html = '<div class="itemPromedioPeriodo itemHeader" style="margin-left: 0px; color: #fff;">Promedio Trimestral</div>'; /* <div class="itemHeader itemNota" style="margin-left: 125px;">Tarea 2</div> <div class="itemHeader itemPromedio" style="margin-left:150px;">Promedio Tareas </div> <div class="itemHeader itemPorcentage" style="margin-left: 175px;">10 % Tarea</div> <div class="itemHeaderCode itemNota" style="margin-left: 0px;"></div> */ $marginLeft = 34; $marginLeftCode = 62; $htmlCodes = '<div class="itemPromedioPeriodo itemHeaderCode" style="color: #fff;">SCIE</div>'; $jumpRight = 34; $width = 32; $html3 = '<div class="itemHeader2 itemPromedioPeriodo" style="width: 32px; color: #fff;">TRIM</div>'; $studentRow = ""; $studentsHeader = ''; $colors = array( "one" => "#38255c", "two" => "#04D0E6" ); foreach( $entries as $entry ) { $temp = $entry; $childrens = $temp->getChildrens(); $size = sizeof($childrens); $logger->err(" if($size == 0){//No child $studentRow .= '<input type="text" class="textField itemNota" tipo="1" rel="total_' . $temp->getId() . '_stdId" perc="' . $temp->getPercentage() . '" std="stdId" >'; $htmlCodes .= '<div class="itemHeaderCode itemNota"></div>'; $html .= '<div class="itemHeader itemNota" style="margin-left: ' . $marginLeft . 'px;">' . $temp->getName() . '</div>'; $marginLeft += $jumpRight; $marginLeftCode += 25; $studentRow .= '<div id="total_' . $temp->getId() . '_stdId" class="itemHeaderCode itemPorcentage nota_stdId">-</div>'; $htmlCodes .= '<div class="itemHeaderCode itemPorcentage">' . $temp->getCode() . '</div>'; $html .= '<div class="itemHeader itemPorcentage" style="margin-left: ' . $marginLeft . 'px;">' . $temp->getPercentage() . '% ' . $temp->getName() . '</div>'; $marginLeft += $jumpRight; $marginLeftCode += 25; $html3 .= '<div class="itemHeader2 itemNota" style="width: ' . (($width * 2) + 2) . 'px">' . $temp->getName() . '</div>'; } else { if($size == 1){//one child foreach ( $childrens as $child){ $htmlCodes .= '<div class="itemHeaderCode itemNota"></div>'; $html .= '<div class="itemHeader itemNota" style="margin-left: ' . $marginLeft . 'px;">' . $child->getName() . '</div>'; $marginLeft += $jumpRight; $marginLeftCode += 25; } $htmlCodes .= '<div class="itemHeaderCode itemPorcentage"></div>'; $html .= '<div class="itemHeader itemPorcentage" style="margin-left: ' . $marginLeft . 'px;">' . $temp->getPercentage() . '% ' . $temp->getName() . '</div>'; $marginLeft += $jumpRight; $marginLeftCode += 25; } else {//two or more foreach ( $childrens as $child){ //$studentRow .= '<input type="text" class="textField itemNota">'; $studentRow .= '<input type="text" class="textField itemNota item_' . $temp->getId() . '_stdId" tipo="2" child="' . $size . '" parent="' . $temp->getId() . '" rel="total_' . $temp->getId() . '_stdId" perc="' . $temp->getPercentage() . '" std="stdId" >'; $htmlCodes .= '<div class="itemHeaderCode itemNota">' . $child->getCode() . '</div>'; $html .= '<div class="itemHeader itemNota" style="margin-left: ' . $marginLeft . 'px;">' . $child->getName() . '</div>'; $marginLeft += $jumpRight; $marginLeftCode += 25; } $studentRow .= '<div class="itemHeaderCode itemPromedio" id="prom_' . $temp->getId() . '_stdId" perc="' . $temp->getPercentage() . '">-</div>'; $htmlCodes .= '<div class="itemHeaderCode itemPromedio"></div>'; $html .= '<div class="itemHeader itemPromedio" style="margin-left:' . $marginLeft . 'px;">Promedio ' . $temp->getName() . ' </div>'; $marginLeft += $jumpRight; $marginLeftCode += 25; //$studentRow .= '<div class="itemHeaderCode itemPorcentage">-</div>'; $studentRow .= '<div id="total_' . $temp->getId() . '_stdId" class="itemHeaderCode itemPorcentage nota_stdId">-</div>'; $htmlCodes .= '<div class="itemHeaderCode itemPorcentage">' . $temp->getCode() . '</div>'; $html .= '<div class="itemHeader itemPorcentage" style="margin-left: ' . $marginLeft . 'px;">' . $temp->getPercentage() . '% ' . $temp->getName() . '</div>'; $marginLeft += $jumpRight; $marginLeftCode += 25; $html3 .= '<div class="itemHeader2 itemNota" style="width: ' . (($width * ($size + 2)) + (($size + 1) * 2)) . 'px">' . $temp->getName() . '</div>'; } } /*$assignedTeacher = new \Tecnotek\ExpedienteBundle\Entity\AssignedTeacher(); $assignedTeacher->setCourseClass($courseClass); $assignedTeacher->setGroup($group); $assignedTeacher->setTeacher($teacher); $em->persist($assignedTeacher);*/ } $html = $htmlCodes . '<div class="clear"></div>' . '<div style="position: relative; height: 152px; margin-left: -59px;">' . $html . '</div>' . '<div class="clear"></div>' . $html3; $students = $em->getRepository("<API key>:Student")->findAll(); foreach($students as $student){ $studentsHeader .= '<div class="itemCarne">' . $student->getCarne() . '</div><div class="itemEstudiante">' . $student . '</div><div class="clear"></div>'; $row = str_replace("stdId", $student->getId(), $studentRow); $html .= '<div class="clear"></div><div id="total_trim_' . $student->getId() . '" class="itemHeaderCode itemPromedioPeriodo"style="color: #fff;">-</div>' . $row; } return $this->render('<API key>:SuperAdmin:Qualification/index.html.twig', array('table' => $html, 'studentsHeader' => $studentsHeader, 'menuIndex' => 5)); } public function <API key>(){ $logger = $this->get('logger'); if ($this->get('request')->isXmlHttpRequest())// Is the request an ajax one? { try { $request = $this->get('request')->request; $periodId = $request->get('periodId'); $gradeId = $request->get('gradeId'); $courseId = $request->get('courseId'); $translator = $this->get("translator"); if( isset($gradeId) && isset($periodId) && isset($courseId)) { $em = $this->getDoctrine()->getEntityManager(); $dql = "SELECT e FROM <API key>:CourseEntry e, <API key>:CourseClass cc WHERE e.parent IS NULL AND e.courseClass = cc AND cc.period = $periodId AND cc.grade = $gradeId And cc.course = $courseId ORDER BY e.sortOrder"; $query = $em->createQuery($dql); $entries = $query->getResult(); $colors = array( "one" => "#38255c", "two" => "#04D0E6" ); $html = ""; $entriesOptions = ""; $temp = new \Tecnotek\ExpedienteBundle\Entity\CourseEntry(); $dql = "SELECT cc FROM <API key>:CourseClass cc WHERE cc.period = $periodId AND cc.grade = $gradeId And cc.course = $courseId"; $query = $em->createQuery($dql); $results = $query->getResult(); $courseClassId = 0; foreach( $results as $result ){ $courseClassId = $result->getId(); } foreach( $entries as $entry ){ $temp = $entry; $courseClassId = $temp->getCourseClass()->getId(); $childrens = $temp->getChildrens(); $size = sizeof($childrens); $entriesOptions .= '<option value="' . $entry->getId() . '">' . $entry->getName() . '</option>'; $html .= '<div id="entryRow_' . $entry->getId() . '" class="row userRow tableRowOdd">'; $html .= ' <div id="entryNameField_' . $entry->getId() . '" name="entryNameField_' . $entry->getId() . '" class="option_width" style="float: left; width: 150px;">' . $entry->getName() . '</div>'; $html .= ' <div id="entryCodeField_' . $entry->getId() . '" name="entryCodeField_' . $entry->getId() . '" class="option_width" style="float: left; width: 100px;">' . $entry->getCode() . '</div>'; $html .= ' <div id="<API key>' . $entry->getId() . '" name="<API key>' . $entry->getId() . '" class="option_width" style="float: left; width: 100px;">' . $entry->getPercentage() . '</div>'; $html .= ' <div id="entryMaxValueField_' . $entry->getId() . '" name="entryMaxValueField_' . $entry->getId() . '" class="option_width" style="float: left; width: 100px;">' . $entry->getMaxValue() . '</div>'; $html .= ' <div id="entryOrderField_' . $entry->getId() . '" name="entryOrderField_' . $entry->getId() . '" class="option_width" style="float: left; width: 100px;">' . $entry->getSortOrder() . '</div>'; $html .= ' <div id="entryParentField_' . $entry->getId() . '" name="entryParentField_' . $entry->getId() . '" class="option_width" style="float: left; width: 150px;">' . $entry->getParent() . '</div>'; $html .= ' <div class="right imageButton deleteButton deleteEntry" style="height: 16px;" title="Eliminar" rel="' . $entry->getId() . '"></div>'; $html .= ' <div class="right imageButton editButton editEntry" title="Editar" rel="' . $entry->getId() . '" entryParent="0"></div>'; $html .= ' <div class="clear"></div>'; $html .= '</div>'; foreach ( $childrens as $child){ $html .= '<div id="entryRow_' . $child->getId() . '" class="row userRow tableRowOdd">'; $html .= ' <div id="entryNameField_' . $child->getId() . '" name="entryNameField_' . $child->getId() . '" class="option_width" style="float: left; width: 150px;">' . $child->getName() . '</div>'; $html .= ' <div id="entryCodeField_' . $child->getId() . '" name="entryCodeField_' . $child->getId() . '" class="option_width" style="float: left; width: 100px;">' . $child->getCode() . '</div>'; $html .= ' <div id="<API key>' . $child->getId() . '" name="<API key>' . $child->getId() . '" class="option_width" style="float: left; width: 100px;">' . $child->getPercentage() . '</div>'; $html .= ' <div id="entryMaxValueField_' . $child->getId() . '" name="entryMaxValueField_' . $child->getId() . '" class="option_width" style="float: left; width: 100px;">' . $child->getMaxValue() . '</div>'; $html .= ' <div id="entryOrderField_' . $child->getId() . '" name="entryOrderField_' . $child->getId() . '" class="option_width" style="float: left; width: 100px;">' . $child->getSortOrder() . '</div>'; $html .= ' <div id="entryParentField_' . $child->getId() . '" name="entryParentField_' . $child->getId() . '" class="option_width" style="float: left; width: 150px;">' . $child->getParent() . '</div>'; $html .= ' <div class="right imageButton deleteButton deleteEntry" style="height: 16px;" title="Eliminar" rel="' . $child->getId() . '"></div>'; $html .= ' <div class="right imageButton editButton editEntry" title="Editar" rel="' . $child->getId() . '" entryParent="' . $entry->getId() . '"></div>'; $html .= ' <div class="clear"></div>'; $html .= '</div>'; } /*if($size == 0){//No child $studentRow .= '<input type="text" class="textField itemNota" tipo="1" rel="total_' . $temp->getId() . '_stdId" perc="' . $temp->getPercentage() . '" std="stdId" >'; $htmlCodes .= '<div class="itemHeaderCode itemNota"></div>'; $html .= '<div class="itemHeader itemNota" style="margin-left: ' . $marginLeft . 'px;">' . $temp->getName() . '</div>'; $marginLeft += $jumpRight; $marginLeftCode += 25; $studentRow .= '<div id="total_' . $temp->getId() . '_stdId" class="itemHeaderCode itemPorcentage nota_stdId">-</div>'; $htmlCodes .= '<div class="itemHeaderCode itemPorcentage">' . $temp->getCode() . '</div>'; $html .= '<div class="itemHeader itemPorcentage" style="margin-left: ' . $marginLeft . 'px;">' . $temp->getPercentage() . '% ' . $temp->getName() . '</div>'; $marginLeft += $jumpRight; $marginLeftCode += 25; $html3 .= '<div class="itemHeader2 itemNota" style="width: ' . (($width * 2) + 2) . 'px">' . $temp->getName() . '</div>'; } else { if($size == 1){//one child foreach ( $childrens as $child){ $htmlCodes .= '<div class="itemHeaderCode itemNota"></div>'; $html .= '<div class="itemHeader itemNota" style="margin-left: ' . $marginLeft . 'px;">' . $child->getName() . '</div>'; $marginLeft += $jumpRight; $marginLeftCode += 25; } $htmlCodes .= '<div class="itemHeaderCode itemPorcentage"></div>'; $html .= '<div class="itemHeader itemPorcentage" style="margin-left: ' . $marginLeft . 'px;">' . $temp->getPercentage() . '% ' . $temp->getName() . '</div>'; $marginLeft += $jumpRight; $marginLeftCode += 25; } else {//two or more foreach ( $childrens as $child){ //$studentRow .= '<input type="text" class="textField itemNota">'; $studentRow .= '<input type="text" class="textField itemNota item_' . $temp->getId() . '_stdId" tipo="2" child="' . $size . '" parent="' . $temp->getId() . '" rel="total_' . $temp->getId() . '_stdId" perc="' . $temp->getPercentage() . '" std="stdId" >'; $htmlCodes .= '<div class="itemHeaderCode itemNota">' . $child->getCode() . '</div>'; $html .= '<div class="itemHeader itemNota" style="margin-left: ' . $marginLeft . 'px;">' . $child->getName() . '</div>'; $marginLeft += $jumpRight; $marginLeftCode += 25; } $studentRow .= '<div class="itemHeaderCode itemPromedio" id="prom_' . $temp->getId() . '_stdId" perc="' . $temp->getPercentage() . '">-</div>'; $htmlCodes .= '<div class="itemHeaderCode itemPromedio"></div>'; $html .= '<div class="itemHeader itemPromedio" style="margin-left:' . $marginLeft . 'px;">Promedio ' . $temp->getName() . ' </div>'; $marginLeft += $jumpRight; $marginLeftCode += 25; //$studentRow .= '<div class="itemHeaderCode itemPorcentage">-</div>'; $studentRow .= '<div id="total_' . $temp->getId() . '_stdId" class="itemHeaderCode itemPorcentage nota_stdId">-</div>'; $htmlCodes .= '<div class="itemHeaderCode itemPorcentage">' . $temp->getCode() . '</div>'; $html .= '<div class="itemHeader itemPorcentage" style="margin-left: ' . $marginLeft . 'px;">' . $temp->getPercentage() . '% ' . $temp->getName() . '</div>'; $marginLeft += $jumpRight; $marginLeftCode += 25; $html3 .= '<div class="itemHeader2 itemNota" style="width: ' . (($width * ($size + 2)) + (($size + 1) * 2)) . 'px">' . $temp->getName() . '</div>'; } }*/ } return new Response(json_encode(array('error' => false, 'entries' => $entriesOptions, 'entriesHtml' => $html, 'courseClassId' => $courseClassId))); } else { return new Response(json_encode(array('error' => true, 'message' =>$translator->trans("error.paramateres.missing")))); } } catch (Exception $e) { $info = toString($e); $logger->err('SuperAdmin::<API key> [' . $info . "]"); return new Response(json_encode(array('error' => true, 'message' => $info))); } }// endif this is an ajax request else { return new Response("<b>Not an ajax call!!!" . "</b>"); } } public function createEntryAction(){ $logger = $this->get('logger'); if ($this->get('request')->isXmlHttpRequest())// Is the request an ajax one? { try { $request = $this->get('request')->request; $parentId = $request->get('parentId'); $name = $request->get('name'); $code = $request->get('code'); $maxValue = $request->get('maxValue'); $percentage = $request->get('percentage'); $sortOrder = $request->get('sortOrder'); $courseClassId = $request->get('courseClassId'); $entryId = $request->get('entryId'); $translator = $this->get("translator"); if( isset($parentId) && isset($name) && isset($code) && isset($maxValue) && isset($percentage) && isset($sortOrder) && isset($courseClassId) && isset($entryId)) { $em = $this->getDoctrine()->getEntityManager(); if($entryId == 0){//Is new $courseEntry = new CourseEntry(); $courseEntry->setCourseClass($em->getRepository("<API key>:CourseClass")->find($courseClassId)); } else {//Is editing $courseEntry = $em->getRepository("<API key>:CourseEntry")->find($entryId); } $courseEntry->setName($name); $courseEntry->setCode($code); $courseEntry->setMaxValue($maxValue); $courseEntry->setPercentage($percentage); $courseEntry->setSortOrder($sortOrder); if($parentId == 0){ $courseEntry->removeParent(); }else { $parent = $em->getRepository("<API key>:CourseEntry")->find($parentId); if(isset($parent)) $courseEntry->setParent($parent); } $em->persist($courseEntry); $em->flush(); return new Response(json_encode(array('error' => false))); } else { return new Response(json_encode(array('error' => true, 'message' =>$translator->trans("error.paramateres.missing")))); } } catch (Exception $e) { $info = toString($e); $logger->err('SuperAdmin::createEntryAction [' . $info . "]"); return new Response(json_encode(array('error' => true, 'message' => $info))); } }// endif this is an ajax request else { return new Response("<b>Not an ajax call!!!" . "</b>"); } } public function <API key>(){ $logger = $this->get('logger'); if ($this->get('request')->isXmlHttpRequest())// Is the request an ajax one? { try { $request = $this->get('request')->request; $periodId = $request->get('periodId'); $translator = $this->get("translator"); if( isset($periodId) ) { $em = $this->getDoctrine()->getEntityManager(); //Get Groups $sql = "SELECT grade.id as 'id', grade.name as 'name' FROM tek_groups g, tek_grades grade WHERE g.period_id = " . $periodId . " AND g.grade_id = grade.id GROUP BY grade.id ORDER BY grade.id, g.name;"; $stmt = $em->getConnection()->prepare($sql); $stmt->execute(); $levels = $stmt->fetchAll(); return new Response(json_encode(array('error' => false, 'levels' => $levels))); } else { return new Response(json_encode(array('error' => true, 'message' =>$translator->trans("error.paramateres.missing")))); } } catch (Exception $e) { $info = toString($e); $logger->err('Admin::<API key> [' . $info . "]"); return new Response(json_encode(array('error' => true, 'message' => $info))); } }// endif this is an ajax request else { return new Response("<b>Not an ajax call!!!" . "</b>"); } } public function <API key>(){ $logger = $this->get('logger'); if ($this->get('request')->isXmlHttpRequest())// Is the request an ajax one? { try { $request = $this->get('request')->request; $periodId = $request->get('periodId'); $levelId = $request->get('levelId'); $translator = $this->get("translator"); if( isset($periodId) && isset($levelId) ) { $em = $this->getDoctrine()->getEntityManager(); //Get Groups $sql = "SELECT CONCAT(g.id,'-',grade.id) as 'id', CONCAT(grade.name, ' :: ', g.name) as 'name'" . " FROM tek_groups g, tek_grades grade" . " WHERE g.period_id = " . $periodId . " AND g.grade_id = grade.id"; if($levelId != 0){ $sql .= " AND grade.id = " . $levelId; } $sql .+ " GROUP BY g.id" . " ORDER BY grade.id, g.name"; $stmt = $em->getConnection()->prepare($sql); $stmt->execute(); $groups = $stmt->fetchAll(); return new Response(json_encode(array('error' => false, 'groups' => $groups))); } else { return new Response(json_encode(array('error' => true, 'message' =>$translator->trans("error.paramateres.missing")))); } } catch (Exception $e) { $info = toString($e); $logger->err('Admin::<API key> [' . $info . "]"); return new Response(json_encode(array('error' => true, 'message' => $info))); } }// endif this is an ajax request else { return new Response("<b>Not an ajax call!!!" . "</b>"); } } public function <API key>(){ $logger = $this->get('logger'); if ($this->get('request')->isXmlHttpRequest())// Is the request an ajax one? { try { $request = $this->get('request')->request; $periodId = $request->get('periodId'); $translator = $this->get("translator"); if( isset($periodId) ) { $em = $this->getDoctrine()->getEntityManager(); $user = $this->get('security.context')->getToken()->getUser(); //Get Groups $sql = "SELECT CONCAT(g.id,'-',grade.id) as 'id', CONCAT(grade.name, ' :: ', g.name) as 'name'" . " FROM tek_groups g, tek_grades grade" . " WHERE g.period_id = " . $periodId . " AND g.institution_id in (" . $user-><API key>() . ")" . " AND g.grade_id = grade.id" . " GROUP BY g.id" . " ORDER BY grade.id, g.name"; $stmt = $em->getConnection()->prepare($sql); $stmt->execute(); $groups = $stmt->fetchAll(); return new Response(json_encode(array('error' => false, 'groups' => $groups))); } else { return new Response(json_encode(array('error' => true, 'message' =>$translator->trans("error.paramateres.missing")))); } } catch (Exception $e) { $info = toString($e); $logger->err('Admin::<API key> [' . $info . "]"); return new Response(json_encode(array('error' => true, 'message' => $info))); } }// endif this is an ajax request else { return new Response("<b>Not an ajax call!!!" . "</b>"); } } public function <API key>(){ $logger = $this->get('logger'); if ($this->get('request')->isXmlHttpRequest())// Is the request an ajax one? { try { $request = $this->get('request')->request; $keywords = preg_split("/[\s-]+/", $request->get('groupId')); $groupId = $keywords[0]; $translator = $this->get("translator"); if( isset($groupId) ) { $em = $this->getDoctrine()->getEntityManager(); //Get Courses $sql = "SELECT course.id, course.name " . " FROM <API key> tat, tek_course_class tcc, tek_courses course " . " WHERE tat.group_id = " . $groupId . " AND tat.course_class_id = tcc.id AND tcc.course_id = course.id" . " ORDER BY course.name "; $stmt = $em->getConnection()->prepare($sql); $stmt->execute(); $courses = $stmt->fetchAll(); return new Response(json_encode(array('error' => false, 'courses' => $courses))); } else { return new Response(json_encode(array('error' => true, 'message' =>$translator->trans("error.paramateres.missing")))); } } catch (Exception $e) { $info = toString($e); $logger->err('Admin::<API key> [' . $info . "]"); return new Response(json_encode(array('error' => true, 'message' => $info))); } }// endif this is an ajax request else { return new Response("<b>Not an ajax call!!!" . "</b>"); } } public function <API key>(){ $logger = $this->get('logger'); $translator = $this->get("translator"); try { $request = $this->get('request'); $periodId = $request->get('periodId'); $groupId = $request->get('groupId'); $courseId = $request->get('courseId'); if( !isset($courseId) || !isset($groupId) || !isset($periodId)) { return new Response(json_encode(array('error' => true, 'message' =>$translator->trans("error.paramateres.missing")))); } $keywords = preg_split("/[\s-]+/", $groupId); $groupId = $keywords[0]; $gradeId = $keywords[1]; if( isset($courseId) && isset($groupId) && isset($periodId)) { $em = $this->getDoctrine()->getEntityManager(); $group = $em->getRepository("<API key>:Group")->find( $groupId ); $grade = $group->getGrade(); $course = $em->getRepository("<API key>:Course")->find( $courseId ); $title = "Calificaciones del grupo: " . $group->getGrade() . "-" . $group . " en la materia: " . $course. " en el Periodo: " . $periodId; $dql = "SELECT ce FROM <API key>:CourseEntry ce " . " JOIN ce.courseClass cc" . " WHERE ce.parent IS NULL AND cc.period = " . $periodId . " AND cc.grade = " . $gradeId . " AND cc.course = " . $courseId . " ORDER BY ce.sortOrder"; $query = $em->createQuery($dql); $entries = $query->getResult(); $temp = new \Tecnotek\ExpedienteBundle\Entity\CourseEntry(); $html = '<tr style="height: 75px; line-height: 0px;"><td class="celesteOscuro" style="min-width: 75px; font-size: 12px; height: 75px;">Carne</td>'; $html .= '<td class="celesteClaro bold" style="min-width: 300px; font-size: 12px; height: 75px;">Estudiante</td>'; $html .= '<td class="azul" style="vertical-align: bottom; padding: 1.5625em 0.625em; height: 75px;"><div class="verticalText" style="color: #000;">Promedio</div></td>'; $marginLeft = 48; $marginLeftCode = 62; $htmlCodes = '<tr style="height: 25px;"><td class="celesteOscuro" style="width: 75px; font-size: 10px;"></td>'; $htmlCodes .= '<td class="celesteClaro bold" style="width: 300px; font-size: 8px;"></td>'; $htmlCodes .= '<td class="azul" style="color: #000;"></td>'; $jumpRight = 46; $width = 44; $html3 = '<tr style="height: 25px; line-height: 0px;" class="noPrint"><td class="celesteOscuro bold headcolcarne" style="min-width: 75px; font-size: 12px;">Carne</td>'; $html3 .= '<td class="celesteClaro bold headcolnombre" style="min-width: 300px; font-size: 12px;">Estudiante</td>'; $html3 .= '<td class="azul headcoltrim" style="color: #000;">TRIM1111</td>'; $studentRow = ''; $studentsHeader = ''; $colors = array( "one" => "#38255c", "two" => "#04D0E6" ); $dql = "SELECT stdy FROM <API key>:Student std, <API key>:StudentYear stdy " . " WHERE stdy.student = std AND stdy.group = " . $groupId . " AND stdy.period = " . $periodId . " ORDER BY std.lastname, std.firstname"; $query = $em->createQuery($dql); $students = $query->getResult(); $studentsCount = sizeof($students); $rowIndex = 1; $colsCounter = 1; $specialCounter = 1; foreach( $entries as $entry ) { $temp = $entry; $childrens = $temp->getChildrens(); $size = sizeof($childrens); if($size == 0){//No child //Find SubEntries $dql = "SELECT ce FROM <API key>:SubCourseEntry ce " . " WHERE ce.parent = " . $temp->getId() . " AND ce.group = " . $groupId . " ORDER BY ce.sortOrder"; $query = $em->createQuery($dql); $subentries = $query->getResult(); $size = sizeof($subentries); if($size > 1){ foreach( $subentries as $subentry ) { //$studentRow .= '<td class=""><input tabIndex=tabIndexCol'. $colsCounter . 'x type="text" class="textField itemNota item_' . $temp->getId() . '_stdId" val="val_stdId_' . $subentry->getId() . '_" tipo="2" child="' . $size . '" parent="' . $temp->getId() . '" rel="total_' . $temp->getId() . '_stdId" max="' . $subentry->getMaxValue() . '" perc="' . $subentry->getPercentage() . '" std="stdId" entry="' . $subentry->getId() . '" stdyId="stdyIdd"></td>'; $studentRow .= '<td class="celesteClaro noPrint"><div><input disabled="disabled" tabIndex=tabIndexCol'. $colsCounter . 'x type="text" class="textField itemNota item_' . $temp->getId() . '_stdId" val="val_stdId_' . $subentry->getId() . '_" tipo="2" child="' . $size . '" parent="' . $temp->getId() . '" rel="total_' . $temp->getId() . '_stdId" max="' . $subentry->getMaxValue() . '" perc="' . $subentry->getPercentage() . '" std="stdId" entry="' . $subentry->getId() . '" stdyId="stdyIdd"></div></td>'; $colsCounter++; $htmlCodes .= '<td class="celesteClaro noPrint"></td>'; $specialCounter++; $html .= '<td class="celesteClaro noPrint"><div class="verticalText">' . $subentry->getCode() . '</div></td>'; $marginLeft += $jumpRight; $marginLeftCode += 25; } //$studentRow .= '<td class="itemHeaderCode itemPromedio" id="prom_' . $temp->getId() . '_stdId" perc="' . $temp->getPercentage() . '">-</td>'; $studentRow .= '<td class="celesteOscuro noPrint" id="prom_' . $temp->getId() . '_stdId" perc="' . $temp->getPercentage() . '">-</td>'; $htmlCodes .= '<td class="celesteOscuro noPrint"></td>'; $specialCounter++; $html .= '<td class="celesteOscuro noPrint"><div class="verticalText">Promedio ' . $temp->getCode() . ' </div></td>'; $marginLeft += $jumpRight; $marginLeftCode += 25; //$studentRow .= '<td id="total_' . $temp->getId() . '_stdId" class="itemHeaderCode itemPorcentage nota_stdId">-</td>'; $studentRow .= '<td id="total_' . $temp->getId() . '_stdId" class="morado bold nota_stdId">-</td>'; $htmlCodes .= '<td class="morado bold">' . $temp->getCode() . '</td>'; $specialCounter++; $html .= '<td class="morado" style="padding: 1.5625em 0.625em; vertical-align: bottom;"><div class="verticalText">' . $temp->getPercentage() . '% ' . $temp->getCode() . '</div></td>'; $marginLeft += $jumpRight; $marginLeftCode += 25; // $html3 .= '<div class="itemHeader2 itemNota" style="width: ' . (($width * (sizeof($subentries)+1)) + ((sizeof($subentries)) * 2) ) . 'px">' . $temp->getCode() . '</div>'; $html3 .= '<td class="celesteClaro noPrint" colspan="' . (sizeof($subentries)+2) . '">' . $temp->getCode() . '</td>'; } else { if($size == 1){ foreach( $subentries as $subentry ) { //$studentRow .= '<td class=""><input tabIndex=tabIndexCol'. $colsCounter . 'x type="text" class="textField itemNota item_' . $temp->getId() . '_stdId" val="val_stdId_' . $subentry->getId() . '_" tipo="1" max="' . $subentry->getMaxValue() . '" child="' . $size . '" parent="' . $temp->getId() . '" rel="total_' . $temp->getId() . '_stdId" perc="' . $subentry->getPercentage() . '" std="stdId" entry="' . $subentry->getId() . '" stdyId="stdyIdd"></td>'; $studentRow .= '<td class="celesteClaro noPrint"><div style="height: 15px;"><input disabled="disabled" tabIndex=tabIndexCol'. $colsCounter . 'x type="text" class="textField itemNota item_' . $temp->getId() . '_stdId" val="val_stdId_' . $subentry->getId() . '_" tipo="1" max="' . $subentry->getMaxValue() . '" child="' . $size . '" parent="' . $temp->getId() . '" rel="total_' . $temp->getId() . '_stdId" perc="' . $subentry->getPercentage() . '" std="stdId" entry="' . $subentry->getId() . '" stdyId="stdyIdd"></div></td>'; $colsCounter++; $htmlCodes .= '<td class="celesteClaro noPrint"></td>'; $specialCounter++; $html .= '<td class="celesteClaro noPrint"><div class="verticalText">' . $subentry->getCode() . '</div></td>'; $marginLeft += $jumpRight; $marginLeftCode += 25; } //$studentRow .= '<td id="total_' . $temp->getId() . '_stdId" class="itemHeaderCode itemPorcentage nota_stdId">-</td>'; $studentRow .= '<td id="total_' . $temp->getId() . '_stdId" class="morado bold nota_stdId">-</td>'; $htmlCodes .= '<td class="morado bold">' . $temp->getCode() . '</td>'; $specialCounter++; $html .= '<td class="morado" style="padding: 1.5625em 0.625em; vertical-align: bottom;"><div class="verticalText">' . $temp->getPercentage() . '% ' . $temp->getCode() . '</div></td>'; $marginLeft += $jumpRight; $marginLeftCode += 25; $html3 .= '<td class="celesteClaro noPrint" colspan="' . (sizeof($subentries)+1) . '">' . $temp->getName() . '</td>'; } } } else { } } $htmlCodes .= "</tr>"; $html .= "</tr>"; $html3 .= "</tr>"; $html = '<table class="tableQualifications" style="border-spacing: 0px; border-collapse: collapse;">' . $htmlCodes . $html; $studentRowIndex = 0; foreach($students as $stdy){ $html .= '<tr style="height: 25px; line-height: 0px;">'; $studentRowIndex++; $html .= '<td class="celesteOscuro headcolcarne" style="width: 75px; font-size: 10px;">' . $stdy->getStudent()->getCarne() . '</td>'; $html .= '<td class="celesteClaro bold headcolnombre" style="width: 300px; font-size: 12px;">' . $stdy->getStudent() . '</td>'; $row = str_replace("stdId", $stdy->getStudent()->getId(), $studentRow); $row = str_replace("stdyIdd", $stdy->getId(), $row); //tabIndexColXx for ($i = 1; $i <= $colsCounter; $i++) { $indexVar = "tabIndexCol" . $i . "x"; $row = str_replace($indexVar, "" . ($studentRowIndex + (($i - 1) * $studentsCount)), $row); } $dql = "SELECT qua FROM <API key>:<API key> qua" . " WHERE qua.studentYear = " . $stdy->getId(); $query = $em->createQuery($dql); $qualifications = $query->getResult(); foreach($qualifications as $qualification){ $row = str_replace("val_" . $stdy->getStudent()->getId() . "_" . $qualification->getSubCourseEntry()->getId() . "_", $qualification->getQualification(), $row); } $html .= '<td id="total_trim_' . $stdy->getStudent()->getId() . '" class="azul headcoltrim" style="color: #000;">-</td>' . $row . "</tr>"; } $html .= "</table>"; return $this->render('<API key>:SuperAdmin:Qualification/<API key>.html.twig', array('table' => $html, 'studentsCounter' => $studentsCount, "codesCounter" => $specialCounter, 'menuIndex' => 5, 'title' => $title, "notaMin" => $grade->getNotaMin())); } else { return new Response(json_encode(array('error' => true, 'message' =>$translator->trans("error.paramateres.missing")))); } } catch (Exception $e) { $info = toString($e); $logger->err('Teacher::<API key> [' . $info . "]"); return new Response(json_encode(array('error' => true, 'message' => $info))); } } public function <API key>(){ $logger = $this->get('logger'); if ($this->get('request')->isXmlHttpRequest())// Is the request an ajax one? { try { $request = $this->get('request')->request; $periodId = $request->get('periodId'); $groupId = $request->get('groupId'); $keywords = preg_split("/[\s-]+/", $groupId); $groupId = $keywords[0]; $gradeId = $keywords[1]; $courseId = $request->get('courseId'); $translator = $this->get("translator"); if( isset($courseId) && isset($groupId) && isset($periodId)) { $em = $this->getDoctrine()->getEntityManager(); $dql = "SELECT ce FROM <API key>:CourseEntry ce " . " JOIN ce.courseClass cc" . " WHERE ce.parent IS NULL AND cc.period = " . $periodId . " AND cc.grade = " . $gradeId . " AND cc.course = " . $courseId . " ORDER BY ce.sortOrder"; $query = $em->createQuery($dql); $entries = $query->getResult(); $temp = new \Tecnotek\ExpedienteBundle\Entity\CourseEntry(); $html = '<tr style="height: 175px; line-height: 0px;"><td class="celesteOscuro headcolcarne" style="width: 75px; font-size: 10px; height: 175px;"></td>'; $html .= '<td class="celesteClaro bold headcolnombre" style="width: 250px; font-size: 8px; height: 175px;"></td>'; $html .= '<td class="azul headcoltrim" style="vertical-align: bottom; padding: 0.5625em 0.625em; height: 175px; line-height: 220px;"><div class="verticalText" style="color: #fff;">Promedio Trimestral</div></td>'; $marginLeft = 48; $marginLeftCode = 62; $htmlCodes = '<tr style="height: 30px;"><td class="celesteOscuro headcolcarne" style="width: 75px; font-size: 10px;"></td>'; $htmlCodes .= '<td class="celesteClaro bold headcolnombre" style="width: 250px; font-size: 8px;"></td>'; $htmlCodes .= '<td class="azul headcoltrim" style="color: #fff;">SCIE</td>'; $jumpRight = 46; $width = 44; $html3 = '<tr style="height: 30px; line-height: 0px;" class="noPrint"><td class="celesteOscuro bold headcolcarne" style="width: 75px; font-size: 12px;">Carne</td>'; $html3 .= '<td class="celesteClaro bold headcolnombre" style="width: 250px; font-size: 12px;">Estudiante</td>'; $html3 .= '<td class="azul headcoltrim" style="color: #fff;">TRIM</td>'; $studentRow = ''; $studentsHeader = ''; $colors = array( "one" => "#38255c", "two" => "#04D0E6" ); $dql = "SELECT stdy FROM <API key>:Student std, <API key>:StudentYear stdy " . " WHERE stdy.student = std AND stdy.group = " . $groupId . " AND stdy.period = " . $periodId . " ORDER BY std.lastname, std.firstname"; $query = $em->createQuery($dql); $students = $query->getResult(); $studentsCount = sizeof($students); $rowIndex = 1; $colsCounter = 1; $specialCounter = 1; foreach( $entries as $entry ) { $temp = $entry; $childrens = $temp->getChildrens(); $size = sizeof($childrens); if($size == 0){//No child //Find SubEntries $dql = "SELECT ce FROM <API key>:SubCourseEntry ce " . " WHERE ce.parent = " . $temp->getId() . " AND ce.group = " . $groupId . " ORDER BY ce.sortOrder"; $query = $em->createQuery($dql); $subentries = $query->getResult(); $size = sizeof($subentries); if($size > 1){ foreach( $subentries as $subentry ) { //$studentRow .= '<td class=""><input tabIndex=tabIndexCol'. $colsCounter . 'x type="text" class="textField itemNota item_' . $temp->getId() . '_stdId" val="val_stdId_' . $subentry->getId() . '_" tipo="2" child="' . $size . '" parent="' . $temp->getId() . '" rel="total_' . $temp->getId() . '_stdId" max="' . $subentry->getMaxValue() . '" perc="' . $subentry->getPercentage() . '" std="stdId" entry="' . $subentry->getId() . '" stdyId="stdyIdd"></td>'; $studentRow .= '<td class="celesteClaro"><div><input style="background-color: #A4D2FD;" disabled="disabled" tabIndex=tabIndexCol'. $colsCounter . 'x type="text" class="textField itemNota item_' . $temp->getId() . '_stdId" val="val_stdId_' . $subentry->getId() . '_" tipo="2" child="' . $size . '" parent="' . $temp->getId() . '" rel="total_' . $temp->getId() . '_stdId" max="' . $subentry->getMaxValue() . '" perc="' . $subentry->getPercentage() . '" std="stdId" entry="' . $subentry->getId() . '" stdyId="stdyIdd"></input></div></td>'; $colsCounter++; $htmlCodes .= '<td class="celesteClaro"></td>'; $specialCounter++; $html .= '<td class="celesteClaro" style="vertical-align: bottom; padding: 0.5625em 0.625em;"><div class="verticalText">' . $subentry->getName() . '</div></td>'; $marginLeft += $jumpRight; $marginLeftCode += 25; } //$studentRow .= '<td class="itemHeaderCode itemPromedio" id="prom_' . $temp->getId() . '_stdId" perc="' . $temp->getPercentage() . '">-</td>'; $studentRow .= '<td class="celesteOscuro" id="prom_' . $temp->getId() . '_stdId" perc="' . $temp->getPercentage() . '">-</td>'; $htmlCodes .= '<td class="celesteOscuro"></td>'; $specialCounter++; $html .= '<td class="celesteOscuro" style="vertical-align: bottom; padding: 0.5625em 0.625em;"><div class="verticalText">Promedio ' . $temp->getName() . ' </div></td>'; $marginLeft += $jumpRight; $marginLeftCode += 25; //$studentRow .= '<td id="total_' . $temp->getId() . '_stdId" class="itemHeaderCode itemPorcentage nota_stdId">-</td>'; $studentRow .= '<td id="total_' . $temp->getId() . '_stdId" class="morado bold nota_stdId">-</td>'; $htmlCodes .= '<td class="morado bold">' . $temp->getCode() . '</td>'; $specialCounter++; $html .= '<td class="morado" style="vertical-align: bottom; padding: 0.5625em 0.625em;"><div class="verticalText">' . $temp->getPercentage() . '% ' . $temp->getName() . '</div></td>'; $marginLeft += $jumpRight; $marginLeftCode += 25; // $html3 .= '<div class="itemHeader2 itemNota" style="width: ' . (($width * (sizeof($subentries)+1)) + ((sizeof($subentries)) * 2) ) . 'px">' . $temp->getName() . '</div>'; $html3 .= '<td class="celesteClaro" colspan="' . (sizeof($subentries)+2) . '">' . $temp->getName() . '</td>'; } else { if($size == 1){ foreach( $subentries as $subentry ) { //$studentRow .= '<td class=""><input tabIndex=tabIndexCol'. $colsCounter . 'x type="text" class="textField itemNota item_' . $temp->getId() . '_stdId" val="val_stdId_' . $subentry->getId() . '_" tipo="1" max="' . $subentry->getMaxValue() . '" child="' . $size . '" parent="' . $temp->getId() . '" rel="total_' . $temp->getId() . '_stdId" perc="' . $subentry->getPercentage() . '" std="stdId" entry="' . $subentry->getId() . '" stdyId="stdyIdd"></td>'; $studentRow .= '<td class="celesteClaro"><div><input style="background-color: #A4D2FD;" disabled="disabled" tabIndex=tabIndexCol'. $colsCounter . 'x type="text" class="textField itemNota item_' . $temp->getId() . '_stdId" val="val_stdId_' . $subentry->getId() . '_" tipo="1" max="' . $subentry->getMaxValue() . '" child="' . $size . '" parent="' . $temp->getId() . '" rel="total_' . $temp->getId() . '_stdId" perc="' . $subentry->getPercentage() . '" std="stdId" entry="' . $subentry->getId() . '" stdyId="stdyIdd"></input></div></td>'; $colsCounter++; $htmlCodes .= '<td class="celesteClaro"></td>'; $specialCounter++; $html .= '<td class="celesteClaro" style="vertical-align: bottom; padding: 0.5625em 0.625em;"><div class="verticalText">' . $subentry->getName() . '</div></td>'; $marginLeft += $jumpRight; $marginLeftCode += 25; } //$studentRow .= '<td id="total_' . $temp->getId() . '_stdId" class="itemHeaderCode itemPorcentage nota_stdId">-</td>'; $studentRow .= '<td id="total_' . $temp->getId() . '_stdId" class="morado bold nota_stdId">-</td>'; $htmlCodes .= '<td class="morado bold">' . $temp->getCode() . '</td>'; $specialCounter++; $html .= '<td class="morado" style="vertical-align: bottom; padding: 0.5625em 0.625em;"><div class="verticalText">' . $temp->getPercentage() . '% ' . $temp->getName() . '</div></td>'; $marginLeft += $jumpRight; $marginLeftCode += 25; $html3 .= '<td class="celesteClaro" colspan="' . (sizeof($subentries)+1) . '">' . $temp->getName() . '</td>'; } } } else { } } $htmlCodes .= "</tr>"; $html .= "</tr>"; $html3 .= "</tr>"; $html = '<table class="tableQualifications">' . $htmlCodes . $html . $html3; $studentRowIndex = 0; foreach($students as $stdy){ $html .= '<tr style="height: 30px; line-height: 0px;">'; $studentRowIndex++; $html .= '<td class="celesteOscuro headcolcarne" style="width: 75px; font-size: 10px;">' . $stdy->getStudent()->getCarne() . '</td>'; $html .= '<td class="celesteClaro bold headcolnombre" style="width: 250px; font-size: 12px;">' . $stdy->getStudent() . '</td>'; $row = str_replace("stdId", $stdy->getStudent()->getId(), $studentRow); $row = str_replace("stdyIdd", $stdy->getId(), $row); //tabIndexColXx for ($i = 1; $i <= $colsCounter; $i++) { $indexVar = "tabIndexCol" . $i . "x"; $row = str_replace($indexVar, "" . ($studentRowIndex + (($i - 1) * $studentsCount)), $row); } $dql = "SELECT qua FROM <API key>:<API key> qua" . " WHERE qua.studentYear = " . $stdy->getId(); $query = $em->createQuery($dql); $qualifications = $query->getResult(); foreach($qualifications as $qualification){ $row = str_replace("val_" . $stdy->getStudent()->getId() . "_" . $qualification->getSubCourseEntry()->getId() . "_", "" . $qualification->getQualification(), $row); } $html .= '<td id="total_trim_' . $stdy->getStudent()->getId() . '" class="azul headcoltrim" style="color: #fff;">-</td>' . $row . "</tr>"; } $html .= "</table>"; return new Response(json_encode(array('error' => false, 'html' => $html, "studentsCounter" => $studentsCount, "codesCounter" => $specialCounter))); } else { return new Response(json_encode(array('error' => true, 'message' =>$translator->trans("error.paramateres.missing")))); } } catch (Exception $e) { $info = toString($e); $logger->err('Teacher::<API key> [' . $info . "]"); return new Response(json_encode(array('error' => true, 'message' => $info))); } }// endif this is an ajax request else { return new Response("<b>Not an ajax call!!!" . "</b>"); } } public function <API key>(){ $logger = $this->get('logger'); if ($this->get('request')->isXmlHttpRequest())// Is the request an ajax one? { try { $request = $this->get('request')->request; $subentryId = $request->get('subentryId'); $studentYearId = $request->get('studentYearId'); $qualification = $request->get('qualification'); $translator = $this->get("translator"); $logger->err('--> ' . $subentryId . " :: " . $studentYearId . " :: " . $qualification); if( !isset($qualification) || $qualification == ""){ $qualification = -1; } if( isset($subentryId) || isset($studentYearId) ) { $em = $this->getDoctrine()->getEntityManager(); $studentQ = $em->getRepository("<API key>:<API key>")->findOneBy(array('subCourseEntry' => $subentryId, 'studentYear' => $studentYearId)); if ( isset($studentQ) ) { $studentQ->setQualification($qualification); } else { $studentQ = new <API key>(); $studentQ->setSubCourseEntry($em->getRepository("<API key>:SubCourseEntry")->find( $subentryId )); $studentQ->setStudentYear($em->getRepository("<API key>:StudentYear")->find( $studentYearId )); $studentQ->setQualification($qualification); } $em->persist($studentQ); $em->flush(); return new Response(json_encode(array('error' => false))); } else { return new Response(json_encode(array('error' => true, 'message' =>$translator->trans("error.paramateres.missing")))); } } catch (Exception $e) { $info = toString($e); $logger->err('SuperAdmin::<API key> [' . $info . "]"); return new Response(json_encode(array('error' => true, 'message' => $info))); } }// endif this is an ajax request else { return new Response("<b>Not an ajax call!!!" . "</b>"); } } public function generateExcelAction(){ $excelService = $this->get('export.excel')->setNameOfSheet("Notas"); //$this->get('export.excel')->createSheet(); $filepath = "export/excel/groupNotes"; $request = $this->get('request')->request; //$periodId = $request->get('periodId'); $periodId = 1; //$groupId = $request->get('groupId'); $groupId = "1-1"; $keywords = preg_split("/[\s-]+/", $groupId); $groupId = $keywords[0]; $gradeId = $keywords[1]; //$courseId = $request->get('courseId'); $courseId = "42"; $translator = $this->get("translator"); if( isset($courseId) && isset($groupId) && isset($periodId)) { $em = $this->getDoctrine()->getEntityManager(); $dql = "SELECT ce FROM <API key>:CourseEntry ce " . " JOIN ce.courseClass cc" . " WHERE ce.parent IS NULL AND cc.period = " . $periodId . " AND cc.grade = " . $gradeId . " AND cc.course = " . $courseId . " ORDER BY ce.sortOrder"; $query = $em->createQuery($dql); $entries = $query->getResult(); $temp = new \Tecnotek\ExpedienteBundle\Entity\CourseEntry(); //$html = '<tr style="height: 175px; line-height: 0px;"><td class="celesteOscuro headcolcarne" style="width: 75px; font-size: 10px; height: 175px;"></td>'; //$html .= '<td class="celesteClaro bold headcolnombre" style="width: 250px; font-size: 8px; height: 175px;"></td>'; $excelService-><API key>(2,2,"Promedio Trimestral", array('rotation' => 90, 'height' => 195, 'width' => 5, 'backgroundColor' => '2b34ee', 'color' => 'ffffff', 'bold' => true)); //$html .= '<td class="azul headcoltrim" style="vertical-align: bottom; padding: 0.5625em 0.625em; height: 175px; line-height: 220px;"><div class="verticalText" style="color: #fff;">Promedio Trimestral</div></td>'; $marginLeft = 48; $marginLeftCode = 62; //$htmlCodes = '<tr style="height: 30px;"><td class="celesteOscuro headcolcarne" style="width: 75px; font-size: 10px;"></td>'; //$htmlCodes .= '<td class="celesteClaro bold headcolnombre" style="width: 250px; font-size: 8px;"></td>'; //$htmlCodes .= '<td class="azul headcoltrim" style="color: #fff;">SCIE</td>'; $excelService-><API key>(1,2,"SCIE", array('height' => 15, 'width' => 5, 'backgroundColor' => '2b34ee', 'color' => 'ffffff', 'bold' => true)); $jumpRight = 46; $width = 44; $excelService-><API key>(1,0,"", array('height' => 15, 'width' => 5, 'backgroundColor' => '82c0fd', 'bold' => true)); $excelService-><API key>(1,1,"", array('height' => 15, 'width' => 5, 'backgroundColor' => 'A4D2FD', 'bold' => true)); $excelService-><API key>(2,0,"", array('height' => 195, 'width' => 5, 'backgroundColor' => '82c0fd', 'bold' => true)); $excelService-><API key>(2,1,"", array('height' => 195, 'width' => 5, 'backgroundColor' => 'A4D2FD', 'bold' => true)); $excelService-><API key>(3,0,"Carne", array('height' => 15, 'width' => 5, 'backgroundColor' => '82c0fd', 'bold' => true)); $excelService-><API key>(3,1,"Estudiante", array('height' => 15, 'width' => 5, 'backgroundColor' => 'A4D2FD', 'bold' => true)); $excelService-><API key>(3,2,"TRIM", array('height' => 15, 'width' => 5, 'backgroundColor' => '2b34ee', 'color' => 'ffffff', 'bold' => true)); //$html3 = '<tr style="height: 30px; line-height: 0px;" class="noPrint"><td class="celesteOscuro bold headcolcarne" style="width: 75px; font-size: 12px;">Carne</td>'; //$html3 .= '<td class="celesteClaro bold headcolnombre" style="width: 250px; font-size: 12px;">Estudiante</td>'; //$html3 .= '<td class="azul headcoltrim" style="color: #fff;">TRIM</td>'; $studentRow = ''; $studentsHeader = ''; $colors = array( "one" => "#38255c", "two" => "#04D0E6" ); $dql = "SELECT stdy FROM <API key>:Student std, <API key>:StudentYear stdy " . " WHERE stdy.student = std AND stdy.group = " . $groupId . " AND stdy.period = " . $periodId . " ORDER BY std.lastname, std.firstname"; $query = $em->createQuery($dql); $students = $query->getResult(); $studentsCount = sizeof($students); $rowIndex = 1; $colsCounter = 1; $specialCounter = 1; $colsIndex = 3; foreach( $entries as $entry ) { $temp = $entry; $childrens = $temp->getChildrens(); $size = sizeof($childrens); if($size == 0){//No child //Find SubEntries $dql = "SELECT ce FROM <API key>:SubCourseEntry ce " . " WHERE ce.parent = " . $temp->getId() . " AND ce.group = " . $groupId . " ORDER BY ce.sortOrder"; $query = $em->createQuery($dql); $subentries = $query->getResult(); $size = sizeof($subentries); if($size > 1){ foreach( $subentries as $subentry ) { $excelService-><API key>(1,$colsIndex,"", array('height' => 15, 'width' => 5, 'backgroundColor' => 'A4D2FD')); $excelService-><API key>(2,$colsIndex,$subentry->getName(), array('rotation' => 90, 'height' => 195, 'width' => 5, 'backgroundColor' => 'A4D2FD')); $colsIndex += 1; //$studentRow .= '<td class=""><input tabIndex=tabIndexCol'. $colsCounter . 'x type="text" class="textField itemNota item_' . $temp->getId() . '_stdId" val="val_stdId_' . $subentry->getId() . '_" tipo="2" child="' . $size . '" parent="' . $temp->getId() . '" rel="total_' . $temp->getId() . '_stdId" max="' . $subentry->getMaxValue() . '" perc="' . $subentry->getPercentage() . '" std="stdId" entry="' . $subentry->getId() . '" stdyId="stdyIdd"></td>'; /*$studentRow .= '<td class="celesteClaro"><div><input tabIndex=tabIndexCol'. $colsCounter . 'x type="text" class="textField itemNota item_' . $temp->getId() . '_stdId" val="val_stdId_' . $subentry->getId() . '_" tipo="2" child="' . $size . '" parent="' . $temp->getId() . '" rel="total_' . $temp->getId() . '_stdId" max="' . $subentry->getMaxValue() . '" perc="' . $subentry->getPercentage() . '" std="stdId" entry="' . $subentry->getId() . '" stdyId="stdyIdd"></div></td>'; $colsCounter++; $htmlCodes .= '<td class="celesteClaro"></td>'; $specialCounter++; $html .= '<td class="celesteClaro" style="vertical-align: bottom; padding: 0.5625em 0.625em;"><div class="verticalText">' . $subentry->getName() . '</div></td>';*/ $marginLeft += $jumpRight; $marginLeftCode += 25; } $excelService-><API key>(1,$colsIndex,"", array('height' => 15, 'width' => 5, 'backgroundColor' => '5F96E7')); $excelService-><API key>(2,$colsIndex,'Promedio ' . $temp->getName(), array('rotation' => 90, 'height' => 195, 'width' => 5, 'backgroundColor' => '5F96E7')); $colsIndex += 1; //$studentRow .= '<td class="itemHeaderCode itemPromedio" id="prom_' . $temp->getId() . '_stdId" perc="' . $temp->getPercentage() . '">-</td>'; /*$studentRow .= '<td class="celesteOscuro" id="prom_' . $temp->getId() . '_stdId" perc="' . $temp->getPercentage() . '">-</td>'; $htmlCodes .= '<td class="celesteOscuro"></td>'; $specialCounter++; $html .= '<td class="celesteOscuro" style="vertical-align: bottom; padding: 0.5625em 0.625em;"><div class="verticalText">Promedio ' . $temp->getName() . ' </div></td>'; $marginLeft += $jumpRight; $marginLeftCode += 25;*/ //$studentRow .= '<td id="total_' . $temp->getId() . '_stdId" class="itemHeaderCode itemPorcentage nota_stdId">-</td>'; /*$studentRow .= '<td id="total_' . $temp->getId() . '_stdId" class="morado bold nota_stdId">-</td>'; $htmlCodes .= '<td class="morado bold">' . $temp->getCode() . '</td>'; $specialCounter++; $html .= '<td class="morado" style="vertical-align: bottom; padding: 0.5625em 0.625em;"><div class="verticalText">' . $temp->getPercentage() . '% ' . $temp->getName() . '</div></td>'; $marginLeft += $jumpRight; $marginLeftCode += 25; // $html3 .= '<div class="itemHeader2 itemNota" style="width: ' . (($width * (sizeof($subentries)+1)) + ((sizeof($subentries)) * 2) ) . 'px">' . $temp->getName() . '</div>'; $html3 .= '<td class="celesteClaro" colspan="' . (sizeof($subentries)+2) . '">' . $temp->getName() . '</td>';*/ $excelService-><API key>(1,$colsIndex,$temp->getCode(), array('height' => 15, 'width' => 5, 'backgroundColor' => 'B698EE')); $excelService-><API key>(2,$colsIndex,$temp->getPercentage() . '% ' . $temp->getName(), array('rotation' => 90, 'height' => 195, 'width' => 5, 'backgroundColor' => 'B698EE')); $colsIndex += 1; } else { if($size == 1){ foreach( $subentries as $subentry ) { //$studentRow .= '<td class=""><input tabIndex=tabIndexCol'. $colsCounter . 'x type="text" class="textField itemNota item_' . $temp->getId() . '_stdId" val="val_stdId_' . $subentry->getId() . '_" tipo="1" max="' . $subentry->getMaxValue() . '" child="' . $size . '" parent="' . $temp->getId() . '" rel="total_' . $temp->getId() . '_stdId" perc="' . $subentry->getPercentage() . '" std="stdId" entry="' . $subentry->getId() . '" stdyId="stdyIdd"></td>'; /*$studentRow .= '<td class="celesteClaro"><div><input tabIndex=tabIndexCol'. $colsCounter . 'x type="text" class="textField itemNota item_' . $temp->getId() . '_stdId" val="val_stdId_' . $subentry->getId() . '_" tipo="1" max="' . $subentry->getMaxValue() . '" child="' . $size . '" parent="' . $temp->getId() . '" rel="total_' . $temp->getId() . '_stdId" perc="' . $subentry->getPercentage() . '" std="stdId" entry="' . $subentry->getId() . '" stdyId="stdyIdd"></div></td>'; $colsCounter++; $htmlCodes .= '<td class="celesteClaro"></td>'; $specialCounter++; $html .= '<td class="celesteClaro" style="vertical-align: bottom; padding: 0.5625em 0.625em;"><div class="verticalText">' . $subentry->getName() . '</div></td>'; $marginLeft += $jumpRight; $marginLeftCode += 25;*/ $excelService-><API key>(1,$colsIndex,"", array('height' => 15, 'width' => 5, 'backgroundColor' => 'A4D2FD')); $excelService-><API key>(2,$colsIndex,$temp->getPercentage() . '% ' . $temp->getName(), array('rotation' => 90, 'height' => 195, 'width' => 5, 'backgroundColor' => 'A4D2FD')); $colsIndex += 1; } //$studentRow .= '<td id="total_' . $temp->getId() . '_stdId" class="itemHeaderCode itemPorcentage nota_stdId">-</td>'; /*$studentRow .= '<td id="total_' . $temp->getId() . '_stdId" class="morado bold nota_stdId">-</td>'; $htmlCodes .= '<td class="morado bold">' . $temp->getCode() . '</td>'; $specialCounter++; $html .= '<td class="morado" style="vertical-align: bottom; padding: 0.5625em 0.625em;"><div class="verticalText">' . $temp->getPercentage() . '% ' . $temp->getName() . '</div></td>'; $marginLeft += $jumpRight; $marginLeftCode += 25; $html3 .= '<td class="celesteClaro" colspan="' . (sizeof($subentries)+1) . '">' . $temp->getName() . '</td>';*/ $excelService-><API key>(1,$colsIndex,$temp->getCode(), array('height' => 15, 'width' => 5, 'backgroundColor' => 'B698EE')); $excelService-><API key>(2,$colsIndex,$temp->getPercentage() . '% ' . $temp->getName(), array('rotation' => 90, 'height' => 195, 'width' => 5, 'backgroundColor' => 'B698EE')); $colsIndex += 1; } } } else { } } /* $htmlCodes .= "</tr>"; $html .= "</tr>"; $html3 .= "</tr>"; $html = '<table class="tableQualifications">' . $htmlCodes . $html . $html3;*/ $studentRowIndex = 4; foreach($students as $stdy){ //$html .= '<tr style="height: 30px; line-height: 0px;">'; $excelService-><API key>($studentRowIndex,0,$stdy->getStudent()->getCarne(), array('height' => 15, 'width' => 10, 'backgroundColor' => '82c0fd')); $excelService-><API key>($studentRowIndex,1,$stdy->getStudent(), array('height' => 15, 'width' => 40, 'backgroundColor' => 'A4D2FD')); $studentRowIndex++; /*$html .= '<td class="celesteOscuro headcolcarne" style="width: 75px; font-size: 10px;">' . $stdy->getStudent()->getCarne() . '</td>'; $html .= '<td class="celesteClaro bold headcolnombre" style="width: 250px; font-size: 8px;">' . $stdy->getStudent() . '</td>'; $row = str_replace("stdId", $stdy->getStudent()->getId(), $studentRow); $row = str_replace("stdyIdd", $stdy->getId(), $row); //tabIndexColXx for ($i = 1; $i <= $colsCounter; $i++) { $indexVar = "tabIndexCol" . $i . "x"; $row = str_replace($indexVar, "" . ($studentRowIndex + (($i - 1) * $studentsCount)), $row); } $dql = "SELECT qua FROM <API key>:<API key> qua" . " WHERE qua.studentYear = " . $stdy->getId(); $query = $em->createQuery($dql); $qualifications = $query->getResult(); foreach($qualifications as $qualification){ $row = str_replace("val_" . $stdy->getStudent()->getId() . "_" . $qualification->getSubCourseEntry()->getId() . "_", "" . $qualification->getQualification(), $row); } $html .= '<td id="total_trim_' . $stdy->getStudent()->getId() . '" class="azul headcoltrim" style="color: #fff;">-</td>' . $row . "</tr>";*/ } $excelService->applyBorderByRange(0, 1, $colsIndex - 1, $studentRowIndex - 1); //$html .= "</table>"; } /*$excelService->writeCellByPosition(1,1,"probando 1"); $excelService->writeCellByPosition(1,2,"probando 2"); $excelService->writeCellByPosition(2,1,"probando 3");*/ //$excelService->writeCellByPosition(row,col,""); $excelService->writeExport($filepath); /*$response->headers->add('Content-Type', 'text/vnd.ms-excel; charset=utf-8'); $response->headers->add('Content-Disposition', 'attachment;filename=stdream2.xls');*/ //return $response; return new Response(json_encode(array('error' => false))); //create the response /*$response = $excelService->getResponse(); $response->headers->set('Content-Type', 'text/vnd.ms-excel; charset=utf-8'); $response->headers->set('Content-Disposition', 'attachment;filename=stdream2.xls'); // If you are using a https connection, you have to set those two headers for compatibility with IE <9 $response->headers->set('Pragma', 'public'); $response->headers->set('Cache-Control', 'maxage=1'); return $response;*/ } public function <API key>(){ $logger = $this->get('logger'); if ($this->get('request')->isXmlHttpRequest())// Is the request an ajax one? { try { $request = $this->get('request')->request; $year = $request->get('year'); $loadOnlyBachelors = $request->get('loadOnlyBachelors'); if ( !isset($loadOnlyBachelors) ) { $loadOnlyBachelors = false; } else { $loadOnlyBachelors = ($loadOnlyBachelors == "true"); } $translator = $this->get("translator"); if( isset($year) ) { $em = $this->getDoctrine()->getEntityManager(); $user = $this->get('security.context')->getToken()->getUser(); //Get Groups $sqlOnlyBachelors = $loadOnlyBachelors? " AND grade.number = 11 ":""; $sql = "SELECT CONCAT(g.id,'-',grade.id) as 'id', CONCAT(grade.name, ' :: ', g.name) as 'name'" . " FROM tek_groups g, tek_periods p, tek_grades grade" . " WHERE p.orderInYear = 3 AND g.period_id = p.id AND p.year = " . $year . " AND g.grade_id = grade.id" . "" . $sqlOnlyBachelors . " AND g.institution_id in (" . $user-><API key>() . ")" . " GROUP BY CONCAT(grade.name, ' :: ', g.name)" . " ORDER BY g.id"; $stmt = $em->getConnection()->prepare($sql); $stmt->execute(); $groups = $stmt->fetchAll(); return new Response(json_encode(array('error' => false, 'groups' => $groups))); } else { return new Response(json_encode(array('error' => true, 'message' =>$translator->trans("error.paramateres.missing")))); } } catch (Exception $e) { $info = toString($e); $logger->err('Admin::<API key> [' . $info . "]"); return new Response(json_encode(array('error' => true, 'message' => $info))); } }// endif this is an ajax request else { return new Response("<b>Not an ajax call!!!" . "</b>"); } } public function <API key>(){ $logger = $this->get('logger'); if ($this->get('request')->isXmlHttpRequest())// Is the request an ajax one? { try { $request = $this->get('request')->request; $keywords = preg_split("/[\s-]+/", $request->get('groupId')); $groupId = $keywords[0]; $translator = $this->get("translator"); if( isset($groupId) ) { $em = $this->getDoctrine()->getEntityManager(); //Get Courses $sql = "SELECT course.id, course.name " . " FROM <API key> tat, tek_course_class tcc, tek_courses course " . " WHERE tat.group_id = " . $groupId . " AND tat.course_class_id = tcc.id AND tcc.course_id = course.id" . " GROUP BY course.id" . " ORDER BY course.name "; $stmt = $em->getConnection()->prepare($sql); $stmt->execute(); $courses = $stmt->fetchAll(); return new Response(json_encode(array('error' => false, 'courses' => $courses))); } else { return new Response(json_encode(array('error' => true, 'message' =>$translator->trans("error.paramateres.missing")))); } } catch (Exception $e) { $info = toString($e); $logger->err('Admin::<API key> [' . $info . "]"); return new Response(json_encode(array('error' => true, 'message' => $info))); } }// endif this is an ajax request else { return new Response("<b>Not an ajax call!!!" . "</b>"); } } public function <API key>(){ $em = $this->getDoctrine()->getEntityManager(); $dql = "SELECT q FROM <API key>:Questionnaire q"; $query = $em->createQuery($dql); $questionnaires = $query->getResult(); $groups = $em->getRepository('<API key>:QuestionnaireGroup')->findAll(); $institutions = $em->getRepository('<API key>:Institution')->findAll(); return $this->render('<API key>:SuperAdmin:Questionnaires/list.html.twig', array( 'questionnaires' => $questionnaires, 'groups' => $groups, 'institutions' => $institutions )); } public function <API key>(){ $logger = $this->get('logger'); if ($this->get('request')->isXmlHttpRequest())// Is the request an ajax one? { try { $request = $this->get('request')->request; $questionnaireId = $request->get('q'); $field = $request->get('field'); $val = $request->get('val'); $translator = $this->get("translator"); if( isset($questionnaireId) && isset($field) && isset($val) ) { $em = $this->getDoctrine()->getEntityManager(); $q = new \Tecnotek\ExpedienteBundle\Entity\Questionnaire(); $q = $em->getRepository('<API key>:Questionnaire')->find($questionnaireId); switch($field){ case 'group': $qGroup = $em->getRepository('<API key>:QuestionnaireGroup')->find($val); $q->setGroup($qGroup); break; case 'teacher': $q-><API key>($val == 1); break; case 'institution': $values = preg_split("/[\s-]+/", $val); $institution = $em->getRepository('<API key>:Institution')->find($values[0]); if($values[1] == 0){ $q->getInstitutions()->removeElement($institution); } else { $q->getInstitutions()->add($institution); } break; default: break; } $em->persist($q); $em->flush(); return new Response(json_encode(array('error' => false))); } else { return new Response(json_encode(array('error' => true, 'message' =>$translator->trans("error.paramateres.missing")))); } } catch (Exception $e) { $info = toString($e); $logger->err('Admin::<API key> [' . $info . "]"); return new Response(json_encode(array('error' => true, 'message' => $info))); } }// endif this is an ajax request else { return new Response("<b>Not an ajax call!!!" . "</b>"); } } }
/** * create edit language file link */ export default (lang) => { return `https://github.com/electerm/electerm-locales/edit/master/locales/${lang}.js` }
using System.Security.Cryptography.X509Certificates; using Xunit; namespace OpenGost.Security.Cryptography.X509Certificates { public class <API key> : <API key> { [Theory] [InlineData("GostECDsa256")] [InlineData("GostECDsa512")] public void <API key>(string certificateName) { var certificate = new X509Certificate2( ResourceUtils.GetBinaryResource( $"OpenGost.Security.Cryptography.Tests.Resources.{certificateName}.cer")); using (var publicKey = certificate.GetECDsaPublicKey()) { Assert.NotNull(publicKey); } } } }
using System; //using Microsoft.VisualStudio.TestTools.UnitTesting; using TestClass = NUnit.Framework.<API key>; using TestMethod = NUnit.Framework.TestAttribute; using NUnit.Framework; using BrowserStack; using System.Text; using System.IO; namespace <API key> { [TestClass] public class <API key> { private TunnelClass tunnel; [TestMethod] public void TestInitialState() { tunnel = new TunnelClass(); Assert.AreEqual(tunnel.localState, LocalState.Idle); Assert.NotNull(tunnel.getOutputBuilder()); } [TestMethod] public void TestBinaryPathIsSet() { tunnel = new TunnelClass(); tunnel.addBinaryPath("dummyPath"); Assert.AreEqual(tunnel.getBinaryAbsolute(), "dummyPath"); } [TestMethod] public void <API key>() { tunnel = new TunnelClass(); tunnel.addBinaryPath(null); string expectedPath = Path.Combine(Environment.<API key>("%HOMEDRIVE%%HOMEPATH%"), ".browserstack"); expectedPath = Path.Combine(expectedPath, "BrowserStackLocal.exe"); Assert.AreEqual(tunnel.getBinaryAbsolute(), expectedPath); } [TestMethod] public void <API key>() { tunnel = new TunnelClass(); tunnel.addBinaryPath(""); string expectedPath = Path.Combine(Environment.<API key>("%HOMEDRIVE%%HOMEPATH%"), ".browserstack"); expectedPath = Path.Combine(expectedPath, "BrowserStackLocal.exe"); Assert.AreEqual(tunnel.getBinaryAbsolute(), expectedPath); } [TestMethod] public void <API key>() { string expectedPath = "dummyPath"; tunnel = new TunnelClass(); tunnel.addBinaryPath("dummyPath"); Assert.AreEqual(tunnel.getBinaryAbsolute(), expectedPath); tunnel.fallbackPaths(); expectedPath = Path.Combine(Environment.<API key>("%HOMEDRIVE%%HOMEPATH%"), ".browserstack"); expectedPath = Path.Combine(expectedPath, "BrowserStackLocal.exe"); Assert.AreEqual(tunnel.getBinaryAbsolute(), expectedPath); tunnel.fallbackPaths(); expectedPath = Directory.GetCurrentDirectory(); expectedPath = Path.Combine(expectedPath, "BrowserStackLocal.exe"); Assert.AreEqual(tunnel.getBinaryAbsolute(), expectedPath); tunnel.fallbackPaths(); expectedPath = Path.GetTempPath(); expectedPath = Path.Combine(expectedPath, "BrowserStackLocal.exe"); Assert.AreEqual(tunnel.getBinaryAbsolute(), expectedPath); } [TestMethod] public void <API key>() { tunnel = new TunnelClass(); tunnel.addBinaryPath("dummyPath"); tunnel.fallbackPaths(); tunnel.fallbackPaths(); tunnel.fallbackPaths(); Assert.Throws(typeof(Exception), new TestDelegate(<API key>), "Binary not found or failed to launch. Make sure that BrowserStackLocal.exe is not already running." ); } [TestMethod] public void TestBinaryArguments() { tunnel = new TunnelClass(); tunnel.addBinaryArguments("dummyArguments"); Assert.AreEqual(tunnel.getBinaryArguments(), "dummyArguments"); } [TestMethod] public void <API key>() { tunnel = new TunnelClass(); tunnel.addBinaryArguments(null); Assert.AreEqual(tunnel.getBinaryArguments(), ""); } public void <API key>() { tunnel.fallbackPaths(); } public class TunnelClass : BrowserStackTunnel { public StringBuilder getOutputBuilder() { return output; } public string getBinaryAbsolute() { return binaryAbsolute; } public string getBinaryArguments() { return binaryArguments; } } } }
// of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // copies or substantial portions of the Software. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. using System; using System.Collections.Generic; using Yaapii.Atoms.Fail; using Yaapii.Atoms.Scalar; namespace Yaapii.Atoms.Enumerable { <summary> The greatest item in the given <see cref="IEnumerable{T}"/> </summary> <typeparam name="T"></typeparam> public sealed class Max<T> : ScalarEnvelope<T> where T : IComparable<T> { <summary> The greatest item in the given <see cref="IEnumerable{T}"/> </summary> <param name="items">list of items</param> public Max(params Func<T>[] items) : this( new Enumerable.Mapped<Func<T>, IScalar<T>>( item => new Live<T>(() => item.Invoke()), new ManyOf<Func<T>>(items) ) ) { } <summary> The greatest item in the given <see cref="IEnumerable{T}"/> </summary> <param name="items">list of items</param> public Max(IEnumerable<T> items) : this( new Enumerable.Mapped<T, IScalar<T>>(item => new Live<T>(item), items)) { } <summary> The greatest item in the given items. </summary> <param name="items">list of items</param> public Max(params T[] items) : this( new Enumerable.Mapped<T, IScalar<T>>(item => new Live<T>(item), items)) { } <summary> The greatest item in the given <see cref="IEnumerable{T}"/> </summary> <param name="items">list of items</param> public Max(params IScalar<T>[] items) : this(new ManyOf<IScalar<T>>(items)) { } <summary> The greatest item in the given <see cref="IEnumerable{T}"/> </summary> <param name="items">list of items</param> public Max(IEnumerable<IScalar<T>> items) : base(() => { var e = items.GetEnumerator(); if (!e.MoveNext()) { throw new <API key>("Can't find greater element in an empty iterable"); } T max = e.Current.Value(); while (e.MoveNext()) { T next = e.Current.Value(); if (next.CompareTo(max) > 0) { max = next; } } return max; }) { } } public static class Max { <summary> The greatest item in the given <see cref="IEnumerable{T}"/> </summary> <param name="items">list of items</param> public static IScalar<T> New<T>(params Func<T>[] items) where T : IComparable<T> => new Max<T>(items); <summary> The greatest item in the given <see cref="IEnumerable{T}"/> </summary> <param name="items">list of items</param> public static IScalar<T> New<T>(IEnumerable<T> items) where T : IComparable<T> => new Max<T>(items); <summary> The greatest item in the given items. </summary> <param name="items">list of items</param> public static IScalar<T> New<T>(params T[] items) where T : IComparable<T> => new Max<T>(items); <summary> The greatest item in the given <see cref="IEnumerable{T}"/> </summary> <param name="items">list of items</param> public static IScalar<T> New<T>(params IScalar<T>[] items) where T : IComparable<T> => new Max<T>(items); <summary> The greatest item in the given <see cref="IEnumerable{T}"/> </summary> <param name="items">list of items</param> public static IScalar<T> New<T>(IEnumerable<IScalar<T>> items) where T : IComparable<T> => new Max<T>(items); } }
<!DOCTYPE html PUBLIC "- <html xmlns="http: <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.13"/> <meta name="viewport" content="width=device-width, initial-scale=1"/> <title>bit by bit: bbb::container_info::<API key>&lt; type &gt; Struct Template Reference</title> <link href="../../tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="../../jquery.js"></script> <script type="text/javascript" src="../../dynsections.js"></script> <link href="../../search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="../../search/searchdata.js"></script> <script type="text/javascript" src="../../search/search.js"></script> <link href="../../doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td id="projectalign" style="padding-left: 0.5em;"> <div id="projectname">bit by bit &#160;<span id="projectnumber">0.0.1</span> </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.13 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "../../search",false,'Search'); </script> <script type="text/javascript" src="../../menudata.js"></script> <script type="text/javascript" src="../../menu.js"></script> <script type="text/javascript"> $(function() { initMenu('../../',true,false,'search.php','Search'); $(document).ready(function() { init_search(); }); }); </script> <div id="main-nav"></div> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> </div> <!-- iframe showing the search results (closed by default) --> <div id="<API key>"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="../../dc/d34/namespacebbb.html">bbb</a></li><li class="navelem"><a class="el" href="../../d8/db2/<API key>.html">container_info</a></li><li class="navelem"><a class="el" href="../../d6/d4e/<API key>.html"><API key></a></li> </ul> </div> </div><!-- top --> <div class="header"> <div class="headertitle"> <div class="title">bbb::container_info::<API key>&lt; type &gt; Struct Template Reference</div> </div> </div><!--header <div class="contents"> <p><code>#include &quot;<a class="el" href="../../dc/da2/<API key>.html">container_traits.hpp</a>&quot;</code></p> <p>Inherits false_type.</p> <hr/>The documentation for this struct was generated from the following file:<ul> <li>bbb/core/traits/<a class="el" href="../../dc/da2/<API key>.html">container_traits.hpp</a></li> </ul> </div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated by & <img class="footer" src="../../doxygen.png" alt="doxygen"/> </a> 1.8.13 </small></address> </body> </html>
using System; using System.Diagnostics.Tracing; namespace tracelogging { public sealed class MySource : EventSource { MySource() : base(EventSourceSettings.<API key>) { } [Event(1)] public void TestEventMethod(int i, string s) { WriteEvent(1, i, s); } public static MySource Logger = new MySource(); } class Program { static void Main(string[] args) { MySource.Logger.TestEventMethod(1, "Hello World!"); MySource.Logger.Write("TestEvent", new { field1 = "Hello", field2 = 3, field3 = 6 }); MySource.Logger.Write("TestEvent1", new { field1 = "Hello", field2 = 3, }); MySource.Logger.Write("TestEvent2", new { field1 = "Hello" }); MySource.Logger.Write("TestEvent3", new { field1 = new byte[10] }); } } }
#include <vcl.h> #pragma hdrstop #include "uFin3015.h" #pragma package(smart_init) #pragma resource "*.dfm" __fastcall TFin3015::TFin3015(TComponent* Owner) : TfrmRelatBase01(Owner) { }
<?xml version="1.0" ?><!DOCTYPE TS><TS language="pt_PT" version="2.1"> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About bitcoinlite</source> <translation type="unfinished"/> </message> <message> <location line="+39"/> <source>&lt;b&gt;bitcoinlite&lt;/b&gt; version</source> <translation type="unfinished"/> </message> <message> <location line="+41"/> <source>Copyright © 2009-2014 The Bitcoin developers Copyright © 2012-2014 The NovaCoin developers Copyright © 2014 The bitcoinlite developers</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source> This is experimental software. Distributed under the MIT/X11 software license, see the accompanying file COPYING or http: This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http: <translation> Este é um programa experimental. Distribuído sob uma licença de software MIT/X11, por favor verifique o ficheiro anexo license.txt ou http: Este produto inclui software desenvolvido pelo Projecto OpenSSL para uso no OpenSSL Toolkit (http: </message> </context> <context> <name>AddressBookPage</name> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>Address Book</source> <translation type="unfinished"/> </message> <message> <location line="+22"/> <source>Double-click to edit address or label</source> <translation>Clique duas vezes para editar o endereço ou o rótulo</translation> </message> <message> <location line="+27"/> <source>Create a new address</source> <translation>Criar um novo endereço</translation> </message> <message> <location line="+14"/> <source>Copy the currently selected address to the system clipboard</source> <translation>Copie o endereço selecionado para a área de transferência</translation> </message> <message> <location line="-11"/> <source>&amp;New Address</source> <translation type="unfinished"/> </message> <message> <location line="-46"/> <source>These are your bitcoinlite addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you.</source> <translation type="unfinished"/> </message> <message> <location line="+60"/> <source>&amp;Copy Address</source> <translation>&amp;Copiar Endereço</translation> </message> <message> <location line="+11"/> <source>Show &amp;QR Code</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Sign a message to prove you own a bitcoinlite address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>Delete the currently selected address from the list</source> <translation>Apagar o endereço selecionado da lista</translation> </message> <message> <location line="-14"/> <source>Verify a message to ensure it was signed with a specified bitcoinlite address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Verify Message</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>&amp;Delete</source> <translation>E&amp;liminar</translation> </message> <message> <location filename="../addressbookpage.cpp" line="+65"/> <source>Copy &amp;Label</source> <translation>Copiar &amp;Rótulo</translation> </message> <message> <location line="+2"/> <source>&amp;Edit</source> <translation>&amp;Editar</translation> </message> <message> <location line="+250"/> <source>Export Address Book Data</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>Ficheiro separado por vírgulas (*.csv)</translation> </message> <message> <location line="+13"/> <source>Error exporting</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation type="unfinished"/> </message> </context> <context> <name>AddressTableModel</name> <message> <location filename="../addresstablemodel.cpp" line="+144"/> <source>Label</source> <translation>Rótulo</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>Endereço</translation> </message> <message> <location line="+36"/> <source>(no label)</source> <translation>(sem rótulo)</translation> </message> </context> <context> <name>AskPassphraseDialog</name> <message> <location filename="../forms/askpassphrasedialog.ui" line="+26"/> <source>Passphrase Dialog</source> <translation>Diálogo de Frase-Passe</translation> </message> <message> <location line="+21"/> <source>Enter passphrase</source> <translation>Escreva a frase de segurança</translation> </message> <message> <location line="+14"/> <source>New passphrase</source> <translation>Nova frase de segurança</translation> </message> <message> <location line="+14"/> <source>Repeat new passphrase</source> <translation>Repita a nova frase de segurança</translation> </message> <message> <location line="+33"/> <source>Serves to disable the trivial sendmoney when OS account compromised. Provides no real security.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>For staking only</source> <translation type="unfinished"/> </message> <message> <location filename="../askpassphrasedialog.cpp" line="+35"/> <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;10 or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source> <translation>Escreva a nova frase de seguraça da sua carteira. &lt;br/&gt; Por favor, use uma frase de &lt;b&gt;10 ou mais caracteres aleatórios,&lt;/b&gt; ou &lt;b&gt;oito ou mais palavras&lt;/b&gt;.</translation> </message> <message> <location line="+1"/> <source>Encrypt wallet</source> <translation>Encriptar carteira</translation> </message> <message> <location line="+7"/> <source>This operation needs your wallet passphrase to unlock the wallet.</source> <translation>A sua frase de segurança é necessária para desbloquear a carteira.</translation> </message> <message> <location line="+5"/> <source>Unlock wallet</source> <translation>Desbloquear carteira</translation> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to decrypt the wallet.</source> <translation>A sua frase de segurança é necessária para desencriptar a carteira.</translation> </message> <message> <location line="+5"/> <source>Decrypt wallet</source> <translation>Desencriptar carteira</translation> </message> <message> <location line="+3"/> <source>Change passphrase</source> <translation>Alterar frase de segurança</translation> </message> <message> <location line="+1"/> <source>Enter the old and new passphrase to the wallet.</source> <translation>Escreva a frase de segurança antiga seguida da nova para a carteira.</translation> </message> <message> <location line="+46"/> <source>Confirm wallet encryption</source> <translation>Confirmar encriptação da carteira</translation> </message> <message> <location line="+1"/> <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR COINS&lt;/b&gt;!</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Are you sure you wish to encrypt your wallet?</source> <translation>Tem a certeza que deseja encriptar a carteira?</translation> </message> <message> <location line="+15"/> <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source> <translation>IMPORTANTE: Qualquer cópia de segurança anterior da carteira deverá ser substituída com o novo, actualmente encriptado, ficheiro de carteira. Por razões de segurança, cópias de segurança não encriptadas efectuadas anteriormente do ficheiro da carteira tornar-se-ão inúteis assim que começar a usar a nova carteira encriptada.</translation> </message> <message> <location line="+103"/> <location line="+24"/> <source>Warning: The Caps Lock key is on!</source> <translation>Atenção: A tecla Caps Lock está activa!</translation> </message> <message> <location line="-133"/> <location line="+60"/> <source>Wallet encrypted</source> <translation>Carteira encriptada</translation> </message> <message> <location line="-58"/> <source>bitcoinlite will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your coins from being stolen by malware infecting your computer.</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <location line="+7"/> <location line="+44"/> <location line="+6"/> <source>Wallet encryption failed</source> <translation>A encriptação da carteira falhou</translation> </message> <message> <location line="-56"/> <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source> <translation>A encriptação da carteira falhou devido a um erro interno. A carteira não foi encriptada.</translation> </message> <message> <location line="+7"/> <location line="+50"/> <source>The supplied passphrases do not match.</source> <translation>As frases de segurança fornecidas não coincidem.</translation> </message> <message> <location line="-38"/> <source>Wallet unlock failed</source> <translation>O desbloqueio da carteira falhou</translation> </message> <message> <location line="+1"/> <location line="+12"/> <location line="+19"/> <source>The passphrase entered for the wallet decryption was incorrect.</source> <translation>A frase de segurança introduzida para a desencriptação da carteira estava incorreta.</translation> </message> <message> <location line="-20"/> <source>Wallet decryption failed</source> <translation>A desencriptação da carteira falhou</translation> </message> <message> <location line="+14"/> <source>Wallet passphrase was successfully changed.</source> <translation>A frase de segurança da carteira foi alterada com êxito.</translation> </message> </context> <context> <name>BitcoinGUI</name> <message> <location filename="../bitcoingui.cpp" line="+280"/> <source>Sign &amp;message...</source> <translation>Assinar &amp;mensagem...</translation> </message> <message> <location line="+242"/> <source>Synchronizing with network...</source> <translation>Sincronizando com a rede...</translation> </message> <message> <location line="-308"/> <source>&amp;Overview</source> <translation>Visã&amp;o geral</translation> </message> <message> <location line="+1"/> <source>Show general overview of wallet</source> <translation>Mostrar visão geral da carteira</translation> </message> <message> <location line="+17"/> <source>&amp;Transactions</source> <translation>&amp;Transações</translation> </message> <message> <location line="+1"/> <source>Browse transaction history</source> <translation>Navegar pelo histórico de transações</translation> </message> <message> <location line="+5"/> <source>&amp;Address Book</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Edit the list of stored addresses and labels</source> <translation type="unfinished"/> </message> <message> <location line="-13"/> <source>&amp;Receive coins</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show the list of addresses for receiving payments</source> <translation type="unfinished"/> </message> <message> <location line="-7"/> <source>&amp;Send coins</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>E&amp;xit</source> <translation>Fec&amp;har</translation> </message> <message> <location line="+1"/> <source>Quit application</source> <translation>Sair da aplicação</translation> </message> <message> <location line="+4"/> <source>Show information about bitcoinlite</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>About &amp;Qt</source> <translation>Sobre &amp;Qt</translation> </message> <message> <location line="+1"/> <source>Show information about Qt</source> <translation>Mostrar informação sobre Qt</translation> </message> <message> <location line="+2"/> <source>&amp;Options...</source> <translation>&amp;Opções...</translation> </message> <message> <location line="+4"/> <source>&amp;Encrypt Wallet...</source> <translation>E&amp;ncriptar Carteira...</translation> </message> <message> <location line="+3"/> <source>&amp;Backup Wallet...</source> <translation>&amp;Guardar Carteira...</translation> </message> <message> <location line="+2"/> <source>&amp;Change Passphrase...</source> <translation>Mudar &amp;Palavra-passe...</translation> </message> <message numerus="yes"> <location line="+250"/> <source>~%n block(s) remaining</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+6"/> <source>Downloaded %1 of %2 blocks of transaction history (%3% done).</source> <translation type="unfinished"/> </message> <message> <location line="-247"/> <source>&amp;Export...</source> <translation type="unfinished"/> </message> <message> <location line="-62"/> <source>Send coins to a bitcoinlite address</source> <translation type="unfinished"/> </message> <message> <location line="+45"/> <source>Modify configuration options for bitcoinlite</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>Export the data in the current tab to a file</source> <translation type="unfinished"/> </message> <message> <location line="-14"/> <source>Encrypt or decrypt wallet</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Backup wallet to another location</source> <translation>Faça uma cópia de segurança da carteira para outra localização</translation> </message> <message> <location line="+2"/> <source>Change the passphrase used for wallet encryption</source> <translation>Mudar a frase de segurança utilizada na encriptação da carteira</translation> </message> <message> <location line="+10"/> <source>&amp;Debug window</source> <translation>Janela de &amp;depuração</translation> </message> <message> <location line="+1"/> <source>Open debugging and diagnostic console</source> <translation>Abrir consola de diagnóstico e depuração</translation> </message> <message> <location line="-5"/> <source>&amp;Verify message...</source> <translation>&amp;Verificar mensagem...</translation> </message> <message> <location line="-200"/> <source>bitcoinlite</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Wallet</source> <translation>Carteira</translation> </message> <message> <location line="+178"/> <source>&amp;About bitcoinlite</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>&amp;Show / Hide</source> <translation>Mo&amp;strar / Ocultar</translation> </message> <message> <location line="+9"/> <source>Unlock wallet</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>&amp;Lock Wallet</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Lock wallet</source> <translation type="unfinished"/> </message> <message> <location line="+34"/> <source>&amp;File</source> <translation>&amp;Ficheiro</translation> </message> <message> <location line="+8"/> <source>&amp;Settings</source> <translation>Con&amp;figurações</translation> </message> <message> <location line="+8"/> <source>&amp;Help</source> <translation>A&amp;juda</translation> </message> <message> <location line="+9"/> <source>Tabs toolbar</source> <translation>Barra de separadores</translation> </message> <message> <location line="+8"/> <source>Actions toolbar</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <location line="+9"/> <source>[testnet]</source> <translation>[rede de testes]</translation> </message> <message> <location line="+0"/> <location line="+60"/> <source>bitcoinlite client</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+70"/> <source>%n active connection(s) to bitcoinlite network</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+40"/> <source>Downloaded %1 blocks of transaction history.</source> <translation type="unfinished"/> </message> <message> <location line="+413"/> <source>Staking.&lt;br&gt;Your weight is %1&lt;br&gt;Network weight is %2&lt;br&gt;Expected time to earn reward is %3</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Not staking because wallet is locked</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Not staking because wallet is offline</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Not staking because wallet is syncing</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Not staking because you don&apos;t have mature coins</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="-403"/> <source>%n second(s) ago</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="-284"/> <source>&amp;Unlock Wallet...</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+288"/> <source>%n minute(s) ago</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n hour(s) ago</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n day(s) ago</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+6"/> <source>Up to date</source> <translation>Atualizado</translation> </message> <message> <location line="+7"/> <source>Catching up...</source> <translation>Recuperando...</translation> </message> <message> <location line="+10"/> <source>Last received block was generated %1.</source> <translation type="unfinished"/> </message> <message> <location line="+59"/> <source>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Confirm transaction fee</source> <translation type="unfinished"/> </message> <message> <location line="+27"/> <source>Sent transaction</source> <translation>Transação enviada</translation> </message> <message> <location line="+1"/> <source>Incoming transaction</source> <translation>Transação recebida</translation> </message> <message> <location line="+1"/> <source>Date: %1 Amount: %2 Type: %3 Address: %4 </source> <translation>Data: %1 Quantia: %2 Tipo: %3 Endereço: %4 </translation> </message> <message> <location line="+100"/> <location line="+15"/> <source>URI handling</source> <translation type="unfinished"/> </message> <message> <location line="-15"/> <location line="+15"/> <source>URI can not be parsed! This can be caused by an invalid bitcoinlite address or malformed URI parameters.</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source> <translation>A carteira está &lt;b&gt;encriptada&lt;/b&gt; e atualmente &lt;b&gt;desbloqueada&lt;/b&gt;</translation> </message> <message> <location line="+10"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source> <translation>A carteira está &lt;b&gt;encriptada&lt;/b&gt; e atualmente &lt;b&gt;bloqueada&lt;/b&gt;</translation> </message> <message> <location line="+25"/> <source>Backup Wallet</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Wallet Data (*.dat)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Backup Failed</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>There was an error trying to save the wallet data to the new location.</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+76"/> <source>%n second(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n minute(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n hour(s)</source> <translation><numerusform>%n hora</numerusform><numerusform>%n horas</numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n day(s)</source> <translation><numerusform>%n dia</numerusform><numerusform>%n dias</numerusform></translation> </message> <message> <location line="+18"/> <source>Not staking</source> <translation type="unfinished"/> </message> <message> <location filename="../bitcoin.cpp" line="+109"/> <source>A fatal error occurred. bitcoinlite can no longer continue safely and will quit.</source> <translation type="unfinished"/> </message> </context> <context> <name>ClientModel</name> <message> <location filename="../clientmodel.cpp" line="+90"/> <source>Network Alert</source> <translation>Alerta da Rede</translation> </message> </context> <context> <name>CoinControlDialog</name> <message> <location filename="../forms/coincontroldialog.ui" line="+14"/> <source>Coin Control</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>Quantity:</source> <translation>Quantidade:</translation> </message> <message> <location line="+32"/> <source>Bytes:</source> <translation>Bytes:</translation> </message> <message> <location line="+48"/> <source>Amount:</source> <translation>Quantia:</translation> </message> <message> <location line="+32"/> <source>Priority:</source> <translation>Prioridade:</translation> </message> <message> <location line="+48"/> <source>Fee:</source> <translation>Taxa:</translation> </message> <message> <location line="+35"/> <source>Low Output:</source> <translation>Saída Baixa:</translation> </message> <message> <location filename="../coincontroldialog.cpp" line="+551"/> <source>no</source> <translation>não</translation> </message> <message> <location filename="../forms/coincontroldialog.ui" line="+51"/> <source>After Fee:</source> <translation>Depois de taxas:</translation> </message> <message> <location line="+35"/> <source>Change:</source> <translation>Troco:</translation> </message> <message> <location line="+69"/> <source>(un)select all</source> <translation>(des)seleccionar todos</translation> </message> <message> <location line="+13"/> <source>Tree mode</source> <translation>Modo de árvore</translation> </message> <message> <location line="+16"/> <source>List mode</source> <translation>Modo lista</translation> </message> <message> <location line="+45"/> <source>Amount</source> <translation>Quantia</translation> </message> <message> <location line="+5"/> <source>Label</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Address</source> <translation>Endereço</translation> </message> <message> <location line="+5"/> <source>Date</source> <translation>Data</translation> </message> <message> <location line="+5"/> <source>Confirmations</source> <translation>Confirmados</translation> </message> <message> <location line="+3"/> <source>Confirmed</source> <translation>Confirmada</translation> </message> <message> <location line="+5"/> <source>Priority</source> <translation>Prioridade</translation> </message> <message> <location filename="../coincontroldialog.cpp" line="-515"/> <source>Copy address</source> <translation>Copiar endereço</translation> </message> <message> <location line="+1"/> <source>Copy label</source> <translation>Copiar rótulo</translation> </message> <message> <location line="+1"/> <location line="+26"/> <source>Copy amount</source> <translation>Copiar quantia</translation> </message> <message> <location line="-25"/> <source>Copy transaction ID</source> <translation>Copiar ID da Transação</translation> </message> <message> <location line="+24"/> <source>Copy quantity</source> <translation>Copiar quantidade</translation> </message> <message> <location line="+2"/> <source>Copy fee</source> <translation>Taxa de cópia</translation> </message> <message> <location line="+1"/> <source>Copy after fee</source> <translation>Taxa depois de cópia</translation> </message> <message> <location line="+1"/> <source>Copy bytes</source> <translation>Copiar bytes</translation> </message> <message> <location line="+1"/> <source>Copy priority</source> <translation>Prioridade de Cópia</translation> </message> <message> <location line="+1"/> <source>Copy low output</source> <translation>Copiar output baixo</translation> </message> <message> <location line="+1"/> <source>Copy change</source> <translation>Copiar alteração</translation> </message> <message> <location line="+317"/> <source>highest</source> <translation>o maior</translation> </message> <message> <location line="+1"/> <source>high</source> <translation>alto</translation> </message> <message> <location line="+1"/> <source>medium-high</source> <translation>médio-alto</translation> </message> <message> <location line="+1"/> <source>medium</source> <translation>médio</translation> </message> <message> <location line="+4"/> <source>low-medium</source> <translation>baixo-médio</translation> </message> <message> <location line="+1"/> <source>low</source> <translation>baixo</translation> </message> <message> <location line="+1"/> <source>lowest</source> <translation>O mais baixo</translation> </message> <message> <location line="+155"/> <source>DUST</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>yes</source> <translation>sim</translation> </message> <message> <location line="+10"/> <source>This label turns red, if the transaction size is bigger than 10000 bytes. This means a fee of at least %1 per kb is required. Can vary +/- 1 Byte per input.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Transactions with higher priority get more likely into a block. This label turns red, if the priority is smaller than &quot;medium&quot;. This means a fee of at least %1 per kb is required.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>This label turns red, if any recipient receives an amount smaller than %1. This means a fee of at least %2 is required. Amounts below 0.546 times the minimum relay fee are shown as DUST.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>This label turns red, if the change is smaller than %1. This means a fee of at least %2 is required.</source> <translation type="unfinished"/> </message> <message> <location line="+37"/> <location line="+66"/> <source>(no label)</source> <translation>(Sem rótulo)</translation> </message> <message> <location line="-9"/> <source>change from %1 (%2)</source> <translation>Alteração de %1 (%2)</translation> </message> <message> <location line="+1"/> <source>(change)</source> <translation>(Alteração)</translation> </message> </context> <context> <name>EditAddressDialog</name> <message> <location filename="../forms/editaddressdialog.ui" line="+14"/> <source>Edit Address</source> <translation>Editar Endereço</translation> </message> <message> <location line="+11"/> <source>&amp;Label</source> <translation>&amp;Rótulo</translation> </message> <message> <location line="+10"/> <source>The label associated with this address book entry</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>&amp;Address</source> <translation>E&amp;ndereço</translation> </message> <message> <location line="+10"/> <source>The address associated with this address book entry. This can only be modified for sending addresses.</source> <translation type="unfinished"/> </message> <message> <location filename="../editaddressdialog.cpp" line="+20"/> <source>New receiving address</source> <translation>Novo endereço de entrada</translation> </message> <message> <location line="+4"/> <source>New sending address</source> <translation>Novo endereço de saída</translation> </message> <message> <location line="+3"/> <source>Edit receiving address</source> <translation>Editar endereço de entrada</translation> </message> <message> <location line="+4"/> <source>Edit sending address</source> <translation>Editar endereço de saída</translation> </message> <message> <location line="+76"/> <source>The entered address &quot;%1&quot; is already in the address book.</source> <translation>O endereço introduzido &quot;%1&quot; já se encontra no livro de endereços.</translation> </message> <message> <location line="-5"/> <source>The entered address &quot;%1&quot; is not a valid bitcoinlite address.</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Could not unlock wallet.</source> <translation>Impossível desbloquear carteira.</translation> </message> <message> <location line="+5"/> <source>New key generation failed.</source> <translation>Falha ao gerar nova chave.</translation> </message> </context> <context> <name>GUIUtil::HelpMessageBox</name> <message> <location filename="../guiutil.cpp" line="+420"/> <location line="+12"/> <source>bitcoinlite-Qt</source> <translation type="unfinished"/> </message> <message> <location line="-12"/> <source>version</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Usage:</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>command-line options</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>UI options</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Set language, for example &quot;de_DE&quot; (default: system locale)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Start minimized</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show splash screen on startup (default: 1)</source> <translation type="unfinished"/> </message> </context> <context> <name>OptionsDialog</name> <message> <location filename="../forms/optionsdialog.ui" line="+14"/> <source>Options</source> <translation>Opções</translation> </message> <message> <location line="+16"/> <source>&amp;Main</source> <translation>&amp;Principal</translation> </message> <message> <location line="+6"/> <source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. Fee 0.01 recommended.</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>Pay transaction &amp;fee</source> <translation>Pagar &amp;taxa de transação</translation> </message> <message> <location line="+31"/> <source>Reserved amount does not participate in staking and is therefore spendable at any time.</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>Reserve</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>Automatically start bitcoinlite after logging in to the system.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Start bitcoinlite on system login</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Detach block and address databases at shutdown. This means they can be moved to another data directory, but it slows down shutdown. The wallet is always detached.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Detach databases at shutdown</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>&amp;Network</source> <translation>&amp;Rede</translation> </message> <message> <location line="+6"/> <source>Automatically open the bitcoinlite client port on the router. This only works when your router supports UPnP and it is enabled.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Map port using &amp;UPnP</source> <translation>Mapear porta usando &amp;UPnP</translation> </message> <message> <location line="+7"/> <source>Connect to the bitcoinlite network through a SOCKS proxy (e.g. when connecting through Tor).</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Connect through SOCKS proxy:</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>Proxy &amp;IP:</source> <translation>&amp;IP do proxy:</translation> </message> <message> <location line="+19"/> <source>IP address of the proxy (e.g. 127.0.0.1)</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>&amp;Port:</source> <translation>&amp;Porta:</translation> </message> <message> <location line="+19"/> <source>Port of the proxy (e.g. 9050)</source> <translation>Porta do proxy (p.ex. 9050)</translation> </message> <message> <location line="+7"/> <source>SOCKS &amp;Version:</source> <translation>&amp;Versão SOCKS:</translation> </message> <message> <location line="+13"/> <source>SOCKS version of the proxy (e.g. 5)</source> <translation>Versão do proxy SOCKS (p.ex. 5)</translation> </message> <message> <location line="+36"/> <source>&amp;Window</source> <translation>&amp;Janela</translation> </message> <message> <location line="+6"/> <source>Show only a tray icon after minimizing the window.</source> <translation>Apenas mostrar o ícone da bandeja após minimizar a janela.</translation> </message> <message> <location line="+3"/> <source>&amp;Minimize to the tray instead of the taskbar</source> <translation>&amp;Minimizar para a bandeja e não para a barra de ferramentas</translation> </message> <message> <location line="+7"/> <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.</source> <translation>Minimize ao invés de sair da aplicação quando a janela é fechada. Com esta opção selecionada, a aplicação apenas será encerrada quando escolher Sair da aplicação no menú.</translation> </message> <message> <location line="+3"/> <source>M&amp;inimize on close</source> <translation>M&amp;inimizar ao fechar</translation> </message> <message> <location line="+21"/> <source>&amp;Display</source> <translation>Vis&amp;ualização</translation> </message> <message> <location line="+8"/> <source>User Interface &amp;language:</source> <translation>&amp;Linguagem da interface de utilizador:</translation> </message> <message> <location line="+13"/> <source>The user interface language can be set here. This setting will take effect after restarting bitcoinlite.</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>&amp;Unit to show amounts in:</source> <translation>&amp;Unidade a usar em quantias:</translation> </message> <message> <location line="+13"/> <source>Choose the default subdivision unit to show in the interface and when sending coins.</source> <translation>Escolha a subdivisão unitária a ser mostrada por defeito na aplicação e ao enviar moedas.</translation> </message> <message> <location line="+9"/> <source>Whether to show bitcoinlite addresses in the transaction list or not.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Display addresses in transaction list</source> <translation>Mostrar en&amp;dereços na lista de transações</translation> </message> <message> <location line="+7"/> <source>Whether to show coin control features or not.</source> <translation>Escolha para mostrar funcionalidades de controlo &quot;coin&quot; ou não.</translation> </message> <message> <location line="+3"/> <source>Display coin &amp;control features (experts only!)</source> <translation type="unfinished"/> </message> <message> <location line="+71"/> <source>&amp;OK</source> <translation>&amp;OK</translation> </message> <message> <location line="+7"/> <source>&amp;Cancel</source> <translation>&amp;Cancelar</translation> </message> <message> <location line="+10"/> <source>&amp;Apply</source> <translation type="unfinished"/> </message> <message> <location filename="../optionsdialog.cpp" line="+55"/> <source>default</source> <translation>padrão</translation> </message> <message> <location line="+149"/> <location line="+9"/> <source>Warning</source> <translation type="unfinished"/> </message> <message> <location line="-9"/> <location line="+9"/> <source>This setting will take effect after restarting bitcoinlite.</source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>The supplied proxy address is invalid.</source> <translation>O endereço de proxy introduzido é inválido. </translation> </message> </context> <context> <name>OverviewPage</name> <message> <location filename="../forms/overviewpage.ui" line="+14"/> <source>Form</source> <translation>Formulário</translation> </message> <message> <location line="+33"/> <location line="+231"/> <source>The displayed information may be out of date. Your wallet automatically synchronizes with the bitcoinlite network after a connection is established, but this process has not completed yet.</source> <translation type="unfinished"/> </message> <message> <location line="-160"/> <source>Stake:</source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>Unconfirmed:</source> <translation type="unfinished"/> </message> <message> <location line="-107"/> <source>Wallet</source> <translation>Carteira</translation> </message> <message> <location line="+49"/> <source>Spendable:</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Your current spendable balance</source> <translation>O seu saldo disponível para gastar</translation> </message> <message> <location line="+71"/> <source>Immature:</source> <translation>Imaturo:</translation> </message> <message> <location line="+13"/> <source>Mined balance that has not yet matured</source> <translation>O saldo minado ainda não maturou</translation> </message> <message> <location line="+20"/> <source>Total:</source> <translation>Total:</translation> </message> <message> <location line="+16"/> <source>Your current total balance</source> <translation>O seu saldo total actual</translation> </message> <message> <location line="+46"/> <source>&lt;b&gt;Recent transactions&lt;/b&gt;</source> <translation>&lt;b&gt;Transações recentes&lt;/b&gt;</translation> </message> <message> <location line="-108"/> <source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source> <translation type="unfinished"/> </message> <message> <location line="-29"/> <source>Total of coins that was staked, and do not yet count toward the current balance</source> <translation type="unfinished"/> </message> <message> <location filename="../overviewpage.cpp" line="+113"/> <location line="+1"/> <source>out of sync</source> <translation>fora de sincronia</translation> </message> </context> <context> <name>QRCodeDialog</name> <message> <location filename="../forms/qrcodedialog.ui" line="+14"/> <source>QR Code Dialog</source> <translation type="unfinished"/> </message> <message> <location line="+59"/> <source>Request Payment</source> <translation type="unfinished"/> </message> <message> <location line="+56"/> <source>Amount:</source> <translation type="unfinished"/> </message> <message> <location line="-44"/> <source>Label:</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>Message:</source> <translation type="unfinished"/> </message> <message> <location line="+71"/> <source>&amp;Save As...</source> <translation type="unfinished"/> </message> <message> <location filename="../qrcodedialog.cpp" line="+62"/> <source>Error encoding URI into QR Code.</source> <translation type="unfinished"/> </message> <message> <location line="+40"/> <source>The entered amount is invalid, please check.</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Resulting URI too long, try to reduce the text for label / message.</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>Save QR Code</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>PNG Images (*.png)</source> <translation type="unfinished"/> </message> </context> <context> <name>RPCConsole</name> <message> <location filename="../forms/rpcconsole.ui" line="+46"/> <source>Client name</source> <translation>Nome do Cliente</translation> </message> <message> <location line="+10"/> <location line="+23"/> <location line="+26"/> <location line="+23"/> <location line="+23"/> <location line="+36"/> <location line="+53"/> <location line="+23"/> <location line="+23"/> <location filename="../rpcconsole.cpp" line="+348"/> <source>N/A</source> <translation>N/D</translation> </message> <message> <location line="-217"/> <source>Client version</source> <translation>Versão do Cliente</translation> </message> <message> <location line="-45"/> <source>&amp;Information</source> <translation>&amp;Informação</translation> </message> <message> <location line="+68"/> <source>Using OpenSSL version</source> <translation>Usando versão OpenSSL</translation> </message> <message> <location line="+49"/> <source>Startup time</source> <translation>Tempo de início</translation> </message> <message> <location line="+29"/> <source>Network</source> <translation>Rede</translation> </message> <message> <location line="+7"/> <source>Number of connections</source> <translation>Número de ligações</translation> </message> <message> <location line="+23"/> <source>On testnet</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Block chain</source> <translation>Cadeia de blocos</translation> </message> <message> <location line="+7"/> <source>Current number of blocks</source> <translation>Número actual de blocos</translation> </message> <message> <location line="+23"/> <source>Estimated total blocks</source> <translation>Total estimado de blocos</translation> </message> <message> <location line="+23"/> <source>Last block time</source> <translation>Tempo do último bloco</translation> </message> <message> <location line="+52"/> <source>&amp;Open</source> <translation>&amp;Abrir</translation> </message> <message> <location line="+16"/> <source>Command-line options</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Show the bitcoinlite-Qt help message to get a list with possible bitcoinlite command-line options.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Show</source> <translation type="unfinished"/> </message> <message> <location line="+24"/> <source>&amp;Console</source> <translation>&amp;Consola</translation> </message> <message> <location line="-260"/> <source>Build date</source> <translation>Data de construção</translation> </message> <message> <location line="-104"/> <source>bitcoinlite - Debug window</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>bitcoinlite Core</source> <translation type="unfinished"/> </message> <message> <location line="+279"/> <source>Debug log file</source> <translation>Ficheiro de registo de depuração</translation> </message> <message> <location line="+7"/> <source>Open the bitcoinlite debug log file from the current data directory. This can take a few seconds for large log files.</source> <translation type="unfinished"/> </message> <message> <location line="+102"/> <source>Clear console</source> <translation>Limpar consola</translation> </message> <message> <location filename="../rpcconsole.cpp" line="-33"/> <source>Welcome to the bitcoinlite RPC console.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Use up and down arrows to navigate history, and &lt;b&gt;Ctrl-L&lt;/b&gt; to clear screen.</source> <translation>Use as setas para cima e para baixo para navegar no histórico e &lt;b&gt;Ctrl-L&lt;/b&gt; para limpar o ecrã.</translation> </message> <message> <location line="+1"/> <source>Type &lt;b&gt;help&lt;/b&gt; for an overview of available commands.</source> <translation>Digite &lt;b&gt;help&lt;/b&gt; para visualizar os comandos disponíveis.</translation> </message> </context> <context> <name>SendCoinsDialog</name> <message> <location filename="../forms/sendcoinsdialog.ui" line="+14"/> <location filename="../sendcoinsdialog.cpp" line="+182"/> <location line="+5"/> <location line="+5"/> <location line="+5"/> <location line="+6"/> <location line="+5"/> <location line="+5"/> <source>Send Coins</source> <translation>Enviar Moedas</translation> </message> <message> <location line="+76"/> <source>Coin Control Features</source> <translation>Funcionalidades de Coin Controlo:</translation> </message> <message> <location line="+20"/> <source>Inputs...</source> <translation>Entradas</translation> </message> <message> <location line="+7"/> <source>automatically selected</source> <translation>Selecção automática</translation> </message> <message> <location line="+19"/> <source>Insufficient funds!</source> <translation>Fundos insuficientes!</translation> </message> <message> <location line="+77"/> <source>Quantity:</source> <translation>Quantidade:</translation> </message> <message> <location line="+22"/> <location line="+35"/> <source>0</source> <translation type="unfinished"/> </message> <message> <location line="-19"/> <source>Bytes:</source> <translation>Bytes:</translation> </message> <message> <location line="+51"/> <source>Amount:</source> <translation>Quantia:</translation> </message> <message> <location line="+22"/> <location line="+86"/> <location line="+86"/> <location line="+32"/> <source>0.00 BC</source> <translation type="unfinished"/> </message> <message> <location line="-191"/> <source>Priority:</source> <translation>Prioridade:</translation> </message> <message> <location line="+19"/> <source>medium</source> <translation type="unfinished"/> </message> <message> <location line="+32"/> <source>Fee:</source> <translation>Taxa:</translation> </message> <message> <location line="+35"/> <source>Low Output:</source> <translation>Output Baixo:</translation> </message> <message> <location line="+19"/> <source>no</source> <translation type="unfinished"/> </message> <message> <location line="+32"/> <source>After Fee:</source> <translation>Depois de taxas:</translation> </message> <message> <location line="+35"/> <source>Change</source> <translation type="unfinished"/> </message> <message> <location line="+50"/> <source>custom change address</source> <translation type="unfinished"/> </message> <message> <location line="+106"/> <source>Send to multiple recipients at once</source> <translation>Enviar para múltiplos destinatários de uma vez</translation> </message> <message> <location line="+3"/> <source>Add &amp;Recipient</source> <translation>Adicionar &amp;Destinatário</translation> </message> <message> <location line="+20"/> <source>Remove all transaction fields</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Clear &amp;All</source> <translation>&amp;Limpar Tudo</translation> </message> <message> <location line="+28"/> <source>Balance:</source> <translation>Saldo:</translation> </message> <message> <location line="+16"/> <source>123.456 BC</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>Confirm the send action</source> <translation>Confirme ação de envio</translation> </message> <message> <location line="+3"/> <source>S&amp;end</source> <translation>&amp;Enviar</translation> </message> <message> <location filename="../sendcoinsdialog.cpp" line="-173"/> <source>Enter a bitcoinlite address (e.g. <API key>)</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>Copy quantity</source> <translation>Copiar quantidade</translation> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation>Copiar quantia</translation> </message> <message> <location line="+1"/> <source>Copy fee</source> <translation>Taxa de cópia</translation> </message> <message> <location line="+1"/> <source>Copy after fee</source> <translation>Taxa depois de cópia</translation> </message> <message> <location line="+1"/> <source>Copy bytes</source> <translation>Copiar bytes</translation> </message> <message> <location line="+1"/> <source>Copy priority</source> <translation>Prioridade de Cópia</translation> </message> <message> <location line="+1"/> <source>Copy low output</source> <translation>Copiar output baixo</translation> </message> <message> <location line="+1"/> <source>Copy change</source> <translation>Copiar alteração</translation> </message> <message> <location line="+86"/> <source>&lt;b&gt;%1&lt;/b&gt; to %2 (%3)</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Confirm send coins</source> <translation>Confirme envio de moedas</translation> </message> <message> <location line="+1"/> <source>Are you sure you want to send %1?</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source> and </source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>The recipient address is not valid, please recheck.</source> <translation>O endereço de destino não é válido, por favor verifique.</translation> </message> <message> <location line="+5"/> <source>The amount to pay must be larger than 0.</source> <translation>A quantia a pagar deverá ser maior que 0.</translation> </message> <message> <location line="+5"/> <source>The amount exceeds your balance.</source> <translation>A quantia excede o seu saldo.</translation> </message> <message> <location line="+5"/> <source>The total exceeds your balance when the %1 transaction fee is included.</source> <translation>O total excede o seu saldo quando a taxa de transação de %1 for incluída.</translation> </message> <message> <location line="+6"/> <source>Duplicate address found, can only send to each address once per send operation.</source> <translation>Endereço duplicado encontrado, apenas poderá enviar uma vez para cada endereço por cada operação de envio.</translation> </message> <message> <location line="+5"/> <source>Error: Transaction creation failed.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation type="unfinished"/> </message> <message> <location line="+251"/> <source>WARNING: Invalid bitcoinlite address</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>(no label)</source> <translation>(Sem rótulo)</translation> </message> <message> <location line="+4"/> <source>WARNING: unknown change address</source> <translation type="unfinished"/> </message> </context> <context> <name>SendCoinsEntry</name> <message> <location filename="../forms/sendcoinsentry.ui" line="+14"/> <source>Form</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>A&amp;mount:</source> <translation>Qu&amp;antia:</translation> </message> <message> <location line="+13"/> <source>Pay &amp;To:</source> <translation>&amp;Pagar A:</translation> </message> <message> <location line="+24"/> <location filename="../sendcoinsentry.cpp" line="+25"/> <source>Enter a label for this address to add it to your address book</source> <translation>Escreva um rótulo para este endereço para o adicionar ao seu livro de endereços</translation> </message> <message> <location line="+9"/> <source>&amp;Label:</source> <translation>Rótu&amp;lo:</translation> </message> <message> <location line="+18"/> <source>The address to send the payment to (e.g. <API key>)</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Choose address from address book</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <location line="+7"/> <source>Paste address from clipboard</source> <translation>Cole endereço da área de transferência</translation> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation>Alt+P</translation> </message> <message> <location line="+7"/> <source>Remove this recipient</source> <translation type="unfinished"/> </message> <message> <location filename="../sendcoinsentry.cpp" line="+1"/> <source>Enter a bitcoinlite address (e.g. <API key>)</source> <translation type="unfinished"/> </message> </context> <context> <name><API key></name> <message> <location filename="../forms/<API key>.ui" line="+14"/> <source>Signatures - Sign / Verify a Message</source> <translation>Assinaturas - Assinar / Verificar uma Mensagem</translation> </message> <message> <location line="+13"/> <location line="+124"/> <source>&amp;Sign Message</source> <translation>A&amp;ssinar Mensagem</translation> </message> <message> <location line="-118"/> <source>You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source> <translation>Pode assinar mensagens com os seus endereços para provar que são seus. Tenha atenção ao assinar mensagens ambíguas, pois ataques de phishing podem tentar enganá-lo, de modo a assinar a sua identidade para os atacantes. Apenas assine declarações completamente detalhadas com as quais concorde.</translation> </message> <message> <location line="+18"/> <source>The address to sign the message with (e.g. <API key>)</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <location line="+203"/> <source>Choose an address from the address book</source> <translation type="unfinished"/> </message> <message> <location line="-193"/> <location line="+203"/> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <location line="-193"/> <source>Paste address from clipboard</source> <translation>Cole endereço da área de transferência</translation> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation>Alt+P</translation> </message> <message> <location line="+12"/> <source>Enter the message you want to sign here</source> <translation>Escreva aqui a mensagem que deseja assinar</translation> </message> <message> <location line="+24"/> <source>Copy the current signature to the system clipboard</source> <translation>Copiar a assinatura actual para a área de transferência</translation> </message> <message> <location line="+21"/> <source>Sign the message to prove you own this bitcoinlite address</source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <source>Reset all sign message fields</source> <translation>Repôr todos os campos de assinatura de mensagem</translation> </message> <message> <location line="+3"/> <location line="+146"/> <source>Clear &amp;All</source> <translation>Limpar &amp;Tudo</translation> </message> <message> <location line="-87"/> <location line="+70"/> <source>&amp;Verify Message</source> <translation>&amp;Verificar Mensagem</translation> </message> <message> <location line="-64"/> <source>Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack.</source> <translation>Introduza o endereço de assinatura, mensagem (assegure-se de copiar quebras de linha, espaços, tabuladores, etc. exactamente) e assinatura abaixo para verificar a mensagem. Tenha atenção para não ler mais na assinatura do que o que estiver na mensagem assinada, para evitar ser enganado por um atacante que se encontre entre si e quem assinou a mensagem.</translation> </message> <message> <location line="+21"/> <source>The address the message was signed with (e.g. <API key>)</source> <translation type="unfinished"/> </message> <message> <location line="+40"/> <source>Verify the message to ensure it was signed with the specified bitcoinlite address</source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <source>Reset all verify message fields</source> <translation>Repôr todos os campos de verificação de mensagem</translation> </message> <message> <location filename="../<API key>.cpp" line="+27"/> <location line="+3"/> <source>Enter a bitcoinlite address (e.g. <API key>)</source> <translation type="unfinished"/> </message> <message> <location line="-2"/> <source>Click &quot;Sign Message&quot; to generate signature</source> <translation>Clique &quot;Assinar mensagem&quot; para gerar a assinatura</translation> </message> <message> <location line="+3"/> <source>Enter bitcoinlite signature</source> <translation type="unfinished"/> </message> <message> <location line="+82"/> <location line="+81"/> <source>The entered address is invalid.</source> <translation>O endereço introduzido é inválido. </translation> </message> <message> <location line="-81"/> <location line="+8"/> <location line="+73"/> <location line="+8"/> <source>Please check the address and try again.</source> <translation>Por favor verifique o endereço e tente de novo.</translation> </message> <message> <location line="-81"/> <location line="+81"/> <source>The entered address does not refer to a key.</source> <translation>O endereço introduzido não refere a chave alguma.</translation> </message> <message> <location line="-73"/> <source>Wallet unlock was cancelled.</source> <translation>O desbloqueio da carteira foi cancelado.</translation> </message> <message> <location line="+8"/> <source>Private key for the entered address is not available.</source> <translation>A chave privada para o endereço introduzido não está disponível.</translation> </message> <message> <location line="+12"/> <source>Message signing failed.</source> <translation>Assinatura de mensagem falhou.</translation> </message> <message> <location line="+5"/> <source>Message signed.</source> <translation>Mensagem assinada.</translation> </message> <message> <location line="+59"/> <source>The signature could not be decoded.</source> <translation>A assinatura não pôde ser descodificada.</translation> </message> <message> <location line="+0"/> <location line="+13"/> <source>Please check the signature and try again.</source> <translation>Por favor verifique a assinatura e tente de novo.</translation> </message> <message> <location line="+0"/> <source>The signature did not match the message digest.</source> <translation>A assinatura não condiz com o conteúdo da mensagem.</translation> </message> <message> <location line="+7"/> <source>Message verification failed.</source> <translation>Verificação da mensagem falhou.</translation> </message> <message> <location line="+5"/> <source>Message verified.</source> <translation>Mensagem verificada.</translation> </message> </context> <context> <name>TransactionDesc</name> <message> <location filename="../transactiondesc.cpp" line="+19"/> <source>Open until %1</source> <translation>Aberto até %1</translation> </message> <message numerus="yes"> <location line="-2"/> <source>Open for %n block(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+8"/> <source>conflicted</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>%1/offline</source> <translation>%1/desligado</translation> </message> <message> <location line="+2"/> <source>%1/unconfirmed</source> <translation>%1/não confirmada</translation> </message> <message> <location line="+2"/> <source>%1 confirmations</source> <translation>%1 confirmações</translation> </message> <message> <location line="+18"/> <source>Status</source> <translation>Estado</translation> </message> <message numerus="yes"> <location line="+7"/> <source>, broadcast through %n node(s)</source> <translation><numerusform>, transmitida através de %n nó</numerusform><numerusform>, transmitida através de %n nós</numerusform></translation> </message> <message> <location line="+4"/> <source>Date</source> <translation>Data</translation> </message> <message> <location line="+7"/> <source>Source</source> <translation>Origem</translation> </message> <message> <location line="+0"/> <source>Generated</source> <translation>Gerado</translation> </message> <message> <location line="+5"/> <location line="+17"/> <source>From</source> <translation>De</translation> </message> <message> <location line="+1"/> <location line="+22"/> <location line="+58"/> <source>To</source> <translation>Para</translation> </message> <message> <location line="-77"/> <location line="+2"/> <source>own address</source> <translation>endereço próprio</translation> </message> <message> <location line="-2"/> <source>label</source> <translation>rótulo</translation> </message> <message> <location line="+37"/> <location line="+12"/> <location line="+45"/> <location line="+17"/> <location line="+30"/> <source>Credit</source> <translation>Crédito</translation> </message> <message numerus="yes"> <location line="-102"/> <source>matures in %n more block(s)</source> <translation><numerusform>matura daqui por %n bloco</numerusform><numerusform>matura daqui por %n blocos</numerusform></translation> </message> <message> <location line="+2"/> <source>not accepted</source> <translation>não aceite</translation> </message> <message> <location line="+44"/> <location line="+8"/> <location line="+15"/> <location line="+30"/> <source>Debit</source> <translation>Débito</translation> </message> <message> <location line="-39"/> <source>Transaction fee</source> <translation>Taxa de transação</translation> </message> <message> <location line="+16"/> <source>Net amount</source> <translation>Valor líquido</translation> </message> <message> <location line="+6"/> <source>Message</source> <translation>Mensagem</translation> </message> <message> <location line="+2"/> <source>Comment</source> <translation>Comentário</translation> </message> <message> <location line="+2"/> <source>Transaction ID</source> <translation>ID da Transação</translation> </message> <message> <location line="+3"/> <source>Generated coins must mature 110 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to &quot;not accepted&quot; and it won&apos;t be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Debug information</source> <translation>Informação de depuração</translation> </message> <message> <location line="+8"/> <source>Transaction</source> <translation>Transação</translation> </message> <message> <location line="+5"/> <source>Inputs</source> <translation>Entradas</translation> </message> <message> <location line="+23"/> <source>Amount</source> <translation>Quantia</translation> </message> <message> <location line="+1"/> <source>true</source> <translation>verdadeiro</translation> </message> <message> <location line="+0"/> <source>false</source> <translation>falso</translation> </message> <message> <location line="-211"/> <source>, has not been successfully broadcast yet</source> <translation>, ainda não foi transmitida com sucesso</translation> </message> <message> <location line="+35"/> <source>unknown</source> <translation>desconhecido</translation> </message> </context> <context> <name><API key></name> <message> <location filename="../forms/<API key>.ui" line="+14"/> <source>Transaction details</source> <translation>Detalhes da transação</translation> </message> <message> <location line="+6"/> <source>This pane shows a detailed description of the transaction</source> <translation>Esta janela mostra uma descrição detalhada da transação</translation> </message> </context> <context> <name><API key></name> <message> <location filename="../<API key>.cpp" line="+226"/> <source>Date</source> <translation>Data</translation> </message> <message> <location line="+0"/> <source>Type</source> <translation>Tipo</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>Endereço</translation> </message> <message> <location line="+0"/> <source>Amount</source> <translation>Quantia</translation> </message> <message> <location line="+60"/> <source>Open until %1</source> <translation>Aberto até %1</translation> </message> <message> <location line="+12"/> <source>Confirmed (%1 confirmations)</source> <translation>Confirmada (%1 confirmações)</translation> </message> <message numerus="yes"> <location line="-15"/> <source>Open for %n more block(s)</source> <translation><numerusform>Aberta por mais %n bloco</numerusform><numerusform>Aberta por mais %n blocos</numerusform></translation> </message> <message> <location line="+6"/> <source>Offline</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Unconfirmed</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Confirming (%1 of %2 recommended confirmations)</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Conflicted</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Immature (%1 confirmations, will be available after %2)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>This block was not received by any other nodes and will probably not be accepted!</source> <translation>Este bloco não foi recebido por outros nós e provavelmente não será aceite pela rede!</translation> </message> <message> <location line="+3"/> <source>Generated but not accepted</source> <translation>Gerado mas não aceite</translation> </message> <message> <location line="+42"/> <source>Received with</source> <translation>Recebido com</translation> </message> <message> <location line="+2"/> <source>Received from</source> <translation>Recebido de</translation> </message> <message> <location line="+3"/> <source>Sent to</source> <translation>Enviado para</translation> </message> <message> <location line="+2"/> <source>Payment to yourself</source> <translation>Pagamento ao próprio</translation> </message> <message> <location line="+2"/> <source>Mined</source> <translation>Minadas</translation> </message> <message> <location line="+38"/> <source>(n/a)</source> <translation>(n/d)</translation> </message> <message> <location line="+190"/> <source>Transaction status. Hover over this field to show number of confirmations.</source> <translation>Estado da transação. Pairar por cima deste campo para mostrar o número de confirmações.</translation> </message> <message> <location line="+2"/> <source>Date and time that the transaction was received.</source> <translation>Data e hora a que esta transação foi recebida.</translation> </message> <message> <location line="+2"/> <source>Type of transaction.</source> <translation>Tipo de transação.</translation> </message> <message> <location line="+2"/> <source>Destination address of transaction.</source> <translation>Endereço de destino da transação.</translation> </message> <message> <location line="+2"/> <source>Amount removed from or added to balance.</source> <translation>Quantia retirada ou adicionada ao saldo.</translation> </message> </context> <context> <name>TransactionView</name> <message> <location filename="../transactionview.cpp" line="+55"/> <location line="+16"/> <source>All</source> <translation>Todas</translation> </message> <message> <location line="-15"/> <source>Today</source> <translation>Hoje</translation> </message> <message> <location line="+1"/> <source>This week</source> <translation>Esta semana</translation> </message> <message> <location line="+1"/> <source>This month</source> <translation>Este mês</translation> </message> <message> <location line="+1"/> <source>Last month</source> <translation>Mês passado</translation> </message> <message> <location line="+1"/> <source>This year</source> <translation>Este ano</translation> </message> <message> <location line="+1"/> <source>Range...</source> <translation>Período...</translation> </message> <message> <location line="+11"/> <source>Received with</source> <translation>Recebida com</translation> </message> <message> <location line="+2"/> <source>Sent to</source> <translation>Enviada para</translation> </message> <message> <location line="+2"/> <source>To yourself</source> <translation>Para si</translation> </message> <message> <location line="+1"/> <source>Mined</source> <translation>Minadas</translation> </message> <message> <location line="+1"/> <source>Other</source> <translation>Outras</translation> </message> <message> <location line="+7"/> <source>Enter address or label to search</source> <translation>Escreva endereço ou rótulo a procurar</translation> </message> <message> <location line="+7"/> <source>Min amount</source> <translation>Quantia mínima</translation> </message> <message> <location line="+34"/> <source>Copy address</source> <translation>Copiar endereço</translation> </message> <message> <location line="+1"/> <source>Copy label</source> <translation>Copiar rótulo</translation> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation>Copiar quantia</translation> </message> <message> <location line="+1"/> <source>Copy transaction ID</source> <translation>Copiar ID da Transação</translation> </message> <message> <location line="+1"/> <source>Edit label</source> <translation>Editar rótulo</translation> </message> <message> <location line="+1"/> <source>Show transaction details</source> <translation>Mostrar detalhes da transação</translation> </message> <message> <location line="+144"/> <source>Export Transaction Data</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>Ficheiro separado por vírgula (*.csv)</translation> </message> <message> <location line="+8"/> <source>Confirmed</source> <translation>Confirmada</translation> </message> <message> <location line="+1"/> <source>Date</source> <translation>Data</translation> </message> <message> <location line="+1"/> <source>Type</source> <translation>Tipo</translation> </message> <message> <location line="+1"/> <source>Label</source> <translation>Rótulo</translation> </message> <message> <location line="+1"/> <source>Address</source> <translation>Endereço</translation> </message> <message> <location line="+1"/> <source>Amount</source> <translation>Quantia</translation> </message> <message> <location line="+1"/> <source>ID</source> <translation>ID</translation> </message> <message> <location line="+4"/> <source>Error exporting</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation type="unfinished"/> </message> <message> <location line="+100"/> <source>Range:</source> <translation>Período:</translation> </message> <message> <location line="+8"/> <source>to</source> <translation>até</translation> </message> </context> <context> <name>WalletModel</name> <message> <location filename="../walletmodel.cpp" line="+206"/> <source>Sending...</source> <translation type="unfinished"/> </message> </context> <context> <name>bitcoin-core</name> <message> <location filename="../bitcoinstrings.cpp" line="+33"/> <source>bitcoinlite version</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Usage:</source> <translation>Utilização:</translation> </message> <message> <location line="+1"/> <source>Send command to -server or bitcoinlited</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>List commands</source> <translation>Listar comandos</translation> </message> <message> <location line="+1"/> <source>Get help for a command</source> <translation>Obter ajuda para um comando</translation> </message> <message> <location line="+2"/> <source>Options:</source> <translation>Opções:</translation> </message> <message> <location line="+2"/> <source>Specify configuration file (default: bitcoinlite.conf)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Specify pid file (default: bitcoinlited.pid)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Specify wallet file (within data directory)</source> <translation>Especifique ficheiro de carteira (dentro da pasta de dados)</translation> </message> <message> <location line="-1"/> <source>Specify data directory</source> <translation>Especificar pasta de dados</translation> </message> <message> <location line="+2"/> <source>Set database cache size in megabytes (default: 25)</source> <translation>Definir o tamanho da cache de base de dados em megabytes (por defeito: 25)</translation> </message> <message> <location line="+1"/> <source>Set database disk log size in megabytes (default: 100)</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Listen for connections on &lt;port&gt; (default: 15714 or testnet: 28756)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Maintain at most &lt;n&gt; connections to peers (default: 125)</source> <translation>Manter no máximo &lt;n&gt; ligações a outros nós da rede (por defeito: 125)</translation> </message> <message> <location line="+3"/> <source>Connect to a node to retrieve peer addresses, and disconnect</source> <translation>Ligar a um nó para recuperar endereços de pares, e desligar</translation> </message> <message> <location line="+1"/> <source>Specify your own public address</source> <translation>Especifique o seu endereço público</translation> </message> <message> <location line="+5"/> <source>Bind to given address. Use [host]:port notation for IPv6</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Stake your coins to support network and gain reward (default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Threshold for disconnecting misbehaving peers (default: 100)</source> <translation>Tolerância para desligar nós mal-formados (por defeito: 100)</translation> </message> <message> <location line="+1"/> <source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source> <translation>Número de segundos a impedir que nós mal-formados se liguem de novo (por defeito: 86400)</translation> </message> <message> <location line="-44"/> <source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source> <translation>Ocorreu um erro ao definir a porta %u do serviço RPC a escutar em IPv4: %s</translation> </message> <message> <location line="+51"/> <source>Detach block and address databases. Increases shutdown time (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+109"/> <source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation type="unfinished"/> </message> <message> <location line="-5"/> <source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds </source> <translation type="unfinished"/> </message> <message> <location line="-87"/> <source>Listen for JSON-RPC connections on &lt;port&gt; (default: 15715 or testnet: 28755)</source> <translation type="unfinished"/> </message> <message> <location line="-11"/> <source>Accept command line and JSON-RPC commands</source> <translation>Aceitar comandos da consola e JSON-RPC</translation> </message> <message> <location line="+101"/> <source>Error: Transaction creation failed </source> <translation type="unfinished"/> </message> <message> <location line="-5"/> <source>Error: Wallet locked, unable to create transaction </source> <translation type="unfinished"/> </message> <message> <location line="-8"/> <source>Importing blockchain data file.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Importing bootstrap blockchain data file.</source> <translation type="unfinished"/> </message> <message> <location line="-88"/> <source>Run in the background as a daemon and accept commands</source> <translation>Correr o processo como um daemon e aceitar comandos</translation> </message> <message> <location line="+1"/> <source>Use the test network</source> <translation>Utilizar a rede de testes - testnet</translation> </message> <message> <location line="-24"/> <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source> <translation>Aceitar ligações externas (padrão: 1 sem -proxy ou -connect)</translation> </message> <message> <location line="-38"/> <source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source> <translation>Ocorreu um erro ao definir a porta %u do serviço RPC a escutar em IPv6, a usar IPv4: %s</translation> </message> <message> <location line="+117"/> <source>Error initializing database environment %s! To recover, BACKUP THAT DIRECTORY, then remove everything from it except for wallet.dat.</source> <translation type="unfinished"/> </message> <message> <location line="-20"/> <source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source> <translation>Atenção: -paytxfee está definida com um valor muito alto! Esta é a taxa que irá pagar se enviar uma transação.</translation> </message> <message> <location line="+61"/> <source>Warning: Please check that your computer&apos;s date and time are correct! If your clock is wrong bitcoinlite will not work properly.</source> <translation type="unfinished"/> </message> <message> <location line="-31"/> <source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source> <translation>Atenção: erro ao ler wallet.dat! Todas as chaves foram lidas correctamente, mas dados de transação ou do livro de endereços podem estar em falta ou incorrectos.</translation> </message> <message> <location line="-18"/> <source>Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.</source> <translation>Atenção: wallet.dat corrupto, dados recuperados! wallet.dat original salvo como wallet.{timestamp}.bak em %s; se o seu saldo ou transações estiverem incorrectos deverá recuperar de uma cópia de segurança.</translation> </message> <message> <location line="-30"/> <source>Attempt to recover private keys from a corrupt wallet.dat</source> <translation>Tentar recuperar chaves privadas de um wallet.dat corrupto</translation> </message> <message> <location line="+4"/> <source>Block creation options:</source> <translation>Opções de criação de bloco:</translation> </message> <message> <location line="-62"/> <source>Connect only to the specified node(s)</source> <translation>Apenas ligar ao(s) nó(s) especificado(s)</translation> </message> <message> <location line="+4"/> <source>Discover own IP address (default: 1 when listening and no -externalip)</source> <translation>Descobrir endereço IP próprio (padrão: 1 ao escutar e sem -externalip)</translation> </message> <message> <location line="+94"/> <source>Failed to listen on any port. Use -listen=0 if you want this.</source> <translation>Falhou a escutar em qualquer porta. Use -listen=0 se quer isto.</translation> </message> <message> <location line="-90"/> <source>Find peers using DNS lookup (default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Sync checkpoints policy (default: strict)</source> <translation type="unfinished"/> </message> <message> <location line="+83"/> <source>Invalid -tor address: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Invalid amount for -reservebalance=&lt;amount&gt;</source> <translation type="unfinished"/> </message> <message> <location line="-82"/> <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: 5000)</source> <translation>Armazenamento intermédio de recepção por ligação, &lt;n&gt;*1000 bytes (por defeito: 5000)</translation> </message> <message> <location line="+1"/> <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: 1000)</source> <translation>Armazenamento intermédio de envio por ligação, &lt;n&gt;*1000 bytes (por defeito: 1000)</translation> </message> <message> <location line="-16"/> <source>Only connect to nodes in network &lt;net&gt; (IPv4, IPv6 or Tor)</source> <translation>Apenas ligar a nós na rede &lt;net&gt; (IPv4, IPv6 ou Tor)</translation> </message> <message> <location line="+28"/> <source>Output extra debugging information. Implies all other -debug* options</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Output extra network debugging information</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Prepend debug output with timestamp</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>SSL options: (see the Bitcoin Wiki for SSL setup instructions)</source> <translation>Opções SSL: (ver a Wiki Bitcoin para instruções de configuração SSL)</translation> </message> <message> <location line="-74"/> <source>Select the version of socks proxy to use (4-5, default: 5)</source> <translation type="unfinished"/> </message> <message> <location line="+41"/> <source>Send trace/debug info to console instead of debug.log file</source> <translation>Enviar informação de rastreio/depuração para a consola e não para o ficheiro debug.log</translation> </message> <message> <location line="+1"/> <source>Send trace/debug info to debugger</source> <translation type="unfinished"/> </message> <message> <location line="+28"/> <source>Set maximum block size in bytes (default: 250000)</source> <translation type="unfinished"/> </message> <message> <location line="-1"/> <source>Set minimum block size in bytes (default: 0)</source> <translation>Definir tamanho minímo de um bloco em bytes (por defeito: 0)</translation> </message> <message> <location line="-29"/> <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source> <translation>Encolher ficheiro debug.log ao iniciar o cliente (por defeito: 1 sem -debug definido)</translation> </message> <message> <location line="-42"/> <source>Specify connection timeout in milliseconds (default: 5000)</source> <translation>Especificar tempo de espera da ligação em millisegundos (por defeito: 5000)</translation> </message> <message> <location line="+109"/> <source>Unable to sign checkpoint, wrong checkpointkey? </source> <translation type="unfinished"/> </message> <message> <location line="-80"/> <source>Use UPnP to map the listening port (default: 0)</source> <translation>Usar UPnP para mapear a porta de escuta (padrão: 0)</translation> </message> <message> <location line="-1"/> <source>Use UPnP to map the listening port (default: 1 when listening)</source> <translation>Usar UPnP para mapear a porta de escuta (padrão: 1 ao escutar)</translation> </message> <message> <location line="-25"/> <source>Use proxy to reach tor hidden services (default: same as -proxy)</source> <translation type="unfinished"/> </message> <message> <location line="+42"/> <source>Username for JSON-RPC connections</source> <translation>Nome de utilizador para ligações JSON-RPC</translation> </message> <message> <location line="+47"/> <source>Verifying database integrity...</source> <translation type="unfinished"/> </message> <message> <location line="+57"/> <source>WARNING: syncronized checkpoint violation detected, but skipped!</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Warning: Disk space is low!</source> <translation type="unfinished"/> </message> <message> <location line="-2"/> <source>Warning: This version is obsolete, upgrade required!</source> <translation>Atenção: Esta versão está obsoleta, é necessário actualizar!</translation> </message> <message> <location line="-48"/> <source>wallet.dat corrupt, salvage failed</source> <translation>wallet.dat corrupta, recuperação falhou</translation> </message> <message> <location line="-54"/> <source>Password for JSON-RPC connections</source> <translation>Palavra-passe para ligações JSON-RPC</translation> </message> <message> <location line="-84"/> <source>%s, you must set a rpcpassword in the configuration file: %s It is recommended you use the following random password: rpcuser=bitcoinliterpc rpcpassword=%s (you do not need to remember this password) The username and password MUST NOT be the same. If the file does not exist, create it with owner-readable-only file permissions. It is also recommended to set alertnotify so you are notified of problems; for example: alertnotify=echo %%s | mail -s &quot;bitcoinlite Alert&quot; admin@foo.com </source> <translation type="unfinished"/> </message> <message> <location line="+51"/> <source>Find peers using internet relay chat (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Sync time with other nodes. Disable if time on your system is precise e.g. syncing with NTP (default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>When creating transactions, ignore inputs with value less than this (default: 0.01)</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Allow JSON-RPC connections from specified IP address</source> <translation>Permitir ligações JSON-RPC do endereço IP especificado</translation> </message> <message> <location line="+1"/> <source>Send commands to node running on &lt;ip&gt; (default: 127.0.0.1)</source> <translation>Enviar comandos para o nó a correr em &lt;ip&gt; (por defeito: 127.0.0.1)</translation> </message> <message> <location line="+1"/> <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source> <translation>Executar comando quando mudar o melhor bloco (no comando, %s é substituído pela hash do bloco)</translation> </message> <message> <location line="+3"/> <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source> <translation>Executar comando quando uma das transações na carteira mudar (no comando, %s é substituído pelo ID da Transação)</translation> </message> <message> <location line="+3"/> <source>Require a confirmations for change (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Enforce transaction scripts to use canonical PUSH operators (default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Upgrade wallet to latest format</source> <translation>Atualize a carteira para o formato mais recente</translation> </message> <message> <location line="+1"/> <source>Set key pool size to &lt;n&gt; (default: 100)</source> <translation>Definir o tamanho da memória de chaves para &lt;n&gt; (por defeito: 100)</translation> </message> <message> <location line="+1"/> <source>Rescan the block chain for missing wallet transactions</source> <translation>Reexaminar a cadeia de blocos para transações em falta na carteira</translation> </message> <message> <location line="+2"/> <source>How many blocks to check at startup (default: 2500, 0 = all)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>How thorough the block verification is (0-6, default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Imports blocks from external blk000?.dat file</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Use OpenSSL (https) for JSON-RPC connections</source> <translation>Usar OpenSSL (https) para ligações JSON-RPC</translation> </message> <message> <location line="+1"/> <source>Server certificate file (default: server.cert)</source> <translation>Ficheiro de certificado do servidor (por defeito: server.cert)</translation> </message> <message> <location line="+1"/> <source>Server private key (default: server.pem)</source> <translation>Chave privada do servidor (por defeito: server.pem)</translation> </message> <message> <location line="+1"/> <source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source> <translation type="unfinished"/> </message> <message> <location line="+53"/> <source>Error: Wallet unlocked for staking only, unable to create transaction.</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>WARNING: Invalid checkpoint found! Displayed transactions may not be correct! You may need to upgrade, or notify developers.</source> <translation type="unfinished"/> </message> <message> <location line="-158"/> <source>This help message</source> <translation>Esta mensagem de ajuda</translation> </message> <message> <location line="+95"/> <source>Wallet %s resides outside data directory %s.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Cannot obtain a lock on data directory %s. bitcoinlite is probably already running.</source> <translation type="unfinished"/> </message> <message> <location line="-98"/> <source>bitcoinlite</source> <translation type="unfinished"/> </message> <message> <location line="+140"/> <source>Unable to bind to %s on this computer (bind returned error %d, %s)</source> <translation>Incapaz de vincular a %s neste computador (vínculo retornou erro %d, %s)</translation> </message> <message> <location line="-130"/> <source>Connect through socks proxy</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Allow DNS lookups for -addnode, -seednode and -connect</source> <translation>Permitir procuras DNS para -addnode, -seednode e -connect</translation> </message> <message> <location line="+122"/> <source>Loading addresses...</source> <translation>Carregar endereços...</translation> </message> <message> <location line="-15"/> <source>Error loading blkindex.dat</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Error loading wallet.dat: Wallet corrupted</source> <translation>Erro ao carregar wallet.dat: Carteira danificada</translation> </message> <message> <location line="+4"/> <source>Error loading wallet.dat: Wallet requires newer version of bitcoinlite</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Wallet needed to be rewritten: restart bitcoinlite to complete</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error loading wallet.dat</source> <translation>Erro ao carregar wallet.dat</translation> </message> <message> <location line="-16"/> <source>Invalid -proxy address: &apos;%s&apos;</source> <translation>Endereço -proxy inválido: &apos;%s&apos;</translation> </message> <message> <location line="-1"/> <source>Unknown network specified in -onlynet: &apos;%s&apos;</source> <translation>Rede desconhecida especificada em -onlynet: &apos;%s&apos;</translation> </message> <message> <location line="-1"/> <source>Unknown -socks proxy version requested: %i</source> <translation>Versão desconhecida de proxy -socks requisitada: %i</translation> </message> <message> <location line="+4"/> <source>Cannot resolve -bind address: &apos;%s&apos;</source> <translation>Não conseguiu resolver endereço -bind: &apos;%s&apos;</translation> </message> <message> <location line="+2"/> <source>Cannot resolve -externalip address: &apos;%s&apos;</source> <translation>Não conseguiu resolver endereço -externalip: &apos;%s&apos;</translation> </message> <message> <location line="-24"/> <source>Invalid amount for -paytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>Quantia inválida para -paytxfee=&lt;amount&gt;: &apos;%s&apos;</translation> </message> <message> <location line="+44"/> <source>Error: could not start node</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Sending...</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Invalid amount</source> <translation>Quantia inválida</translation> </message> <message> <location line="+1"/> <source>Insufficient funds</source> <translation>Fundos insuficientes</translation> </message> <message> <location line="-34"/> <source>Loading block index...</source> <translation>Carregar índice de blocos...</translation> </message> <message> <location line="-103"/> <source>Add a node to connect to and attempt to keep the connection open</source> <translation>Adicione um nó ao qual se ligar e tentar manter a ligação aberta</translation> </message> <message> <location line="+122"/> <source>Unable to bind to %s on this computer. bitcoinlite is probably already running.</source> <translation type="unfinished"/> </message> <message> <location line="-97"/> <source>Fee per KB to add to transactions you send</source> <translation type="unfinished"/> </message> <message> <location line="+55"/> <source>Invalid amount for -mininput=&lt;amount&gt;: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>Loading wallet...</source> <translation>Carregar carteira...</translation> </message> <message> <location line="+8"/> <source>Cannot downgrade wallet</source> <translation>Impossível mudar a carteira para uma versão anterior</translation> </message> <message> <location line="+1"/> <source>Cannot initialize keypool</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Cannot write default address</source> <translation>Impossível escrever endereço por defeito</translation> </message> <message> <location line="+1"/> <source>Rescanning...</source> <translation>Reexaminando...</translation> </message> <message> <location line="+5"/> <source>Done loading</source> <translation>Carregamento completo</translation> </message> <message> <location line="-167"/> <source>To use the %s option</source> <translation>Para usar a opção %s</translation> </message> <message> <location line="+14"/> <source>Error</source> <translation>Erro</translation> </message> <message> <location line="+6"/> <source>You must set rpcpassword=&lt;password&gt; in the configuration file: %s If the file does not exist, create it with owner-readable-only file permissions.</source> <translation>Deverá definir rpcpassword=&lt;password&gt; no ficheiro de configuração: %s Se o ficheiro não existir, crie-o com permissões de leitura apenas para o dono.</translation> </message> </context> </TS>
<?php namespace felpado\tests; use felpado as f; class not_fnTest extends felpadoTestCase { public function testIt() { $constFalse = f\not_fn(function() { return true; }); $constTrue = f\not_fn(function() { return false; }); $invert = f\not_fn(function($bool) { return $bool; }); $nand = f\not_fn(f\operator('&&')); $this->assertEquals(false, $constFalse()); $this->assertEquals(true, $constTrue()); $this->assertEquals(false, $invert(true)); $this->assertEquals(true, $invert(false)); $this->assertEquals(false, $nand(true, true)); $this->assertEquals(true, $nand(true, false)); } }
# Games The repo serves to hold all of the data for the website codingtime.io. The corresponding code for each game can be found in the GameCode repo.
# ethereumjs-icap [![NPM Package](https: [![Build Status](https: [![Coverage Status](https: [![Gitter](https://img.shields.io/gitter/room/ethereum/ethereumjs-lib.svg?style=flat-square)](https://gitter.im/ethereum/ethereumjs-lib) or #ethereumjs on freenode Utilities for handling [ICAP](https://github.com/ethereum/wiki/wiki/ICAP:-<API key>) addresses. It works in Node.js as well as in the browser via `browserify`. When minified for a browser, it should be less than 4K in size. ## API * `fromAddress(address, print, nonstd)` - try encoding an address into an IBAN * `fromAsset(asset, print)` - try encoding an asset description into an IBAN * `toAddress(iban)` - try decoding an IBAN into an address * `toAsset(iban)` - try decoding an IBAN into an asset description * `encode(address/asset)` - encode an address or asset description into an IBAN * `decode(iban)` - decode an IBAN into an address or asset description * `encodeBBAN(address/asset)` - encode an address or asset description into a BBAN * `decodeBBAN(bban)` - decode a BBAN into an address or asset description * `isICAP(iban)` - return true if input is a valid ICAP, otherwise false * `isAddress(iban)` - return true if the input is a valid ICAP with an address, otherwise false * `isAsset(iban)` - return true if the input is a valid ICAP with an asset description, otherwise false All of the above methods will throw exceptions on invalid inputs. The `to*` and `from*` method will also check for the expected inputs and outputs. The `print` parameter above, when set to true, will create an IBAN in the *print format*, which is space delimited groups of four characters: `XE73 38O0 73KY GTWW ZN0F 2WZ0 R8PX 5ZPP ZS` The `address` parameter only supports `0x` prefixed input and will include that in the output. The `nonstd` parameter of `fromAddress`, when set to true, will turn on support for the *basic ICAP format* generating an invalid IBAN, but encoding the entire 160 bits of an Ethereum address. ## Examples js ICAP.fromAsset({ asset: 'ETH', institution: 'XREG', client: 'GAVOFYORK' }) // returns '<API key>' ICAP.fromAddress('<API key>') // returns '<API key>' ICAP.toAsset('<API key>') // returns { // asset: 'ETH', // institution: 'XREG', // client: 'GAVOFYORK' ICAP.toAddress('<API key>') // returns '<API key>' ## *Direct* address generation A *direct address ICAP* is an address less than 155 bits of length and therefore it safely fits into the length restrictions of IBAN (and the checksum method used). That upper limit is `<API key>` or `<API key>`. The following simple bruteforce code can be used to generate such addresses: js const ethUtil = require('ethereumjs-util') function <API key> () { while(true) { var privateKey = crypto.randomBytes(32) // or your favourite other random method if (ethUtil.privateToAddress(privateKey)[0] <= 3) { return privateKey } } } Alternatively [`ethereumjs-wallet`](http://npmjs.com/packages/ethereumjs-wallet) can be used to generate compatible addresses.
#ifndef COLLECTION_H #define COLLECTION_H #include <vector> #include "LuceneSync.h" namespace Lucene { Utility template class to handle collections that can be safely copied and shared template <class TYPE> class Collection : public LuceneSync { public: typedef Collection<TYPE> this_type; typedef boost::shared_ptr<this_type> shared_ptr; typedef std::vector<TYPE> collection_type; typedef typename collection_type::iterator iterator; typedef typename collection_type::const_iterator const_iterator; typedef TYPE value_type; virtual ~Collection() { } protected: boost::shared_ptr<collection_type> container; public: static this_type newInstance(int32_t size = 0) { this_type instance; instance.container = Lucene::newInstance<collection_type>(size); return instance; } template <class ITER> static this_type newInstance(ITER first, ITER last) { this_type instance; instance.container = Lucene::newInstance<collection_type>(first, last); return instance; } void reset() { resize(0); } void resize(int32_t size) { if (size == 0) { container.reset(); } else { container->resize(size); } } int32_t size() const { return (int32_t)container->size(); } bool empty() const { return container->empty(); } void clear() { container->clear(); } iterator begin() { return container->begin(); } iterator end() { return container->end(); } const_iterator begin() const { return container->begin(); } const_iterator end() const { return container->end(); } void add(const TYPE& type) { container->push_back(type); } void add(int32_t pos, const TYPE& type) { container->insert(container->begin() + pos, type); } template <class ITER> void addAll(ITER first, ITER last) { container->insert(container->end(), first, last); } template <class ITER> void insert(ITER pos, const TYPE& type) { container->insert(pos, type); } template <class ITER> ITER remove(ITER pos) { return container->erase(pos); } template <class ITER> ITER remove(ITER first, ITER last) { return container->erase(first, last); } void remove(const TYPE& type) { container->erase(std::remove(container->begin(), container->end(), type), container->end()); } template <class PRED> void remove_if(PRED comp) { container->erase(std::remove_if(container->begin(), container->end(), comp), container->end()); } TYPE removeFirst() { TYPE front = container->front(); container->erase(container->begin()); return front; } TYPE removeLast() { TYPE back = container->back(); container->pop_back(); return back; } iterator find(const TYPE& type) { return std::find(container->begin(), container->end(), type); } template <class PRED> iterator find_if(PRED comp) { return std::find_if(container->begin(), container->end(), comp); } bool contains(const TYPE& type) const { return (std::find(container->begin(), container->end(), type) != container->end()); } template <class PRED> bool contains_if(PRED comp) const { return (std::find_if(container->begin(), container->end(), comp) != container->end()); } bool equals(const this_type& other) const { return equals(other, std::equal_to<TYPE>()); } template <class PRED> bool equals(const this_type& other, PRED comp) const { if (container->size() != other.container->size()) { return false; } return std::equal(container->begin(), container->end(), other.container->begin(), comp); } int32_t hashCode() { return (int32_t)(int64_t)container.get(); } void swap(this_type& other) { container.swap(other->container); } TYPE& operator[] (int32_t pos) { return (*container)[pos]; } const TYPE& operator[] (int32_t pos) const { return (*container)[pos]; } operator bool() const { return container.get() != NULL; } bool operator! () const { return !container; } bool operator== (const this_type& other) { return (container == other.container); } bool operator!= (const this_type& other) { return (container != other.container); } }; template <typename TYPE> Collection<TYPE> newCollection(const TYPE& a1) { Collection<TYPE> result = Collection<TYPE>::newInstance(); result.add(a1); return result; } template <typename TYPE> Collection<TYPE> newCollection(const TYPE& a1, const TYPE& a2) { Collection<TYPE> result = newCollection(a1); result.add(a2); return result; } template <typename TYPE> Collection<TYPE> newCollection(const TYPE& a1, const TYPE& a2, const TYPE& a3) { Collection<TYPE> result = newCollection(a1, a2); result.add(a3); return result; } template <typename TYPE> Collection<TYPE> newCollection(const TYPE& a1, const TYPE& a2, const TYPE& a3, const TYPE& a4) { Collection<TYPE> result = newCollection(a1, a2, a3); result.add(a4); return result; } template <typename TYPE> Collection<TYPE> newCollection(const TYPE& a1, const TYPE& a2, const TYPE& a3, const TYPE& a4, const TYPE& a5) { Collection<TYPE> result = newCollection(a1, a2, a3, a4); result.add(a5); return result; } template <typename TYPE> Collection<TYPE> newCollection(const TYPE& a1, const TYPE& a2, const TYPE& a3, const TYPE& a4, const TYPE& a5, const TYPE& a6) { Collection<TYPE> result = newCollection(a1, a2, a3, a4, a5); result.add(a6); return result; } template <typename TYPE> Collection<TYPE> newCollection(const TYPE& a1, const TYPE& a2, const TYPE& a3, const TYPE& a4, const TYPE& a5, const TYPE& a6, const TYPE& a7) { Collection<TYPE> result = newCollection(a1, a2, a3, a4, a5, a6); result.add(a7); return result; } template <typename TYPE> Collection<TYPE> newCollection(const TYPE& a1, const TYPE& a2, const TYPE& a3, const TYPE& a4, const TYPE& a5, const TYPE& a6, const TYPE& a7, const TYPE& a8) { Collection<TYPE> result = newCollection(a1, a2, a3, a4, a5, a6, a7); result.add(a8); return result; } template <typename TYPE> Collection<TYPE> newCollection(const TYPE& a1, const TYPE& a2, const TYPE& a3, const TYPE& a4, const TYPE& a5, const TYPE& a6, const TYPE& a7, const TYPE& a8, const TYPE& a9) { Collection<TYPE> result = newCollection(a1, a2, a3, a4, a5, a6, a7, a8); result.add(a9); return result; } template <typename TYPE> Collection<TYPE> newCollection(const TYPE& a1, const TYPE& a2, const TYPE& a3, const TYPE& a4, const TYPE& a5, const TYPE& a6, const TYPE& a7, const TYPE& a8, const TYPE& a9, const TYPE& a10) { Collection<TYPE> result = newCollection(a1, a2, a3, a4, a5, a6, a7, a8, a9); result.add(a10); return result; } } #endif
@font-face { font-family: 'layouter'; src: url('../fonts/layouter.eot?42hzee'); src: url('../fonts/layouter.eot?42hzee#iefix') format('embedded-opentype'), url('../fonts/layouter.ttf?42hzee') format('truetype'), url('../fonts/layouter.woff?42hzee') format('woff'), url('../fonts/layouter.svg?42hzee#icomoon') format('svg'); font-weight: normal; font-style: normal; } [class^="icon-"], [class*=" icon-"] { /* use !important to prevent issues with browser extensions that change fonts */ font-family: 'layouter' !important; speak: none; font-size: 1.5em; font-style: normal; font-weight: normal; font-variant: normal; text-transform: none; line-height: 1; vertical-align: middle; -<API key>: antialiased; -<API key>: grayscale; } .layouterRow--outer + .layouter-row--outer { margin-top: 2px; } .layouterRow--inner { background-size: cover; background-repeat: no-repeat; } .<API key> { <API key>: fixed; background-position: center; } .layouterRow--inner.show-grid [class^=col-] { border: 2px dashed #1F5E8E; margin-bottom: -4px; } #id_container_type li { display: inline-block; width: 250px; text-align: center; border: 0; padding-bottom: 15px; user-select: none; } #id_container_type li span { padding-bottom: 7px; display: inline-block; } #id_container_type li.checked { border: 1px solid black; margin-bottom: -1px; margin-right: -1px; margin-left: -1px; margin-top: -1px; } #id_container_type input[type=radio] { display: none; } .quarter:before { content: "\e900"; } .third:before { content: "\e901"; } .half:before { content: "\e903"; } .two-third:before { content: "\e904"; } .three-quarter:before { content: "\e905"; } .full-width:before { content: "\e906"; } .<API key> { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; display: flex; }
<?php namespace Brainwave\Database; use \Pimple\Container; use \Brainwave\Support\Arr; use \Brainwave\Database\Connection\ConnectionFactory; use \Brainwave\Database\Connection\Interfaces\ConnectionInterface; use \Brainwave\Database\Connection\Interfaces\<API key>; /** * DatabaseManager * * @package Narrowspark/Database * @author Daniel Bannert * @since 0.9.2-dev * */ class DatabaseManager implements <API key> { /** * The application instance. * * @var \Pimple\Container */ protected $app; /** * The database connection factory instance. * * @var \Brainwave\Database\Connection\ConnectionFactory */ protected $factory; /** * The active connection instances. * * @var array */ protected $connections = []; /** * The custom connection resolvers. * * @var array */ protected $extensions = []; /** * Create a new database manager instance. * * @param \Pimple\Container $app * @param \Brainwave\Database\Connection\ConnectionFactory $factory * @return void */ public function __construct(Container $app, ConnectionFactory $factory) { $this->app = $app; $this->factory = $factory; } /** * Get a database connection instance. * * @param string $name * @return \Brainwave\Database\Connection\Connection */ public function connection($name = null) { // If we haven't created this connection, we'll create it based on the config // provided in the application. Once we've created the connections we will // set the "fetch mode" for PDO which determines the query return types. if (!isset($this->connections[$name])) { $connection = $this->makeConnection($name); $this->connections[$name] = $this->prepare($connection); } return $this->connections[$name]; } /** * Disconnect from the given database and remove from local cache. * * @param string $name * @return void */ public function purge($name = null) { $this->disconnect($name); unset($this->connections[$name]); } /** * Disconnect from the given database. * * @param string $name * @return void */ public function disconnect($name = null) { if (isset($this->connections[$name = $name ?: $this-><API key>()])) { $this->connections[$name]->disconnect(); } } /** * Reconnect to the given database. * * @param string $name * @return \Brainwave\Database\Connection\Connection */ public function reconnect($name = null) { $this->disconnect($name = $name ?: $this-><API key>()); if (!isset($this->connections[$name])) { return $this->connection($name); } else { return $this-><API key>($name); } } /** * Refresh the PDO connections on a given connection. * * @param string $name * @return \Brainwave\Database\Connection\Connection */ protected function <API key>($name) { $fresh = $this->makeConnection($name); return $this->connections[$name]->setPdo($fresh->getPdo()); } /** * Make the database connection instance. * * @param string $name * @return \Brainwave\Database\Connection\Connection */ protected function makeConnection($name) { $config = $this->getConfig($name); // First we will check by the connection name to see if an extension has been // registered specifically for that connection. If it has we will call the // Closure and pass it the config allowing it to resolve the connection. if (isset($this->extensions[$name])) { return call_user_func($this->extensions[$name], $config, $name); } $driver = $config['driver']; // Next we will check to see if an extension has been registered for a driver // and will call the Closure if so, which allows us to have a more generic // resolver for the drivers themselves which applies to all connections. if (isset($this->extensions[$driver])) { return call_user_func($this->extensions[$driver], $config, $name); } return $this->factory->make($config, $name); } /** * Prepare the database connection instance. * * @param \Brainwave\Database\Connection\Interfaces\ConnectionInterface $connection * @return \Brainwave\Database\Connection\Connection */ protected function prepare(ConnectionInterface $connection) { $connection->setFetchMode($this->app['settings']['database::fetch']); // The database connection can also utilize a cache manager instance when cache // functionality is used on queries, which provides an expressive interface // to caching both fluent queries and Eloquent queries that are executed. $app = $this->app; $connection->setCacheManager(function () use ($app) { return $app['cache']; }); // Here we'll set a reconnector callback. This reconnector can be any callable // so we will set a Closure to reconnect from this manager with the name of // the connection, which will allow us to reconnect from the connections. $connection->setReconnector(function (ConnectionInterface $connection) { $this->reconnect($connection->getName()); }); return $connection; } /** * Get the configuration for a connection. * * @param string $name * @return array * * @throws \<API key> */ protected function getConfig($name) { $name = $name ?: $this-><API key>(); // To get the database connection configuration, we will just pull each of the // connection configurations and get the configurations for the given name. // If the configuration doesn't exist, we'll throw an exception and bail. $connections = $this->app['settings']['database::connections']; if (is_null($config = Arr::arrayGet($connections, $name))) { throw new \<API key>("Database [$name] not configured."); } return $config; } /** * Get the default connection name. * * @return string */ public function <API key>() { return $this->app['settings']['database::default']; } /** * Set the default connection name. * * @param string $name * @return void */ public function <API key>($name) { $this->app['settings']['database::default'] = $name; } /** * Register an extension connection resolver. * * @param string $name * @param callable $resolver * @return void */ public function extend($name, callable $resolver) { $this->extensions[$name] = $resolver; } /** * Return all of the created connections. * * @return array */ public function getConnections() { return $this->connections; } /** * Dynamically pass methods to the default connection. * * @param string $method * @param array $parameters * @return mixed */ public function __call($method, $parameters) { return <API key>(array($this->connection(), $method), $parameters); } }
# Acknowledgement This package is from [crypt](https://github.com/xordataexchange/crypt) [MIT license](https: