Posts

Showing posts from August, 2010

python - Changing multiple positions in a list -

i have string want manipulate @ every position throughout it's length. for example, have string looks this: string1 = 'aatgcatt' i want create list change 1 position @ time either a, t, c, or g. thinking of using approach so: liststring = list(string1) changedstrings = [] pos in range(2, len(liststring) - 2): ##i don't want change first , last characters of string if liststring[pos] != 'a': liststring[pos] = 'a' random1 = "".join(liststring) changedstrings.append(random1) i thinking of using similar approach append rest of changes (changing rest of positions g,c, , t) list generated above. however, when print changedstrings list, appears code changes of positions after first two. wanted change position 3 'a' , append list. change position 4 'a' , append list , on give me list so: changedstrings = ['aaagcatt', 'aatacatt', 'aatgaatt'] any suggestions? ...

android - Decode Json Object from a url in php coming from a user -

hey making android app user's request in format of json . request this.. jsonobject j = new jsonobject(createjson()); string url ="http://codemoirai.esy.es/test.php?userdetails="+j; j = {"email":"code@gmail.com","username":"xyz","password":"xyz"} this sending test.php , want know how can fetch data , display using php. <?php require "init1.php"; $jsonobject = $_get["userdetails"]; $obj = json_decode($jsonobject); $email = $obj->email; $password = $obj->password; ....... echo $email; //everthing fetch jsonobject null. why? ?> thankyou, correct how fetching in php?? in test.php can catch data $_get['userdetails'] decode json_decode($_get['userdetails') then can iterate foreach loop example: if(isset($_get['userdetails'])) { $details = json_decode($_get['userdetails']); foreach($details ...

android - On Button Click in recyclerview how to increment counter and show in textview -

i working on app displays images using recycler view , volley.i have imageview, textview , buttons in each card. trying add functionality button when clicked, count number of clicks , display in textview. getting error "variable 'count' assesed within inner class,needs declared final" trying this.what doing wrong? code import android.content.context; import android.media.image; import android.support.v7.widget.recyclerview; import android.view.layoutinflater; import android.view.view; import android.view.viewgroup; import android.widget.button; import android.widget.imagebutton; import android.widget.progressbar; import android.widget.textview; import com.android.volley.toolbox.imageloader; import com.android.volley.toolbox.networkimageview; import org.w3c.dom.text; import java.util.arraylist; import java.util.list; /** * created belal on 11/9/2015. */ public class cardadapter extends recyclerview.adapter<cardadapter.viewholder> { //imageloader...

mysql - How to import an .sql file into a Postgres database? -

when run following command import sql db postgressql, psql -u homestead -h localhost <db name> < <backup.sql> it throws following syntax error. error: unrecognized configuration parameter "sql_mode" error: unrecognized configuration parameter "time_zone" error: syntax error @ or near "`" line 1: create table if not exists `addresses` ( any idea resolve issue. in advance. you can use mysqldump create .sql file. mysqldump -u username -p --compatible=postgresql databasename > outputfile.sql can import .sql in postgresql database without error. hope help.

What are KeyPoint and MatchDpoint in OpenCV in Java -

dears 1-i know point class regarding 2 channel integer value coordinates(points): matofpoint vector of integer points. same keypoint class? know class containing salient points.is true @ them 2 channel float value coordinates(points)? @ lines below: keypoint test; test= new float[]{x,y}; i wrote them see if interpretation regarding keypoint valid. please validate this. 2-what dmatch match.trainidx? mean trainidx? peace keypoint stores salient points description. stores x, y, angle, size etc. see http://docs.opencv.org/java/2.4.2/org/opencv/features2d/keypoint.html correct way manually initialize in java be: keypoint test = new keypoint(x, y, size); or list of keypoints image : mat srcimage; matofkeypoint keypoints; mat descriptors; descriptorextractor descexctractor = descriptorextractor.create(descriptorextractor.sift); descexctractor.compute(srcimage, keypoints, descexctractor); keypoint[] keypointsarray = keypoints.toarray() dmatch constains descri...

winrt xaml - Edge manipulation detection in fullscreen mode is not working as expected in UWP app -

i have situation manipulation events emanating offscreen (think bezel of surface pro) not being registered when app in fullscreen mode. however, registering expected when application "maximized" (i put in quotes because know it's no longer officially "thing" maximized). to reproduce, create blank application , add code @ end of post. swipe top down, , notice absence of manipulation events being fired. click exit full screen button maximize button , repeat experiment, , see manipulation events fire. it important start dragging offscreen. is design? there gotcha i'm not aware of? bug? the following xaml file: <page x:class="edgeswipedetect.mainpage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:edgeswipedetect" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas...

android - Energy economy: BLE device - when to make connectable? -

i designing custom ble device protocol. device 1 of - scales, blood pressure monitor, fitness band . the protocol defines collection procedure android/ios app ( collector ) use collect sensor data 1 of these devices. we can assume collector present 50% of time , scanning air broadcasted device connect , collect data it my question is: effective way of making device connectable, battery power in mind? my current approach: device connectable, if (a) has unsent measurements user, (b) user turned on (by stepping on scales, pushing button or whatever) in case (b) device broadcasts e.g. each 1 seconds , available connected collector in case (a) device broadcasts e.g. each 5 seconds , available connected collector as conditions (a)/(b) not apply, device goes sleeping mode - not broadcasting anything. is effective approach means of energy consumption? or there better practices accomplish "device visibility" ? p.s. not find better resource asking that,...

load balancing - Azure Application gateway for web app -

coming link http://azureblogger.com/2016/02/load-balancing-in-azure/ does azure application gateway support web apps? based on above link, says no, not find mentioned explicitely in azure documentation app gateway. second question related, wise/suggested use application gateway/traffic manager azure web app scalable based on performance , has 2 or more instances running in standard tier. does using application gateway/traffic manager makes sense? considering web apps allows set cookie based session affinity, assume using level 7 load balancing solution. based on headers have set enable this, assume using http://www.iis.net/downloads/microsoft/application-request-routing . using application gateway wouldn't make sense. traffic manager has different goal, routes traffic on more of global scale using dns. example user in europe routed european azure website, american user routed american azure website. has automatic failover, if whole site fails, routed different ...

c# - Performance tips mapping indexers to objects -

given following code able access pixels of image , map them color struct. to eye though looks inefficient since every time access indexer reading array 4 times. takes 9 seconds on computer run. what looking example of how optimise code. i'm guessing can sort of reference array using unsafe code , read in 1 move have yet find decent guide explain how , how apply approach other situations. while code example on own aid me, explanation of going on , why improve performance more beneficial myself , reading. public class program { public static void main(string[] args) { image img = new image(10000,10000); stopwatch stopwatch = new stopwatch(); stopwatch.start(); (int y = 0; y < img.height; y++) { (int x = 0; x < img.width; x++) { color color = img[x,y]; } } stopwatch.stop(); console.writeline( string.format("time: {0} ms...

node.js - How to shim npm package dependency in browserify? -

so have react project, in i'm deploying react-lite footprint much smaller. i'd use react-nouislider , in it's package.json, i've found this: "peerdependencies": { "react": "^0.14.0" } what means whenever require react-nouislider, pulls in react instead of react-lite. how shim dependencies of npm package top-level package.json? this how i'm shimming react-lite in: "browser": { "react": "react-lite" } and tried this, didn't work: "browserify-shim":{ "react-nouislider": { "depends": "react-lite" } } how possible shim dependency of package itself? browserify shim's tagline is: makes commonjs incompatible files browserifyable. your issue here react-lite commonjs compatible. commonjs compatible file, browserify automatically add dependencies , peerdependencies appropriate, before browserify shim gets inv...

Return the value from the method in Kurento Media Server -

what do: 1.i downloaded kms-opencv-plugin-sample link( https://github.com/kurento/kms-opencv-plugin-sample ). 2.replace opencv sample in process method opencv facedetection . 3.also make changes reference link how pass parameter in kms plugin , run facedetection. 4.i passes argument method,by modifying kmd.json file what need do: 1.in face detection shows output mat,also need return facerect value(rectangle points) 2.so need return value in response you can raise event in case because process method signature cannot changed. from kurento documentation : there lot of examples of how define methods, parameters or events in our public built-in modules: kms-pointerdetector kms-crowddetector kms-platedetector edit: an example raising event can found here . can see, once event defined in kmd, can create , send using signal object. in case of opencv plugin, need little bit more of work, because need reference endpoint object opencv class doing proc...

ios - Convert NSData object to NSArray -

this question has answer here: need convert nsdata nsarray 2 answers i response server in format this: [_postviolationoperation setcompletionblockwithsuccess:^(afhttprequestoperation *operation, id responseobject) { if (responseobject != nil && [responseobject iskindofclass:[nsdata class]]) { //some code convert responseobject nsarray //responseobject looks this: ["fsdfsf","sdfsfd"] } } failure:nil]; how can convert nsarray? nserror *error = nil; nsarray *jsonarray = [nsjsonserialization jsonobjectwithdata: responsedata options: nsjsonreadingmutablecontainers error: &error];

validation - Split and validate text that contains brackets, commas and integers -

Image
how can split text contains brackets, commas , 3 integers. example: {5,40,30} i want validate looks above. try using regex. var teststring = "12,23,{23,23},23,{51,22,345}{{]}1123,{12,12,232,123}{{33,33,33}}"; var regex = new regex(@"{\d+,\d+,\d+}"); var matches = regex.matches(teststring); the output of above test string after match {51,22,345} , {33,33,33}

javascript - Google Maps v3 performance issues -

Image
i'm experiencing massive performance issues google maps v3 api , not find similar issues when searching problem. problem can seen on browser, i'm focussing on chrome here. the symptoms: when zoom map or out of map, fps rate drops drastically leading increadibly bad experience. my code: i implemented google map using documentation simple example. <!doctype html> <html> <head> <title>simple map</title> <meta name="viewport" content="initial-scale=1.0"> <meta charset="utf-8"> <style> html, body { height: 100%; margin: 0; padding: 0; } #map { height: 100%; } </style> </head> <body> <div id="map"></div> <script> var map; function initmap() { map = new google.maps.map(document.getelementbyid('map'), { ...

Xamarin Android C#: Using the xml resource folder and manifest to define an intent filter for detecting connected usb devices crashs application -

hope day good! i have followed step step guide in android development guide detecting connection of usb device here: http://developer.android.com/guide/topics/connectivity/usb/accessory.html (in c# xamarin though not java , going intent filter path automatically detect device via broadcast receiver) needless say, did not work out expected , caused app crash when started up. after quite few hours have managed pinpoint @ least 1 of problems there may more. problem if create "accessory_filter.xml" in xml folder (that created) in res folder app crash no matter what. if code not use @ all, xml file exists app crash straight after starting. any help, advice or assistance appreciated! thank you. edit: android manifest <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="scout.app" android:versioncode="1" android:versionname="0.0.0" an...

angularjs - how to make a web page pass data to backend(server and save to databse) using nodejs -

i new nodejs. question quite simple. trying use nodejs express framwork(in eclipse ide) make sample website. website contains 2 pages, 1 page hotel booking, on page, customer can choose type of rooms(king bed room, queen bed room), select how many rooms needed, , total price automaticly shown on page(using angularjs). there button custom can click checkout. have finished page using angularjs, code(hoteloder.ejs) attached below . question comes next step : after clicking checkout. want send 3 values(the type of rooms, number of rooms ordered, order total) on page end(server) , save server's database using nodejs. cannot figure gout how using nodejs (transfer.js file below). if database have sucessfully saved these 3 values, let server response saved "order total" second page(orderconfirm.ejs, attach below). can help? know how coding upload(or called post?) these 3 value backend , save database(use mysql). transfer.js var ejs = require("ejs"); function o...

c - why print out a char pointer yield the entire array instead of the memory addr of the pointer? -

int aryint[4] = {1,2,3,4}; char *ptr = "1234"; char ch ='a'; char *chptr = &ch; //chptr = 3509449623 (mem addr) printf("chptr = %u, chptr); //aryint = 3509449648 (mem addr) printf("aryint = %u ", aryint); //ptr = 1234 printf("ptr = %s, ptr); why printing out char point “ptr” return entire array of char (the whole string), , printing out char point “chptr” return mem addr of “chptr”? if because “ptr” pointing array, why printing out array “aryint” return mem addr of aryint (not entire array)? printing out entire array applies string constant? or because of %s? but when tried replacing %s %u on printf() of ptr, constant (4197008) equivalent entire array/string (1234), , not mem address: //ptr u = 4197008 (a constant not mem addr), ptr s = 1234, printf("ptr u = %u, ptr s = %s”, ptr, ptr) however, when attempt print out char array “str”, mem address when applied %u on “str” (not entire array in ptr). got entire arra...

json - Nodejs page freezes after multple requests to Custom API -

the problem have application works when submit 1 one when press submit button multiple times freezes , after time (about 1000.000 ms) returns last request in console , jade page. submit button returns post form , sends same page . button refreshing page. important page returns (json) post page , there other json request sends api(and returns same page ) app.js var options_search = { hostname: 'host', path: 'path', method: 'post', headers: { 'content-type': 'application/json', 'content-length': json request .length, } }; app.post('/result',function(req,response){ var keyword=req.body.user; global.objtojson ={ keyword }; response.write(json.stringify(global.objtojson)); console.log("test " +json.stringify(global.objtojson) ); }); app.get('/search', function(req, res) { var req = http.request(options_search, (resb) => { var buffer...

Using Xmonad with custom keys to launch a function? -

how do this? tried following method gives me error saying brackets mismatched etc. not sure if function entry correct main = xmonad defaultconfig { terminal = "terminator" , modmask = mod4mask , borderwidth = 3 , layouthook = mylayout , keys = inskeys } inskeys :: xconfig l -> [((keymask, keysym), x ())] inskeys conf@(xconfig {modmask = modm}) = [ ((mod1mask, xk_f2 ), savecurrentworkspace) ] getlayout :: x (layout window) getlayout = gets $ w.layout . w.workspace . w.current . windowset mylayout = tiled ||| mirror tiled ||| full tiled = spacing 5 $ tall nmaster delta ratio nmaster = 1 ratio = 1/2 delta = 3/100 savecurrentworkspace :: x () savecurrentworkspace = layout x <- getlayout liftio $ writefile "currentlayout" (show x) to map custom keys launch function following. add xmonad.hs myadditionalkeys = [ ((mod1mask .|. xk_f1...

An android application were i need to place display 1GB data to the users ? -

an android application need place display 1 gb data users , can u please suggest me easy , fast way display content users ? xml / sqlite should create tables in data base , retrieve details . or should use xml text view , list view display content . since 1 gb data big, must use web service fetch data remote server. if use local database complex app handle. use web service , display fetched data in listview or like.

mysql - Regular expression to exclude a particular number -

i have model called department. class department < activerecord::base # associations belongs_to :client belongs_to :facility scope :facility_departments, ->(facility_id) { where("facility_id = ? ", facility_id)} scope :matching_departments, ->(facility_id, identifier) {facility_departments(facility_id).where(" ? regexp reg_exp ", identifier.to_s).order("weight desc") } end in departments table have facility_id , , regular expression column. i have employees in application, each 1 having department id. in order identify employees department, i'm using scope matching_departments in department model (see above). each employee has got identifier too. all employees having numeric identifier , identifier length = 9 , except 9 zeros (000000000) - should map department 1. so should regular expression department-1 in departments table? updated (^[0-9]{9,...

c++ - Create a tuple from the results of a callable tuple -

i have tuple of callable types. std::tuple<std::function<int(int)>, std::function<std::string(double)>> funcs; i want create tuple has type of result of each callable. example, funcs contains int->int , double->std::string how can create results tuple depend on each element in funcs , . std::tuple<int, std::string> results; #include <tuple> #include <functional> #include <string> // takes arbitrary tuple of std::functions , creates // tuple of return types of std::functions template<class t, class... types> struct tuplehandler; // handles recursive inheritance base case when // elements of tuple have been processed template<class... types> struct tuplehandler<std::tuple<>, types...> { using returntypetuple = std::tuple<types...>; }; // strips off first std::function in tuple, determines // return type , passes remaining parts on have next element // processed templa...

jquery - Free jqGrid - callback functions on filterToolbar are not being called -

example @ jfiddle (look text "example filter callback function") this deceleration seems have no effect on beforeclear & beforesearch: $(nameofgrid).jqgrid('filtertoolbar', {stringresult: true, searchonenter: true, searchoperators: true, defaultsearch : "cn",beforeclear: function() {alert(1)}, beforesearch: function() {alert(1);}}); i placed "alert(1)" see if popsup, doesn't seems triggered when filter or clean filter. i see since 4.9.0, on latest example shows. appreciate help, thanks, tal. the reason of problem: usage of filtertoolbar more once : $('#jqgrid').jqgrid('filtertoolbar', {stringresult: true}); $('#jqgrid').jqgrid('navgrid',{...}); $('#jqgrid').jqgrid('filtertoolbar', {stringresult: true, searchonenter: true, searchoperators: true, defaultsearch : "cn",beforeclear: function() {alert(1)}, beforesearch: function() {alert(1);}}); if 1 commen...

Unable to hide page properties tab for Granite Dialog(Touch UI) in AEM 6.1 -

i have requirement hide cloud services , permissions tab in page properties particular set of user group. have 2 of custom tabs in page properties. when create rep:policy node , add deny permission particular group custom tabs hidden ootb tabs cloud services , permissions not hidden. please note have overridden cq:dialog libs apps. any highly appreciated. thanks & regards ashish try: <cloudservices jcr:primarytype="nt:unstructured" sling:hideresource="true"/> <permissions jcr:primarytype="nt:unstructured" sling:hideresource="true" /> source :- http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manager.topic.html/forum__nkzm-i_have_a_requirement.html ~kautuk

linux - installaing Ubuntu 15.10 in windows 10 -

i running windows 10 in hp laptop, , wished run ubuntu 15.10. then, did: erased data in partition of laptop. created usb bootable using power iso in windows. restarted computer , pressed f9 . selected usb. and, selected " something else ". i chose erased partition: a. chose ext4 filesystem , logical , the begining b. mount point / then, installed ubuntu in selected partition, in there no windows 10 boot loader. the main problem is: when start computer both os options not showing. thanks in advance. you have update grub configuration file... open terminal , type following command: $ sudo update-grub it detect other operating systems installed on pc.output shown below generating grub configuration file ... found background: /home/rajeev/pictures/portal.png warning: setting grub_timeout non-zero value when grub_hidden_timeout set no longer supported. found background image: /home/rajeev/pictures/portal.png found linux image: /boot/vmlinuz-4...

How to check the Paypal account has been verifeid or not -

how check user's paypal account has been verified or not. we have used below link check status of paypal account, https://www.paypal.com/verified/pal= but link not working now. so, can me how check verified status of paypal account. you use getverifiedstatus api verify specific account's status. need submit application request make api call. please refer guide adaptive accounts. the detailed parameters getverifiedstatus api can found here .

javascript - Run browser JS in Node.js -

i wrote basic javascript code in angularjs. want able run code in node.js keep possibility run in browser depending situation. i know possible run node.js code in browser using browserify or lobrow did not find solution run browser code in node.js thanks in advance answers daniel first warning. no dom manipulation in module since node has no dom. if need require in module should looking @ browserify et al. your module this (function(){ var sayhello = function(name) { return "hello " + name; }; // here's interesting part if (typeof module !== 'undefined' && module.exports) { // we're in nodejs module.exports = sayhello; } else { // we're in browser window.sayhello = sayhello; } })(); in node var sayhello = require('./mymodule'); console.log(sayhello("node")); // => "hello node" and in br...

angularjs - Get specific image after a click -

i have list each has button invoke camera take picture , save locally. every time in html able view images have taken. <body ng-app="starter"> <ion-content class="has-header padding" ng-controller="imagecontroller"> <ion-list> <ion-item can-swipe="true" ng-repeat="prod in items"> {{prod.name}} <button class="button button-small button-energized" ng-click="addimage($index)">add image</button> <!-- view image taken index of button--> <img ng-repeat="" ng-src="" style="height:50px;"/> </ion-item> <ion-item> <!-- image taken showed list--> <img ng-repeat="image in images" ng-src="{{urlforimage(image)}}" s...

PHP saved twice when submitting to mySQL -

i using wordpress platform website , wrote following code submit form mysql database. problem is, whenever submit from, appears twice on database. wondering caused problem. <?php echo $sql; $name=''; $gender=0; $hpv=0; $hiv=0; $herpes=0; $symptoms=0; $diagnosed=0; $a=0; $e=0; $c=0; $qnumber=0; ?> <?php if (isset($_post['submit'])) { $db_host = 'localhost'; $db_user = ''; $db_pwd = ''; $database=''; mysql_connect($db_host, $db_user, $db_pwd); mysql_select_db($database); $name= $_post['username']; if (isset($_post['female'])) {$gender=1;} if (isset($_post['male'])) {$gender=2;} if (isset($_post['herpes'])) {$herpes=1;} if (isset($_post['hpv'])) {$hpv=1;} if (isset($_post['hiv'])) {$hiv=1;} if (isset($_post['symptoms'])) {$symptoms=1;} if (isset($_post['diagnosed'])){ $diagnosed=1;} if (isset($_post['awareness'])){ $a=1;} if (isset($_post['educat...

php - What is issue in my code Sandbox paypal future payment -

i have alredy enable future payments permission in app , using developer dashboard.but not working yet please find error http://developer.paypal.com/ , log in https://developer.paypal.com/developer/accountstatus there can see permits have. $data = array( "intent" => "authorize", "payer" => array( "payment_method" => "paypal" ), "transactions" => array( array("amount" => array( "currency" => "usd", "total" => "1.88" ), "description" => "future of sauces") )); $data_string = json_encode($data); $ch = curl_init(); curl_setopt($ch, curlopt_url, "https://api.sandbox.paypal.com/v1/payments/...

css - How can I debug twitter bootstrap v4-alpha grid? col-sm-offset-* not working -

Image
i've changed something, somewhere , col-sm-offset-* s aren't working @ all. example, if wanted split screen in half, , display content on right hand side, use: <div class="container"> <div class="row"> <div class="col-sm-6 col-sm-offset-6"> content isn't on right hand side, it's on left if col-sm-offset-6 isn't there. </div> </div> </div> how can check what's wrong? i'm using npm , laravel elixir (gulp) minify (make production ready) files , short of me copying entire css file here, don't know else do. there obvious? has come across before? update <div class="container"> <div class="row"> <div class="col-sm-6 col-sm-offset-6"> <div class="row"> <form role="form" method="post" action="/register"> ...

Why does this basic Java boolean expression not work? -

why not compute in java (v1.8). seems logical me.... boolean banana = true; (banana == true || false) ? system.out.println("true") : system.out.println("false"); output message: error: java: not statement the ternary conditional operator must return value. second , third operands can't statements don't return anything. must expressions return value. you switch : system.out.println(banana ? "true" : "false"); note banana == true || false equivalent banana == true , equivalent banana banana boolean type.

asp.net - Get child page data from master page selectedItems -

i have location dropdownlist in master page. have set control in child page takes properties master page. running query select * table city '"+city.text+"' here city.text gets value master page selected cities. problem it's not showing records per city.text has values in it. shows random records. my code master page <asp:dropdownlist id="locationselector" runat="server" autopostback="true"> <asp:listitem selected>pune</asp:listitem> <asp:listitem>delhi</asp:listitem> <asp:listitem>chennai</asp:listitem> <asp:listitem>bangalore</asp:listitem> <asp:listitem>mumbai</asp:listitem> </asp:dropdownlist> child page vb code dim location dropdownlist = page.master.findcontrol("locationselector") city....

How do I use Http Digest Auth with volley on Android -

i want use http digest volley . far have used following code: @override public map<string, string> getheaders() throws authfailureerror { hashmap<string, string> params = new hashmap<string, string>(); string creds = string.format("%s:%s","admin","mypass"); string auth = "digest " + base64.encodetostring(creds.getbytes(), base64.no_wrap); params.put("authorization", "digest " +auth); return params; } so far response server wrong credentials means authentication working wrong credentials getting passed. credentials right. you use base64 encoding fine basic auth not how digest works. digest & basic auth specs can found here: https://tools.ietf.org/html/rfc2617 the newer digest specs can found here: https://tools.ietf.org/html/rfc7616 and nice explanation on wikipedia here: https://en.wikipedia.org/wiki/digest_access_authentication for volley implementation of di...

javascript - Is it possible to search the DOM for a keyword occurring within an iframe and reload page until it's found? -

Image
i have ad displays within iframe on given publisher site around every 1000 loads or so. have no control on host site need way see ad live users see it. i'm trying figure out javascript solution load page, search name of company see if ad loaded (the company name id of div tag loads iframe) , either stop there if finds it, or reload page if not. i had sort of working running script in console got innerhtml of document body, searched keyword , reloaded page if keyword wasn't found. two problems though. it find keywords outside of iframe. it didn't search content of iframe (where actual keyword identify particular ad sits) if set delay or did onload. secondly, every page refresh, script cleared console. i know beginner stuff love pointers correct way tackle problem. thanks far (also, upvoted don't think have necessary cred show publicly) here's got. created chrome plugin following manifest.json: { "manifest_version": 2, "n...

javascript - How to use yield with my own functions? -

i new generator concept. understanding if function returns promise , can used yield . have small node.js script looks this: q.fcall(function*(){ var url = "mongodb://" + config.host + ":" + config.port + "/" + config.db; var db = yield mongoclient.connect( url ); var data = yield makerequest(); console.log( data ); db.close(); }); function makerequest(){ var deferred = q.defer(); request({ "method" : "get", "url" : "....", "headers" : { "accept" : "application/json", "user_key" : "...." } },function(err,data){ if( err ){ deferred.reject( err ); }else{ deferred.resolve( data ); } }); return deferred.promise; } i know works because porting callback hell style generator style. however, not see data in console.log. what need change make work? q.f...

Error while installing Python TA-lib package on Linux system with no sudo privileges -

i'm having trouble installing python talib package on linux system ( linux 2.6.32-431.17.1.el6.x86_64 ). see https://github.com/mrjbq7/ta-lib . what did far: brew install ta-lib (dependency) this worked fine. if rerun command see warning: ta-lib-0.4.0 installed pip install ta-lib when running this, following error: error: command /home/username/.linuxbrew/bin/gcc' failed exit status 1 i don't have sudo privileges on machine , suspect might problem. tried pip install --user ta-lib and wget https://github.com/mrjbq7/ta-lib/archive/master.zip && unzip master.zip && cd ta-lib-master && python setup.py install. same error above. any ideas i'm doing wrong? i stuck @ problem. found 2 ways solve this. problem because ta-lib installation check several dirs, not include linuxbrew path. have 2 ways solve problem. follow instructions on https://github.com/mrjbq7/ta-lib , download " ta-lib-0.4.0-src.tar.gz ...

EXCEL - VBA . Getting the cell values as Key Value Pairs -

i trying address values excel cells of column 'i' , pass query string url using vba. have embedded 'microsoft object browser' inside excel load page. is possible? because worried amount of data passed query string high (1000 rows approximate). the code not working though, there way same passing query string array? also need vba syntax parse dictionary values. i new vba. please help. dim arr() variant ' declare unallocated array. arr = range("i:i") ' arr allocated array set dict = createobject("scripting.dictionary") dim irow integer irow = 1 dim parms variant dim rg range each rg in sheet1.range("i:i") ' print address of cells negative 'msgbox (rg.value) 'result = result & rg.value dict.add rg.value irow = (irow + 1) next msgbox (dict.item(1)) set dict = nothing 'webbrowser1.navigate2 "http://localhost/excelmaps/maps.php?adr=...

c# - Exception while loading assemblies Xamarin.Android.Support.v4 -

Image
i working on visual studio xamarin.forms , following error: exception while loading assemblies: system.io.filenotfoundexception: not load assembly 'xamarin.android.support.v4, version=1.0.0.0, culture=neutral, publickeytoken='. perhaps doesn't exist in mono android profile? file name: 'xamarin.android.support.v4.dll' @ xamarin.android.tuner.directoryassemblyresolver.resolve(assemblynamereference reference, readerparameters parameters) @ xamarin.android.tasks.resolveassemblies.addassemblyreferences(icollection`1 assemblies, assemblydefinition assembly, boolean toplevel) @ xamarin.android.tasks.resolveassemblies.execute() sportbook.droid what should do? go nuget , update xamarin android support library -v4 package, , in cases need update xamarin.forms library, more info check following link: https://forums.xamarin.com/discussion/26685/xamarin-forms-filenotfoundexception-xamarin-android-support-v4

How to edit href of button on magento homepage -

i magento dev years stopped couple of years. , stuck @ how magento (architecture works). question is: how find href of submit button on magento homepage? this template button located. log magento back-end admin go system -> configuration in main menu go developer on bottom left under advanced switch store view on top left current website or store view. under debug tab of same developer config page see new option appear allow turn on/off template path hints. remember clear cache.