Posts

Showing posts from August, 2014

Is it necessary to declare null variables manually in php? -

i aware php considers undefined variables null. despite this, when want use 1 undefined variable throws e_notice error saying variable undefined. prevent this, should fix e_notice setting variables manually null? for example: class myclass{ private $var1; private $var2; public function __construct($settings){ $allowedkeys = array("var1","var2"); foreach($allowedkeys $key => $value){ if(!isset($settings[$value])){ $settings[$value] = null; } } $this->var1 = $settings['var1']; $this->var2 = $settings['var2']; } } you have 4 options prevent e_notice: one set variable either null, string, integer before use variable. i.e.: $variable = null; $variable = ''; $variable = 0; $variable = []; ... if(empty($variable)) { // situation } the other check if variable exists. did in 1 line: if(isset($variable)){ ... } third 1 turn off e_notice in scipt: error_reporting(e_all & ~e_notic

How do you modify excessive user input in Ruby? -

i know seems quite personal, have question modifying user input. so want create "code-language" decoder, parts of correction isn't corrected correctly. think might because there many gsubs. an example of have: puts "hello world:" user_input = gets.chomp user_input.downcase! if user_input.include? "a" user_input.gsub!(/a/, "b") user_input.include? "b" user_input.gsub!(/b/, "c") user_input.include? "c" user_input.gsub!(/c/, "d") user_input.include? "d" user_input.gsub!(/d/, "e") user_input.include? "e" user_input.gsub!(/e/, "f") user_input.include? "f" user_input.gsub!(/f/, "g") user_input.include? "g" user_input.gsub!(/g/, "h") user_input.include? "h" user_input.gsub!(/h/, "i") user_input.include? "i" user_input.gsub!(/i/, "j") user_input.include?

swift - In Quickblox is it possible to update the user password without reset? -

i attempting change user's password following code: let updateparameters = qbupdateuserparameters() updateparameters.password = newpasswordfield.text qbrequest.updatecurrentuser(updateparameters, successblock: { (response: qbresponse, user: qbuuser?) -> void in print("success") }, errorblock: { (response: qbresponse) -> void in print("error") }) upon debugging, receive 422 client error. assuming because qbupdateuserparameters has restriction on updating passwords. i ran couple of answers change password old qbuusers class recent updates seemed have removed use of class. can point me in right direction? you need provide old password: updateparameters.oldpassword = ...

ios - Retrieving specific Firebase data that is stored in a childByAutoId() Reference (Swift) -

this problem may difficult explain. here json generated firebase: { "users" : { "2w1sse5kizarfq5k8ukjp87d8rk2" : { "plainnote" : { "-kizyvagzqcztsi1l4qi" : { "note" : "finally works", "title" : "whats up" }, "-kizy_m3fmw0m8mgx4am" : { "note" : "aye", "title" : "db" }, "-kizpaesa7-wscojfhvv" : { "note" : "this wont work reason", "title" : "helloo" } }, "email" : "jacobsiegel@gmail.com" }, "xtjy66z8xewteilx6e0moo1jeaz2" : { "email" : "123@gmail.com" }, "rfzv1sauf3rtpu7ycqj0vyaogmd2" : { "plainnote" : { "-kizpfbfhcepu3e8hpeu" : { "note" : &q

python - Can't to get data from flask restful api. Angularjs -

i have simple restful api on flask. #!flask/bin/python flask import flask, jsonify, response app = flask(__name__) @app.route('/todo/api/v1.0/notes', methods=['get']) def get_tasks(): return jsonify({'key': 'value'}) if __name__ == '__main__': app.run(debug=true) and have angularjs controller this: var app = angular.module('notesapp',['angular-markdown-editable']); app.controller('notescontroller',function($scope, $http, $window){ $http({ method: 'get', url: "http://127.0.0.1:5000/hello" }).then(function successcallback(response) { $window.alert(":)"); }, function errorcallback(response) { $window.alert(":("); }); }); problem: not receive objects (errorcallback executes). when try: curl -i http://127.0.0.1:5000/hello i have result:` http/1.0 200 ok content-type: text/html; charset=utf-8 content-length: 5

javascript - Why does `ng-repeat` on filtered dictionary cause `10 $digest() iterations reached` error? -

consider following plunker here html <div ng-repeat="(id, testoject) in filterlist()"> <div ng-if="testoject['state']"> {{testobject}} </div> </div> here relevant js $scope.test = { '1': {'state': true, 'label': '1'} } $scope.filterlist = function() { var map = {}; (var key in $scope.test){ if($scope.test[key]['state']) { map[key] = { 'state': $scope.test[key]['state'], 'label': $scope.test[key]['label'] } } } return map; }; the above code causes 10 $digest() iterations reached error. however if modify code bit. $scope.filterlist = function() { var map = {}; (var key in $scope.test){ if($scope.test[key]['state']) { map[key] = true } } return map; }; the error doesn't occur it seems ch

bash - while looking for matching line 27: syntax error: unexpected end of file -

i trying create multiply table using loop don't know how initialize variables , if read variable needs same in loop syntax: #!/bin/bash #multiplication table #$#=parameter given script #$i=variable in loop #$1=variable represents valid number not 0 #$0=variable represents bash script name echo "enter number want multiply" read varnumber echo "this number: $varnumber has multiplication result: if [ $varnumber -eq 0 ] echo "error - number missing command line argument" echo "syntax : $0 number" echo "use print multiplication table given number" exit 1 fi n=$varnumber in 1 2 3 4 5 6 7 8 9 10 echo "$varnumber * $i = `expr $i \* $varnumber`" a loop should end done, : for in 1 2 3 4 5 6 7 8 9 10 echo "$varnumber * $i = `expr $i \* $varnumber`" done #line added also there no harm in doing : n="$varnumber" and note backticks (` `) not preferred in bash. use command $() format instead thi

Extract characters out of string in php -

lets string motive s01e13 hdtv x264 evolve eztv need find out episode in string. season 1 episode 13. need extract 13 out of string. i'm newer php . so, lets say: $title = 'motive s01e13 hdtv x264 evolve eztv'; i need find 'e' , see if next 2 characters numerical values. assume... ahead of time! i think you're looking for: $title = 'motive s01e13 hdtv x264 evolve eztv'; preg_match('/s\d\de(\d\d)/i', $title, $matches); echo $matches[1]; // 13 this output 13 , you're looking for. work on formatted string, , output episode number (as long format s00e00 followed). case insensitive, if care that.

Google Maps API Search Box: Using exact lats and longs -

i'm trying google map in browser go exact decimal-degree locations typing them search box. i've set search box per api docs except removed biasing toward current location. these seems work reasonably if 'place' near coordinates want, doesn't if there nothing there. users typically searching rural locations there 'nothing there', want go there anyway (e.g., searching 0, 0 should take me sea off west africa). know can use 0n, 0e - of users want use +/- not cardinal compass points (i.e. -90 +90 , -180 +180, not n, s, e, w). ideally, don't want separate control - search box integrated , want. is there way force search box go coordinates regardless? (assuming +ve n , e, -ve s , w) (bonus points if there way allow accept utm locations google earth :) ) edit: the code per api docs here: https://developers.google.com/maps/documentation/javascript/examples/places-searchbox with section removed: // bias searchbox results towards current map&#

php - Error in redirection of user after REGISTRATION_SUCCESS event in FOSUserBundle -

Image
i trying redirect user form before user confirmation email. after submit of register form want redirect user form fill can assign roles user. after submission of form user should confirmation email. after confirmation user login automatically. full code user management fub registrationsuccesslistener.php namespace usr\userbundle\eventlistener; use fos\userbundle\fosuserevents; use fos\userbundle\event\getresponseuserevent; use symfony\component\eventdispatcher\eventsubscriberinterface; use symfony\component\httpfoundation\redirectresponse; use symfony\component\routing\generator\urlgeneratorinterface; class registrationsuccesslistener implements eventsubscriberinterface { private $router; public function __construct(urlgeneratorinterface $router) { $this->router = $router; } /** * {@inheritdoc} */ public static function getsubscribedevents() { return array( fosuserevents::registration_success => 'onregistrationsuccess' ); } public fun

php - Symfony2 get root directory path from command class -

what way root directory path command class in symfony 2 ? note : not controller class creating cli command. or there a way define path in config file , access in anywhere ? by extending containerawarecommand can access root directory path using: $this->getcontainer()->get('kernel')->getrootdir() see http://symfony.com/doc/current/cookbook/console/console_command.html#getting-services-from-the-service-container

swift - Returning an array of objects from a function -

i'm new swift. i have following classes used map json response. class basketballteamresponse: mappable { var name: string? var alias: string? var market: string? var founded: int? var players: [players]? required init?(_ map: map){ } func mapping(map: map) { name <- map["name"] alias <- map["alias"] market <- map["market"] founded <- map["founded"] players <- map["players"] } } class players: mappable { var full_name: string? var jersey_number: string? var position: string? init(full_name: string, jersey_number: string, position: string) { self.full_name = full_name self.jersey_number = jersey_number self.position = position } required init?(_ map: map) { } func mapping (map: map) { full_name <- map["full_name"] jersey_number <- map["jersey_numb

android - How to keep GoogleAPIClient always connected -

i using googleapiclient read location information. want connected. how ensure connected. 1 way reconnect whenever connection failure callbacks invoked. what use-case @ below callbacks triggered? 1.onconnectionfailedlistener -> onconnectionfailed 2. connectioncallbacks -> onconnectionsuspended i tried force stopping google play services did not callback [onconnectionsuspended] will there issue (battery, performance) if googleapiclient connected? from official documentation can find following: // create instance of googleapiclient. if (mgoogleapiclient == null) { mgoogleapiclient = new googleapiclient.builder(this) .addconnectioncallbacks(mconnectioncallbacks) .addonconnectionfailedlistener(mconnectionfailedcallbacks) .addapi(locationservices.api) .build(); } //you need specify callbacks. //of course, need connected: protected void onstart() { mgoogleapiclient.connect(); super.onstart(); } //disconnect prote

How can I split name in SQL -

i have column in table 1000 names. want make new column splitting name in new format: example: santosh kumar yadav it should be: santosh k yadav middle name initials , rest name should same. how can ? if want replace second name initial. here's idea mysql database. assuming name of names column name & new column want put data formatted_name . try this. update users set formatted_name = replace( name, substring_index(substring_index(name, ' ', 2), ' ', -1), left(substring_index(substring_index(name, ' ', 2), ' ', -1), 1) ); here's demo http://sqlfiddle.com/#!9/4e5f95

c# - Sort linq query result, when it has "First() and into Group" -

var qrylatestinterview = rows in dt.asenumerable() group rows new { positionid = rows["msbf_acc_cd"], candidateid = rows["msbf_fac_tp"] } grp select grp.first(); i want sort above results using msbf_fac_dt datetime column, so did following changes var qrylatestinterview = rows in dt.asenumerable() orderby rows["msbf_fac_dt"] ascending group rows new { positionid = rows["msbf_acc_cd"], candidateid = rows["msbf_fac_tp"], facilitydate = rows["msbf_fac_dt"] } grp select grp.first(); but not sort above msbf_fac_dt column

javascript - jQuery clone() issue -

here full html date , time table : <div class="addmore_box_date"> <div class="row"> <div class="col-xs-6 col-sm-4 col-md-4"> <input type='text' name="add_date[]" class="form-control" id="add_date" placeholder="select date"> </div> <div class="col-xs-6 col-sm-4 col-md-4"> <select class="form-control add_time" id="add_time" name="add_time[]"> <option value="">select time</option> <option value="12:00 am">12:00 am</option> <option value="1:00 am">1:00 am</option> <option value="2:00 am">2:00 am</option> <option value="3:00 am">3:00 am</option> <option

c# - Read bytea data is slow in PostgreSQL -

i store data in bytea column in postgresql 9.5 database on windows. the data transmission speed lower expect : 1.5mb per second. the following code using (var conn = connectionprovider.getopened()) using (var comm = new npgsqlcommand("select mycolumn mytable", conn)) using (var dr = comm.executereader()) { var clock = stopwatch.startnew(); while (dr.read()) { var bytes = (byte[])dr[0]; debug.writeline($"bytes={bytes.length}, time={clock.elapsed}"); clock.restart(); } } produces following output bytes=3895534, time=00:00:02.4397086 bytes=4085257, time=00:00:02.7220734 bytes=4333460, time=00:00:02.4462513 bytes=4656500, time=00:00:02.7401579 bytes=5191876, time=00:00:02.7959250 bytes=5159785, time=00:00:02.7693224 bytes=5184718, time=00:00:03.0613514 bytes=720401, time=00:00:00.0227767 bytes=5182772, time=00:00:02.770491

algorithm - Dijkstra's alghoritm second minimum way -

so have next task:find minimum , second minimum way(which can same) value in graph , use dijkstra's alghoritm. first minimum good(just use alghoritm) have problem finding second minimum.tried find way ,based on first minimum way, smallest difference that's isn't working because second minimum way can different first.so ideas on finding second minimum way? assuming store distance in array distance[x] representing distance node x , can switch array matrix . so, every node x you'll have list of values stored in distance[x] . on, use of values compute distances node adjacent x . after finished, can select line destination node , pick second minimum value there.

ios - I want to implement custom navigation bar but status leaves 20 pixels gap.Its not comming on custom navigation bar -

Image
1. completed order custom navigation bar. 2. active order uinavigation bar. 3. want status bar looks active order navigation bar. take uiview of size : screenwidth , 64 height. set background color red. add label title , 2 buttons search , add desired place in view. and put view @ (0,0) position. view's origin should (0,0). update : your constraints should : top,leading,trailing , fixed height top = view.top equalto superview.top constant 0 leading = view.leading equalto superview.leadind constant 0 trailing = superview.trailing equalto view.trailing constant 0 fixed height = view.height equal 64 yo can check size inspector . click constraint , click size inspector . make sure when giving(pin) constraints constraint margin unchecked. check screenshot hope :)

sapui5 - Page should not active when reload -

i new openui5 , developing web application. page should not active when reload page. searching using openui5 not getting idea that. please me anyone. use session storage check whether page reloaded , if reloaded kill it. example assuming want kill page: ostorage = jquery.sap.storage("session"); $(window).load(function() { if(!ostorage.get("is_reloaded")){ ostorage.put("is_reloaded",false); } checknoofvisits(); }); function checknoofvisits(){ if(ostorage.get("is_reloaded")){ window.stop(); } else{ ostorage.put("is_reloaded",true); } }

Getting error while adding custom java component in Mule -

i getting below compile error after adding java component in mule process error xml config <?xml version="1.0" encoding="utf-8"?> <mule xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd"> <http:listener-config name="http_listener_configuration_8082" host="0.0.0.0" port=&qu

Which 3D engine should I use with QT for the best performance -

i working qt development. using qt 3d engine render 3d view pointer cloud, slow, bad performance. can suggest 1 working qt high performance? orge3d or irrlicht or else. thanks i don't think integration of 3rd party 3d engine easier fixing code have. if need drawing point clouds think code gpu standpoint - upload points gpu before drawing? draw in 1 batch? animated or static? can simplify shaders and/or blending settings? etc... if need full blown engine can go written in c++ dmitry said (well, not in c++ that's easier). bear in mind you'll need learn engine-specific api , you'll need many things in specific way. may encounter bugs in chosen engine, you'll need fix or work around. besides of you'll add few mb or more of additional dll's, make project bigger , slower load. if still want have 3rd party engine integrated here few links start from. few ogre: http://www.ogre3d.org/tikiwiki/tiki-index.php?page=integrating+ogre+into+qt5 http://w

How to configure WSO2 DAS server to get realtime stats from WSO2 API Manager? -

i have configured wso2 das server receive statistics wso2 api manager. want see realtime statistics. there way configure it, realtime stats & test? in [1] can find example car file has usecase of showing alert in das backend console has used cep realtime execution engine. may refer , modify requirements apim stats visualization. [1] https://docs.wso2.com/display/das301/analyzing+realtime+service+statistics

javascript - Get Row column text using jquery -

i trying text of input fields of each row , columns on save click button. rows can more one. want texts of rows , respective columns.i don't know how put in loop inputs values of more 1 row. below tried 1 row input value , getting undefined : $('#btnsave').click(function() { $("#tab_logic").find('tr').each(function() { if ($(this).find('input[type="text"]')) { var data1 = $(this).find('td:eq(0):input[type="text"]').val(); alert(data1); } }); }); any appreciated. in advance. loop through each td , check if has text field using length peroperty, $("#tab_logic tr td").each(function() { if ($(this).find('input[type="text"]').length > 0)) { var data1 = $(this).find('input[type="text"]').val(); alert(data1); } }); to values array, use var arr = $("#tab_logic tr td input[type='text']

spring mvc - I can't display my image in my temlate.vm (velocity) -

i'm trying send email template using springmvc. used velocity disay template. problem image in cannot appear in email. , i'm sure src incorrect! here template.vm <html> <body> <h3>hi ${user.login}, welcome chipping sodbury on-the-hill message boards!</h3> <img src="fond-bleu.jpg"> <div> email address <a href="mailto:${user.emailaddress}">${user.emailaddress}</a>. </div> </body> </html> your problem has nothing velocity, , i'm pretty sure url not correct: when displaying image in email, have choose between 3 solutions: hosting image somewhere (then image url http://myserver/... ) linking image email attachment (in case image url cid:{0} ) embedding image in base64 (in case image url data:image/jpeg;base64,... ). there pros , cons each method.

How do you manipulate input arrays in an always block (verilog)? -

i'm new verilog , i'm starting understand how works. want manipulate input module mant[22:0] , in block not sure how go it. module normalize(mant,exp,mant_norm,exp_norm); input [22:0]mant; input [7:0]exp; output [22:0]mant_norm; output [7:0]exp_norm; reg mantreg[22:0]; reg count=0; always@(mant or exp) begin mantreg<=mant; //this gives error if(mant[22]==0) begin mant<={mant[21:0],1'b0};//this gives error count<=count+1; end end endmodule so have shift mant register if bit22 0 , count number of shifts. confused when use reg , when use wire , how manipulation. please let me know how go it. as can see in code assigning vector value (mant) array of 23(mantreg). instead should declare mantreg reg [22:0] mantreg (which vector of 23 bit). wire type variable can not assigned procedurally. used in continues assignment. other way around reg varible can procedura

c# - UWP Win 10 Tinder swipe card inside Pivot? -

firstly here's link minimal version project . trying create tinder swipe card kind of effect inside pivot page. after referring lightstone carousel able create 1 in c# , xaml works inside grid . problem custom control should come inside pivot element. pivot's default manipulation overrides control's swipe manipulation on touch devices. how can bubble down custom control. wasn't able find touch in win 10 app per @romasz answer. other control suggestion similar effect appreciated. xaml <pivot> <pivotitem> <grid background="white"> <grid.rowdefinitions> <rowdefinition height="*"/> <rowdefinition height="3*"/> <rowdefinition height="*"/> </grid.rowdefinitions> <grid grid.row="0" background="lightblue"/>

sql - Postgres: join two queries and select based on result -

there social network each user can repost user's posts. each 10 reposts of posts gift. there 2 tables: gifts , repost_history , see scheme below. question: how write query calculate how many gifts need grand each user in system? ========= = gifts = ========= id // pk user_id // id of user received gift amount // amount of gifts (bonuses), may + or - type // type of gift. type we're interested in 'repost_type' ================== = repost_history = ================== id // pk user_id // id of user did repost owner_id // id of user post reposted query algorithm: 1) find total repost count each user select owner_id, count(owner_id) repost_history group owner_id; 2)find total amount of repost_type gifts each user select user_id, count(amount) gifts type = 'repost_type' group user_id; 3) join 1st , 2nd steps based on owner_id = user_id 4) (user_id, gift_to_grand_count) result set based on 3rd step r

MongoDB ssl .pem file in connection string -

i have mongodb server v 3.2 configured use ssl client connections, custom-generated certificate. can connect server using mongo.exe following format: c:\mongodb\bin>mongo.exe myhost:27017/mydb --sslpemkeyfile c:\etc\ssl\mongodb.pem --ssl --username myuser --password mypassword --sslallowinvalidcertificates is possible write equal mongodb connection string (mongodb://....)? according documentation , there ssl parameter, seems not enough. could try connect mongo.exe parameter below: "mongodb://myuser:mypassword@myhost:27017/mydb?ssl=true&sslallowinvalidcertificates=true&sslpemkeyfile=c:/etc/ssl/mongodb.pem"

javascript - String Search Algorithm Implementation -

i have implemented string search algorithm using naive method count number of times substring occurs in string. did implementation in javascript , python. algorithm (from topcoder): function brute_force(text[], pattern[]) { // let n size of text , m size of // pattern count = 0 for(i = 0; < n; i++) { for(j = 0; j < m && + j < n; j++) if(text[i + j] != pattern[j]) break; // mismatch found, break inner loop if(j == m) // match found count+=1 return count } } javascript implementation: a = "rainbow"; b = "rain"; count = 0; function findsubstr(str, substr){ (i = 0; i<a.length; i++){ //document.write(i, '<br/>'); (j = 0; j < b.length; j++) //document.write('i = ',i, '<br/>'); //document.write(j, '<br/>'); if(a[i + j] != b[j]) break; document.write('j = ', j, '<br/&

node.js - Pass files from Amazon S3 through NodeJS server without exposing S3 URL? -

i trying integrate s3 file storage nodejs application. this tutorial explaining how upload directly s3 good, it's not suitable needs, want files accessible via web app's api. don't want files publicly available @ s3 urls, want them available through example /api/files/<user_id>/<item_id>/<filename> . the reason want downloads go through api can check user permitted view particular file. the reason want uploads go through server know <item_id> assign filename, same mongodb _id property. can't if upload file s3 before item has mongo _id in first place. i've looked couldn't find straightforward tutorial how stream files s3 client , vice versa through nodejs application. thank you a combination of express middleware (to check authorization of user making request) , use of node aws sdk should trick. here full example using multer upload. var express = require('express'); var app = express(); var router

javascript - Angular $uibModal causing Error: [$injector:unpr] -

i trying implement $uibmodal this site but add $uibmodal service controller error: [$injector:unpr] http://errors.angularjs.org/1.4.8/ $injector/unpr?p0=%24uibmodalprovider%20%3c-%20%24uibmodal%20%3c-%20dailymenucontroller angular code below: var app = angular.module('app', ['djangular-confirm','djangular-alert','ui.bootstrap']).config(function($httpprovider,$interpolateprovider) { $httpprovider.defaults.headers.common['x-requested-with'] = 'xmlhttprequest'; $httpprovider.defaults.headers.common['x-csrftoken'] = '{$ csrf_value $}'; $interpolateprovider.startsymbol('{$'); $interpolateprovider.endsymbol('$}'); }); app.controller('dailymenucontroller', function($scope, $http, $location, $djconfirm, $djalert, $uibmodal ) { var modalinstance = $uibmodal.open({ }); }); i ha

node.js - Concurrent request handling in Nodejs -

Image
i have issue of concurrent request, modifies db. what doing is. 1 request fetch data user-1 , calculate data user-1 modified field-1 in record, , save. next request fetch data user-1 , calculate data user-1 modified field-1 in record, , save. both request operates simultaneously. last request update wrong data. function calculate() { var needupdate = false; user = new userlib(user_id); var old_config = user.config; if (old_config[req.id]) { old_config[req.id].value = 0; needupdate = true; } if (req.delete == void(0) || req.delete == false) { delete req.delete; old_config[req.id].value = old_config[req.id].value + 1; needupdate = true; } if (needupdate) { return user.save(); } return true; } we getting both requests @ same time. var express = require('express'); var app = express(); app.get('/update', function(req, res) { res.writehead(200, { 'content-type'

maven - Unable to deploy artifact using encrypted password with LDAP enabled -

Image
we using artifactory version 4.7.0. have configured ldap artifactory , able login successfully. when trying use encrypted password deploying artifacts, it's not working. in artifacts tab, clicked on "set me up" , generated maven settings after entering credentials. downloaded settings.xml file had following content: <?xml version="1.0" encoding="utf-8"?> <settings xsi:schemalocation="http://maven.apache.org/settings/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd" xmlns="http://maven.apache.org/settings/1.1.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance"> <servers> <server> <username>${security.getcurrentusername()}</username> <password>${security.getescapedencryptedpassword()!"*** insert encrypted password here ***"}</password> <id>central</id> </server> <server> <username>$

Two-dimensional interpolation in R, without any extrapolation -

Image
i have 2-dimensional array of data, missing values. there 3 columns: x y intensity i can plot x against y in ggplot2, intensity colour scale. i’d smooth transitions between colours, , have come across idw function, gstat package. idw aims interpolate nas in 2-dimenstions. shouldn’t extrapolate, , whilst technically respect limits of data (±20 in both directions), makes attempt fill gaps @ edge of plot, seen below: i’d avoid extrapolation occurring outside limits of data have, including bottom-right of data shown in first figure. how might achieve this? edit : here example dataset. isn't same dataset shown above, again contains large missing region in lower-right corner. structure(list(x = c(10l, 15l, -10l, 0l, -5l, -10l, -15l, 0l, -15l, 15l, 5l, 10l, -20l, -5l, -15l, -15l, -5l, 5l, 20l, -20l, -15l, 20l, -15l, 5l, -5l, -20l, -5l, 15l, 0l, 0l, 15l, 10l, 0l, 20l, -10l, 5l, 5l, 0l, 20l, 5l, -15l, 5l, -5l, -5l, -15l, -10l, -10l, -10l, -5l, -10l, 15l, 20l

php - Sending email using smtp gmail in phpmailer -

i tried sending email using smtp gmail using phpmailer. gmail account got suspended saying there unusual activity. here code have used sending emails. what's correct way of sending emails using smtp gmail in phpmailer? my question not duplicate. have tried : send email using gmail smtp server php page i'm using phpmailer, , accounts getting suspended. <?php include('phpmailer.php'); class mail extends phpmailer { // set default variables new objects public $from = 'noreply@exmaple.org'; public $fromname = sitetitle; public $host = 'smtp.gmail.com'; public $mailer = 'smtp'; public $smtpauth = true; public $username = 'username@gmail.com'; public $password = 'password'; public $smtpsecure = 'tls'; public $wordwrap = 75; public function subject($subject) { $this->subject = $subject; } public function body($body) { $this-&

php - Codeigniter delete a row -

i'm beginner in codeigniter.i'm trying delete row table.i tried following code.but it's not working. this url i'm passing. <a href="./delete_user/<?= $thisid ?>">delete user</a> this controller (delete_user.php). <?php defined('basepath') or exit('no direct script access allowed'); class delete_user extends ci_controller { public function delete_row($id) { $this->load->model('delete_selecteduser'); $where = array('id' => $id); $this->delete_selecteduser->delete_user('users', $where); } and here model (delete_selecteduser.php). <?php class delete_selecteduser extends ci_model { public function __construct() { $this->load->database(); } public function delete_user($table, $where = array()) { $this->db->where($where); $res = $this->db->delete($table); if ($res) return true; else return

windows - You don’t currently have permission to access this folder. -

Image
i given admin rights on machine on work. unfortuanately when going through directory structure ket geting message box: if hit continue, works. time consuming , may interfering of development efforts. is there way permanent access everything? thanks! uac disable ? if not, i'll suggest : [hkey_local_machine\software\microsoft\windows\currentversion\policies\system] put enablelua 0 (if want reactive uac put 1) others solutions : http://www.petri.co.il/disable-uac-in-windows-7.htm#

python - Asking the user for input until they give a valid response -

i writing program must accept input user. #note: python 2.7 users should use `raw_input`, equivalent of 3.x's `input` age = int(input("please enter age: ")) if age >= 18: print("you able vote in united states!") else: print("you not able vote in united states.") this works expected if user enters sensible data. c:\python\projects> canyouvote.py please enter age: 23 able vote in united states! but if make mistake, crashes: c:\python\projects> canyouvote.py please enter age: dickety 6 traceback (most recent call last): file "canyouvote.py", line 1, in <module> age = int(input("please enter age: ")) valueerror: invalid literal int() base 10: 'dickety six' instead of crashing, try getting input again. this: c:\python\projects> canyouvote.py please enter age: dickety 6 sorry, didn't understand that. please enter age: 26 able vote in united states! how can accomplish this? i