Posts

php - Cannot obtain page access token through an app that is granted the manage_pages permission -

i'm trying develop php application let me make new posts on pages automatically, through cronjob, while offline , not logged facebook @ all. i'm aware offline_access permission has long been gone, removal of offline_access permission article states following: scenario 5: page access tokens when user grants app manage_pages permission, app able obtain page access tokens pages user administers querying [user id]/accounts graph api endpoint. migration enabled, when using short-lived user access token query endpoint, page access tokens obtained short-lived well. exchange short-lived user access token long-lived access token using endpoint , steps explained earlier. using long-lived user access token, querying [user id]/accounts endpoint provide page access tokens not expire pages user manages. apply when querying non-expiring user access token obtained through deprecated offline_access permission. ... made me think automated php solu...

angularjs - How do I pass and then access an object inside a directive template (directive uses isolate scope)? -

i have collection of navbaritems , presenting them this: <a data-role="button" data-iconpos="notext" ng-show="navbaritems['search'].show" ng-click="navbaritems['search'].click()" data-icon="{{navbaritems['search'].icon}}">{{navbaritems['search'].title}}</a> i'm repeating code , changing 'type', i'd create directive template , call this: <navbaritem type="search"></navbaritem> i've tried passing attribute isolated scope can't navbaritems once in directive. as mentioned in comment above, since isolate scope being used/created, other data isolate scope requires need passed directive via additional attributes on same element. in case navbaritems needs specified: <navbaritem type="search" items="navbaritems"></navbaritem> since navbaritems object (not string), = syntax should used in isolate ...

javascript - RegEx to match only numbers incorrectly matching -

i'm trying use regular expression in javascript match number or number containing decimal. regular expression looks [0-9]+ | [0-9]* \. [0-9]+ . however, reason '1a'.match(/^[0-9]+|[0-9]*\.[0-9]+$/) incorrectly finds match. i'm not sure part of expression matching a . the problem alternation. says: ^[0-9]+ # match integer @ start | # or [0-9]*\.[0-9]+$ # match decimal number @ end so first alternative matches. you need group alternation: /^(?:[0-9]+|[0-9]*\.[0-9]+)$/ the ?: optimisation , habit. suppresses capturing not needed in given case. you away without alternation well, though: /^[0-9]*\.?[0-9]+$/ or shorter: /^\d*\.?\d+$/

c - segmentation fault after waking a process -

hey i'm writing simple shell on getting sigstsp pause process , continue on getting more commands. saves suspended process in job list. when try waking suspended process segmentation fault, after (ex)suspended process deals sigcont signal. this signalhandler void signalhandle(int sig) { int i,pid,id; sigset_t mask_set; sigset_t old_set; signal(sigtstp,signalhandle); sigfillset(&mask_set); sigprocmask(sig_setmask,&mask_set,&old_set); //handle sigtstp **if (sig == sigtstp)**{ gpid=getpid(); pid=fork(); if (pid==-1){ perror("(ctrl-z)(signal error)(fork)"); } else if (pid==0){ susp_bg_pid=gpid; i=0; while (getpid(jobslist,i)!=-1){ i=i+1; } id=getid(&jobslist,gpid); if (id==-1){ insertelem(&jobslist, l_fg_cmd, i, gpid, 1); } else{ delpid(&jobslist,gpid); insertelem(&jobslist, l_fg_cmd, id, gpid, 1)...

assembly - Compiling ASM with C and having result "NaN" or "-NaN". Square Root Function -

i had errors compiling earlier after working on them, got no errors/warnings. altho result given nan. here code: c: iclude <stdio.h> extern float wynik1 (int a, int b, int c); extern float wynik2 (int a, int b, int c); int = 2; int b = 2; int c = 2; int main () { float licz1 = 0; float licz2 = 0; licz1 = wynik1(a, b, c); licz2 = wynik2(a, b, c); printf("roots : %f oraz %f \n", licz1, licz2); return 0; } asm1: sysexit = 1 sysread = 3 syswrite = 4 stdout = 1 exit_success = 0 stdin = 0 .align 32 .data a: .int 2 b: .int 2 c: .int 2 buf: .float 0 x1: .float 0 cztery: .float 4 dwa: .float 2 .text .global wynik1 wynik1: xor %eax, %eax xor %ebx, %ebx xor %ecx, %ecx pushl %ebp movl %esp, %ebp movl 8(%ebp), %ecx movl 12(%ebp), %ebx movl 16(%ebp), %eax pushl %eax pushl %ebx pushl %ecx movl %eax, movl %ebx, b movl %ecx, c finit fld fld c deltaa1: fmulp fld cztery fmulp fld b fld b fmulp fsubp pierwiastek1: fsqrt fld b fchs fsubp fstp buf fld fld dwa...

angularjs - Using a child controller from another module -

i've defined module , made main module app using ng-app directive. added 2 controllers main app using angular.module('myapp').controller(). 1 of controllers has page wide scope whereas other controller child controller. what i'm trying include controller belongs module (not main myapp module), can't figure out. not want globally namespace controllers. anyone know how this? here have far: <!doctype html> <html lang="en" data-ng-app='myapp' data-ng-controller='myapp.maincontroller'> <head> <meta charset="utf-8"> <title>untitled</title> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script> $(function() { var app, module; //create 2 modules, 1 of used app base app = angular.module('myapp', []); module = angular.module('othermodule', []); //create main controller m...

image uploading - pictures uploaded from android app to server aren't accessible from the browser (not consistent) -

i developing android app captures pic camera or gallery , uploads server while storing link url path in db. i using phonegap upload pics , see files ( jpg) uploaded server ( free web hosting) . , can view them managing consul of hosting web-server. the strange problem encountering that i cannot access of pics browser typing full path. this not consistent since noticed pics accessible through url path while others not ( pics in gallery taken devises camera) i cannot seem find reason the file names given 4032.jpg ( gallery) or longer 1123156984.jpg if loaded captured picture thought reasone might related digits ocationly said able view pic through browser. as amajoritu not able view pics typing url path . have mention if uploading pics pc ( localhost server) hosting server problem doesn't seem exist. the code using upload 1 taken zachary can 1 have idea seems problem ?

python - Prettytable 0.7.2 HTML Table Not Working -

so, trying prettytable 0.7.2 working html table. can't seem working. using following: from prettytable import from_html html = "<table><tr><th>h1</th></tr><tr><td>v1</td></tr></table>" table = from_html(html) print (table) which results in: [<prettytable.prettytable object @ 0x90556ec>] i can table work using other methods, can't seem tackle html table method. i'm not sure if doing wrong or missing something. if shed light on issue appreciated. the problem is, table isn't prettytable object, a list containing single prettytable object . calling from_html function return list containing 1 prettytable per table tag encountered in html string. you want do: print table[0] which returns: +----+ | h1 | +----+ | v1 | +----+

c# - automapper: skipping/ignoring nested types -

i'm trying create map between domain object , viewmodel support use case feels quite common. fact can't find solution makes me think i'm approaching problem incorrectly. here's psuedo code represents source , destination types: public class domainclass { public nesteddomainclass1 nesteddomainclass1{ get; set; } } public class nesteddomainclass1 { public nesteddomainclass2 nesteddomainclass2 { get; set; } } public class nesteddomainclass2 { public string propertya { get; set; } public string propertyb { get; set; } public string propertyc { get; set; } } public class domainviewmodel { public string propertya { get; set; } public string propertyb { get; set; } public string propertyc { get; set; } } as can see, domainviewmodel maps domainclass.nesteddomainclass1.nesteddomainclass2 . however, reasons aren't entirely relevant, can't create mappi...

php - Trouble importing file with CakePHP -

i'm trying import phpquery 1 of controllers i'm getting errors. saved in vendors folder , plugins folder. i've tried adding following itemscontroller , none have worked include_once(__dir__.'/vendors/phpquery.php'); app::uses('phpquery', 'vendor'); app::import('phpquery', 'vendor'); all of result in either error of not finding method or error: application trying load file phpquery plugin i tried placing in plugins folder , i'm having luck. importing vendor files (especially if not stick regular conventions, one class per file ), requires variants of 'normal' app::import() this section in documentation describes variants: loading vendor files i tested one, , worked without problems; app::import('vendor', 'phpquery'); (loads 'app/vendor/phpquery.php')

error catastrophic failure installshield 2012 -

i using installshield le 2012 visual studio create installable file problem written in vb on .net. while problem requires third party driver installed first. added run custom action during installation "before first dialog". however, every time tried install it, shows "error: catastrophic failure", have no idea means. mean process of installing driver take time? or there resource collision problem between these two? how solve problem? needs help. the os using windows 7 ultimate. you need support third party driver vendor. custom action calling out of process code installshield has no control over. don't know driver vendor, name , version or how calling there's nothing can here. fwiw, installshield , windows installer has support using difx install drivers based on .inf files. isn't supported in crippled installshield limited edition.

facebook - Getting this error after months of no problems - redirect_uri not owned by application -

i had problem when started facebook integration of our site. after doing searching, found solution , fixed it. now, few months later, has stopped working. nothing changed in either javascript code or app settings on facebook developers site. once again set searching, , found same answers before: site url must match redirect_uri etc. i have app domain: "domain.com" , site url: "http://www.domain.com" error given: api error code: 191 api error description: specified url not owned application error message: redirect_uri not owned application. i'm @ loss has happened. has facebook changed api? (i did check documentation, , it's still same). any appreciated. javascript code below: var publish = { method: 'feed', redirect_uri: 'http://www.domain.com', link: 'http://www.domain.com', picture: 'http://pathtoimage/logo.png', name: 'name', caption: 'title', descript...

c# - Multithreading a web scraper? -

i've been thinking making web scraper multithreaded, not normal threads (egthread scrape = new thread(function);) threadpool there can large number of threads. my scraper works using for loop scrape pages. for (int = (int)pagesmin.value; <= (int)pagesmax.value; i++) so how multithread function (that contains loop) threadpool? i've never used threadpools before , examples i've seen have been quite confusing or obscure me. i've modified loop this: int min = (int)pagesmin.value; int max = (int)pagesmax.value; paralleloptions poptions = new paralleloptions(); poptions.maxdegreeofparallelism = properties.settings.default.threads; parallel.for(min, max, poptions, =>{ //scraping }); would work or have got wrong? the problem using pool threads spend of time waiting response web site. , problem using parallel.foreach limits parallelism. i got best performance using asynchronous web requests. used semaphore limit number of concurrent requ...

ruby on rails - how could i flash a message to users before a deploy? -

using capistrano deploys, possible flash message users on when deploy has started, or before know site slow , unresponsive few minutes? you can use capistrano hooks execute rails runner, hook application , globally display message. you need code global message logic application, , accesses via rails runner command @ appropriate hook points within capistrano.

html - Stylizing pages that have PHP -

i'm trying create user registration form sends confirmation email user after sign up, , when host site locally, works fine. however, when host on web (hostgator), following error: warning: session_start() [function.session-start]: cannot send session cache limiter - headers sent i know part has been answered many times before - , yes, have removed text area above php code , error goes away. however, if can't put above this, how can use code on site , still stylize page? want use css style sheet right can't use in or declare doctype without seeing error. i've tried creating stylized html file , using php include function include php code, doesn't work. what can stylize pages , still use php code on same page without errors? also, why code working on local server, not when upload on hostgator? below php code i'm using page that's causing errors. ideas? index.php <!doctype html> <html> <head> <meta charset="u...

.net - How to Join multiline strings from left to right -

Image
i have array 3 entries. first entry of array multiline string: "my dog " second entry too: " dont " and hird entry too: " ... die! " now how can combine multiline strings obtain joined string left right this?: my dog dont that... die! what tried: richtextbox1.text = string.join(myarray(1), myarray(2)) well example more reallistic, need combine multiline strings (which ascii letters) stored in array, when try join obtain string joined down: the code i've used : richtextbox1.text = string.join(" ", characters(70), characters(77), characters(70), characters(76)) this should need. key creating list of lists , splitting on newline character on each item in original array. this should work arbitrary number of strings, each string must have same number of newline characters break on. for example: "yo \ndon't kill \nman!" "dude! \nme bro!...

geolocation - Nokia HERE Map using Google Latitude -

i trying parse , add google latitude kml marker nokia here map. works locally on laptop in ie 9, doesn't add marker in safari 5.7, chrome 27 (locally or on web server). ideas? kml.parsekml("http://latitude.google.com/latitude/apps/badge/api?user=-1099057214648547758&type=kml"); if kml being loaded successful on browsers not others, due browser in question kindly trying prevent cross-scripting domain attack. you have three options host kml file in same domain javascript reading file - e.g. if own example.com , javascript should hosted on example.com , kml hosted on example.com set kml parser retrieve file example.com , use proxy solution such php example retrieve file elsewhere enable cors on server hosting kml file, , load kml using ajax followed parse() method shown in example if kml never loaded successfully, should check see whether file valid , , indeed whether html displaying map syntactically correct.

SQL Server : left join results in fewer rows than in left table -

i using sql server (i believe 2005). i have tablea has 2 columns , 439 rows (each row unique). +----------+ |id | name | +----------+ i have tableb has 35 columns , many hundreds of thousand rows (each row unique). +------------------------------------------------------------------------------+ |date | id | name | blah1 | blah2 | ... | hour1 | hour2 | hour3 | ... | hour24 | +------------------------------------------------------------------------------+ each row in tableb has hourly observations , other house keeping information. testing purposes interested in today's date i.e 4/19/2013. if do: select count(*) tableb date = '4/19/2013 12:00:00 am' i 10526, correct there 10526 distinct locations there hourly observation data each day. i want left join tablea , tableb on a.id = b.id , should produce result has 439 rows. unfortunately, result has 246 rows. how can be? isn't left join suppose return rows in tablea regardless of whether there m...

Screen transition effects android -

i trying left right swipe transition of button click in screen 1 , right left transition screen 2 screen one. following codes screen 1: intent intent = new intent(customactivitytransitionactivity.this, secondactivity.class); overridependingtransition(r.anim.slide_in_right, r.anim.slide_out_left); startactivity(intent); screen 2: intent intent = new intent(secondactivity.this, customactivitytransitionactivity.class); overridependingtransition(r.anim.slide_in_left, r.anim.slide_out_right); startactivity(intent); the respective anims give below, slide_in_left <set xmlns:android="http://schemas.android.com/apk/res/android" android:shareinterpolator="false" > <translate android:duration="200" android:fromxdelta="-100%" android:fromydelta="0%" android:toxdelta="0%" android:toydelta="0%" /> </set> slide_out_left <set xmlns:android=...

Combine two MYSQL table with same column Name -

i have 2 table table 1 scheduletime id | edition | time | 1 | 1 | 9:23am | 2 | 2 | 10:23am| table 2 actualtime id | edition | time | 1 | 1 | 10:23am | 2 | 2 | 11:23am | i want result caption | edition | time | scheduleed | 1 | 9:23am | actual | 1 | 10:23am | scheduleed | 2 | 10:23am | actual | 2 | 11:23am | how can in mysql ? select caption, edition, time ( select 'scheduled' caption, edition, time scheduletime union select 'actual' caption, edition, time scheduletime ) subquery order edition, field(caption, 'scheduled', 'actual') sqlfiddle demo sqlfiddle demo ( without using field() , plain order by...desc ) output ╔═══════════╦═════════╦═════════╗ ║ caption ║ edition ║ time ║ ╠═══════════╬═════════╬...