Posts

Showing posts from March, 2015

html - Hyperlinks are showing path in Magento -

Image
out of blue, magento site displaying "service temporarily unavailable" . so, deleted maintenance.flags file , site came back, of header links on main page , sub pages showing paths on hyperlinks: i have not changed prior either of these issues , have no idea how fix this... have template path helper, cause , how fix this? you have in skin/frontend/default/default/css/home/css/blueprint/print.css : a:link:after, a:visited:after {content:" (" attr(href) ")";font-size:90%;} remove , work expected

objective c - Facebook SDK login never calls back my application on iOS 9 -

i've followed this guide update application use facebook sdk 4.6 work when built ios 9 sdk. when tap login button now, safari view controller gets presented (shouldn't redirect facebook app?), after accepting permission safari view controller never dismissed. loads new blank page , sits there doing nothing. if tap done button, returned fbsdkloginmanagerloginresult 's iscancelled true. is normal sdk choosing safari view controller on facebook app? , why not getting callbacks after login complete? turns out on ios 9 when uiapplicationdelegate 's application:openurl:options: implemented, application:openurl:sourceapplication:annotation: not called. so had call fbsdkapplicationdelegate 's application:openurl:sourceapplication:annotation: uiapplicationdelegate 's application:openurl:options: - (bool)application:(uiapplication *)app openurl:(nsurl *)url options:(nsdictionary<nsstring*, id> *)options { return [[fbsdkapplicationdelega

php - error with pagination codeigniter -

i have problem pagination in codeigniter. when click page two, information loaded. page active one, not two. can me?? this code: in config pagination $config['pagination']['full_tag_open']='<div class="row"><div class="col-xs-12"><div class="datatables_paginate paging_bootstrap"><ul class="pagination pull-right">'; $config['pagination']['full_tag_close']='</ul></div></div></div>'; $config['pagination']['first_link']='← trang đầu'; $config['pagination']['first_tag_open']='<li class="prev disabled">'; $config['pagination']['first_tag_close']='</li>'; $config['pagination']['last_link']='trang cuối'; $config['pagination']['last_tag_open']='<li>'; $config['pagination']['last_tag_close']

Azure Resource Manager :: Nested Templates -

the microsoft azure resource manager (arm) api supports nested json templates, declarative provisioning of cloud resources. however, documentation not [currently] state how many layers of nesting supported. 1 layer of nesting, or can nested further? if so, depth limit? https://azure.microsoft.com/en-us/documentation/articles/resource-group-linked-templates/ right, there no explicit limit. if inspect json schema, not find max restriction defined: deployment template schema . however, azure deployment template limited in total size , must no exceed 1mb: you must limit size template 1 mb, , each parameter file 64 kb. 1 mb limit applies final state of template after has been expanded iterative resource definitions, , values variables , parameters. do not confused resources element though, constrained 5 levels of nesting: the resources property allows specify child resources related resource being defined. child resources can defined 5 levels deep. important not

soundcloud - How to get "all" tracks related to an artist with Souncloud API -

i have been looking answer while, , couldn't find it. currently, i'm getting tracks of artist specified api: sc.get('/users/30806929/tracks', { userid: '30806929'}, function(tracks) { $(tracks).each(function(index, track){ $('#results').append($('<li></li>').html(track.title + ' - ' + track.genre)); }); }); that's easy , works fine. the problem i'm getting tracks uploaded user, listed in following link: tracks uploaded user but want "all" music related user, listed in homepage: user souncloud homepage has faced problem? answer bnz, simple example tracks (including tracks , tracks-repost): var url = 'https://api-v2.soundcloud.com/profile/soundcloud:users:30806929?limit=10&offset=0&linked_partitioning=1&client_id=your_client_id&app_version=810b564&format=json'; $.ajax({url:url}).success(function(data){ $(data.collection).each(fun

Rotate image over X, Y and Z axis in Matlab -

Image
i'm trying rotate image on 3 axis in matlab. used function rotx, roty, rotz create rotation matrix don't know how use. these methods considering center point origin? because image 2d projection 3d world, 1 of 3d planes needs set 0 if want work. i'm going assume z -plane equal 0, , image laying flat on z = 0 plane. basically... this, using cameraman.tif image. looks like: here's looks in 3d. first, load in image, generate (x,y) pairs each intensity in image. done meshgrid . once this, use scatter plot each point assuming z = 0 , make colour of each point actual intensity seen @ image coordinate. however, see in 2d perspective scatter naturally 2d. make 3d, change camera view you're looking @ image matlab's default 3d view, add things labels , grid reversing y coordinate y coordinates images positive going downwards: %// load in image im = imread('cameraman.tif'); %// generate coordinates , unravel single vector [x,y] =

amazon s3 - Bulk transfer of all S3 assets to Google Cloud -

i'm looking move s3 assets google cloud bunch of reasons. however, have ~25 buckets, thousands of files in each. i'm aware of google storage transfer tool - https://cloud.google.com/storage/transfer/getting-started - works on buckets 1 @ time. there of them @ once? the google cloud storage transfer service still best bet, if buckets very, large. if buckets aren't large enough bother setting up, use gsutil command-line tool little bit of scripting accomplish this: for bucket in bucket1 bucket2 bucket3 bucket4 etc; gsutil -m cp -r s3://$bucket/* gs://$bucket done

graph - valued bipartite projection using R igraph -

i trying create valued bipartite projection data looks following: name rid emile 17560 lou 11800 luther 11800 tot 11800 phineas 11800 phineas 13580 calvin 13580 calvin 11800 les 11800 jeff 11800 sonny 13580 leon 13580 red 13580 i imported above data , call data1 then following: ##create graph object data1 graph1 <- graph.data.frame(data1) #check if bipartite is.bipartite(graph1) false ##convert bipartite graph v(graph1)$type <- v(graph1)$name %in% data1[,1] ##check again if bipartite is.bipartite(graph1) true ##create biparite projection ##the multiplicity argument suppose count number of ##edges proj<-bipartite.projection(graph1, v(graph1)$type,multiplicity = true) ##get adjace

assembly - When to use which registers? -

$t (temporaries) caller saved if needed. subroutines can use w/out saving. not preserved across procedure calls. $s (saved values) callee saved. subroutine using 1 of these must save original , restore before exiting. preserved across procedure calls. when use registers? far guess, when working subroutines, use $s registers, and, otherwise $t registers. when use $f registers? use $txx as possible. use $sxx program state needs preserved across calls. (a common bug , difficult find bug accidentally expecting $txx register have unchanged state across call.) the $fxx registers floating point use only. not use them else - way lies madness.

java - GCM onHandleIntent(Intent intent) not being called -

my onhandleintent(intent intent) function in gcmintentservice has registration gcm call variable function sends gcm token back-end db. while run mainactivity constructor of gcmintentservice gets called while onhandleintent doesnt. gcmintentservice . public class gcmintentservice extends intentservice { private static final string tag = "regintentservice"; private static final string[] topics = {"global"}; string senderid = "1048700326431"; asynchttpclient client = new asynchttpclient(); public gcmintentservice() { super(tag); log.i(tag, "always in here"); } @override public void onhandleintent(intent intent) { log.i(tag, " need in here"); sharedpreferences sharedpreferences = preferencemanager.getdefaultsharedpreferences(this); try { // [start register_for_gcm] // call goes out network retrieve token, subsequent calls

typescript - Angular 4 show list data from firebase to md-table -

i trying create table load data firebase , show in created table. here component html <div fxlayout="row"> <div>dealers</div> <div> <md-form-field floatplaceholder="never"> <input mdinput #filter placeholder="filter dealer"> </md-form-field> </div> <div> <md-table #table [datasource]="datasource"> <ng-container mdcolumndef="userid"> <md-header-cell *mdheadercelldef> id </md-header-cell> <md-cell *mdcelldef="let row"> {{row.id}} </md-cell> </ng-container> <ng-container mdcolumndef="email"> <md-header-cell *mdheadercelldef> email-id </md-header-cell> <md-cell *mdcelldef="let row"> {{row.email}} </md-cell> </ng-con

java - Unquantifying an integer -

is possible create int variable no value, quantify in code, , "unquantify" no longer has value? example: class test { int integer; public static void main (string[] args) { integer = 1; ... //do stuff ... integer = null; //does line set integer's value nothing? // want able reset value of integer when defined (the value nothing, had no value) } } edit: grammar you cannot assign null primitive type. you use integer object this: integer = null; if have int classmember , access inside method value of int 0. also have make variable static access in main.

css - padding-left 100% on element extends over parent left border -

Image
i'd need extend padding-left or margin-left of div 100% animation, text in div outside parent box resp. outside padding on right side. the div within bootstrap <div class="row"><div class="col-mod-12">...</div></div> , has otherwise no special formatting. do have tip me how can push element of animatable css property (text-align not animatable) right, within parent container? i'd grateful. code (without browser pre-fix): <style> @keyframes slidein { 0% { padding-left: 0; } 100% { padding-left: 100%; } } div.slidein { animation: slidein 3s infinite alternate; } </style> <div class="slidein"> animate </div> asking helps trigger thinking. works follows: @keyframes slidein { 0% { width: 0; } 100% { width: 100%; } } div.slidein { display: inline-block; text-align: right; animation: slidein 3s infinite alternate; } sorry bother. mdn has example margin-left: http

JavaScript append property to object -

this question has answer here: why can't modify data returned mongoose query (ex: findbyid) 2 answers i overlooking simple solution i've tried come or find on internet. i'm trying add property json object need in output. whatever try add property, doesn't show in object. verified 'doc' variable actual object. no console errors. console.log() shows contents of 'doc' object , nothing more. anyone knows going on? blog.findone({'slug': req.params.slug}, function(err, doc) { if (!err){ if(_.isempty(doc)) { res.status(404).json({ response: "nothing found here." }); } else { var blogpost = doc; blogpost.someproperty = 'test'; console.log(blogpost); // doesn't contain new property res.status(200).json( { response: blogpost }); } } else { throw err; } }); outp

css - Adjust Padding on Navigation Border - Wordpress -

Image
i'm trying tighten border under navigation menu. css code have: css: li.current_page_item { border-top: 0; border-bottom: 3px; border-style:solid; line-height: 0; border-bottom-color:green; } my website http://www.verbatimagency.com try this: li.current_page_item { border-top: 0; border-bottom: 2px; border-style:solid; line-height: 0; border-bottom-color:green; line-height: 0px; height: 0px; padding-bottom: 10px; } li.current_page_item { line-height: 0px; padding-bottom: 0; height: 0; } it padding-bottom on <a> tag. see corrected preview: you may need adjust accordingly.

text files - python FileNotFoundError -

i writing program accesses .txt file @ start of program open() function. ran without errors on ide , able read text file when running ide without issues. although when ran python launcher threw "filenotfounderror" here's code: directions_object = open('warcards_directions.txt','r') further dan d's comment.. try putting on line in front of open() call: os.path import abspath print(abspath('warcards_directions.txt')) you'll see python looks in different places depending on run .. because looks files relative current working directory, changes depending on how run python. this common problem new comers. see here how import files in python using sys.path.append? solutions (note underlying problem in post same one.. fact they're trying import file, , here we're trying open 1 not important). also i'll add reference things relative script itself... this: from os.path import abspath, join, dirname script

sql - Finding words with and without whitespaces in Rails and Postgresql -

i'm trying figure out statement can use in ruby on rails sql query match word might or might not have whitespaces similar word might or might not have whitespaces. example: matthew jones or matthewjones should match matthew jones or matthewjones you can using postgres replace function: select * mytable replace(username, ' ', '') = replace("matthew jones", ' ', '') and match both matthewjones , matthew jones . you can write in activerecord query: mytable.where("replace(username, ' ', '') = replace('john bob jones', ' ', '')") update: you can use ilike make query case-insensitive: user.where("replace(username, ' ', '') ilike replace(?, ' ', '')", "john bob jones")

ios - Why UITableView first row is behind top tab bar? -

Image
i don't know how explain problem therefore added screenshots. when go personal tab first row behind personal tab , parts hided behind it. but when scroll down can see them! i have defined tab title in way: self.title = @"personal"; any idea why behave this? as @alejandroiván said have change top bar this->

mongodb - How start Mongo Instance in sharded cluster -

i want deploy sharded cluster using mongodb manual. first created 3 config servers. mongod --configsvr --dbpath /data/configdb1 --port 27019 , mongod --configsvr --dbpath /data/configdb2 --port 27019 , mongod --configsvr --dbpath /data/configdb3 --port 27019 but in second step start mongos instances find command mongos --configdb cfg0.example.net:27019,cfg1.example.net:27019,cfg2.example.net:27019 but can't understand meaning of cfg0.example.net cfg1.example.net cfg2.example.net so please explain meaning of above command , how can use according hostname? please check "deploy sharded cluster" , cfg[0-3].example.net means hostnames of 3 config servers, each of mongos server should started config servers configured.

c# - How to list text files in the selected directory in a listbox? -

how can list text files in directory (c:\users\ece\documents\testings) in listbox of winform(windows application)? // directory files in?... directoryinfo dinfo = new directoryinfo(@"c:\testdirectory"); // type of file want?... fileinfo[] files = dinfo.getfiles("*.txt"); // iterate through each file, displaying name inside listbox... foreach( fileinfo file in files ) { listbox1.items.add(file.name); } // statement, followed smiley face... oughta it. ;o)

javascript - how does the callback in fs.readfile get called when using fs.readfile.bind(context,pathArgument) -

how callback in fs.readfile called when using fs.readfile.bind(context,pathargument) so. //understandable because task function knows name of callback parameter async.series([function(callback){ //operation done callback()},...],finalcallback(err,result)); but //not understandable async.series([fs.someoperation.bind(null,firstargument),...],finalcallback(err,esult)) i believe understand partial application;however, this. function(callback){ fs.someoperation(firstargument, ????)}(asynccallbackfunc) , have no idea how second argument called... thx, in advance helping me clear up. all bind set context of callback. still regular callback other. except, explicitly told this be. looks in case, set null .

c++ - What's wrong with my (pointer based) mergesort? -

no errors, doesn't sort list. worked when used indices instead of pointers directly. feel i'm missing way pointer's should behave... . correct in assuming pointers passed value (copied) recursive calls, or messing them down way? #include<iostream> using namespace std; void merge(int *start, int *pivot, int *end) { const int n = start - end; int ret[n]; int i; (i=0; i<n; ++i) { if (*start < *pivot) { ret[i] = *(start++); } else { ret[i] = *(pivot++); } } (i=0;i<n;++i) { start[i] = ret[i]; } } void sort1(int* start,int* end) { int n = end - start; if (n <= 1) { return; } int* pivot = &start[n/2]; sort1(start,pivot); sort1(pivot,end); merge(start,pivot,end); } int main() { int x[] = {1,3,6,2,4,5}; sort1(x,x+6); int i; (i=0; i<6; ++i) { cout << x[i] << endl; } } my current out

javascript - Workng Google Maps API I have it setup so that the user can add a selection rectangle to their screen. How can I only do this just once? -

basically want user able add 1 rectangluar selection map. right adds many want. tried adding making addselection equal noop. didn't me. thought that allow function execute once. anyway trying allow user add 1 rectangular selection map. wondering best path peruse be. html, body { height: 100%; margin: 0; padding: 0; } #map { height: 100%; } <body> <div id="map"></div> <script> var map; var rectangle; var infowindow; var penang = { lat: 5.466277, lng: 100.289981 }; /** * centercontrol adds control map recenters map on chicago. * constructor takes control div argument. * @constructor */ function noop() {} function addselection(controldiv, map) { // set css control border. var controlui = doc

ibm mobilefirst - WL.Client.Logout not calling its onSuccess or onFailure callbacks? -

Image
using mobilefirst platform 7.1, i have noticed logout function has stopped working. have browser web app has logout button triggers: wl.client.logout("myauthenticatorrealm", { onsuccess: function(res) { console.log("success server logout"); // never called :( wlauthorizationmanager.obtainauthorizationheader().then ( function(header) { // reload app here, }, function(error) { ... }); }, onfailure: function(res) { console.log("failure server logout"); // never called :( } }); but callbacks never called. have checked sample code tutorial , can see same thing happening too. is there specific need add in 7.1? used work in 7.0 edit 2015/08/31 there nothing in server logs. client web app seem doing request authorization/v1/authorization?client_id=xyz&scope=-myauthenticatorrealm&isajaxrequest=true&x=0.07530371774919331

How to do pointers in swift like I used to do in c++ -

so apple has had little documentation can find doing this. big feature miss c++ being able (sorry syntax errors little rusty in c++ int* chosenint; int option1 = 1 int option2 = 2 int option3 = 3 if (the sun up) chosenint = &option1 else chosenint = &option2 however swift doesnt recognize "*" or "&" operator. trying have global variable stores pointer skspritenode, , can change different one. swift seems have large unsafemutablepointer thing. how c++ code in swift skspritenodes? all trying have global variable stores pointer skspritenode, , can change different one. swift seems have large unsafemutablepointer thing. how c++ code in swift skspritenodes? skspritenode class, i.e. reference type, don't need anything. behavior without asterisks , ampersands.

html - How to add radio buttons and input fields using angularJS -

Image
i trying add both input fields , corresponding radio buttons project using angularjs. means when click add, create 1 input field , 3 corresponding radio buttons together, below picture. able add input fields when click add. having trouble in creating radio buttons when click add iput field's placeholder should display input 1 , when click add again should display input 2 that. can me on it. following code. html portion: <table class="table"> <tr class="tr_class"> <td></td> <td></td> <td align="center"><b>functional check </b></td> <td align="center"><b>xxissue</b></td> <td align="center"><b>yy risk</b></td> </tr> <tr class="tr_class"> <td class="td_class"><div class="input-group"> <span class="input-group-addon">inp

ios - Adding multiple sublayers to UIView will only display one -

trying add bottom border login system, have used following code: var bottomborder = calayer() bottomborder.frame = cgrectmake(0.0, useremailaddresstextfield.frame.size.height - 1, useremailaddresstextfield.frame.size.width, 1.0) bottomborder.backgroundcolor = uicolor.blackcolor().cgcolor useremailaddresstextfield.layer.addsublayer(bottomborder) i trying password textfield well. have used various amount of techniques none seem work. first attempt: adding same code again, shows bottom border second bar. second attempt: tried same thing different variable being bottombordertwo , replicating code, wouldn't work either. solutions? create common function func addbottomlayertotheview(view:uiview) { var bottomborder = calayer() bottomborder.frame = cgrectmake(0.0, view.frame.size.height - 1, view.frame.size.width, 1.0) bottomborder.backgroundcolor = uicolor.blackcolor().cgcolor view.layer.addsublayer(bottomborder) } call function after creating te

sdk - Emulator showing black screen on android studio -

i trying run emulator on android studio. ide shows message -netdelay none -netspeed full -avd nexus_5_api_22 creating filesystem parameters: size: 69206016 block size: 4096 blocks per group: 32768 inodes per group: 4224 inode size: 256 journal blocks: 1024 label: blocks: 16896 block groups: 1 reserved block group size: 7 created filesystem 11/4224 inodes , 1302/16896 blocks emulator: device fd:792 hax working , emulator runs in fast virt mode emulator: emulator window out of view , recentered i can't figure problem is. should do.

Custom sorting in shell -

i have custom order sorting: 'd','r' -> 'i' -> 'w','x' , 'z'. is, 'd' , 'r' equal , sort before 'i'; , 'w', 'x' , 'z' equal , sort after 'i'. input: 123d123 234r111 333i333 111w111 222x222 111z111 the sorting on 4th character, , followed sorting 5th 7th characters. the expected output be: 234r111 123d123 333i333 111w111 111z111 222x222 paste <(cut -c 4-7 file | tr 'rwx' 'dzz') <(cat file) | sort -k 1,1 | awk '{print $2}' 234r111 123d123 333i333 111w111 111z111 222x222 explanation: create key r=d , w=x=z, sort key, discard key

win universal app - Windows 10 SplitView + Pivot not working properly -

i have used splitview in windows 10 universal application , added pivot splitview .content problem when start application cant click on pivot headers navigate. this problem occurring on phone desktop or tablet not showing issue. if click on hamburger menu open splitview .pane , close pane can touch pivot headers , navigate pivot items. why pivot headers not clickable @ start? <splitview> <splitview.content> <pivot> <pivotitem /> <pivotitem /> <pivotitem /> </pivot> </splitview.content> <splitview.pane> hamburger menu button other buttons </splitview.pane> i having same issue. clicking on pivot header doesn't change content of pivot body. need resize app content of selected pivot shown. have sample , video showing issue: http://1drv.ms/1m7jytq it happens on both, phone , computer.

unix - Substring command not working in solaris kshell -

i trying use following command extract substring string : propertypath=$(echo $path|awk '{print substr($0,3,$index)}') however command not pick value of $index variable , therefore not return valid substring. this work: propertypath=$(echo $path|awk '{print substr($0,3,'$index')}') or propertypath=$(echo $path|awk -v index=$index '{print substr($0,3,index)}')

c - Does Linux raw socket buffer size have upper limit of 256 K? -

i using following code in centos change raw socket buffer size 400 kb, got same result set buffer size 256 kb. wrong? or limitation of socket layer? kernel version 2.6.34. thanks! int rawsock; socklen_t socklen; int optval; int bufsize = 400 * 1024; rawsock = socket(pf_packet, sock_raw, htons(eth_p_all)); if (rawsock < 0) { my_log(log_err, "error creating raw socket"); return rawsock; } optval = 0; socklen = 4; err = getsockopt(rawsock, sol_socket, so_rcvbuf, &optval, &socklen); bail_error(err); my_log("socket rx original buffer size = %d", optval); optval = 0; socklen = 4; err = getsockopt(rawsock, sol_socket, so_sndbuf, &optval, &socklen); bail_error(err); my_log("socket tx original buffer size = %d", optval); err = setsockopt(rawsock, sol_socket, so_rcvbuf, &bufsize, sizeof(bufsize)); bail_error(err); err = setsockopt(rawsock, sol_socket, so_sndbuf, &bufsize, sizeof(bufsize)); bail_error(er

Drive API for Android is broken, right? -

as @ august 2015, 'drive api android' not functioning (loosely)documented, broken. main sore points follows: 1) app sharing same app_id , logged in same google user meant able to find , access same files as google indicate (e.g. appx on device1 creates folder named 'blahblah' (where no 'blahblah' folder exists in user's drive), appx on device2 should able find folder , upload/download files also...however not case (or if work, intermittent , not working @ all)). remains case after (many) requestsync calls , on 72hours of allowing drive sync itself. 2) trashed folder not observed trashed, after requestsync call has succeeded. such trashed folder still have istrashed==false. 3) permanently trashed folder (i.e. gone drive, never coming back). can still found , "successfully" have folders , files created within it, writing such file's contents yield failure in completion event service. again, such folder still have istrashed==false (whi

ios - Why interface builder not let me to add uiview to uitableview? -

Image
i have table view. want add features when user click on cell view opens , show details cell. trying follow part of video add uiview: youtube tutorial but when drag , drop myself, returns , not adding tableview. here storyboard. i see attached image , per think have use uitableviewcontroller has mainview uitableview . but video trying follow , in have take uiviewcontroller has mainview " uiview ". in have have drag drop uitableview . , have added uiview in "mainview "uiview" " not uitableview. if want learn how sue uitableview in uiviewcontroller, there here tutorial link : http://www.appcoda.com/ios-programming-tutorial-create-a-simple-table-view-app/   if follow steps able create same tableview have developed. , try add view mainview. allow add it.

date - Calendar java does not work properly -

import java.util.calendar; ... calendar calendar = calendar.getinstance(); calendar.settime(new date(1443351600000l));// set 2015-9-27 calendar.add(calendar.hour_of_day, 23); // add 23 hours i don't know why calendar updated 2015-09-27 00:00:00 2015-09-28 00:00:00 . expect 2015-09-27 23:00:00 . calendar calendar = calendar.getinstance(); calendar.settime(new date(1443351600000l));// set 2015-9-28 calendar.add(calendar.hour_of_day, 23); // add 23 hours and 1 works fine. result 2015-09-28 23:00:00 . there's 23 hours in day if daylight saving time starts on 2015-9-27 . google search says following starts daylight saving time on sep 27, 2015: new zealand samoa south pole if you're in 1 of these places, there's answer.

html5 - prevent client from seeing image used in a javascript canvas -

i have path image in server. paths used javascript load image use in canvas, in following way: js script draws image in canvas: hides parts of image(by covering them black layers) the problem user can read js script image url, , load entirely(without hidden parts) is there way solve issue can think off? imagemap.src = 'pathtojpgimage.jpg'; imagemap.onload = function() { // function draws black circles hiding areas of map coverhidenareas(); } i've got javascript image scrambler can use. scramble function works on image element. careful getting onload loop. can see scramble onload , reset onload avoid looping when setting new value. function scramble(el){ var v=document.createelement('canvas') var w=v.width=el.width,h=v.height=el.height,c=v.getcontext('2d') c.drawimage(el,0,0) var id=c.getimagedata(0,0,w,h),d=id.data,l=d.length,i=l/4,a=[] for(;--i;)a[i]=i function s(a){

php - shell_exec() command not working locally -

i'm trying run shell command via php. interestingly, script works fine on production server , works when plug in command shell manually. shell_exec() command not work in local dev. environment on os x - returns blank web page instead of pdf supposed generated. i won't dive specifics of local env. since i'm guessing high-level issue... the command supposed execute via shell_exec() looks like: /usr/local/bin/phantomjs --ignore-ssl-errors=true --debug=true ../scripts/renderteamprofile.js https://127.0.0.1/app_dev.php/pdf/enterprise-lpc-enterprise/profile/render /private/var/tmp/pjsk2n16e.pdf the php: public function pdfresponse($url, $script, $remote_filename) { $tempfile = tempnam('/tmp', 'pjs'); $tempfilepdf = $tempfile . '.pdf'; rename($tempfile, $tempfilepdf); # nginx should restrict access localhost url $urllocal = preg_replace('/^https:..[^\/]+/', 'https://127.0.0.1', $url); $phantomjs = $t

xamarin - Track GPS Route accurately Android -

Image
i writting application tracks users real time location , show on map. results seeing not satisfactory. when compare app others present on play store difference lot. here things have tried far: (just in case using xamarin build application) i have earlier used fused location api, gave of deviation users current location. so, tried location manager using gps_provider. using accuracy increased lot still not perfect. below code using location manager: protected void createlocationrequest() { if (locmgr.allproviders.contains (locationmanager.gpsprovider) && locmgr.isproviderenabled (locationmanager.gpsprovider)) { locmgr.requestlocationupdates (locationmanager.gpsprovider, 3000, 2, this); } } public void onlocationchanged (location location) { console.writeline ("onlocationchanged"); if(location != null && location.accuracy <= 20){ drawpath (location);

Excel: Sum columns and rows if criteria is met -

Image
i have sheet product names in column , dates there on. each date there numbers of how many pieces of product have made. i'm trying sum numbers based on product type, i.e.: k l m ... 30.8. 31.8. 1.9. ... mad23 2 0 45 ... mmr32 5 7 33 ... mad17 17 56 0 ... mad: 120 (2+0+45+17+56+0) mmr: 45 (5+7+33) what i'm doing sum row first: =sum(k6:gn6) mad23 = 47 mmr32 = 45 mad32 = 73 and sum numbers in column j based on part of product name in column i: =sumif(sheet1!i6:i775;"mad*";sheet1!j6:j775) mad = 120 mmr = 45 is possible one formula per criteria? just trying on 3 rows, get =sum($k$6:$m$8*(left($i$6:$i$8,len(i10)-1)=left(i10,len(i10)-1))) which array formula , must entered ctrl shift enter that's assuming i10 going contain characters followed colon , want match first characters of i6:i8.

virtualenv - Why import error while using django-templated-email? -

i trying use bradwhittington django-templated-email. installed it, , added following lines in settings.py. from templated_email.backends.vanilla_django import templatebackend templated_email_backend = templatebackend when try run server, import error. when use from templated_email import send_templated_mail in models.py again import error. new django, , googled answer many times. no luck. missing? 'run' window on pycharm shows following: "c:\program files\jetbrains\pycharm 4.0.4\bin\runnerw.exe" "e:\***\***\***\env1\scripts\python.exe" "c:\program files\jetbrains\pycharm 4.0.4\helpers\pycharm\django_manage.py" syncdb "e:/***/***/***/***" traceback (most recent call last): file "c:\program files\jetbrains\pycharm 4.0.4\helpers\pycharm\django_manage.py", line 41, in <module> run_module(manage_file, none, '__main__', true) file "c:\python34\lib\runpy.py", line 182, in run_module ret

C# LINQ return counter array indices max to min -

a newbie c# , linq. have array counted sequence. {1,3,5,2,7,2} i trying write query returns list of indices highest values in descending order: 4,2,1,3,5,0 i can maximum index query below, can't seem work out how next indexes in sequence single query. int index = array.tolist().indexof(array.max()); this works: var list = new [] {1,3,5,2,7,2}; var indices = list .select((n, i) => new { n, }) .orderbydescending(x => x.n) .select(x => x.i) .toarray();

Jquery show render page in gridview yii2 -

Image
i trying create feedback page put gridview on page show feedbacklist, , have plan put list replay under current comment. following code made: 'columns' => [ [ 'attribute' => 'iduser.photo', 'format' => 'html', 'value'=> function($data) { return html::img($data->imageurl) . " <p class='feedback-username'>" . $data->username . "</p>"; }, 'contentoptions'=>['style'=>'max-width: 10px; max-height: 10px'], ], [ 'attribute' => 'komentar', 'format' => 'raw', 'value' => function($model) { return $model->komentar ."<br><p class='feedback-date'>". $model->tanggal ."</p><hr><div id='replay'><ul></ul></div>";}, ],

Database using Visual Studio C# (Web Application) -

i have create implement database in 1 of projects. i'm using visual studio , coding in c# problem i'm experiencing cannot find information on how create database web application database program best use. any documentation explaining how go making , using database appreciated. thanks in advance sign windows azure. free trial , nice gui create databases , web apps. then can use basic sql start interacting database

How can i pass the jquery value to php function -

here want call php function parameter held in jquery function. i have php function takes 1 parameter , executes sql query. , have jquery function getting different values when select item dropdown box. now want pass value of dropdown box php function, how can this? here have done $("#product_category").change(function(){ var category = $(this).val(); //getting dropdown value // here want pass variable value php function }); php function productmanagement($procat){ // create connection $conn = new mysqli($servername, $username, $password, $dbname); // check connection if ($conn->connect_error) { die("connection failed: " . $conn->connect_error); } $sql = "select product_name,product_category,product_image_url product_list product_category='$procat'"; $result = $conn->query($sql); if ($result->num_rows > 0) { // output data of each row

charts - kendo UI Select area and zoom in selected -

i working on kendo ui charts. want develop simple chart allows me select area , zoom in selected part of chart. not find in kendo ui charts, available in high chart. please have here. $(function () { $.getjson('http://www.highcharts.com/samples/data/jsonp.php?filename=usdeur.json&callback=?', function (data) { $('#container').highcharts({ chart: { zoomtype: 'x' }, title: { text: 'usd eur exchange rate on time' }, subtitle: { text: document.ontouchstart === undefined ? 'click , drag in plot area zoom in' : 'pinch chart zoom in' }, xaxis: { type: 'datetime' }, yaxis: { title: { text: 'exchange rate' } }, legen

R: fastest way to check presence of each element of a vector in each of the columns of a matrix -

i have integer vector a a=function(l) as.integer(runif(l,1,600)) a(100) [1] 414 476 6 58 74 76 45 359 482 340 103 575 494 323 74 347 157 503 385 518 547 192 149 222 152 67 497 588 388 140 457 429 353 [34] 484 91 310 394 122 302 158 405 43 300 439 173 375 218 357 98 196 260 588 499 230 22 369 36 291 221 358 296 206 96 439 423 281 [67] 581 127 178 330 403 91 297 341 280 164 442 114 234 36 257 307 320 307 222 53 327 394 467 480 323 97 109 564 258 2 355 253 596 [100] 215 and integer matrix b b=function(c) matrix(as.integer(runif(5*c,1,600)),nrow=5) b(10) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 250 411 181 345 4 519 167 395 130 388 [2,] 383 377 555 304 119 317 586 351 136 528 [3,] 238 262 513 476 579 145 461 191 262 302 [4,] 428 467 217 590 50 171 450 189 140 158 [5,] 178 14 31 148 285 365 515 64 166 584 and make new boolean l x c matrix shows whether or not each vector ele

linux - Call another shell script with argument which contains whitespce -

script a: #!/bin/bash . foo.sh args="a \"b c\" d" ./foo.sh $args script foo: #!/bin/bash echo "$1" echo "$2" echo "$3" echo "$4" after executing script a, got following result: a "b c" d my expected result is: a b c d could tell me reason, , how change expected result, in advance. to store multiple arguments white-spaces better use shell arrays: args=(a "b c" d) and call script as ./foo.sh "${args[@]}" this print: a b c d

python - Pandas - Creating Difference Matrix from Data Frame -

i'm trying create matrix show differences between rows in pandas data frame. import pandas pd data = {'country':['gb','jp','us'],'values':[20.2,-10.5,5.7]} df = pd.dataframe(data) i this: country values 0 gb 20.2 1 jp -10.5 2 5.7 to become (differences going vertically): country gb jp 0 gb 0.0 -30.7 14.5 1 jp 30.7 0.0 16.2 2 14.5 -16.2 0.0 is achievable built-in function or need build loop desired output? help! this standard use case numpy's broadcasting : df['values'].values - df['values'].values[:, none] out: array([[ 0. , -30.7, -14.5], [ 30.7, 0. , 16.2], [ 14.5, -16.2, 0. ]]) we access underlying numpy array values attribute , [:, none] introduces new axis result 2 dimensional. you can concat original series: arr = df['values'].values - df['values'].values[:, none] pd.conca