Posts

Featured post

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 ?