Posts

php - Howto Know difference - clicked Link vs email preview - for 1 time use URL's? -

i'm using email text gateway url stops further email texts. when text arrives on phone, provider preview attempt on url - triggers application stop sending future texts. is there way tell difference - way of env variables (php) running because clicked on link , not cellular provider doing preview attempt? i'm using apache web server, php server side. previously i've used ip check see if "barracuda" remote address , ignore - has not been successful - added new ip address blocks. seemed cellular provider using barracuda email->text gateway email services. wondering if has better suggestion keep searching logs new ip blocks add application. the log entries are: first hits base domain name, hits base url, full url itself. 64.74.215.166 - - [24/jul/2017:19:02:47 -0600] "get / http/1.1" 200 882 "-" "mozilla/5.0 (windows nt 6.1) applewebkit/537.36 (khtml, gecko) chrome/56.0.2924.76 safari/537.36" 64.74.215.176 -...

xcode - How to change iOS in app purchase when changing to lifetime membership instead of subscription? -

our app allows users either have 1 month subscription, or lifetime subscription. 1 month auto-renew subscription, lifetime 1 time purchase. our issue arises when user has 1 month subscription, , wants change lifetime subscription, aren't sure how cancel user's monthly subscription them, or if possible.

multithreading - php exec() haphazardly working in pthreads -

i use loop exec() file 300 times in pthreads. full 300 exec() calls successful, times few of exec() fail , between 295 or 299 successful executes of file. the error code exec() comes @ #127, checked file_exists on failures , says "file exists", says "file not executable" on failures. strange because executable other 295 times within loop. my pthread version 2 months old. confident don't have pthread workers sharing files or writing same spots. scratching head else can do. class workerthreads extends thread { private $workerid; public function __construct($id) { $this->workerid = $id; } public function run() { $mainfile="/pastlotto_1/".$this->workerid."/preset_pthread.php"; for($x=0; $x<100; $x++) { for($o=0; $o<3; $o++) { $command="php $mainfile"; $finde=exec($command,$output,$return_var); if($return_var !== 0){ echo " fil...

Spring Controller Mapping Issues - Double Wildcard -

i map following url: /resource/{path/to/git/repo.git}/{branch}/{path/within/repository} to spring framework controller. having issues. have tried following pattern no success: /resource/**.git/{branch}/** matches resource/anything.git/branch/path/etc (no slashes in path git repo) does not match resource/path/anything.git/branch/path/etc expect i have tried /resource/**/.git/{branch}/** in testing behaves expected, allowing number of slashes in both ant pattern wildcards, not suit situation added slash. is there way map without resorting /resource/** , doing work of matching in controller? i ended fixing using mapping: /resource/**/*.git/{branch}/** a side effect of example given in original post working

matlab - Subplot with decomposed morphological structuring element -

Image
i using matlab 2014b, function strel behaves in different way respect newer versions [1] . in case, generating disk shaped structuring element approximation of 8 (in reality 10) linear structuring elements. i visualize these linear structuring elements , example in subplot. unfortunately, after these years using matlab, still have many problems understanding how obtain want plot. in case able visualize them "comparable" scale, 1 can notice differences in size , orientation. (note: using imcomplement black lines on white background, instead of opposite, printing reasons.) the minimal code this: se = strel('disk', 300, 8); seq = getsequence(se); k = 1:length(seq) subplot(5,2,k); imshow(imcomplement(seq(k).getnhood)); axis equal end as can see, results in suboptimal subplot: so summarize, question is: is possible obtain visualization (either subplot, or 10 different plots) where strels have same scale , , visible enough reader can idea of...

python - Write from Text files to CSV Files -

i trying write rows contain string: bunch of text files. code: import os import glob import csv import re #defining keyword keyword = '2012-07-02' #code merge relevant log files 1 file , insert open('combined-01022012.txt' , 'w', newline = '') combined_file: csv_output = csv.writer(combined_file) filename in glob.glob('fao_agg_2012_part_*.txt'): open(filename, 'rt', newline = '') f_input: #with gzip.open((filename.split('.')[0]) + '.gz', 'rt', newline='') f_input: csv_input = csv.reader(f_input) row in csv_input: row.insert(0, os.path.basename(filename)) try: if keyword in row[2]: csv_output.writerow(row) #row.insert(0, os.path.basename(filename)) #csv_output.writerow(row) except: continue ...

algorithm - Time complexity pseudo code -

i want calculate time complexity of following code : for(i=0;i<n;i++){ func(); . // other o(1) operations . } where func() has complexity of o(k). the time complexity o(k*n) then.