Posts

Showing posts from August, 2013

java - NullPointerException - attempt to invoke virtual method `notifyDataSetChanged()` - can't see list created -

Image
i'm working way through this tutorial , stuck adding names list, , having list populate. here's i'm trying get, list of names type in in input box: (the underlined "darryl" input box, , shows name (after hitting button) on top, adds list). i'm getting error though: 08-24 18:17:50.903 21935-21935/com.example.batman.myapplication e/androidruntime﹕ fatal exception: main process: com.example.batman.myapplication, pid: 21935 java.lang.nullpointerexception: attempt invoke virtual method 'void android.widget.arrayadapter.notifydatasetchanged()' on null object reference @ com.example.batman.myapplication.mainactivity.onclick(mainactivity.java:65) @ android.view.view.performclick(view.java:5217) @ android.view.view$performclick.run(view.java:20983) @ android.os.handler.handlecallback(handler.java:739) @ android.os.handler.dispatchmessage(handler.java:95) @ android.os.l...

c# - SimpleInjector lifestyle.CreateInstance per webrequest -

i trying register dbcontext implements 2 interfaces web application. want create webrequestlifestyle registration, simple iinjector exception on load torn registration (i think getting multiple instances didn't mind). following this example documentation, error lifestyle mismatch. when lifestyle.createregistration in on webrequestlifestyle instance, transient context registration. question: how lifestyle.createregistration return me per web request registration rather transient registration? edit namespace siproject.sample.web.controllers { public class taxonomy{ public int taxonomyid { get; set; } public string term { get; set; } } public class navitem { public int navitemid { get; set; } public string navname { get; set; } public string url { get; set; } } public interface itaxonomydbcontext { dbset<taxonomy> taxonomys { get; set; } } public interface inavigationdbcontext { dbset<navitem> navitems { get; set; } } public...

javascript - onclick event not firing based on boolean flag -

i'm working on code if user clicks on particular button, person not presented exit popup upon exiting page. way i'm doing setting flag whenever user clicks on button. however, code isn't working expected: popup loads whether or not button clicked. don't understand why. edit: help! <!doctype html> <html> <head> <title>test!</title> <script> var bool = false; var config = new object(); config.surveyid = 3155031; config.takesurveyurl = 'http://www.supporterfeedback.org/a/takesurvey'; config.windowpositionleft = 200; config.windowpositiontop = 300; config.home = 'http://www.surveyanalytics.com/'; config.isrighttoleft = false; config.showfooter = true; // document.getelementbyid("btn").onclick = function() // { // bool = true; ...

ruby on rails - nil is not a symbol accepts_nested_attributes_for has_one association -

i trying accepts_nested_attributes_for working has_one association. have following set using mongoid. class foo include mongoid::document include mongoid::timestamps include mongoid::paranoia has_and_belongs_to_many :bars, inverse_of: nil end class bar include mongoid::document include mongoid::paranoia has_one :magazine, class_name: 'foo', dependent: :destroy, inverse_of: nil accepts_nested_attributes_for :magazine end when following in rails console seem following output. r = bar.new => #<bar _id: 1213 .... [2] pry(main)> r.foo.build typeerror: nil not symbol /users/home/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems /mongoid-3.1.6/lib/mongoid/attributes.rb:155:in `respond_to? this blog post writeup of inverse_of . instead of inverse_of: nil in models, have specify symbol. example, :bars association should declared inverse_of: :magazine .

regex - Extracting number from text string referencing specific text -

this question has answer here: extract numeric part of strings of mixed numbers , characters in r 4 answers i have dataframe following: columna=c("kuala lumpur sector 2 new","old jakarta sector31", "sector 9, 7 hong kong","jakarta new sector22") df1 <- data.frame(columna) from extract sector in instances, i.e.: 2,31,9,22 in cases number preceded word 'sector'. however, there may or may not space before number. although not in example above, there may other irrelevant numbers in text string, want ignore. numbers range 1-30, no 100s or above involved. i'm afraid regular expression experience nil. appreciated. also, future use, if there regex guides specific r, appreciate heads-up. for example using gsub , grouping: gsub(".*sector ?([0-9]+).*","\\1",columna) [1] ...

Pushbullet Oauth using Bash and curl -

i wrote pushbullet linux command line client in bash. want allow users grant access pushbullet accounts via oauth, i'm having trouble. did oauth google drive api other day. straightforward, requiring few lines of code. honest, oauth section in pushbullet api docs unclear. let me make sure understand steps required: send user pushbullet site url generated in-app url should include: client_id , redirect_url (redirect_url specifies url user re-directed after granting access pushbullet, in addition response_type, either token or code) user grants or denies access pushbullet account if access granted, user sent redirect_url client must obtain access_token embedded in redirect_url , append access_token future requests does sound right? my script loads authentication url in browser, when click "approve" following error: the param 'redirect_uri' has invalid value . used redirect_uri listed in "clients" section of pushbullet settings. so, this:...

How to I return the key number I just added to an array in PHP by using [ ]? -

i have while loop, , in loop appending keys array using $my_array[] = $array_element; code snippet: <?php $raw_string = 'david,frank,hal9000,victor,jack,charles' $put_into_array = explode(',', $raw_string); $my_array = array(); foreach($put_into_array $array_element){ if($array_element != 'hal9000'){ $living_crew[] = $array_element; if( //the array key 2nd key// ){ $lost_in_space_by = $tried_to_retrieve; ////do here//// } if( //the array key 1st key// ){ $tried_to_retrieve = //this key//; } } } ?> i looking way value added [] infront of $my_array. know particular example can solved in other ways, point learn function, not solve 1 example in other ways. expected behave similar now-depricated mysql_insert_id() function. thanks! use $idx = array_push($living_crew, $xxx) - 1 instead of $living_crew[] = $xxx; it returns length of array. se...

How can I ensure in Java that the current local time is correct? -

Image
this question has answer here: i want current time in java without internet , without system time 1 answer i need make sure in client application user doesn't dramatically change machine date (e.g. bringing 1 month before). to best of knowledge, best way check current time in java system.currenttimeinmillis() how can make sure correct date, in multiplatform environment (either windows, linux, mac, etc.)? no connection remote servers available, nor internet. also, @ startup time time tampered. need check time internal biz logic purpose, not set anything. radio clock obtain radio clock usb connection output of current time synchronized time code transmitted radio transmitter connected time standard such atomic clock. similarly, receiver of gps signals capture time signal . the meinberg global company, @ least, offers several such devices . ...

apache - httpd redirects with SSL and subdomains/vhosts -

Image
i'm trying setup http -> https redirected subdomains on website, being served apache (version: 2.2.31). purchased wildcard ssl certificate installed correctly main site ( www.domain.com ) because green lock next address, part should done. the issue : browsing subdomain.domain.com redirects www.domain.com , can't figure out why. i've been reading , following this page several others similar content, i'm missing key ingredient. the main site served /var/www/html , subdomain served /var/www/vhosts/subdomain . also, i'm getting error: [warn] _default_ virtualhost overlap on port 443, first has precedence here's vhost section of /etc/httpd/conf/httpd.conf : namevirtualhost *:80 <virtualhost *:80> servername www.domain.com serveralias www.domain.com #redirect permanent / https://www.domain.com redirect 302 / https://www.domain.com </virtualhost> <virtualhost *:80> servername subdomain.domain.com servera...

unity3d - [Unity][Javascript] Why are these simple js scripts not working in Unity? -

i've been sort of teaching myself , sort of learning jimmy vegas on youtube: https://www.youtube.com/channel/ucrmxhq2rj9_0chs7mhl7erg if haven't seen tutorials or don't want look, 1 of things create small script destroys coin when player collider hits it, mine isn't working. code below (a little mis-formatted, sorry, couldn't format correctly): function oncollisionenter (collision : collision) { if(collision.gameobject.tag == "coincollect") { destroy(this.gameobject); } } i applied script prefab , placed bunch of coins around little area, additionally, made capsule collider in first person controller tagged "coincollect", , ticked "is trigger" also, i'm trying make teleporter teleports first person character 1 teleporter another. code below: var warptarget001 : gameobject; var warptarget002 : gameobject; function ontriggerenter (col : collider) { if (col.gameobject.tag == "warp001") { this.tran...

ant contrib - Ant @ variable not resolved -

here snippet of build.xml <target name="compile"> <for param="rsync.destination.host" list="${file}" delimiter="${line.separator}"> <sequential> <echo message="${rsync.ssh.user}@@{rsync.destination.host}:${rsync.destination.base.dir}/"/> </sequential> </for> </target> i received following output, compile: [echo] root@{rsync.destination.host}:/tmp/ [echo] root@{rsync.destination.host}:/tmp/ build successful total time: 0 seconds so here @{rsync.destination.host} variable not interpreted because of double @@ character. if put space in between them <echo message="${rsync.ssh.user}@ @{rsync.destination.host}:${rsync.destination.base.dir}/"/> then variable resolved expected. compile: [echo] root@ server1:/tmp/ [echo] root@ server2:/tmp/ build successful total time: 0 seconds since there space in username , server through...

ios - How to give a button iPhone onScreenKeyboard return key behaviour? -

Image
i have application have implement customised quicktype suggestion @ top of onscreen keyboard. where(quicktype suggestion box) right button behaviour keyboard return type behaviour. if keyboard return key "next" suggestion's right key "next", if "done" has "done" along type action. had attested 3 buttons along top of keyboard when it's appear. can't figure out, how work it? possible trick? , how? if, there ways that, please suggest. okey first need know type of keyboard button , if button next text fields should have unique tag foreach 1 : -(ibaction)didtaponcustomnextbutton:(id)sender { uitextfield * textfield = (uitextfield *)sender ; if(textfield.returnkeytype == uireturnkeynext) { nsinteger nexttextfield = textfield.tag+1; uiresponder* responder = [textfield.superview viewwithtag:nexttextfield]; if (responder!=nil) { [responder becomefirstresponder]; } ...

ios - Present Popover View Controller Swift -

when try display popover view controller programmatically won't work , don't know why. i've copied multiple sources on web , nothing seems work, same error in console every time showing warning: attempt present <addfriendspopoverviewcontroller> on <mainpageviewcontroller> view not in window hierarchy! lost , can't seem figure out problem is, in advance! here swift code in viewdidload() function: let addfriendspopoverviewcontroller = addfriendspopoverviewcontroller() override func viewdidload() { super.viewdidload() if (pfuser.currentuser()?["numberoffriends"])! as! nsobject == 0 { print(pfuser.currentuser()?["numberoffriends"]) let storyboard = uistoryboard(name: "main", bundle: nil) let vc = storyboard.instantiateviewcontrollerwithidentifier("addfriendspopoverviewcontroller") as! uiviewcontroller vc.modalpresentationstyle = uimodalpresentationstyle.popover ...

web - Double Brackets [[ ]] vs Double Braces {{ }} in Polymer -

what's succinct way explain difference between double brackets ( [[...]] ) , double braces ( {{...}} ) in polymer 1.0? for instance, in documentation <iron-list> element sample html shows: <template is="dom-bind"> <iron-ajax url="data.json" last-response="{{data}}" auto></iron-ajax> <iron-list items="[[data]]" as="item"> <template> <div> name: <span>[[item.name]]</span> </div> </template> </iron-list> </template> why data bounded double braces in 1 spot ( last-response="{{data}}" ) bounded double brackets ( items="[[data]]" ) in spot? binding can either one-way (using [[]]) or two-way (using {{}}, use notify). to explain *-way binding think traffic. one-way binding when update model, view gets updated. when vice-versa true two-way binding. for more information see documentation ...

jquery - How to make the menu is clickable only if certain condition is met? -

how make menu clickable or dropable when condition met? in case want menu clickable or dropable when button clicked ul {list-style: none;padding: 0px;margin: 0px;} ul li {display: block;position: relative;float: left;border:1px solid #000} li ul {display: none;} ul li {display: block;background: #000;padding: 5px 10px 5px 10px;text-decoration: none; white-space: nowrap;color: #fff;} ul li a:hover {background: #f00;} li:hover ul {display: block; position: absolute;} li:hover li {float: none;} li:hover {background: #f00;} li:hover li a:hover {background: #000;} #drop-nav li ul li {border-top: 0px;} <!doctype html> <html lang="en"> <head> <link rel="stylesheet" type="text/css" href="try.css"> <meta charset="utf-8"> <title></title> </head> <body> <ul id="drop-nav"> <li><a href="#">content management...

c - Reading in words into a linked list -

im trying write program reads each word inputted user , sticks word linked list. have tried far got seg faults not sure went wrong mallocing/pointers. (havent implemented printlist yet). #include <stdio.h> #include <stdlib.h> #include <string.h> #define max_len 20 typedef struct node{ char *word; struct node *next; }node_t; node_t *read(node_t *node); void printlist(node_t *node); node_t *insertnode(char *word, node_t *node, int size); int main(int argc, char *argv[]) { node_t *start = null; printf("enter sentence:\n"); read(start); return 0; } void *read(node_t *node){ int i, size = max_len; char c, *word; if(!(word=malloc(size))){ printf("out of memory!\n"); exit(exit_failure); } while((c=getchar())!='\n'){ for(i=0;c!=' ';i++){ word[i]=c; if(i>size){ size=size*2; if(!realloc(word, size)){ ...

bind9 - DNS Query using TSIG : BIND server -

here trying do: use tsig validate dns transaction : query , response. i know tsig used between 2 hosts secured zone transfers. but, trying validate simple query client using tsig. have generated private key @ server using dnssec-gen tool , appended tsig record @ client side outgoing dns query message. i not sure how enable bind server validate tsig rr on incoming query. have added key configuration in named.conf file matches tsig rr signed @ client side. when receive tsig signed dns query @ server side, following error message shown: request has invalid signature: tsig mytsigkey: tsig verify failure (badsig) but, feel mac have generated , appended dns query record correct (i verified slavasoft hmac calculator). not sure if missing in named.conf file. below config. inputs highly appreciated. key "mytsigkey" { algorithm hmac-md5; secret "aszn6w/8hjihoffalh/4xg=="; }; options { listen-on port 53 { any; }; listen-...

swift2 - waits until the user finishes responding to the popup dialog in Swift -

i want user type text in pop dialog, want program wait until user finished writing text in pop dialog use uialertcontroller : let alertcontroller = uialertcontroller(title: "title", message: nil, preferredstyle: .alert) alertcontroller.addtextfieldwithconfigurationhandler { (textfield) -> void in } alertcontroller.addaction(uialertaction(title: "cancel", style: uialertactionstyle.cancel, handler: nil)) loginalertcontroller.addaction(uialertaction(title: "go", style: uialertactionstyle.default, handler: { (action) -> void in }

svg - Why, when I read the bootstrap3css, do you change the value that the browser returned by jQuery offset method? -

why, when read bootstrap3css, change value browser returned jquery offset method? value browser returned jquery offset method becomes point . which correct? how match? chrome 44.0.2403.157 m do not read bootstrap3css <style> svg { border: 1px solid #ddd; } </style> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <svg preserveaspectratio="none" viewbox="0 0 2000 400" width="500" height="400"> <rect id="hoge" x="50" y="50" width="50" height="50"/> </svg> <script> console.log($("#hoge").offset()); //object {top: 59, left: 21.5} </script> read bootstrap3css <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"> <style> svg { border: 1px solid #ddd; } </style> <script...

reporting services - Add Rows for months missing from years SQL Server 2008 R2 -

Image
i working table stores data @ monthly level. however, many items, there isn't entries months. how add rows missing months specific year range (example: 2017 - 2020)? here's have done far: --create temp table retrieve months , years range looking populate rows for: declare @months table (monthnum int) declare @i int =1 while (@i<=12) begin insert @months(monthnum) select @i set @i=@i+1 end declare @yearsrange table (monthnum int, yearsrange int) insert @yearsrange (monthnum, yearsrange) ( select *, year(getdate()) years @months union select *, year(getdate()) + 1 years @months union select *, year(getdate()) + 2 years @months union select *, year(getdate()) + 3 years @months ) select * @yearsrange table structure: --rows red ones expect end result: first, don't use loop. can recursive cte quickly... declare @start date = '20170101' declare @end date = '20201201' ;with rcte as( select thedate = @start union se...

android - Imageview getting automatically changed on scroll listview -

i new android , facing 1 comman problem of listview googled alot did'nt found usefull case.hope people show me right direction.whenever changing image "plus" "tick" on click last item image got automatically changed on scroll. my list_comapare_product xml :- <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/white_color" android:orientation="vertical" > <relativelayout android:layout_width="match_parent" android:layout_height="100dp" android:layout_marginleft="20dp" android:layout_marginright="20dp" android:background="@color/white_color" android:gravity="center_vertical...

javascript - CRUD's save method refers to wrong URL -

i need task.save go /users/:user_id/tasks seems refer wrong path , error: no route matches [post] "/users/tasks" how can solve issue? in advance. js var app = angular.module('todolist', ['ngresource', 'xeditable']); app.factory('task', [ '$resource', function($resource) { return $resource('users/:user_id/tasks/'); } ]); app.controller('tasksctrl', [ '$scope', 'task', function($scope, task) { $scope.addnewtask = function() { var task = task.save($scope.newtask); $scope.tasks.push(task); $scope.newtask = {}; }; } ]); you aren't telling resource :user_id path parameter from. you either supply when call save task.save({user_id: 'some value'}, $scope.newtask) or, if property part of $scope.newtask , eg $scope.newtask = {id: 'some id'} , declare in resource definition return $resource('users/...

c++ - Why is this SQlite3 query execution returning "SQLITE BUSY : Database is locked" and what it the likely solution -

this code keeps returning "sqlite busy : database locked" though not accessing external thread or process , how can resolve this? the code uses cppsqlite3 c++ wrapper sqlite. int departmentaccess::saveordeleteaccess(long long ideptnameid,long long &iuserid,int &iaccesstypeid) { char szstring[1000]; char chaccesstypeid[1000]; stringcbprintfa(szstring,sizeof(szstring),"%d",iaccesstypeid); encryptstring(szstring,chaccesstypeid); try { char szdatabasefile[1000]; getdatabasea(szdatabasefile,sizeof(szdatabasefile)); cppsqlite3db db; db.open(szdatabasefile); cppsqlite3statement stmt = db.compilestatement("select accessid departmentaccess (insututionid = ? , deptnameid = ? , userid = ? , accesstype = ?)"); stmt.bind(1,m_iinsututionid); stmt.bind(2,ideptnameid); stmt.bind(3,iuserid); stmt.bind(4,chaccesstypeid); cppsqlite3query q = stmt.execq...

ios - Images are changing in collectionView when i scroll it -

this question has answer here: proper way deal cell reuse background threads? 3 answers n code below, collectionview scroll smoothly, if scroll extremely fast, there incorrect image shows , changes correct 1 scrolling decelerates. why isn't setting below code using my code : - (uicollectionviewcell *)collectionview:(uicollectionview *)collectionview cellforitematindexpath:(nsindexpath *)indexpath { uicollectionviewcell *cell; cell= [collectionview dequeuereusablecellwithreuseidentifier:@"identifier" forindexpath:indexpath]; cell.backgroundcolor = [uicolor whitecolor]; nsmutablearray *arr_assect=[menuarray objectatindex:indexpath.row]; backview=[[uiview alloc]initwithframe:cgrectmake(0, 0, cell.bounds.size.width, cell.bounds.size.height)]; uiimageview *dotlines=[[uiimageview alloc]init]; ...

python - How can I pass parameters to --output in youtube-dl? -

have csv file bunch of youtube links. it's structured video-name \t part \t youtube-url i want use youtube-dl python download each video , have saved video-name_part.extension - possible or can things %(name)s included in youtube-dl? you can import youtube_dl module , pass parameters using parameter dictionary. need take @ the documentation finer control on can do, outtmpl allows control output format in way suggested. the following script shows how go reading csv file: import csv, youtube_dl open("filelist.csv", "r") f_filelist: csv_filelist = csv.reader(f_filelist, delimiter="\t") cols in csv_filelist: video_name = cols[0] part = cols[1] youtube_url = cols[2] ydl_opts = {"outtmpl" : r"{}_{}.%(ext)s".format(video_name, part)} youtube_dl.youtubedl(ydl_opts) ydl: ydl.download([youtube_url])

image preloader - Reference loaded <img> in javascript -

i use carousel jquery plugin defines container must contain <img> tags. images loaded , shown, carousel works. i implementing image preview on hover. i've created separate <div> purpose being shown loaded image. the problem i'm programatically creating new <img> tag within <div> each time mouse hovers on different image. results in massive amount of unnecessary server requests. how can use preloaded images carousel within image preview div? i don't need working solution, i'll accept abstract answers. further comments, here's working sample of clonenode method mentioned. i've not bothered mechanics of containers or of triggering behaviour via mouse hover, click existing image , work. you'll have change image source have. i'm testing full-res version of image: https://commons.wikimedia.org/wiki/file:soundingrocketsamplepayload-02.jpg <!doctype html> <html> <head> <script> "use...

App is crashing when using AVAudioplayer continuously xamarin ios -

my xamarin.ios app crashing when play sounds using avaudioplayer continously . i'm using captuvo scanner scan bar codes , play sounds according barcode scanned. at time may need play 3 or more sounds 1 one . use finished launching method of avaudioplayer play sound 1 one. the app working when scanned slowly, when scanned more speed app crashes. here crash log. incident identifier: 8ac6f9c2-eeb2-4e11-a618-c6f6b82f759c crashreporter key: 1ea5f3b8e74c13c25fde44ab839109c4d5380982 hardware model: ipod5,1 os version: iphone os 8.2 (12d508) kernel version: darwin kernel version 14.0.0: mon feb 9 22:07:50 pst 2015; root:xnu-2783.5.38~5/release_arm_s5l8942x date: 2015-08-25 12:03:42 +0530 exception code: 0xdeaffeed reason:power assertion timeout "com.apple.timed.ntp". releasing now. backtrace power assertion: pid 32 (0x280c8d57 0x280c921b 0xabf05 0xabbf5 0x31914c83 0x31914c6f 0x31920553 0x23789891 0x23787fb...

Mysql Master Master Replication Issue -

i implementing master master replication in mysql. can have doubt. for case, there 2 solution 1. use 1 master failover cases only. (i dont recommend) 2. distribute load changing application (like it) issue found in of 2 approach. we have 2 masters , b. user update city delhi , goes server , before b replicate query server goes down , shift queries server b only. same user updates city mumbai. when server goes up, * delhi update query go server b (bin log reading) * mumbai update query go server (bin log reading) hence discrepancy in data. how solve issue ? my database mix of innodb , myisam i guess (not tested) can achieve proxy, e.g. maxscale configure proxy readsplit distrubutes reads on server , b , 1 master rest. in addition setup master failover scenario when server goes down. actually have simple master-slave setup in maxscale, in background there still master-master working. maxscale or application doesn't need know this.

Grails: how to reset a form in grails -

i've created form , reset button application. my reset button looks this <g:render template="/layouts/pagebuttons" model="[type:'reset', value:'reset', reset:true]"/> and form composed of textfields , radiobuttons. this how made radio button : <g:render template="/layouts/customelements" model="[type: 'radio', radioname: 'gender', radiolabels: ['male','female'], radiovalues: ['m','f'], radiovalue: employeeinstance?.gender]" /> i have portion in page shows error messages if have invalid input, etc. my question if, if tried click existing reset button have, fields affected except radiobutton , errormessages. means if chose "female button" not reset value. , error messages remain in page. what can radio buttons affected reset , error messages cleared? note: need use render tag reset , radio button, please give me solution use well. thank ...

web services - How to locate the WSDL file in Azure web site? -

i've created web application runs web service (wcf). source code long gone checked app still , running. given have address service ( something.azurewebsites.com ) , name of 1 of methods exposed (parameterless ping ), how can learn location of wsdl file? as far recall, i've exposed common way, publish file fetched suggestion on azure portal. i'd call method ping verify something, rebuilding whole new service seems bit overkill. suggestions on exact url might be? alternatively, suggestions on tool sniff up? go azure portal , find ftp address "something.azurewebsite.net". use ftp program connect server , browse files. way might able find ".svc" file. matter, might able download of code , use tool reflector view .net compiled code.

python - How to save the global variable value in Django and how to get that saved value if I reloads the page? -

i have 1 webpage track user tasks every day. want freeze date user cannot able edit data before date. done admin.so declare global variable(flag) in views.py , when admin freezing date value assigned true. when user logged in value not changed. how can this?

javascript - How to get id of html element in top level html tag -

after rendering html , jquery code in browser, <html> <body> ... <div class="mce-container-body"> <div class="mce-first"> ... <input type="text" id="texteditfirst01"> ... </div> <div class="mce-last"> <input type="text" id="texteditsecond01"> </div> </div> <iframe> <html> ... <input type="submit" onclick="return mysubmit();" /> <script type="text/javascript"> function mysubmit() { var url = "http://localhost:61222/14communityimages/hands.png"; var id = window.parent.$(".mce-container-body").child("input").attr("id"); alert(id); //parent.document.getelementbyid("mceu_96-inp").value = url; tinymcepopup.close(); } </script> ...

tfs - Can no longer connect to Visual Studio Team Services using Visual Studio 2008 -

today tried connecting visual studio team services using visual studio 2008 , got error tf31002. tf31002: unable connect team foundation server x. team foundation server url: y. i used able connect using installation of visual studio seems no longer case. this url using: https://myusername.visualstudio.com/defaultcollection same url works fine in browser. here steps tried in specified order: uninstall visual studio 2008 using tool provided microsoft: http://go.microsoft.com/fwlink/?linkid=105801 install visual studio 2008 again. install visual studio 2008 team explorer install visual studio 2008 sp1 install visual studio 2008 gdr update tfs after performing above steps, still getting exact same error. able connect vs team services fine visual studio 2015 installation on same computer. visual studio 2008 no longer supported when connecting tfs 2015 , visual studio team services through old team explorer client 2008. while still works (sort of), you...

performance - Jmeter BSF shel l: Response message: org.apache.bsf.BSFException: unable to load language: java -

i want run java code in jmeter using bsf shell shows error: "response message: org.apache.bsf.bsfexception: unable load language: java". please provide url can download java language jar jmeter. easy way: switch beanshell test elements , beanshell quite java-compliant (apart modern features generics, switch statement on strings, etc. hard way: patch bsf-2.4.0.jar file (lives under /lib folder of jmeter installation) add javaengine class it. right way: from bsf sampler documentation : the bsf api has been largely superseded jsr-223, included in java 6 onwards. scripting languages include support jsr-223; please use jsr223 sampler instead. bsf sampler should needed supporting legacy languages/test scripts. so consider using jsr223 test elements , groovy language instead. in 99% of cases valid groovy code valid java code it's unlikely you'll have change anything. see beanshell vs jsr223 vs java jmeter scripting: performance-off you...

Pick shortest route with simpleXML -

first post bear me. i have hacked module oscommerce figures delivery cost pizza delivery. i used google distance matrix , got working discover picks fastest route , not shortest. , there no option tell pick shortest. oh well.. poked arround , found use direction api instead http://maps.googleapis.com/maps/api/directions/xml?origin=svendborgvej%20323,%205260%20odense%20s,%20denmark&destination=albanivej%2027,%205792%20%c3%85rslev&alternatives=true now have 2 routes in xml , need pick shortest one extract distance it my code far: http://pastebin.com/t3ky5qzn i'm not programmer , bit stuck here... me out? i used online xml viewer more human readable format , can see 2 blocks 1 route in , total distance in each.. its simple as: echo min($result) from there simple mod module picks shortest route of google might give

c# - Trigger BackgroundTask either any of two conditions: PushNotification Received or using Geofence -

Image
i have single backgroundtask . can start backgroundtask using both pushnotification or using "geofencing" technique in same app? requirement that, backgroundtask should start in either of following 2 cases: when push notification received, implemented on app , working well. when user change location, using "geofencing" technique need implement on app. any appreciated. advance! i found solution. can add many background tasks per requirement in package.appmanifest . have added 2 backgroundtasks , works perfectly. completed task successfully.

Configure IBM WAS Liberty V8.5.5.6 & eXreme Scale -

i attempting (and failing) configure development environment follows:- eclipse 4.5 java ee developers (mars). websphere developer tools ibm websphere extreme scale v8.5 liberty profile developer tools websphere extreme scale v8.6 developers - liberty profile liberty v8.5.5.6 java ee 7 full platform the issues have relate organisations security constraints related downloading resources external web sites. i can configure following separate environments extreme scale eclipse 4.5 java ee developers (mars). websphere developer tools eclipse websphere extreme scale v8.6 developers - liberty profile liberty beta v9 osgi applications jee7 eclipse 4.5 java ee developers (mars). websphere developer tools eclipse liberty v8.5.5.6 java ee 7 full platform my 2 blockers eclipse extreme scale tools ibm websphere extreme scale v8.5 liberty profile developer tools are available update site. can install eclipse tools zip archives. are these eclipse tools available zip arch...

R - apply function - Deactivation of matrix conversion -

is possible deactivate as.matrix() conversion of apply()? in r documentation , in previous posts @ stack overflow, not find flags solve problem. example: selection of multiple sub matrices matrix using apply(). problem: apply() function automatically converts results matrix. leads 1 big matrix containing results. code: #mat contains data, m desired column selections mat <- matrix(c(1,2,3,4, 2,3,4,1, 2,4,3,1, 3,4,2,1) ,nrow = 4) colnames(mat) <- c(1,2,3,4) m <- matrix(c(1,2, 3,4) ,nrow = 2) #selects first 2 , last 2 columns of mat #returns matrix of both results (connected rbind) #instead of list of 2 matrices l <- apply(m,1,function(r)mat[,r]) it clear workaround example simple (select rows manually), trying write generic code bigger data sets. convert m data.frame , use lapply : lapply(data.frame(m), function(r) mat[,r]) $x1 1 2 [1,] 1...

c# - Can't iterate through a combobox from a focused textbox -

i have combobox indefinite items in list, not how many items in there. have focus on textbox , want achieve change selected index of combo box when press or down. unfortunately i'm doing wrong again. private void txtbox_keydown(object sender, keyeventargs e) { if (e.keycode == keys.down) { while (combo.selectedindex <= combo.items.count) { if (combo.selectedindex >= combo.items.count) { break; } combo.selectedindex++ } } } something that: private void txtbox_keydown(object sender, keyeventargs e) { // use "e.modifiers == keys.none" // if want down arrow , not, say, alt + down; shift + down etc. if ((e.keycode == keys.down) && (e.modifiers == keys.none)) { // don't need default behaviour whatever e.handled = true; combobox combo = sender combobox; // if selected index not last one, select next item if (combo != null) if (combo.selectedindex < (combo.ite...

android - How to generate signed and unsigned APK's using gradle? -

i need generate both unsigned , signed release apks using gradle command line ( gradlew assemblerelease command im using now) the apks must aligned. checked this: build unsigned apk gradle seems old way achieve this, not work , has changed in lastest versions of android , gradle compilation. , need generate both apks @ same time, not release mode or unsigned mode i think buildtypes more suitable place productflavors . can extend release build replacing signingconfig. buildtypes { release { .... signingconfig signingconfigs.release } releaseunsigned.initwith(buildtypes.release) releaseunsigned { signingconfig null } } then building both apk-files: ./gradlew assemble or if want release builds ./gradlew assemblerelease assemblereleaseunsigned or ./gradlew assr assru if want use assemblerelease task, can make dependency assemblerelease.dependson assemblereleaseunsigned and build just ./gradlew assemblerelease...