Posts

php - How can I tell if someone is subscribed with a Paypal Subscribe Button? -

so have paypal subscribe button set on test website. it's monthly subscription user have pay gain access profile. can't seem logic right in head. might lack of knowledge paypal classic api's, i've searched has led me dead end. using php , mysql, how keep track of user , make sure subscribed and/or if cancel subscription? may lead me solving this, appreciate it. if need of code, i'll glad add , edit, don't know if code needed question.

Using HTML5/Javascript to generate and save a file -

i've been fiddling webgl lately, , have gotten collada reader working. problem it's pretty slow (collada verbose format), i'm going start converting files easier use format (probably json). thing is, have code parse file in javascript, may use exporter too! problem saving. now, know can parse file, send result server, , have browser request file server download. in reality server has nothing particular process, why involved? have contents of desired file in memory. there way present user download using pure javascript? (i doubt it, might ask...) and clear: not trying access filesystem without users knowledge! user provide file (probably via drag , drop), script transform file in memory, , user prompted download result. of should "safe" activities far browser concerned. [edit]: didn't mention upfront, posters answered "flash" valid enough, part of i'm doing attempt highlight can done pure html5... flash right out in case. (though it...

linux - bash script fails when password contains backtick -

a colleague wrote script acts wrapper executing other scripts remotely. set ask password echo 'ed remote systems use in sudo . relevant code*: read -s pw .... ${ssh_tt} ${host} "echo ${pw} | ${sudo_s} ./${script_name} > ${home}/${host_output}" 2> /dev/null * please ignore upper-case variables. if enter password contains backtick following error: bash: -c: line 0: unexpected eof while looking matching ``' bash: -c: line 1: syntax error: unexpected end of file if change password 1 not contain backtick script runs fine. imagine happen passwords contain single- , double-quotes well. while changing password option not desirable due size of our platform (we don't use centralized authentication). i'm wondering if there way sanitize or otherwise escape backtick isn't interpreted shell either locally or remotely. you can escape password before execute last line. in bash: escaped_pw=`printf "%q" ${pw}` then use escape...

php - How do I create a complex left outer join in Yii2? -

how perform query in yii2? select `keyword`.`id`, `keyword`, `volume`, `cpc`, `competition`, `keyword_id` `keyword` left join `ad_group_keyword` on keyword.id = ad_group_keyword.keyword_id , ad_group_id = 1 ((`keyword_id` null) , (not (`volume` null))) , (not (`cpc` null)) order volume desc limit 1; i tried following , many combinations can't on part right. $kw = keyword::find()->select(['keyword.id', 'keyword', 'volume', 'cpc', 'competition', 'keyword_id'])-> leftjoin('ad_group_keyword', 'keyword.id = ad_group_keyword.keyword_id', ['ad_group_id'=>1])-> andwhere(['keyword_id'=>null])-> andwhere(['not', ['volume' => null]])->andwhere(['not', ['cpc' => null]])-> orderby('volume desc')->asarray()->limit(1)->all(); the above generates sql, missing second condition of on : select keyword ...

angularjs - Mocking API with httpBackend [Protractor] -

i'm developing frontend app rest api. i'm using protractor end-to-end tests api mocked out. able mock authtoken api response , navigate chosen url, page displayed under destined url renders empty. here's code: describe('e2e tests', function() { it('fo tests', function() { browser.addmockmodule('webclientapp', function() { console.log('test'); angular.module('webclientapp', ['ngmocke2e']) .run(function($httpbackend) { console.log('test2'); $httpbackend.whenpost('http://0.0.0.0:9000/api/organizations').respond(200); $httpbackend.whenpost('/api/auth/get_resource_by_token').respond(200); $httpbackend.whenget('/api/auth/current_resource').respond(200); $httpbackend.whenget(/.*/).respond(200); }); }); browser.getregisteredmockmodules(); browser.get('http://0.0.0.0:9000/#/organizations/profile'); browser.pause(); }); }); sadly, protractor console not pr...

How to convert a set of 4 rows to columns in MySQL? -

Image
i have mysql question, , have no idea how resolve it. i have following query: select p.nombre, ti.tallerhorario_id persona p, talleresinscritos ti p.pasaporte = ti.pasaporte at result this: i'm looking make query in second column doesn't show row every "tallerhorario_id", every "nombre". for example: euclides | 7 | 24 | 32 | 48 liz lorena | 4 | 18 | 33 | 47 every person have 4 rows associated, without exceptions. could me please? thank you! the simplest method put values in 1 column, using group_concat() : select p.nombre, group_concat(ti.tallerhorario_id) persona p join -- learn use proper explicit join syntax talleresinscritos ti on p.pasaporte = ti.pasaporte group p.nombre; a comma-delimited list not asked for, might solve problem. if have counter, 1, 2, 3, , 4, second table, can using conditional aggregation: select p.nombre, max(case when counter = 1 ti.tallerhorario_id end) id1, max(...

swift - Change CGSize with a variable -

i want change size of sknode variable can made smaller loop. giving me error: cannot find initializer type 'cgsize' accepts argument list of type '(width:... , height:...)' for (var = 0.9; > 0.0; -= 0.1){ (var k = 1.25; > 0.0; -= 0.1){ self.sun.size = cgsize(width: self.size.width * i, height: self.size.height * k) // error here } } i ran skaction code instead of loop suggested abakersmith , looks lot cleaner. var shrinksun = skaction.scaleby(0.5, duration: 2) self.sun.runaction(shrinksun)