Posts

Showing posts from August, 2013

javascript - ExtJS change mask target while opening an Ext.Window -

i have extjs application , want change mask target while showing ext.window . when show window, entire dom masked, want mask div. overriding getmasktarget not working, gets target through ext.panel.header . maybe can setup window modal: false , mask component / element in window show event handler (remove mask in hide or destroy event handler depending on closeaction )?

c# - Code jam Store Credit -

problem receive credit c @ local store , buy 2 items. first walk through store , create list l of available items. list buy 2 items add entire value of credit. solution provide consist of 2 integers indicating positions of items in list (smaller number first). input first line of input gives number of cases, n. n test cases follow. each test case there be: • 1 line containing value c, amount of credit have @ store. • 1 line containing value i, number of items in store. • 1 line containing space separated list of integers. each integer p indicates price of item in store. • each test case have 1 solution. output each test case, output 1 line containing "case #x: " followed indices of 2 items price adds store credit. lower index should output first. limits 5 ≤ c ≤ 1000 1 ≤ p ≤ 1000 small dataset n = 10 3 ≤ ≤ 100 large dataset n = 50 3 ≤ ≤ 2000 sample data input 3 100 3 5 75 25 200 7 150 24 79 50 88 345 3 8 8 2 1 9 4 4 56 90 3 output case #1: 2 3 case #

Read logcat continuously in Android app -

i'm trying read continuously - means: if, example, have process every few second write logcat, want app listen on logcat, once new line added - catch , show on screen i have 1 activity every second write counter log: runnable r = new runnable() { @override public void run() { i++; log.d("bbb", "i= " + i); mhandler.postdelayed(this, 1000); } }; i have service trying "listen" on "logcat -s bbb", once listener started - app stuck (looks app entered endless loop) , after few seconds got message app must closed. the listener code is: (the message "start read line" printed , that's it...) public static void parse() { runtime rt = runtime.getruntime(); process process = null; try { process = rt.exec("su"); dataoutputstream os = new dataoutputstream(process.getoutputstream()); os.writebytes("logcat -s bbb");

Camel Processor not working in a Splitter pattern -

i have camel route which, when bit simplified, boils down following one: <bean id="myprocessor" class="com.acme.myprocessor" /> <camelcontext xmlns="http://camel.apache.org/schema/spring"> <route> <from uri="file:/home/inbox?filename=file.txt&amp;noop=true" /> <split> <tokenize token="@" /> <process ref="myprocessor" /> </split> <to uri="file:/home/outbox" /> </route> </camelcontext> to surprise have found if processor being invoked, not able change single tokens. example: public class myprocessor implements processor { public void process(exchange exchange) throws exception { string mystring = exchange.getin().getbody(string.class); exchange.getin().setbody(mystring.touppercase()); } } in end, file produced tokens not a

unit testing - How to return multiple values when using mock patch.object with contextlib.nested -

i new unit testing , trying write unit test using patch.object mock function calls. mocked function getobj() called twice in function testing. first time when called expecting none return_value , second time expecting some_string . not getting how it. the code follows: def test_create(self): contextlib.nested( patch.object(agent, 'try_connect', patch.object(util, 'get_obj', return_value = none), ) (mock_try_connect, mock_get_obj): proxy_info = self.util.create(data) i tried using side_effects , , give input return_value every time returning none . mock_value=mock() mock_value.side_effect = [none, 'some_string'] patch.object(util, 'get_obj', return_value = mock_value()) use assert_has_calls verify mocked out object being called how expect called. debug issue. def test_create(self): contextlib.nested( patch.object(agent, 'try_connect', patch.object(util, 

bash - Check wordcount in until loop -

i want continue bash script when docker container has 2 mentions of string in logs..i tried following code can't seem re-count variable (using eval), stays stuck: number=`docker logs mysql 2>&1 | grep 'mysqld: ready connections' | wc -l` until [ "$number" -eq 2 ]; sleep 2 echo $number eval "$number" done echo mysql started , rebooted, continue.. i fixed this: number=0 until [ "$number" -eq 2 ]; sleep 2 number=`docker logs mysql 2>&1 | grep 'mysqld: ready connections' | wc -l` done

javascript - How to get data from one php page using ajax and pass it to another php page using ajax -

i trying data 1 php page , pass page using ajax. js : $.ajax({ url: "action.php", success: function(data){ $.ajax({ url: "data.php?id=data" } }); action.php : <?php $test= 1; ?> data.php : <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script type="" src="action.js"></script> <?php $id = $_get['id']; echo $id; ?> first of all, need echo data in action.php , , second, use data parameter of ajax request send data data.php . here's reference: jquery.ajax() so organization of pages should this: js : $.ajax({ url: "action.php", success: function(data){ $.ajax({ url: "data.php", data: {id: data}, success: function(data){ // code // alert(data);

No Canvas.ZIndex or SetZIndex() property on WPF Canvas -

Image
i might being stupid, i'm trying change z order of components on wpf canvas, doesn't seem exist xaml property or method in code behind. here's xaml: <usercontrol x:class="frontendui.controls.radialtracker" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:frontendui.controls" mc:ignorable="d" d:designheight="500" d:designwidth="500"> <grid > <canvas x:name="trackercanvas"> </canvas> </grid> at first trying programatically: then tried adding path using xaml , setting canvas.zindex, didn't exist. there panel.zindex though, i'm

excel - Could not set the List property -

i have looked issue , tried follow of solutions happens reason it's not working me. so have dropdown menu (gateway) , text box (duedate) , once select , fill blank spaces want populate listbox1 being 1st column gateway , 2nd column duedate. this have, pops window saying: "run-time error '381': not set list property. invalid property array index." private sub commandbutton2_click() 'listbox1.additem (gateway.value) listbox1.list(listcount - 1, 0) = gateway.value listbox1.list(listcount - 1, 1) = duedate.value end sub i have set listbox1 boundcolumn , columncount 2 in design editor. thanks in advance! edit: managed fix it. based on first comment thread have used following. with listbox1 listcount = .listcount .additem gateway.value .list(listcount, 1) = duedate.value end i needed time figure out myself (^.^): private sub commandbutton2_click() listbox1 listcount = .listcount .additem gate

regex - Regular expression, match anything but these strings -

within splunk have number of field extractions extracting values uri stems. have few match specific pattern, want regex matches these. ^/sitename/[^/]*/(?<a_request_type>((?!process)|(?!process)|(?!assets)|(?!assets))[^/]+) the regex above have far. expecting negative lookaheads prevent matching process, process, assets or assets. seems [^/]+ after these lookaheads can go ahead , match these strings anyway. resulting in regex overriding other regexes wrote accept these strings what correct syntax me make regex match string, other specified in negative lookaheads? thanks! negative lookaheads do not consume of string being searched. when want multiple negative lookaheads, there no need separate them | (or). try this: ^/sitename/[^/]*/(?<a_request_type>((?![pp]rocess)(?![aa]ssets))[^/]+) note have combined lookaheads ( [pp]rocess , [aa]ssets ) make regular expression more concise. live test .

c# - ASP.NET - i'm looking for a way to change a subString font into a gridview cell -

<asp:textbox id="searchdescription" runat="server" height="26px" width="270px"></asp:textbox> <br /> <br /> <asp:button id="button2" runat="server" text="Търси" onclick="button2_click" /> <br /> <br /> so here gridview : <asp:gridview id="gridview2" runat="server" horizontalalign="center" allowpaging="true" autogeneratecolumns="false" cellpadding="4" forecolor="#333333" gridlines="none"> <alternatingrowstyle backcolor="white" /> <columns> <asp:boundfield datafield="Марка" headertext="Марка" sortexpression="Марка" /> <asp:boundfield datafield="Година" headertext="Година"

html - How parse DOM to get emails Javascript -

i'am building chrome extension parses entire dom/html , replace found email(multiple emails) following div: <div class="email_tmp"> found_email <span>save email</span></div> example: <body> <div>some text...</div> <div>text a@a.com text</div> <div>some text...</div> <p>more text</p> <div><div><span>text b@b.com text</span></div></div> <span>last text</span> </body> replaced to: <body> <div>some text...</div> <div>text <div class="email_tmp"> a@a.com <span>save email</span></div> text</div> <div>some text...</div> <p>more text</p> <div><div><span>text <div class="email_tmp"> b@b.com <span>save email</span></div> text</span></div></div> <span>last text</s

Can't debug using Azure SDK for Node.js -

i absolutely frustrated azure sdk years have been using , problem of outputting errors log file still arises: application has thrown uncaught exception , terminated: error: enoent, no such file or directory 'c:\dwasfiles\sites\pazooza\virtualdirectory0\site\wwwroot\iisnode\rd00155d4313f9-20848-stdout-tue mar 26 2013 03:10:56 gmt+0000 (gmt standard time).txt' @ object.opensync (fs.js:240:18) @ object.writefilesync (fs.js:628:15) @ syncwritestream.<anonymous> (d:\program files (x86)\iisnode\interceptor.js:181:20) @ object.<anonymous> (console.js:25:18) @ incomingmessage.<anonymous> (c:\dwasfiles\sites\pazooza\virtualdirectory0\site\wwwroot\utils\facebook.js:69:21) @ incomingmessage.emit (events.js:88:20) @ httpparser.parseronmessagecomplete [as onmessagecomplete] (http.js:130:23) @ cleartextstream.socketondata [as ondata] (http.js:1288:20) @ cleartextstream._push (tls.js:375:27) @ securepair.cycle (tls.js:734:20) a

javascript - dc.js chart redrawing with new group function with click event -

i trying redraw dc.js charts new groups when other chart library click event.but doesnt redraw. here javascript codes: var donemchart = dc.rowchart('div#donem'), hospitaltypechart = dc.rowchart('div#hospital_type'), ckyshospitalclasschart = dc.rowchart('div#ckys_hospital_class'), ckyshospitaltypechart = dc.rowchart('div#ckys_hospital_type'), hospitalhealthregionchart = dc.rowchart('div#hospital_health_region'), hospitalrolechart = dc.rowchart('div#hospital_role'), hospitalschart = dc.rowchart('div#hospitals'); d3.json('tsim.json',function(data){ var ndx = crossfilter(data); var = ndx.groupall(); //define crossfilter dimensions var donemdim = ndx.dimension(function(d){ return d.donem}), hospitaltypedim = ndx.dimension(function(d){ return d.kurum_turu}), ckyshospitalclassdim = ndx.dimension(f

javascript - why global variable is not changed? -

global variables not change values. pagenumber remains 1 , supposed incremented in function. try implement continious scroll , next block of code, using post query action in asp.net mvc controller, of course gets me same result <script type="text/javascript"> pagenumber = 1; //infinite scroll starts second block nomoredata = false; inprogress = false; function scrollfunction(pagenumber, nomoredata, inprogress) { var documentheight = $(document).height(); var windowheight = $(window).height(); var windowscrolltop = $(window).scrolltop(); var documentminuswindowheight = documentheight - windowheight; //-1 because when scroll reaches bottom of document windowscrolltop - documentheightminuswindowheight equals 0 1 if ((windowscrolltop > documentminuswindowheight - 1) && !nomoredata && !inprogress) { inprogress = true; $("#loadingdiv").show(); $.post("@url.action("infinitescroll"

php - How to get time at midnight of an user from my server? -

i have user timezone (for example: +7 gmt). in php language: my server set timezone @ 0-gmt. how know server midnight of user? assuming have timezine of user saved (i'll use america/los_angeles since gmt -7 right now) $user_tz = 'america/los_angeles'; // db $dt = new datetime(); $dt->settimezone(new datetimezone($user_tz)) if ($dt->format('g') == 0 && $dt->format('i') == '00') { echo "it's midnight"; }

c - Typecasting structure pointers -

hie guys. studying structures , pointers using book called pointers in c: hands on approach , on page 107, came across incomplete example of struct type casting. tried make work implementing function receivedata() ,adding headers , making few changes. complete code: #include <stdio.h> #include <string.h> #include <stdlib.h> struct signature { char sign; char version; }; struct id { char id; char platform; }; struct data { struct id idv; struct signature sig; char data[100]; }; static void receivedata(struct data *d); static struct signature *extractsignature(struct data *d); static struct id *extractid(struct data *d); int main(int argc, char *argv[]) { /* actual line in book : * struct data *img; no memory allocation or assignment null. * had errors allocated memory on heap before passing value * receivedata(); */ struct data *img = malloc(sizeof(struct data)); receivedata(img); /* actual line in book : * st

javascript - loop not working if function name is in a variable when checking if function exists -

this question has answer here: check if function exists name in string? 2 answers the below code works if use function name directly , not variable function name. i make work loop variable having function name. please ! function func_1() { alert("function exists"); } function func_2() { alert("function exists"); } var functions = ["func_1", "func_2", "func_3", "func_4"]; (var = 0; < functions.length; i++) { var func_name = functions[i]; // doesnt work < 1 want work var func_name = func_3; // works if (typeof func_name === 'function') { alert("hello world"); } alert("iterating well"); } according this answer matt, should "check whether it's defined in global scope": if (typeof window[func_name] === "

javascript - JWPlayer Unexpected Token Ilegal -

this question has answer here: no visible cause “unexpected token illegal” 10 answers i have next test code, , got next error message uncaught syntaxerror: unexpected token illegal after got next error message uncaught referenceerror: jwplayer not defined i've downloaded jwplayer account on jwplayer page. doing wrong? <!doctype html> <html> <head> <script src='//code.jquery.com/jquery-2.2.0.min.js' type='text/javascript' ></script> <script src='./player/jwplayer.js' type='text/javascript' ></script> </head> <body> <div id='target'> </div> <script language='javascript'> var playerinstance = jwplayer('target').setup({ file: './videos/jaguar.mp4', flashplayer: &

Automatically open a link in browser and login using java -

i'm trying find way using java code, provide url, username , password , code automatically opens link in browser , login without me having provide credentials again in browser when link opens. there way ? you can pass username , password through parameters such as: mysite.com/login?username=user&password=user then can extract parameters request , use them authentication: @requestmapping("login") public string login(@requestparam(required=false) string username, @requestparam(required=false) string password) { if(username != null && password != null) { //perform auth } return "login"; } but better way associate unique token each user , login them based on that. //p.s. opening browser specified url can use: open link in browser java button?

swift - How to rounded the corners when I draw rectangle using UIBezierPath points -

Image
i crated rectangle using uibezierpath adding point point, want rounded corners of rectangle seems there no way it. can me ? class rectanglelayer: cashapelayer { let animationduration: cftimeinterval = 0.5 override init() { super.init() fillcolor = colors.clear.cgcolor linewidth = 5.0 path = rectanglepathstart.cgpath } required init?(coder adecoder: nscoder) { fatalerror("init(coder:) has not been implemented") } var rectanglepathstart: uibezierpath { let rectanglepath = uibezierpath() rectanglepath.movetopoint(cgpoint(x: 0.0, y: 100.0)) rectanglepath.addlinetopoint(cgpoint(x: 0.0, y: -linewidth)) rectanglepath.addlinetopoint(cgpoint(x: 100.0, y: -linewidth)) rectanglepath.addlinetopoint(cgpoint(x: 100.0, y: 100.0)) rectanglepath.addlinetopoint(cgpoint(x: -linewidth / 2, y: 100.0)) rectanglepath.closepath() // fillcolor = colors.red.cgcolor

angularjs - Create an array using ng-init angular js -

is possible create array using ng-init dynamically? bellow code not working ng-init="medi_count = new array(5)" angular expression not same javascript expression. has limits.! no object creation new operator: cannot use new operator in angular expression. refer angular documentation : angular expression

php - Can Never Seem To Login No Matter What -

i'm complete newb @ php , have been banging head on week trying different tutorials sake of basic login none of them ever work. i stumbled across 1 able registration work funny enough, have never been successful logging in when comes matching parameters , what's in database , cannot find reason why. i have copied , pasted code , changed few names tutorial's website -> die('we encountered problems'); have re-written code on , on -> die('we encountered problems'); checked hours straight tiny errors, none , still -> die('we encountered problems'); i cannot log in. <?php require 'connection.php'; if (!empty($_post['username']) && !empty($_post['password'])): $records = $conn->prepare('select id, username, password users username = :username'); $records->bindparam(':username', $_post['username']); $records->execute(); $results = $records->fetch(pdo::fe

java - Alternatives to distribute spring-boot application using maven (other than spring-boot:repackage) -

as far know, spring-boot-maven-plugin has provided way distribute entire application in fat executable jar file: spring-boot-maven-plugin however, don't want fat executable jar encapsulates modules , dependencies , configuration files , such, maybe zip/tar file main module in jar , launch scripts different platforms alongside jar, , dependencies under lib folder , configurations file reside in conf folder: application.zip mainapp.jar run.sh run.bat lib a.jar b.jar c.jar conf application.properties logback.xml how make distribution in structure? use maven appassembler plugin - program example seems close you're looking for. output like: . `-- target `-- appassembler |-- bin | |-- basic-test | `-- basic-test.bat `-- repo `-- org `-- codehaus `-- mojo

java - Security Exception while starting an activity -

i facing weird situation getting below logs. java.lang.securityexception: permission denial: get/set setting user asks run user -2 calling user 0; requires android.permission.interact_across_users_full to resolve this, have tried cleaning project , adding below permission not resolving issue. android.permission.interact_across_users_full please me out. according answer: android.permission.interact_across_users_full signature level permission. app not able use until , unless has same signature system. which not can achieve unless either creator or system build, or collaborating them such willing sign apk certificate. in other words, off limits developers.

ios - NSObject unable to convert -

i getting errors on following lines of code. since project downloaded github, https://github.com/hubspot/bidhub-ios not sure these lines doing. let 1 = nsmutableattributedstring(string: "bid\n", attributes: bidattrs [nsobject : anyobject] [nsobject : anyobject] ) one.appendattributedstring(nsmutableattributedstring(string: "$\(startamount + incrementone)", attributes: otherattrs)) plusonebutton.setattributedtitle(one, forstate: .normal) let 5 = nsmutableattributedstring(string: "bid\n", attributes: bidattrs [nsobject : anyobject] [nsobject : anyobject]) five.appendattributedstring(nsmutableattributedstring(string: "$\(startamount + incrementfive)", attributes: otherattrs)) plusfivebutton.setattributedtitle(five, forstate: .normal) let ten = nsmutableattributedstring(string: "bid\n", attributes: bidattrs [nsobject : anyobject] [nsobject : anyobject]) ten.appendattributedstring(nsmutableattributedstr

winapi - WPF: TextBox do not paste text on KeyDown (CTRL+V) event -

we have wpf window hosted in win32 window. implementation such when user presses ctrl+v, text in clipboard pasted textbox in keyup event , not in keydown event (due limitation textbox control when being hosted inside mfc). hence have overridden keyup event paste text. however, in machines noticed text pasted twice on doing ctrl+v only once . on further investigation found pasted keydown (default window behaviour) , on keyup event (overridden us). wondering why pasting on keyup in machine , in machine both keydown , keyup? help appreciated. -nayan i think depend on control has focus when press ctrl+v. if edit control has focus, wm_paste notification , default windowproc paste clipboard contents text box. if control has focus, you'll need handle ctrl+v paste edit control.

javascript - how can change offline to online at openfire presence? -

i'm creating messenger using xmpp. did connect openfire server successfully. console log received 'connecting' , 'connected' status, checked session on openfire admin console: name : anonymous resource : values node : local status : authenticated presence : offline if use spark client program, changed presence online status. how can change that? should add more code lines? var jid = 'id'; var pw = 'testpw'; var bosh_service = 'http://127.0.0.1:7070/http-bind/'; var connection = null; connection = new strophe.connection(bosh_service); connection.connect(jid, pw, callback); function callback(status){ console.log(status); } to declare presence status have add these lines in callback function: if (status == strophe.status.connected) { connection.send($pres()); } if need web client example based on xmpp (using strophe.js) check plunker below: http://plnkr.co/edit/ehqhdsypdhrecmaailzo

javascript - Complexe child_process not working with Promise bluebird -

i wan't execute shell command using child_process node.js https://nodejs.org/api/child_process.html , doing electron program using react js. i want promise bluebird, function works small command 'ls' if want execute simple hello world program in folder want : cd localbuild/login/ && java main . it's working on terminal. when tried in function have error : promise rejected: error: spawn cd localbuild/login/ enoent closing code: -2 . here function : _compile(command){ var promise = require('bluebird'); var exec = require('child_process').execfile; var pathfile = "cd localbuild/login/"; function promisefromchildprocess(child) { return new promise(function (resolve, reject) { child.addlistener("error", reject); child.addlistener("exit", resolve); }); } var child = exec(pathfile+ " && "+command); //var child = exec('ls'); // wo

javascript - Cursor position is changing while any new new value entered in a textbox -

definition: have textbox has maxlength of 11 characters. if try enter value in middle of textbox, cursor position moved automatically end position. please me set cursor position fixed. note: function used textbox allows alphanumeric value. here code <!doctype html> <html> <body> <script> //function alphanumberic validation function alphanumericonly(i){ if(i.value != null) { i.value = i.value.replace(/[^\w]+/g, ''); } } </script> <input type="text" maxlength="11" id="policyorbondnum" onkeyup="alphanumericonly(this);" /> </body> </html> try- <input type="text" maxlength="11" id="policyorbondnum" onkeyup="alphanumericonly(this);" style="text-align: right; padding-right: 50px;"/>

java - Spring autowired issue with webservice -

i creating webservice , have use service in it. there autowired not working,i tried lot of things it. my directory structure is: package com.mycaptionlabs.quickbooks.ws; import java.util.arraylist; import javax.jws.webservice; import org.springframework.beans.factory.annotation.autowired; import org.springframework.web.context.support.springbeanautowiringsupport; import com.mycaptionlabs.repository.userrepository; import com.mycaptionlabs.service.userservice; /* * http://developer.intuit.com/qbsdk-current/doc/pdf/qbwc_proguide.pdf */ @webservice(endpointinterface = "com.mycaptionlabs.quickbooks.ws.qbwebconnectorsvcsoap") public class itemqueryrqsoapimpl extends springbeanautowiringsupport implements qbwebconnectorsvcsoap { userrepository userrepository; @autowired userservice userservice; @override public arrayofstring authenticate(string strusername, string strpassword) { system.out.println(userservice); arrayofstring arr =

blackberry - Customizing ExpandableView in QML -

Image
i using expandableview in qml blackberry development. want customize expandableview . ex : 1.in below image (screen shot of expandableview in collapsed stage) can see text 'more' shown when use expandableview qml . displayed during collapsed stage, want change default text other text 2.collapse(^) , expand image want change . is there way achieve ? according documentation, https://developer.blackberry.com/native/reference/cascades/bb__cascades__expandableview.html , there no properties or methods setting text or arrow images. so, not possible.

threadpool - ScheduledExecutorService: modify one or more running tasks -

i have program, loads few tasks file prepared user , start executing them according scheduling shown in file. example: taskfile.txt task1: run every hour task2: run every 2 seconds ... taskn: run every monday @ 10:00 this first part ok, solved using scheduledexecutorservice , satisfied. tasks load , run should. now, let's image user, gui (at runtime), decides task2 should run every minute, , wants remove task3. cannot find way access 1 specific task in pool , in order remove/modify it. so cannot update tasks @ runtime. when user changes task, can modify taskfile.txt , restart application, in order reload tasks according newly updated taskfile.txt. do know way access single task in order modify/delete it? or even, way remove 1 given task, can insert new 1 in pool, modifications wanted user. thanks this not elegant, works. let's suppose need 10 threads, , need manage specific thread. instead have pool 10 thread, use 10 pools 1 thread each, keep th

Objective C: Fetch value from dictionary -

my "savedata" dictionary looks this: { adresser = { "completed_status" = { finished = 4; total = 5; }; ... } and "dorder" dictionary looks this { id = 1924; name = adresser; order = 0; } and snippet of code nsdictionary * savedata = [self dbreadformdata:_objectid]; (nsdictionary * dorder in dictformsections[@"order"]) { nsstring * segname = dorder[@"name"]; nslog(@"finished: %@", savedata[segname][@"completed_status"][@"finished"]); nslog(@"total: %@", savedata[segname][@"completed_status"][@"total"]); nsstring * vfinished = [savedata objectforkey:savedata[segname][@"completed_status"][@"finished"]]; nsstring * vtotal = [savedata objectforkey:savedata[segname][@"completed_status"][@"total"]]; nsstring * ssection = [nsstring s

angularjs - Auth0 - login widget does not display enterprise connections -

Image
i created auth0 app using starter template - hybrid mobile app > ionic > asp.net web api i've followed documentation create enterprise connection orgs idp (okta in case) , i've tested connection. login widget however, not show option connect : i can't seem find documentation on how add more connections widget. looking @ code, project appears using auth0 angular don't see there either. know bootstrapped code importing lock library - don't see lock methods called anywhere i'm not sure if it's using auth0 lock widget. any here appreciated! to use enterprise connections lock, need associate them 1 or more email domains. example, if you're using saml connection: if type @example.com email address in lock, prompt log in connection directly. if don't want use feature , want have button log in directly, you can add dynamically list of connections. example: widget.once('signin ready', function() { var link = $(&#

android - Change AutoCompleteTextView filter from "startsWith" to "Contains"? -

i change default filtering in autocompletetextview . default filtering finds strings startswith given token. project requires filtering should find strings contains given token. is possible? i found solution that, google , searching 2 days. @torque203 suggested, i've implemented own custom adapter. first define new xml file custom item in adapter: autocomplete_item.xml <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <textview android:layout_width="match_parent" android:layout_height="wrap_content" android:textappearance="?android:attr/textappearancemedium" android:text="medium text" android:paddingleft="8dp"

java - libgdx remove bullet from bullet array -

im creating 2d game. have array of bullet class use create bullets. have array consisting sprites move around screen being rendered every 3 4 seconds. problem: when bullet , other sprite meet @ same location bullet should removed or deleted , never comeback. please me... code rendering bullet: bullet.java: import com.badlogic.gdx.math.vector2; public class bullet{ public vector2 bulletlocation = new vector2(0, 0); public vector2 bulletvelocity = new vector2(0, 0); public bullet(vector2 sentlocation, vector2 sentvelocity) { bulletlocation = new vector2(sentlocation.x, sentlocation.y); bulletvelocity = new vector2(sentvelocity.x, sentvelocity.y); } public void update() { bulletlocation.x += bulletvelocity.x; bulletlocation.y += bulletvelocity.y; } } main class: arraylist<bullet> bulletmanager = new arraylist<bullet>(); array<other> othersmanager = new array<other>(); bullet currentbullet; other currentothers; render();

How to decode json file in php? -

i want data json. json file [[["test demo","",,,0]],,"vi",,,,0.58984375,,[["vi"],,[0.58984375]]] i want data "test demo" create code $html = file_get_contents("jasonfile"); $obj1 = json_decode($html, true); echo $obj1[][][]; but not working. doing wrong please me on this.. json not valid, doesn't allow several commas in row. changing to: [[["test demo","",0]],"vi",0.58984375,[["vi"],[0.58984375]]] and running: $obj1 = json_decode(...yourinput...); echo $obj1[0][0][0]; correctly outputs test demo .

javascript - datetimepicker bootstrap get value and use it as input undefined bug -

i'm not sure why following happening but, i'm using datetimepicker1 bootstrap, , when try selected value, undefined var date = $("#datetimepicker1").find("input").val(); but right date when type $("#datetimepicker1").find("input").val(); on console. how can value of date picked/selected can use it? html <div class="container"> <div class="row"> <div class='col-sm-6'> <div class="form-group"> <div class='input-group date' id='datetimepicker1'> <input type='text' class="form-control" /> <span class="input-group-addon"> <span class="glyphicon glyphicon-calendar"></span> </span> </div> </div> </div> </div> also, im trying change format of