Posts

Showing posts from March, 2010

spring - Liferay service builder 6.2 -

it basic question. main advantages of using service builder? if portlet doesn't have database, of using webservices, service builder in case caching? service builder provides service layer, can apply aop on ? you can create service without attrs, service builder create services , injections these services. the advantage maybe having service wrapper, can use liferay catching solution. example use services classes, , create method calls web services. well there can use liferay cache solution.you can take class: multivmpoolutil.java hope helps

wordpress - htaccess http-to-https redirect not affecting root -

this one's been bugging me while now. we're trying redirect http:// https:// , ourdomain.co.uk www.ourdomain.co.uk . both https , www redirects work every page. but https not applied when accessing root url, http://www.ourdomain.co.uk . http://ourdomain.co.uk gets redirected https://... without problems. what causing this? i'm .htaccess n00b, we're using matches suggestions i've found searching problem... this start of our .htaccess : # fix wordpress menu limit <ifmodule mod_php5.c> php_value max_input_vars 6000 </ifmodule> # begin wordpress <ifmodule mod_rewrite.c> rewriteengine on # force https rewritecond %{https} !=on rewriterule ^ https://%{http_host}%{request_uri} [l,r=301] # force www. rewritecond %{http_host} !^www\. rewriterule .* https://www.%{http_host}%{request_uri} [l,r=301] # force traing slash rewritecond %{request_filename} !-f rewriterule ^(.*[^/])$ /$1/ [l,r=301] rewritebase / rewriterule ^index\.php$ -

vb.net - Module Based Application, Execute code OnExit? -

i have small vb.net application marked windows forms application however, there no forms. everything driven module. done eliminate form of interface (form, console window, etc.). have new need execute bit of code prior application closing however, cannot seem find suitable event attach to. whether app closes due unhandled exception (of course never happens..) or closed via task manager, need code execute. how can achieve this? try subscribing application's exit event. in main (or whatever code called on application start), add handler: addhandler application.applicationexit, addressof onapplicationexit then define handler run when application shuts down. 'application exit hander private sub onapplicationexit(byval sender object, byval e eventargs) try ' ignore errors might occur while closing file handle. catch end try end sub

vagrant centos7.2 Vagrantfile -

i try setup vagrant centos7.2. i've found on atlas: https://atlas.hashicorp.com/brightcove/boxes/centos7.2 when set on vagrantfile with config.vm.box = "brightcove/centos7.2" and config.vm.box_url = "https://atlas.hashicorp.com/brightcove/boxes/centos7.2" i error: vagrant_centos$ vagrant bringing machine 'default' 'virtualbox' provider... ==> default: box 'brightcove/centos7.2' not found. attempting find , install... default: box provider: virtualbox default: box version: >= 0 ==> default: loading metadata box 'https://atlas.hashicorp.com/brightcove/boxes/centos7.2' default: url: https://atlas.hashicorp.com/brightcove/boxes/centos7.2 ==> default: adding box 'brightcove/centos7.2' (v1.0.14) provider: virtualbox default: downloading: https://atlas.hashicorp.com/brightcove/boxes/centos7.2/versions/1.0.14/providers/virtualbox.box error occurred while downloading remote file. error m

javascript - Generate arrays of numbers in certain algorithm -

so need few arrays : array 1 = [1,9,17,25,33,41]; array 2 = [2,10,18,26,34,42]; etc. each array adds 8 last item. but, need generate dynamically (using functions in javascript). var initvalue = 5; var diff = 8; var len = 5; function makediffarray(initvalue, diff, len) { (var = 0, arr = []; < len; i++) { arr.push(initvalue); initvalue += diff; } return arr; } console.log(makediffarray(initvalue, diff, len));

c# - Animate Property of Custom Class -

in uwp project, bind several elements on page various objects updated. 1 of these objects custom class attached dependencyproperty called background. background, in class, defined solidcolorbrush. when animating background of element directly, say, button, use: storyboard.settargetproperty(animation, "(button.background).(solidcolorbrush.color)"); so, when trying animate background property of custom class, write: storyboard.settargetproperty(animation, "(myclass.background).(solidcolorbrush.color)"); this gives me error: cannot resolve targetproperty (myclass.background).(solidcolorbrush.color) how can correctly animate dependencyproperty of custom class?

apache spark - StandardScaler returns NaN -

env: spark-1.6.0 scala-2.10.4 usage: // row of df : dataframe = (string,string,double,vector) (id1,id2,label,feature) val df = sqlcontext.read.parquet("data/labeled.parquet") val sc = new standardscaler() .setinputcol("feature").setoutputcol("scaled") .setwithmean(false).setwithstd(true).fit(df) val scaled = sc.transform(df) .drop("feature").withcolumnrenamed("scaled","feature") code example here http://spark.apache.org/docs/latest/ml-features.html#standardscaler nan exists in scaled , sc.mean , sc.std i don't understand why standardscaler in mean or how handle situation. advice appreciated. data size parquet 1.6gib, if needs let me know update: get through code of standardscaler , problem of precision of double when multivariateonlinesummarizer aggregated. thanks @zero323 i locate problem : there value equals double.maxvalue , when standardscaler sum columns, result overflows.

solr - Extended Dismax Query parser avoid replacing multiple white spaces with single white space -

i using extended dismax query parser in our setup. running following query documents related company _query_:"{!edismax qf='company' q.op='or'}(\"the procter & gamble company\")" for issue our indexing logic, have multiple spaces in company name the procter & gamble company when run above query, not giving results edismax parser replacing multiple white spaces single white space. following snippet debug output "rawquerystring": "_query_:\"{!edismax qf='company' q.op='or'}(\\\"the procter & gamble company\\\")\"", "querystring": "_query_:\"{!edismax qf='company' q.op='or'}(\\\"the procter & gamble company\\\")\"", "parsedquery": "(+disjunctionmaxquery((company:the procter & gamble company)))/no_coord", "parsedquery_tostring": "+(company:the procter & gambl

How to mock an array of interfaces using powermock or mockito -

i mocking interface array throws java.lang.illegalargumentexception: cannot subclass final class class. following changes did. added following annotations @ class level in exact order: @runwith(powermockrunner.class) @preparefortest({ array1[].class, array2[].class }) inside class doing this: array1[] test1= powermockito.mock(array1[].class); array2[] test2= powermockito.mock(array2[].class); and inside test method: mockito.when(staticclass.somemethod()).thenreturn(test1); mockito.when(staticclass.somediffmethod()).thenreturn(test2); basically need mock array of interfaces. appreciated. opening perspective on problem: think getting unit tests wrong. you use mocking frameworks in order control behavior of individual objects provide code under test. there no sense in mocking array of something. when "class under test" needs deal array, list, map, whatever, provide array, list, or map - make sure elements within array/collection ... need them

java - Random - nextInt(int y) isn't able to give me 18 even integers in a row when 'int y' % 2 == 0 && 'int y' != a power of 2 -

sorry title wanted pack information problem in little space possible without being confusing. so, have loop runs n times , each time uses = r.nextint(int y ); generate int , if n integers generated numbers, program "returns true". the weird thing is: if chose n 18 or higher while y , number not power of 2, programm not "termintate successfully". i love me, , can take heavy dose of criticism. (i know i'm asking random/nextint(int) topic take tips better coding) edit: looked documentation java8 befor posted here , powers of 2 method uses different way of producing random number. what don't understand why 18 breakpoint consecutive numbers , why work odd numbers nextint(int)? so following code work howmanyints = 16 or 17 not 18 (or higher) when nextintvalue number not power of 2 (6,10,12...) it works howmanyints = 25 , nextintvalue = 8 in less 20 seconds import java.util.*; class test{ public static void main(string[] args)

c++ - Errors While Loading Mono (Embeded) -

i'm trying embed mono in c/c++ application framework (game engine), have troubles trying run it: following error the assembly mscorlib.dll not found or not loaded. should have been installed in 'g:\users\mattmatt\workspace\spikyengine\lib\mono\4.5\mscorlib.dll' directory'. the issue can't find files name of mscorlib.dll in mono installation directory; suggestions? here code: #include "../include/spiky/system/log.h" #include <mono/jit/jit. int main(int argc, char **argv) { monodomain *domain; domain = mono_jit_init("test"); monoassembly *assembly; assembly = mono_domain_assembly_open(domain, "file.exe"); if (!assembly) { spiky_log(spiky::log_level_error) << "@mono couldn't load assembly code 'file.exe'"; } return 0; } i solved it. needed point mono assembly directory, way: mono_set_dirs("...\\mono\\lib", "...\\mono\\

wpf - bindable property for checkbox ischecked do not reflect when trigger used -

my bindable property revalsurfacechecked not updated when set ischecked property in trigger <checkbox grid.row="1" grid.column="2" grid.columnspan="2" x:name="chkrevalsurface" content="export reval surface (if applicable)" horizontalalignment="left" verticalalignment="center"> <checkbox.isenabled> <multibinding converter="{staticresource revalsurfacecheckboxenableconverter}"> <binding elementname="chkexporttocsv" path="ischecked"></binding> <binding elementname="chkexporttoexcel" path="ischecked"></binding> </multibinding> </checkbox.isenabled> <checkbox.style> <style targettype="{x:type checkbox}"> <setter property="

html - CSS Bootstrap MegaMenu -

Image
i'm trying make megamenu dropdown, bugs. problems: -the li tags inside sub-menu not appearing. -mouse hover on sub-menu , main menu border disappear. images mouse hover main menu: mouse hover sub-menu: html: <div class="collapse navbar-collapse" id="mainmenu"> <!-- main navigation --> <ul class="nav navbar-nav pull-right"> <li class="primary <?php if($page == 'main'){ echo 'active'; } ?>"> <a href="./?page=main" class="firstlevel last" >home</a> </li> <li class="primary <?php if($page == 'about'){ echo 'active'; } ?>"> <a href="./?page=about" class="firstlevel last" >about us</a> </li> <li class="primary"> <a href="#" class="drop">features</a><!-- begin

java - Can't pass string from one class to another -

hello trying write program takes third line comma separated text file passes through getdata method in weatherdatapoint class splits string separate strings on comma. want string variable date set value of dataline2[7]. print out date string calling getdate method driver class. public class driver { public static void main(string[] args) { weatherdatapoint weather = new weatherdatapoint(); string dataline1 = ""; string inputfile = "weatherdata.csv"; scanner readfile = null; try { readfile = new scanner (new file(inputfile)); } catch (filenotfoundexception ex) { system.out.println("error file not found"); system.exit(1); } while (readfile.hasnextline()) { dataline1 = readfile.nextline(); weather.getdata(dataline1); } system.out.println(string.format("%s",weather.getdate())); } } public class weatherdatapoint { private string date

functional programming - Function that creates a list of all indexes where an element appears in a list -

i attempting write function (positions n l) returns list of each index appears in l , n number given first element of l. for example, (positions 0 'a '(a b c d e a)) => (0 3 6) (positions 1 'a '(a b c d e a)) => (1 4 7) so far, have come (which isn't working correctly): (define (positions n l) (cond ((null? l) '()) ((= (car l) a) (cons n (positions (+ n 1) (cdr l)))) (#t (positions (+ n 1) (cdr l))))) try this: (define (positions n l) (cond ((null? l) '()) ((equal? (car l) a) (cons n (positions (+ n 1) (cdr l)))) (else (positions (+ n 1) (cdr l))))) the problem = defined numbers. if you're that list contain symbols, use eq? . otherwise use equal? , general equality comparison , works many data types (numbers, symbols, booleans, etc.) also, use else last condition, using #t common lisp convention doesn't apply in scheme.

phpmyadmin - How could I upload huge data from local mysql server to online database? -

i have table (on localhost) having more 158k rows , want upload them online database in internet. i tried upload failed (504 gateway out), tried zip minimize size (from 15 mb 1.5 mb) still same issue. please me resolve it. you have 2 checkboxes on page import: browse computer , select web server upload directory /home/... upload file in such directory /home/... , try import again

bash - select log messages between two dates -

i want extract log messages between 2 dates. problem date format below. [tthangavel@localhost test]$ cat file may 1 06:00:08 localhost my_process: myfield,bras_vci,1,1,10000000,10000000000,e,rtt,125,50,200,5,601,17635626,50,15841153,4928488,14274344,0,-,17560 may 12 06:00:08 localhost my_process: myfield,bras_vci,1,1,10000000,10000000000,e,rtt,125,50,200,5,601,17635626,50,15841153,4928488,14274344,0,-,17560 may 13 06:00:07 localhost my_process: myfield,bras_vci,1,1,10000000,10000000000,-,rtt,55,50,200,5,813,10000000000,96,22859361,5306968,19470856,0,-,17559 may 14 06:00:07 localhost my_process: myfield,bras_vci,1,1,10000000,10000000000,-,rtt,56,50,200,5,762,10000000000,96,17805577,4979448,13233936,0,-,17559 may 15 06:00:07 localhost my_process: myfield,bras_vci,1,1,10000000,10000000000,-,rtt,56,50,200,5,848,10000000000,96,19767812,5691888,14387304,0,-,17559 jun 10 06:00:08 localhost my_process: myfield,bras_vci,1,1,10000000,10000000000,e,rtt,125,50,200,5,601,17635626,50,15841153,

python - str() error when running AWS Lambda (converting uuid to string) w/ Dynamo DB -

i have tried converting uuid string in code below , error. regardless of whether or not declare str() separately uuid.uuid4() see code below: __future__ import print_function decimal import * import boto3 import json locale import str import uuid def my_handler(event, context): description = event['description'] spot_id = uuid.uuid4() #unique identifier spot dynamodb = boto3.client('dynamodb') tablesinfo = "sinfo" dynamodb.put_item( tablename = tablesinfo, item = { 'spot_id':{'s' : str(spot_id)}, 'description': {'s' : description } ) return {'spot_id' : spot_id} these errors receive: { "stacktrace": [ [ "/var/task/create_spot_test.py", 15, "my_handler", "'spot_id':{'s' : str(spot_id)}," ], [

jquery - How to return a string rendered from an html template using javascript? -

i have javascript function below function format(d) { // `d` original data object row return '<div class="expandedrow" style="padding: 10px; border-style: solid; border-width: 0px 1px; border-color: #f0f0f0;">' + '<table cellpadding="5" cellspacing="0" border="0" style="width: 100%;">' + '<tr>' + '<td>full name:</td>' + '<td>' + d.name + '</td>' + '</tr>' + '<tr>' + '<td>extension number:</td>' + '<td>' + d.extn + '</td>' + '</tr>' + '<tr>' + '<td>extra info:</td>' + '<td>and further details here (images etc)...</td>' + '</tr>' + '</table>'+ '<div>'; } clearly returns string . html temp

r - How do I compare two columns and delete the not overlapping elements? -

i have 2 columns in 2 data frames, longer 1 includes elements of other column. want delete elements in longer column not overlap other, corresponding row. identified "difference" using: diff <- setdiff(gdp$country, tfpg$country) and tried use 2 loops done: for (i in 1:28) { for(j in 1:123) {if(diff[i] == gdp$country[j]) {gdp <- gdp[-c(j),]}}} where 28 number of rows want delete (length of diff) , 123 length of longer column. not work, error message: error in if (diff[i] == gdp$country[j]) { : missing value true/false needed so how fix this? or there better way this? thank much. i have data frame called "gdp" here: country wto y1990 y1991 y1992 austria 1995 251540 260197 265644 belgium 1995 322113 328017 333038 cyprus 1995 14436 14537 15898 denmark 1995 177089 179392 182936 finland 1995 149584 140737 136058 france 1995 1804032 1822778 1851937 there 123 rows. delete rows country names specified in vec

Rails has_and_belongs_to_many query for all records -

given following 2 models class propertyapplication has_and_belongs_to_many :applicant_profiles end class applicantprofile has_and_belongs_to_many :property_applications end i have query lists property_applications , gets collection of applicant_profiles each property_application . the query follows , inefficient. applications = propertyapplication.includes(:applicant_profile).all.select |property_application| property_application.applicant_profile_ids.include?(@current_users_applicant_profile_id) assume @current_users_applicant_profile_id defined. how can perform 1 (or few) queries achieve this? i want achieve this propertyapplication.includes(:applicant_profile).where('property_application.applicant_profiles in (@current_users_applicant_profile))

php - Modifying DOM to style sequential headings -

let's start html in database table: <section id="love"> <h2 class="h2article">iii. love</h2> <div class="divarticle"> this display looks after run through dom script: <section id="love"><h2 class="h2article" id="a3" data-toggle="collapse" data-target="#b3">iii. love</h2> <div class="divarticle collapse in article" id="b3"> and this: <section id="love"><h2 class="h2article" id="a3" data- toggle="collapse" data-target="#b3"> <span class="article label label-primary"> <i class="only-collapsed fa fa-chevron-down"></i> <i class="only-expanded fa fa-remove"></i> iii. love</span></h2> <div class="divarticle collapse in article" id="b3"> in other word,

c# - Setting pixel shader uniform variable -

dummy question, guess. have custom shader looks this: sampler2d inputtexture; float parameter1, parameter2 etc float4 main(float2 uv : texcoord) : color { float4 result = blah-blah-blah calculations using parameter1, parameter2 etc. return result; } i'm trying use via wrapper looks this: class myshadereffect : shadereffect { private pixelshader _pixelshader = new pixelshader(); public readonly dependencyproperty inputproperty = shadereffect.registerpixelshadersamplerproperty("input", typeof(myshadereffect), 0); public myshadereffect() { _pixelshader.urisource = new uri("myshader.ps", urikind.relative); this.pixelshader = _pixelshader; this.updateshadervalue(inputproperty); } public brush input { { return (brush)this.getvalue(inputproperty); } set { this.setvalue(inputproperty, value); } } } so, question is: how set shader parameters c# program? it's ri

java - Add custom data source to Jaspersoft Studio -

i trying fill table passing custom data source it. have created simple report table on it. report self gets data ms sql database. have written java class similar class in example . no value in table. @ example there no scriptlet. have checked (string) this.getfieldvalue("kn_formelgg"); line of code. gets data field , can show on report. guess bean data source not filled. call fill table method in aftergroupinit . how can use collection of data java in jasper? tried adding java bean in dataset , query dialog , did not me either. should add scriptlet subreport/table? main emphasis of problem having custom data source in scriptlet. went other problem through, still no answer. added $p{fielddatasource}.getdata() check data, delivers null. java class 1: package testprojektiman.scriptlets; import java.util.arraylist; import java.util.hashmap; import java.util.list; import java.util.map; import net.sf.jasperreports.engine.jrdefaultscriptlet; import net.sf.jasperreports.e

node.js - Multer uploading array of files fail -

i have array of file objects sent server. "files[0] = (file object), files[1]= ... " multer doesn't recognized field name , "request.files" empty "request.body array of files. use multer middleware upload.any() app.post('/photos/upload', upload.any(), function (req, res, next) { // req.files array of `photos` files // req.body contain text fields, if there })

sql server - Optimized sql query for 5 parent and child table with relation?how -

Image
i have 5 table in database shown in image below link the join this: tablea----->tableb------>tablec---------->tabled----->table see image fields [name fields in image amount , in nvarchar(max) ] now want apply optimized queries save response time like 1-sum (amount) of db making join of b b c d 2-simlarly agreagate function in clause 3-calculations 4-count i prefer solution without inner join since takes more response time , fails if 1 join fails. in cases failure in relation of a---b not give record of c etc

node.js - How to run middleware on all routes except static assets -

is there way run middleware on express routes except static assets? i tried running right in app.use('/', authenticate, app.router()); leads running static assets well. would have list on routes? as @explosion pills points out in comments, add middleware after express.static middleware sample codes below app.use('/', express.static(path.resolve(root, './build/client'))); app.use(cors()); app.use(bodyparser.json()); app.use(bodyparser.urlencoded({extended: true}); // ... app.use('/', authenticate, app.router());

node.js - sending json array from android to node server -

android : try { jsonobject obj = new jsonobject(); obj.put("id", editid.gettext().tostring()); obj.put("pw", editpassword.gettext().tostring()); final string jsonstring = obj.tostring(); //final string jsonstring = "{\"id=\":\"abce\",\"pw\":\"13447\"}"; log.i("tag",jsonstring); thread background = new thread(new runnable() { @override public void run() { try { log.i("tag", "thread"); url url = new url("http://49.172.86.247:80/login/controller_on"); httpurlconnection hey = (httpurlconnection) url.openconnection(); hey.setrequestmethod("post"); hey.setd

linux - Using ansible launch configuration module ec2_lc and securitygroup names versus id -

i want accomplish following in aws ec2: create security groups using ansible module ec2_group. create launch configuration using ansible module ec2_lc , attach security group created earlier. now, want use security group names instead of id's because want able recreate whole infrastructure ansible if needed. recreating security groups cause id of group different. ec2_lc module accepts security group id's. is there way can map security group id name? i defining security groups this: - name: create ec2 group ec2_group: name: "{{ item.name }}" description: "{{ item.description }}" vpc_id: "{{ item.vpc_id }}" region: "{{ item.region }}" state: present rules: "{{ item.rules }}" rules_egress: "{{ item.rules_egress }}" register: sg the launch configuration code looks this: - name: create launch configuration ec2_lc: region: "{{ item.region }}" name: &

user interface - Android: Show elapsed time on UI for given start time and continue to update it with handler (timer) -

i project start time web service , work out time project had taken current date. store datetime web in starttimelist . here how i'm getting current elapsed time on project: public void settimeelapsed() { try { calendar calstart = calendar.getinstance(); simpledateformat sdf = new simpledateformat("yyyy-mm-dd hh:mm:ss"); calstart.settime(sdf.parse(starttimelist.get(0))); long startmillis = calstart.gettimeinmillis(); long = system.currenttimemillis(); long difference = - startmillis; calendar caldiff = calendar.getinstance(); caldiff.settimeinmillis(difference); int eyear = caldiff.get(calendar.year); int emonth = caldiff.get(calendar.month); int eday = caldiff.get(calendar.day_of_month); int ehour = caldiff.get(calendar.hour_of_day); int emin = caldiff.get(calendar.minute); int esec = caldiff.get(calendar.second); mimduration.settext(str

c# - Rewrite WCF binding from app.config to code -

i try rewrite wcf custom binding app.config code. app.config <custombinding> <binding name="cb"> <security defaultalgorithmsuite="default" authenticationmode="issuedtokenovertransport" requirederivedkeys="true" includetimestamp="true" messagesecurityversion="wssecurity11wstrust13wssecureconversation13wssecuritypolicy12basicsecurityprofile10"> <issuedtokenparameters keytype="bearerkey" tokentype="http://docs.oasis-open.org/ws/oasis-wss-saml-token-profile-1.1#samlv2.0"> <additionalrequestparameters> <trust:secondaryparameters xmlns:trust="http://docs.oasis-open.org/ws-sx/ws-trust/200512"> <trust:tokentype xmlns:trust="http://docs.oasis-open.org/ws-sx/ws-trust/200512">http://docs.oasis-open.org/wss/oasis-wss-saml-tok

mysql - How to find server name in share cpanel sql database? -

first of should mention maybe question posted couldn't find solution. let me explain you. i want compare 2 databases on server using db compare. need server name. added host name server name. reference here doesn't work. i added ip address in remote mysql it's still same. mean got error it's failed connect server ** please guide me how find server name cpanel share server ? ** thank you you should read product description "dbcomparer professional database comparison tool analyzing differences in microsoft sql server 2008 (and 2005) database structures." it not compatible mysql

hibernate - web service with spring security in java -

Image
i trying secure web service spring , hibernate. here trace of project and in webappconfig.java i'm writing @propertysource("classpath:application.properties") @importresource("classpath:spring-security.xml") but gives me java.io.filenotfoundexception: class path resource [application.properties] cannot opened because not exist any appreciated! the resources folder should in build path. if working eclipse can in way: right click on project -> properties but better convert project maven project. right click on project -> configure -> convert maven project maven create resources folder properly.

c# - PushSharp OnNotificationSent event not trigger when push notification sent to Android but its trigger when sent to iphone -

i using pushsharp library send pushnotification .net android , iphone my android , iphone recieving push notification sent .net in .net onnotificationsent event trigger ios , not android **my pushsharp registration code** push = new pushbroker(); push.onnotificationsent += notificationsent; push.onchannelexception += channelexception; push.onserviceexception += serviceexception; push.onnotificationfailed += notificationfailed; push.ondevicesubscriptionexpired += devicesubscriptionexpired; push.ondevicesubscriptionchanged += devicesubscriptionchanged; push.onchannelcreated += channelcreated; push.onchanneldestroyed += channeldestroyed; push.registergcmservice(new gcmpushchannelsettings(configurationsettings.appsettings["pushnotificationapikey"])); string basepath = appdomain.currentdomain.basedirectory; string fullpath = path.combine(basepath, "certificates/certificate.p12"); byte[] applecert = fil

java - Currency converter not converting properly -

ok, new android studio , trying make currency converter. supposed consume api , code converting , taking rates api. when run it, works fine other fact converting 0, disregarding user input. i had hard code way because of api , have no idea how easier way. sorry trouble. please inform me if more information needed. here code mainactivity2 converter resides in: package com.example.justin.currencyconverter20; import android.app.progressdialog; import android.os.asynctask; import android.support.v7.app.appcompatactivity; import android.os.bundle; import android.util.log; import android.view.menu; import android.view.menuitem; import android.view.view; import android.widget.arrayadapter; import android.widget.edittext; import android.widget.spinner; import android.widget.textview; import android.widget.toast; import org.json.jsonarray; import org.json.jsonexception; import org.json.jsonobject; import org.w3c.dom.text; import java.util.list; public class mainactivity2 extends a