Posts

Showing posts from January, 2010

android - java.lang.ClassNotFoundException: Didn't find class from AAR -

i have android library project created aar file. have added aar file application project, while running following exception: caused by: java.lang.classnotfoundexception: didn't find class "com.creatrixone.customcomponents.loadmorelistview" on path: dexpathlist[[zip file "/data/app/com.creatrixcampus-1.apk"], nativelibrarydirectories=[/data/app-lib/com.creatrixcampus-1, /system/lib]] @ dalvik.system.basedexclassloader.findclass(basedexclassloader.java:53) @ java.lang.classloader.loadclass(classloader.java:501) @ java.lang.classloader.loadclass(classloader.java:461) @ android.view.layoutinflater.createview(layoutinflater.java:559) @ android.view.layoutinflater.createviewfromtag(layoutinflater.java:696) @ android.view.layoutinflater.rinflate(layoutinflater.java:755)  @ android.view.layoutinflater.inflate(layoutinflater.java:492)  @ android.view.layoutinflater.inflate(layoutinflater.java:397)  @ android.view.layoutinflater.i...

angular - How to pass Attribute as dependency in provide function? -

i building simple login verification directive, work described here . make adjustments - create new provider in boot function this: new provider(routeroutlet, { usefactory: (_elementref: elementref, _loader:dynamiccomponentloader, _parentrouter: router,_authenticationservice:authenticationservice) => new sessionverificationrouteroutlet(_elementref, _loader, _parentrouter, _authenticationservice), deps: [elementref, dynamiccomponentloader, router, authenticationservice] }) however, can see here: @directive({ selector: 'auth-router-outlet' }) export class sessionverificationrouteroutlet extends routeroutlet { publicroutes: string[]; private parentrouter: router; constructor( _elementref: elementref, _loader: dynamiccomponentloader, _parentrouter: router, @attribute('name') nameattr: string, private _authenticationservice: authenticationservice ) { super(_elementref, _loader, _parentrouter, nameattr); ...

Alternatives to HTTP Rest for Django backend and iOS/mobile clients? -

we're writing django-based backend, heavily used ios , other mobile clients. we're using django-rest-framework provide http rest api. the api used downloading lists of products, checking on inventory levels, cart , payment, , sending analytics data clients. possible, keep products , inventory levels synced between clients in real-time, or close real-time possible. we expect our api usage quite chatty. i'm curious - apart form http rest, other alternatives have transport handle real-time sync well, , perform mobile devices (many of possibly on 3g - both bandwidth , latency issues). what work in situation? , issues/pitfalls might encounter? (e.g. zeromq? protobuf?) cheers, victor node.js , socket.io have become quite famous use making real time applications. have used them basic real-time analytics app , turned out pretty real time. mine small project didn't load testing there nice reads scalability of node.js , socket.io: http://weblog.bocoup...

html - Make the span element inside div clickable -

Image
i have dropdown list using javascript. inside div have span element text div, because want show/hide text according screen size. added span element span area not clickable. other parts in div clickable , show menu, except area span. how make span clickable well? here's code: <div onclick="dropdownfunction()" class="dropbtn"><span>my list &nbsp;</span> <i class="fa fa-arrow-circle-down" aria-hidden="true"></i></div> and codepen: http://codepen.io/nfds89/pen/mylgkr an alternate css-only solution pass through clicks on <span> , <i> .dropbtn span, .dropbtn { pointer-events: none; }

oracle - Liquibase : Error executing SQL SET DEFINE OFF -

i'm using liquibase execute oracle scripts. oracle scripts, executing merge statements oracle, work fine, problem data need insert have strange characters, in order work using set define off (at beginning of file) , set define on (at end of file) in order avoid errors. but if try run same script in liquibase not working , error: liquibase update failed: error executing sql set define off my changelog looks this: <changeset author="e-ballo" id="nopa_data_email" dbms="oracle" > <sqlfile path="email/nopa_activate_security.sql" relativetochangelogfile="true" splitstatements="true" stripcomments="true" /> anyone know how avoid problem ? thanks in advance set define not sql sql*plus command. sql*plus oracle proprietary client, , other clients (such ides) don't recognise commands. the liquibase forums suggest using cdata best way pass non-standard characters. find out ...

java - JMS queue with persistence enabled - performance bottlenecks -

this question try , understand performance bottlenecks, if any, exist in listening message queue in messages persisted jms provider resides vs listening message same queue had message not been persisted. minute differences needs considered end-to-end response time starting dequeing message processing message needs complete in millisecond time frame. based on comparison results, decision needs taken whether persistence of messages need forwarded separate queue not affect mainstream consumers need millisecond response. insights differnces between way messages handled between persistent queue vs non-persistent great

python - adding is_empty to hashtable -

i'm trying add is_empty(self) method. return true if hash table maps no keys values, else false. have @ moment i'm unsure how approach is_empty function using self. class myhashtable: def __init__(self, capacity): self.capacity = capacity self.slots = [none] * self.capacity def __str__(self): return str(self.slots ) def is_empty(self) pass as self.slots list , , goal test elements none . suggest: def is_empty(self) return self.slots.count(none) == len(self.slots) see how check if items in list none? answer there , others.

How to refactor regex in Perl -

i have following sentences: text <mir-1> ggg-33 <exp-v-3> text text <vaccvirus-prop-1> other. text <mir-1> text <assc-phrase-1> text <vaccvirus-prop-1> other <pattern-1> other. what want create single regular expression (regex) can match 2 sentences above. note differing pattern in above sentences middle factor <exp-v-3> , <assc-phrase-1> . i'm stucked current attempt, matched them in 2 redundant regex. what's right way it? use data::dumper; @sent = ("text <mir-1> ggg-33 <exp-v-3> text text <vaccvirus-prop-1> other.", " text <mir-1> text <assc-phrase-1> text <vaccvirus-prop-1> other <pattern-1> other."); foreach $sent (@sent) { if ( $sent =~ /.*<mir-\d+>.*<exp-v-\d+>.*<vaccvirus-prop-\d+>.*/gi ) { print "$sent\n"; } elsif( $sent =~ /.*<mir-\d+>.*...

freeswitch v1.6 use speex codec error -

i have compiled freeswitch branch v1.6 sourcecode ,when use speex codec , freeswitch console : 2016-05-09 15:37:31.611965 [warning] switch_core_codec.c:721 codec speex exists not @ desired implementation. 16000hz 64ms 1ch 2016-05-09 15:37:31.611965 [err] switch_core_media.c:3025 can't load codec? i think key problem here: "16000hz 64ms 1ch". if @ freeswitch configuration file vars.xml , see many examples of ptimes one: dvi4@16000h@40i - ima adpcm 16khz using 40ms ptime. (multiples of 10) so freeswitch complaining 64ms packet time, it's not multiple of 10. should able change in codec preferences on endpoint configuration.

ios - Can't get correct city name in swift with CLGeocoder -

i tried current city name , country name swift. here's source code. // in cllocationmanagerdelegate method can user's current location coordinates: func locationmanager(manager: cllocationmanager, didupdatelocations locations: [cllocation]) { let locvalue:cllocationcoordinate2d = manager.location!.coordinate print("locations = \(locvalue.latitude) \(locvalue.longitude)") self.locationmanager.stopupdatinglocation() getaddressfromgeocodecoordinate(manager.location!) } func getaddressfromgeocodecoordinate(locationobj: cllocation) { let geocoder = clgeocoder() geocoder.reversegeocodelocation(locationobj, completionhandler: { (placemarks, error) -> void in // place details var placemark: clplacemark! placemark = placemarks?[0] // address dictionary print(placemark.addressdictionary) // city if let city = placemark.addressdictionary!["city"] as? nsstring { ...

c# - How can I return a string from an async operation? -

i'm using pclstorage , need way read file. i'm going use json serialization, need read saved content file: public async string readfromfile(string filename) { ifolder rootfolder = filesystem.current.localstorage; ifolder folder = await rootfolder.createfolderasync("mysubfolder", creationcollisionoption.openifexists); ifile file = await folder.getfileasync(filename); string content = await file.readalltextasync(); return content; } but cant return string, has void, task or task. is there easy way can return string method? maybe invoking method? you need return task<string> , this: public async task<string> readfromfile(string filename) { ifolder rootfolder = filesystem.current.localstorage; ifolder folder = await rootfolder.createfolderasync("mysubfolder", creationcollisionoption.openifexists); ifile file = await folder.g...

node.js - Bluebird - how to break promise chain early -

promisea().then(function(dataa){ if (dataa.foo == "skip me") return ?? //break promise - don't perform next then() else return promiseb() }).then(function(datab){ console.log(datab) }).catch(function (e) { //optimal solution not cause method invoked }) how can above code modified break (skip 2nd then())? bluebird allows cancel promise : var promise = require('bluebird'); promise.config({ // enable cancellation cancellation: true, }); // store promise var p = promisea().then(function(dataa){ if (dataa.foo == "skip me") p.cancel(); // cancel when needed else return promiseb(); }).then(function(datab){ console.log(datab); }).catch(function (e) { //optimal solution not cause method invoked });

regex - Java Runaway Regular Expression: Catastrophic Backtracking -

can explain me why regular expression: [a-za-z]+\s(.+?)+\s(?:pr.|g.|a.)|[a-z][a-za-z]+\.\s[a-za-z+\s(?:pr.|g.|a.)|[a-za-z]+\s(?:pr.|g.|a.)|[a-za-z]+\s[a-za-z]+\s(?:pr.|g.|a.) with input: testės r. sav., Žtestčių vhest sen., platakių k. is causing catastrophic backtracking? on other hand, if add ^ , $, like: ^[a-za-z]+\s(.+?)+\s(?:pr.|g.|a.)|[a-z][a-za-z]+\.\s[a-za-z+\s(?:pr.|g.|a.)|[a-za-z]+\s(?:pr.|g.|a.)|[a-za-z]+\s[a-za-z]+\s(?:pr.|g.|a.)$ there no backtracking. (tested regex101.com) however, when try use regular expression (^$ included) java: matcher matcher = myregexpattern.matcher(string); if(matcher.find()){ // } backtrack persists... ideas how avoid backtrack using java?

javascript - How to stop code from running on a specific date -

i want stop specific part of code running when 29th of may . can me out on jquery or javascript . you can try this, var currentdate = new date(); var yourselecteddate = new date(2016, 04, 29, 10, 15); //here 29th may 2016 if(currentdate > yourselecteddate ){ //currentdate more yourselecteddate // display warning message or whatever want display. } else{ //yourselecteddate more currentdate //put code in part. }

html - Radio button pseudo-element positioning problems in a container with a percentage width -

Image
i have following radio buttons set percentage-width container: the circle in middle has centred, of course. i have found quite tricky pseudo-element positioning. depending on browser's width, circle not horizontally centred. here gif of radio buttons, while resizing window: is possible keep circle centred while maintaining percentage-width container? here's code: html: <div class="form-section gender"> <div class="label-col"> <label>gender</label> </div> <div class="form-section"> <input type="radio" name="gender" id="male" value="male" /> <label for="male"><span>male</span></label> </div> <div class="form-section"> <input type="radio" name="gender" id="female" value="female" /> <label for="female"><sp...

excel vba - Failure to reliably overwrite file from VBA -

i have vba program should delete , overwrite file, same name. code sample below. worked fine until maybe several months ago, when overwrite started behaving strangely despite no apparent change anywhere. @ times, file not overwritten @ all. tried deleting file manually before doing write vba, didn't work, instead looked previous version in recycle bin being restored, rather overwriting new version. when manually delete file in target folder, , delete previous revs recycle bin, write works fine. posting following lot of googling , other searching, nothing describes specific problem. suggestions on what's happening here / how fix? excel 2013 under win10. nothing unusual platform, excel setup or file being written, plenty of disk space available. fname = "c:\datfolder\incrdat.bin" kill fname ' remove previous file fnum = freefile open fname binary access write #fnum .... write close #fnum edit 14 may, following many trials. omg how can difficult?...

ios - Setting tint color for UIImageView on old iPad doesn't work when view did load -

Image
this how looks on ipad pro : and on ipad 4 : why there difference? the arrow uiimageview connected through @iboutlet image rendered template image : when viewdidload() called is: downarrowimageview.tintcolor = uicolor.easternblue()

javascript - Java Http server Get Post to Ajax -

i have simple http server written in java. trying achieve have javascript/ajax client there able message server. java server have able detect connection made client unable message out print server. there button in client, upon clicking server message did not thought able send connection server. client should display "test server" upon clicking button client <html> <body> <h2>ajax</h2> <button type="button" onclick="loaddoc()">request data</button> <p id="demo"></p> <script> function loaddoc() { var xhttp = new xmlhttprequest(); xhttp.onreadystatechange = function() { if (xhttp.readystate == 4 && xhttp.status == 200) { document.getelementbyid("demo").innerhtml = xhttp.responsetext; } }; xhttp.open("get", "http://127.0.0.1", true); xhttp.send(); } </script> </body> </html> server public class java...

how do i create a gui in monodevelop using c++? -

is there way create gui in monodevelop using c++ language? know built in stetic development tool , seems work c#, , need c++ project (for class). c++ has many different toolkits handling guis, need specify want achieve. you can use monodevelop , stetic tool build gtk interface example, implement logic in c++ (which gtk has, of course, support for). never attempted that, might wanna check tooling , support, should theoretically possible. worth noting is, xaml cross platform in context of universal windows applications, might wanna check out first. xamarin , try stick current information, platform big technological shift microsoft. this outdated, gives idea using c++/qt , qml qt designer (as suggested @joachim pileborg) 1 of best paths undertake stable, cross platform, native looking gui toolkit.

c# - Posting attached file to a web service via httpwebrequest -

i trying post xml file web service. this current code var tempfilelocation = @"c:\temp\"; xmldocument xdoc = new xmldocument(); xdoc.loadxml(item); xdoc.save(tempfilelocation + "\\pcf.xml"); var url = "https://siteaddress/xml.aspx"; utf8encoding encoding = new utf8encoding(); byte[] byte1 = encoding.getbytes(xdoc.innerxml); httpwebrequest submissionrequest = (httpwebrequest)webrequest.create(url); submissionrequest.keepalive = true; submissionrequest.method = "post"; submissionrequest.contenttype = "multipart/form-data"; submissionrequest.contentlength = byte1.length; submissionrequest.timeout = 10000; submissionrequest.headers.add("accept-encoding", "gzip,deflate"); stream requeststream = submissionrequest.getrequeststream()...

android - What the "No opaque field provided" mean in ffmpeg? -

i use code covert image , wav mp4: ffmpeg -loop 1 -i img.jpg -i audio.wav -c:v libx264 -c:a aac -strict experimental -b:a 192k -shortest out.mp4 but got errors: 05-09 17:00:23.473 26907-27514/com.tian.example e/xx: ffmpeg version 0.11.1 copyright (c) 2000-2012 ffmpeg developers 05-09 17:00:23.473 26907-27514/com.tian.example e/xx: built on may 9 2016 16:36:21 gcc 4.9 20150123 (prerelease) 05-09 17:00:23.473 26907-27514/com.tian.example e/xx: configuration: --arch=arm --cpu=cortex-a8 --target-os=linux --enable-runtime-cpudetect --prefix=/data/data/info.guardianproject.ffmpeg/app_opt --enable-pic --disable-shared --enable-static --cross-prefix=/users/tian/documents/adt/android-ndk-r9c/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi- --sysroot=/users/tian/documents/adt/android-ndk-r9c/platforms/android-16/arch-arm --extra-cflags='-i../x264 -mfloat-abi=softfp -mfpu=neon -fpie -pie' --extra-ldflags='-l../x264 -fpie -pie' ...

marklogic - Schema Validation of XHTML field -

i have xml entity this, a:news-article xmlns:c="http://abc/core" xmlns:f="http://abc/fields" xmlns:a="http://abc/assets" xmlns:r="http://abc/refdata"> <c:id>xyz</c:id> <c:type>asset</c:type> <c:created-on>2016-03-17t08:26:27.764z</c:created-on> <c:released-on>1985-11-03t00:00:00z</c:released-on> <c:expires-on>2009-12-12t00:00:00z</c:expires-on> <f:short-headline> <c:content><c:l10n xml:lang="en"> <p> carbide technology south korean project </p> </c:l10n></c:content> <c:resources/> </f:short-headline> </a:news-article> in xml, xhtml field. need validate such xhtml fields using schema validation. i.e. if provided empty value should throw schema validation error. you need separate schemas each namespace. in xsd " http://abc/core " namespace might w...

javascript - Could not apply delete function to images in showFiles and previousFile function -

i have rent detail page developed using reactjs shows detail of specific rent. there edit button on page , displayed user has registered it. editing wanted fetch previous stored data of rent input boxes , images below image upload box. fetch rental data input boxes calling this.props.ownername defaultvalue , fetch uploaded images in previousfile() not create delete function using delete icon on each images , not post uploaded images along images further added server. have used react-dropzone ( https://github.com/okonet/react-dropzone ) image upload. please me? code on image upload let image = []; class renderphotos extends react.component { constructor(props, context) { super(props, context); this.state = { files: [] }; } ondrop(files) { console.log('received files: ', files); this.setstate({ files: files }); image = new formdata(files); $.each(files,function(i,file){ i...

hadoop - Cloudera Installation issue (scm_prepare_node.sh: Permission denied) -

when trying installing cloudera hadoop getting below error while copying files stage /tmp/scm_prepare_node.bggvxw3l bash: /tmp/scm_prepare_node.bggvxw3l/scm_prepare_node.sh: permission denied can fix issue. p.s: tmp having 777 permissions drwxrwxrwt. 41 root root 4096 may 9 14:59 tmp my /tmp mounted. changed noexec permissions in /etc/fstab restarted machines. working fine

mysql - ListView and DB Android -

i have , issue android app. basically app have 2 main points. has updated db , need display listview in listview every item entry in db, , should have own layout. the db needed updated non-programmer user. have been looking information before asking here. have seen can use phpmyadmin db in android. solves issue non-programmer user updating app. that left 2 points: 1º how use listview (or other method) display template db entrys 2º how can update app without making download play store or similar? thanks, , sorry issue. to dynamically display items db in listview in separate layouts need custom adapter. create custom adapter class , read db in it, adding new listview items. attach adapter listview calling listview.setadapter().

Compare 2 excel files using Python -

i have 2 xlsx files follows: value1 value2 value3 0.456 3.456 0.4325436 6.24654 0.235435 6.376546 4.26545 4.264543 7.2564523 and value1 value2 value3 0.456 3.456 0.4325436 6.24654 0.23546 6.376546 4.26545 4.264543 7.2564523 i need compare cells, , if cell file1 != cell file2 print that. import xlrd rb = xlrd.open_workbook('file1.xlsx') rb1 = xlrd.open_workbook('file2.xlsx') sheet = rb.sheet_by_index(0) rownum in range(sheet.nrows): row = sheet.row_values(rownum) c_el in row: print c_el how can add comparison cell of file1 , file2 ? the following approach should started: from itertools import izip_longest import xlrd rb1 = xlrd.open_workbook('file1.xlsx') rb2 = xlrd.open_workbook('file2.xlsx') sheet1 = rb1.sheet_by_index(0) sheet2 = rb2.sheet_by_index(0) rownum in range(max(sheet1.nrows, sheet2.nrows)): if rownum < sheet1.nrows: row_rb1 = sheet1.row_values(rownum) ...

c++ - QCalendarWidget - How to disable dates -

i'm trying use qcalendarwidget enabled or disabled dates (and not range dates) it's impossible ( https://bugreports.qt.io/browse/qtbug-198 ). do know if possible paintevent method (or else) ? thank's reading :) i've done research. calendar widget contains regular qtableview subclass ( qcalendarview ) regular model ( qcalendarmodel ). attempt add proxy model view , change data() , flags() functions return disabled state dates wanted disable. needed know date displayed on cell. there qcalendarmodel::dateforcell method that, it's inaccessible code. it's rather complicated , depends on implementation of qcalendarmodel . so think hardly possible. way see copy qcalendarwidget source project , rename classes avoid conflicts along existing qt classes. can change implementation. in place minimum , maximum date used (e.g. in qcalendarmodel::flags function) should replace use of enabled/disabled class list. in case find useful in attempt, i'v...

powershell - Capture multiple variables -

i have powershell script allows me enter in details users 1 @ time can used variables later on. @ present script calls each input , saves variable, repeated 10 times. [system.reflection.assembly]::loadwithpartialname('microsoft.visualbasic') | out-null $nameone = [microsoft.visualbasic.interaction]::inputbox("enter username") $firstname,$surname = $nameone -split("\.") $nametwo = [microsoft.visualbasic.interaction]::inputbox("enter username") $firstname,$surname = $nametwo -split("\.") is there way shorten script both allow usernames input , stored move on next part of script when inputbox has no data input? thanks tom use while loop: $users = while(($username = [microsoft.visualbasic.interaction]::inputbox("enter username")).trim() -ne "") { $firstname,$surname = $username -split '\.' new-object psobject -property @{ firstname = $firstname surname = $surname ...

PowerShell - Test-path -

i have script gets drives on host , outputs text file. text file below - d: e: f: g: i need test each drive path , if true assign variable. i have following far not working. know super obvious, appreciated. get-wmiobject win32_logicaldisk -filter "drivetype=3 , deviceid!='c:'" | select deviceid | format-table -hidetableheaders > c:\deviceid.txt -force $deviceid = get-content c:\deviceid.txt $deviceid | foreach {$_.trimend()} | ? {$_.trim() -ne '' } > c:\deviceid.txt $deviceid = get-content c:\deviceid.txt $path = "$deviceid\apps\netprobent\" $pathexists = test-path $path foreach-object ($deviceid in $deviceid) { if ($pathexists -eq $true) { $devicedrive = $deviceid} else { $devicedrive = "c:"} } if need more information please let me know. thanks below working. i have come across method works $folder = "apps\netprobent" get-psdrive | where-object { $_.root -match "[c-z]:\\" -and (test-path $(...

c++ - Deletion of reference underlying -

what happen reference if underlying variable whom referring got deleted? for e.g. why below code giving 12 output checked both on gcc , msvc int *x = new int(1); int& y = *x; delete x; x=null; int z = 12; y=z; cout<<"y = "<<y<<endl; accessing object memory has been deleted undefined behaviour, regardless of whether directly or through reference. the fact code outputs 12 on gcc , msvc largely irrelevant: output 13 , or 42 , or potato , still standard-conformant.

SQL server Backups Files types -

i trying read content of backup e.g.(testdb.bak) in text format e.g.(notepad or text editor) this command retrieving file holds: restore headeronly disk = 'c:\backups\testdb.bak' is there way or file extension, file type or format, can see whole content of backup? without restoring it. is there way or file extension, file type or format, can see whole content of backup? without restoring it. no there no command in sql server let see content of .bak file. if open in notepad see some information , lots of garbage characters. not supported the best way see content restore on sql server database , run many select statements on tables.

linker - Cinder + FreeImage + XCode -

i working on project uses cinder graphics, , image loading, using freeimage loading hdr images. it working fine under windows, trying build osx version hitting snag. first tried download , build freeimage, makefiles hopelessly outdated , not work. managed fudge them , build library, when adding xcode didn't seem link. error library ignored because built different architecture. (i couldn't figure out how fix this, option go if else fails). anyway, next attempt use macports install , build freeimage. worked without error , able include library in project. however, problem many std linking errors. after searching around, it seems problem freeimage built libstdc++, cinder complains if dont build project c++11 . so, there way of fixing this? can modify make files macports uses build freeimage? or there other sneaky way? suggestions appreciated. sorry if question bit parochial, in searches have seen others similar problems (but unfortunately few answers).

How to enable masking of mobile numbers using the Uber API? -

in actual uber app, mobile numbers of passenger , driver masked using temporary number. however, have noticed while using uber api, seems real numbers exposed when requesting ride , attempting call driver. is there parameter can use enable masking of mobile numbers? don't want expose real numbers of either driver or passenger. if not, suggested solution mask numbers? thanks!

java - Spring REST web service appContext failed -

i'm trying create rest web service using spring. i have 1 controller, 1 appcontext. controller: @controller public class restcontroller { @requestmapping(method=requestmethod.post, value="service/{url}......<params>) //some method here //some logic here } and app context: <?xml version="1.0" encoding="utf-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:context="http://www.springframework.org/schema/context" xsi:schemalocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd"> <context:component-scan base-package="spring.rest.controller...

java - get distance between two places -

i trying find distance between 2 places, new this. came know openstreetmap. not sure do. i found traveling salesman application uses osm route. here question how osm between places .e.g. " http://www.openstreetmap.org/api/0.6/map?bbox=10,30,10,30 " gives me map of box (10,30,10,30) .. if want map between leeds , sheffield should query. or there other way find distance.(as student want open source way academic project..) please suggest.. for calculating routing distance between 2 places can use 1 of various online or offline routers. there list of various information routing developers containing list of libraries , other information. if have obtain location of specific address before doing actual routing can use nominatim .

angular - Declare variable in ngFor -

in angular2 project need present matrix. current code: <tr *ngfor="let worker of workers"> <td class="{{worker.fired ? 'fired-worker':''}}">{{worker.lastname}}<br>{{worker.firstname}}</td> <td *ngfor="let course of courses;" class="sk-table-sub-header"> <div *ngif="course.isgeneric"> <div class="col-xs-6" sc-dc [sc-dc-date]="matrix[worker.id][course.id].expiration"> <date-picker (ondatechanged)="ondatechanged($event, worker, course, 'genericstartdate')" [date]="matrix[worker.id][course.id].genericstartdate></date-picker> </div> <div class="col-xs-6 training-table-rounded-cell" sc-dc [sc-dc-date]="matrix[worker.id][course.id].expiration"> <date-picker (ondatechanged)="ondatechanged($event, worker, ...

smtp - Delay after RCTP command on GMail -

i want create smtp validation on registration @ website, got strange behavior on gmail smtp servers. validation looks sending emails: after establishing connection smtp server send commands ehlo , helo , mail from , rcpt to , quit . commands helo , mail from not take many time, command rcpt to can take 3 seconds on gmail. example, on several others servers command takes 200-300ms. also, if check existing email address, rctp command takes 600-900ms, delay takes more 3 seconds unexisting address. i think, delay antispam behavior, how can bypass it? domain has correct txt-spf , spf records. server not listed in spam lists. i'm not seeing delay you're reporting after rcpt to. run mail server logs transcript remote mta every delivery. looking @ few recent deliveries gmail addresses, see server gmail responded 250 ok after rcpt side. see below. (email addresses , ip's anonymized protect innocent!). tue jul 23 16:01:52 2013 gmt dns mx record lookup gm...

How to translate view with smooth animation in android -

i have written peace of code perform animation. have written animation file in anim folder my animone.xml file <?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/linear_interpolator" android:fillafter="true"> <translate android:fromydelta="0%p" android:toydelta="-5%p" android:duration="1500"/></set> and here apply animation on view linearlayout animation animate= animationutils.loadanimation(context,r.anim.animone); subprofile.setvisibility(view.visible);//subprofile linear layout subprofile.startanimation(animate); so when run code . change position of view without smooth sliding after specified duration. want make smooth. please help. ----------------here complete code---------------- main fragment file <framel...

java - Displaying just one value in JComboBox when one is selected -

Image
hello :) need changing jcombobox in jtable . i'm new gui-programming , swing , couldn't solve problem: have change behavior of jcombobox . you can see combobox in picture below. if "ja" selected there should "nein" option , other way around. cool if "nein" set per default. code written 1 student last semester , have difficulties adjust combobox have to. that's code snippet combobox gets initialized. optionsinteger = new jcombobox<string>(); optionsinteger.additem("ja"); optionsinteger.additem("nein"); optionsinteger.setselecteditem(optionsinteger.getitemat(0)); optionsinteger.setselectedindex(1); optionsinteger.setname("optionsinteger"); the combobox gets inserted jtable in method: public void repaintxtable(defaulttablemodel model,jtable table, int xamount, jscrollpane scrollpane, jcombobox<string> optionsinteger) { model.se...

dictionary - multiple lists into a map -

i had question regarding code below. i'm reading file containing lots of data of stuff irrelevant. data written out on 1 line, cannot use nextline or something. for each vertex , save relevant information dataperpoint . when go next vertex, want clear list fill new relevant information. the issue have each time clear dataperpoint , values in map cleared. when try fill it, previous positions in map same values. how can , make sure each vertex own list? looking forward suggestions! public static map<integer, list<double>> readdata(file f) // throws io exception? { // create map store vertex , list relevant information in list<double> dataperpoint = new arraylist<double>(); map<integer, list<double>> data = new hashmap<>(); // open scanner try (scanner in = new scanner(f)) { // make sure correct localization used in.uselocale(locale.us); // first 6 integers contain irrelevant...

php - Large text replace array -

i'm looking when replacing text when i'm importing xml file. want text-replace values when importing, matches categories, filter values etc. on website. i'm using function. wrote myself copy-pasting internet (i'm not coder) need help/advice. <?php // text replace test function function my_text_replace($x) { ($y = 0; $y < 2; $y = $y+1) { $phrase = $x; $old = array("draaideurkast", "fout1 mrc", "draaideurkast mrc", "draaideurkast mrc"); $new = array("fout1", "fout2", "goed", "fout3"); $x = str_ireplace($old, $new, $phrase); $y = $y+1; return $x; } } ?> code fix: happens not want partial match replace, complete value of $x. in example output should 'goed'. should replace once when found. (but fixed loop think). output should case insensitive. advice question: correct way of replace (large amounts) of texts during ...

Add a Sound Mute Button to a Video Object -

in flash actionscript 3.0. have added video object stage attaching camera , video classes. have created simple mute/unmute button. want embed sound button video object give clients more options. there anyway can incorporate mute button video object? code: wont display here appreciated!! var nc:netconnection = new netconnection(); nc.addeventlistener(netstatusevent.net_status, nethandler); nc.connect(rtmfp://example); cam:camera = camera.getcamera(); var vid:video = new video(); camera.setmode(720,540,15,true); camera.setquality(0, 100); vid.attachcamera(cam); video.width = camera.width; video.height = camera.height; addchild(vid); function setmute(vol){ var stransform:soundtransform = new soundtransform(1,0); stransform.volume = vol; soundmixer.soundtransform = stransform; } var ismuted:boolean = false; mute_btn.addeventlistener(mouseevent.click, togglemutebtn); function togglemutebtn(event:mouseevent):void{ if(ismuted)...

JavaScript Code Optimization - Creating Reusable Classes -

i new javascript , need code optimization. pretty sure there ways create "classes" run code better , more efficient. here link jsfiddle demo version: jsfiddle demo <form id="tyreform"> <div id="currenttyre"> <h2>current tyre size</h2> <div id="errordisplay"></div> <input type="number" id="sectionwidth"> / <input type="number" id="aspectratio"> r <input type="number" id="rimdiameter"> <p>sidewall: <span class="output"></span></p> <p>width: <span class="output"></span></p> <p>diameter: <span class="output" id="fulldiameter"></span></p> <p>circumference: <span class="output"></span></p> <p>reverse / mile: <span class="output"></span></p> </div>...

c# - asp.net mvc + wordpress on IIS 8 on same root -

is possible run wordpress , asp.net mvc site on same root. client want , asked him install wordpress blog in sub directory insisted on same root because claims has seen running both without sub directory. i have deleted default route mvc site route.config. , installed wordpress plesk panel , setup it's permalinks. wordpress working fine, asp.net mvc routes not working. i aware iis use fastcgi rewrite routes wordpress. there way asp.net mvc routes work? please me out, thanks

android - Cordova Media plugin - Load stream after hours -

for long time m trying solve problem cordova media plugin... want play internet radio stream on button press (play) code: app.js var mmedia; function playaudio(url) { mmedia = new media(url, function () { console.log("playaudio():audio success"); }, function (err) { console.log("playaudio():audio error: " + err); } ); // play audio mmedia.play(); } index.html <input type="button" value="play" onclick="playaudio('http://streaming.tdiradio.com:9000/');" /> but silence...and few hours later radio starts playing.. hours after app closed (i didn't release media though)... i'm using android 4.4.2 on phone.. on ripple works fine without 1s of delay.. what about? , best way solve this?

Gather graphs in Neo4j -

i have multiple neo4j graphs in hand, let's g1 , g2 , g3 . how can efficiently migrate graphs 1 graph. in graph, g1 , g2 , g3 has label g1 , g2 , g3 , never connect each other. i using neo4j 2.3 3.0 considered. thanks. edit ok. using spring date neo4j, hard connect multiple neo4j instances. decided put graph 1 instance , distinguish them labels. clear enough? ok. problem solved. following things: convet graphs json file. read json file using java , write final graph.