Posts

Showing posts from July, 2015

CouchDB API query with ?limit=0 returns one row - bug or feature? -

i use couchdb 1.5.0 , noticed strange thing: when query api action, example: curl -x "http://localhost:5984/mydb/_changes?limit=1" i same result limit=1 , limit=0 , limit=-55 . in cases 1 row start of list. although, postgresql returns: zero rows when limit 0 message error: limit must not negative when limit -55 my question concerned api design. know opinions. it's flaw or maybe it's good/acceptable practice? this how _changes api designed. if not specify type of feed i.e long-poll, continuous etc default return list of changes in single results array. if want row row result of changes in database specify type of feed in url so curl -x "http://localhost:5984/mydb/_changes?feed=continuous" another point note in _changes api using 0 has same effect using 1 in limit parameter.

excel vba - Copy and paste array of data to remove blanks rows of data -

i'm trying develop script moves 1 sheet , copies data 1 table another. problem i’m having source table doesn't have rows populated data , destination needs presented data collapsed without blank rows. source data can vary 100 1000 rows each time script used. i have tried number of solutions, remove blanks, remove duplicates, , these don't work. here script have been using. sub as1055datacrunch() sheets("data extract").select range("bi3").select range(selection, selection.end(xltoright)).select range(selection, selection.end(xldown)).select selection.copy sheets("as 1055 table").select range("c8").select activesheet.paste selection.pastespecial paste:=xlpastevalues, operation:=xlnone, skipblanks:=true call removegaps end sub sub removegaps() range(selection, selection.end(xltoright)).select range(selection, selection.end(xldown)).select .value = .value .remo

cakephp - PHP redirect only root domain -

i need php code redirect index page site fast somthing problem : code redirect page <?php header('status: 301 moved permanently', false, 301); header( 'location: http://www.fastfreesurfing.cf/' ) ; exit(); ?> do this: if ($_server['request_uri'] == '/' || strtolower($_server['request_uri']) == '/index.php') { header('status: 301 moved permanently', false, 301); header( 'location: http://www.fastfreesurfing.cf/' ) ; exit(); }

sql server - Fixing the cryptic SSRS error - rsServerConfigurationError -

my ssrs 2008 service started in windows services. running , uses local system logon, same 1 used during installation of bids. started ssrs 2008r2 entered url - http://mycomputer:80/reportserver_ss2008 internet explorer. saw pop user , password. after entering windows login use computer, error - rsserverconfigurationerror. there no other information provided. don't have clue why happening. how fix ? edit - error parts of report server log file - main complaint - no urls specifed application reportmanager. configmanager!defaultdomain!15c8!somedate e error: no urls specifed application reportserverwebservice. ignored.configmanager!defaultdomain!15c8!somedate e error: failed report server url reservations. configmanager!defaultdomain!15c8!somedate e error: failed report server url reservations. configmanager!defaultdomain!15c8!somedate w warn: isapplicationurlsubsetofreportserver() -- failed report server url reservations. configmanager! windowsservice_1!1a1c!somed

java - Running a scanner program -

i trying write program read integer 1,000 999,999 , display comma separating thousands. far have this, , eclipse doesn't it. why? /* package whatever; // don't place package name! */ import java.util.*; import java.lang.*; import java.io.*; /* name of class has "main" if class public. */ class ideone { public static void main (string[] args) throws java.lang.exception { // scanner scan = new scanner(system.in); double value, integer; system.out.println("enter value without comma"); integer = scan.nextdouble(); system.out.println(integer,); scan.close(); you have lot of errors in code why eclipse doesnt ;) to name few: new scanner -> scanner capital s system.in -> same system check out snippet below , run fine :) /* package whatever; // don't place package name! */ import java.util.*; import java.lang.*; import java.io.*; /* name of class has "main" if class public. */ class ideone { public static void main(s

primefaces - Call backing bean from p:inputText ondblclick -

i need double click on p:inputtext inside p:datatable bring me page , launch details. possible call backing bean method primefaces p:inputtext ondblclick? p:inputtext normal input in end, can use jquery register ondblclick on it, can call p:remotecommand reach bean. i assume have multiple inputext since have datatable . xhtml <p:datatable var="car" value="#{bean.cars}"> <p:column headertext="model"> <p:inputtext value="#{car.model}" styleclass="dbclickinput" /> </p:column> </p:datatable> <p:remotecommand name="calldetailscommand" actionlistener="#{bean.calldetails()}" /> <script> $(document).ready(function() { $('.dbclickinput').dblclick( function() { calldetailscommand([{name: 'carmodelvalue', value: $(this).val()}]); } ); }); </scri

asp.net mvc - How to bind multiple classes in web api -

$.ajax({ type: "post", data: "{myevents: " + json.stringify(myevents) + ", myrecurrences: " + json.stringify(myrecurrences) + "}", url: "/signupadmin/api/signupadminapi/saveevent", contenttype: "application/json; charset=utf-8", datatype: "json", success: function (obj) { alert("success"); }, error: function (obj) { alert(obj.error()); } }); [httppost] public bool saveevent(evancedeventdata myevents,recurrencedata myrecurrences) { return true; } i have used 2 class files(evancedeventdata , recurrencedata) mentioned , trying bind json objects 2 classes ajax throws error "cannot bind multiple parameters" can 1 suggest reason why not getting binded would better support questions examples of data, such json string you're posting , exception report. however, try creating wrapper cla

android - Set the width of Spinner using java not referencing any xml -

i dynamically building view here have far: scrollview sv = new scrollview(this); linearlayout ll = new linearlayout(this); ll.setorientation(linearlayout.vertical); sv.addview(ll); spinner s = new spinner(this); s.setid(1); list<spinnerobject> list = this.datasource.getfacilitieslist(); arrayadapter<spinnerobject> adapter = new arrayadapter<spinnerobject>(this, android.r.layout.simple_spinner_dropdown_item, list); adapter.setdropdownviewresource(android.r.layout.simple_spinner_dropdown_item); s.setadapter(adapter); ll.addview(s); setcontentview(sv); how set width of spinner . know how set wrap_content , set value 200dp you can change width of in code adjusting layoutparams . example: windowmanager.layoutparams lp = getwindow().getattributes(); lp.width = 200dp; getwindow().setattributes(lp);

Rally release scope change app tagging deleted items -

in sdk 2.0 version of rally release scope change app, there filter being applied search items in recycle bin (in _getsnapsforsubset function): var deleted_item_from_release_change_filter = ext.create('rally.data.lookback.queryfilter', { property: 'release', operator: 'in', value:release_oids }).and(ext.create('rally.data.lookback.queryfilter', { property: '_previousvalues.recycled', value:false })); in returned result sets during processing want pull these out explicitly can't see easy way identify them. during filter process can tag these records in way can identify them later? you using snapshot store gets data lookbackapi. per this post , this post lbapi doesn't track entries in recycle bin, , there no way know when has been restored recycle bin. there recycled attribute on hierarchicalrequirement in ws api, reflects current value (if item in recycle bin, true or

PHP Mongodb - POST array insert -

i trying convert post data format allow me pass right collection. example: when print_r on $_post form data: array ( [name] => steve [email] => steve@mail.com [submit] => submit ) i wondering how can convert acceptable object insert mongodb collection using php similar to: $record = array( 'name' => 'steve', 'email' => 'steve@mail.com', 'submit' => 'submit' ); $collection->insert($record); i thinking loop of above array additional formatting can't seem figure out. have tried json_encode keep getting same error "call member function insert() on non-object in..." saying not proper object. thank help. no need encode anything, it's php native , expects array. let driver work you: $collection->insert( $_post ); as 2 should equivalant: $rec = array( 'name' => 'steve', 'email' => 'steve@mail.com', 'submi

MySQL Query with 2 or more Filters -

i want ask if possible have 2 filters in 1 mysql query? can show examples? try this select * table1 cond1 = "value1" , cond2 = "value2" or: select * table1 cond1 = "value1" or cond2 = "value2" mysql clause

recursion in Python extra brackets -

not sure went wrong, gives me [-1, [-2, [-3, []]]] instead of [-1,-2,-3] def search(list1,list2): if list2 == []: return list1 elif list2[0] == list1[0]: return [-list1[0] , search(list1[1:],list2[1:])] print search([1,2,3],[1,2,3]) i'm not entirely sure goal function aimed @ (why return negative of matching value?), can expected output concatenating lists in return statement: def search(list1,list2): if list2 == []: return list1 elif list2[0] == list1[0]: return [-list1[0]] + search(list1[1:],list2[1:]) print search([1,2,3],[1,2,3]) # output: # [-1, -2, -3]

bash string quoted multi-word args to array -

the question: in bash scripting, best way convert string, containing literal quotes surrounding multiple words, array same result of parsed arguments? the controversy: many questions exist applying evasive tactics avoid problem instead of finding solution, question raises following arguments , encourage reader focus on arguments , if it, partake in challenge find optimum solution. arguments raised: although there many scenarios pattern should avoided, because there exists alternative solutions better suited, author of opinion valid use cases still remain. question attempt produce 1 such use case, make no claim viability thereof conceivable scenario may present in real world situation. you must find optimum solution satisfy requirement. use case chosen real world applications. may not agree decisions made not tasked give opinion deliver solution. satisfy requirement without modifying input or choice of transport. both chosen real world scenario defend narrative parts o

xcode5 - iPhone5 Default image with Assets Catalog not working -

Image
already added iphone5 default-568h@2x.png image, displaying black screen on launch , displays black strip inside game. here screenshot anything else need specify ios7 read default-568h@2x.png image ? asset catalog has bug launch images in landscape format. see also: iphone landscape-only no launch image ios7 r4 image asset

html - jquery Hide table row if td has no text -

i trying hide table row if rows td has no text inside it. how that. far tried at fiddle here javascript: $('#tblnodes > tbody > tr').each(function () { if ($td.text() == '') { $(this).hide(); } }); html: <table id="tblnodes" border=1 width=100%> <tr> <td class="nodedata"></td> </tr> <tr> <td class="nodedata">abc</td> </tr> <tr> <td class="nodedata"></td> <tr> <td class="nodedata"></td> </tr> <tr> <td class="nodedata">abc</td> </tr> <tr> <td class="nodedata"></td> </tr> </tr> </table> try $('#tblnodes > tbody > tr').has('td:empty').hide() or $(

arrays - exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: -1 at -

i have problem when massage box tell exception in thread "main" java.lang.arrayindexoutofboundsexception: -1 @ pla3d_2.tkmat<pla3d_2.java:509> @ pla3d_2.tkmat<pla3d_2.java:327> below line of code reference for line 327 /***construction , overall stiffness matrix of b mato (line 326) tkmat(xyz,e1,p1,aj,psaig,aji,detjg,detjgg,gbg1,bmat,dep);(327) /***introduction of boundary conditions (328) fix(nb,n,nband,ix,iy,iz,u,v,w,ib,dtf,ux,uy,uz); (329) /***solutions system of linear equations (330) and for line 509 static void tkmat(double xyz[][],double e1[],double p1[], double aj[][][],double psaig[][][],double aji[][][],double detjg[], double detjgg[][],double gbg1[][][],double bmat[][],double dep[][]){ int l,l1,l2,l3,l4,l5,ie,je,it,jt,iit,jjt; double aj11,aj12,aj13,aj21,aj22,aj23,aj31,aj32,aj33,detj,sum; double gek1[][] = new double[6][nodel*3]; double gek2[][] = new double[nodel*3][nodel*3];

Access Web service from java when wsdl file is known -

i trying access web service in remote system using java code. take wsdl url xmethods registry , download wsdl file location. parse wsdl file , display list of operations , input , output parameters , type. input user according information got wsdl file. need need display user corresponding output webservice. easiest method consume webservice. dont have idea. please can me??? in advance. you can user axis2 jar framework consume webservice. axis2 jar's generate dependency files consume web service. use link create client files. http://javapapers.com/web-service/axis2-web-service-using-eclipse/

swing - java Jbutton icon, move is okay but when I cancel the move, the source button's icon goes blank -

how code: if drop position same source position nothing. i'm using jbuttons squares, , when moved(dragged) piece, move problem is, if drag piece on same position, meaning changed mind , decided move piece icon changes blank icon. public class board extends jpanel { private static final string imagefolderpath = "src/resources/images/"; private arraylist<piece>list = new arraylist<piece>(); private imageicon img; private gridbagconstraints gbc; private dragmouseadapter listener = new dragmouseadapter(); jbutton space; jbutton p; imageicon blankimg = new imageicon(imagefolderpath+"/pieces/blank.png"); public board(){ //set layout of each panel , make bg transparent this.setopaque(true); this.setbackground(new color(0,0,0,0)); this.setlayout(new gridbaglayout()); gbc = new gridbagconstraints(); //cre

android - IBM Worklight - How to get IMSI number from mobile device? -

we want imsi number mobile device in order find out if user registered use particular application or not. i did search on net. worklight using cordova. gives uuid , device name /description not imsi number. i trying code here. cordova goes getfailure. , says class not found. using ibm worklight import org.apache.cordova.callbackcontext; import org.apache.cordova.cordovaplugin; import org.json.jsonarray; import org.json.jsonexception; import android.provider.settings; import android.content.context; import android.telephony.telephonymanager; @override public boolean execute(string action, jsonarray args, callbackcontext callbackcontext) throws jsonexception { if (action.equals("imeinumber")) { org.json.jsonobject r = new org.json.jsonobject(); telephonymanager tmanager = (telephonymanager) cordova.getactivity().getsystemservice(context.telephony_service); r.put("imei", "sampleimei&

html - How to style select dropdown only when value is empty -

lets have markup this: <select> <option value="">select</option> <option value="1">one</option> <option value="2">two</option> </select> now, want dropdown display in gray when value empty i.e when showing "select". when user has selected 1 of options, should black / default color. (this visually consistent textboxes on page have gray placeholders). i want accomplish this: select[value=""] { color: gray; } but turns out select tag doesn't have value attribute. any way accomplish other using javascript? <select name="background" size="1" onchange="updatetextcolour(this.value);"><!--changecolor(this.selected);"--> <option style="color:gray">select</option> <option style="color:black">value 1</option> <option style

android - delete item in listview by capturing checkbox selection in listview -

i using custom list view has check box , button , populating list view using cursor adapter. now trying capture checkbox selection in listview , delete listview item using checkbox selection.. after lot of googling found out sparseboolean array wil solve purpose. have used capture checked checkbox array returning null. below code public class stockmanager extends activity{ string getentry; private int storeid=0; //database d; stocktable st; private string getstocks; public cursor a1; intent bd; intent sd; //listview popstocks; /*public stockmanager() { // todo auto-generated constructor stub }*/ static class viewholder { checkbox cb; button view1; } protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.stockmanager); // d=new database(getapplicationcontext()); st=new stocktable(getapplicationcontext()

getSupportActionBar returns null in android 4.1 and above -

getsupportactionbar returns null in android 4.1 , above. using support v4 , sherlockfragmentactivity . this logcat. 03-10 11:35:47.876: e/crittercism(4778): java.lang.runtimeexception: unable start activity componentinfo{com.cx.android/com.cx.android.ui.homeactivity}: java.lang.nullpointerexception 03-10 11:35:47.876: e/crittercism(4778): @ android.app.activitythread.performlaunchactivity(activitythread.java:2245) 03-10 11:35:47.876: e/crittercism(4778): @ android.app.activitythread.handlelaunchactivity(activitythread.java:2299) 03-10 11:35:47.876: e/crittercism(4778): @ android.app.activitythread.access$700(activitythread.java:150) 03-10 11:35:47.876: e/crittercism(4778): @ android.app.activitythread$h.handlemessage(activitythread.java:1280) 03-10 11:35:47.876: e/crittercism(4778): @ android.os.handler.dispatchmessage(handler.java:99) 03-10 11:35:47.876: e/crittercism(4778): @ android.os.looper.loop(looper.java:137) 03-10 11:35:47.876: e/crittercism(4778):

Excel table default value and data validation without VBA -

i have table in excel tracking projects. whenever create new row table i'd auto-populate 1 column project has "not invoiced". column use data validation allow either "not invoiced" or "invoiced" content. i have been able make both of these things work, cannot seem make them work without error! closest have gotten: put formula in relevant column. have tried both super basic ="not invoiced" =if formula based on blankness of column. correctly carries down each time make new row. i add data validation on column works fine @ first since default value formula 1 of options, when project invoice , select "invoiced" error i'm violating above formula. i've read selecting drop down should replace auto-populated formula, doesn't seem happen, gives me error i've violating column's formula instead. i've read multiple places if correctly order things (create table, add formula default value, add data validati

Using WebView and Adobe Flash Player plugin to play .swf flash doesn't work in Android 4.4.2? -

in project, need play local .swf flash files in assets folder. works in android 4.1.1, not in android 4.4.2; shows white screen. i've searched internet, , said android 4.4.2 doesn't support kind of situation more. here code websettings websettings = this.mwebview.getsettings(); websettings.setjavascriptenabled(true); websettings.setpluginstate(websettings.pluginstate.on); websettings.setcachemode(websettings.load_cache_else_network); mwebview.setbackgroundresource(r.drawable.background_main); mwebview.loadurl("file:///android_asset/flash/chinese_culture/main_culture.swf"); whether declare android:hardwareaccelerated="true" in androidmanifest.xml or not, doesn't work either.

delphi - mathematical 'not' of integer -

why delphi perform mathematical 'not' of integer rather force cast boolean value in while looping ? example var myint:integer; ... myint:=1; while not myint=5 begin myint:=myint+1; showmessage('myint : '+inttostr(myint)); end; your expression uses 2 operators: not , = . in order understand how parsed need consult table of operator precedence . operators precedence ---------------------------- @ first (highest) not ---------------------------- * second / div mod , shl shr ---------------------------- + third - or xor ---------------------------- = fourth (lowest) <> < > <= >= in ---------------------------- this shows not has highest precedence of operators, , of higher precedence = . means expression parsed if were: (not myint) = 5 in expression, because bound integral variable, not biwise negation . in order result desire must use parentheses indicate wish perform eq

string - How to convert a byte in binary representation into int in java -

i have string[] byte values string[] s = {"110","101","100","11","10","1","0"}; looping through s, want int values out of it. i using this byte b = new byte(s[0]); // s[0] = 110 int result = b.intvalue(); // b.intvalue() returning 110 instead of 6 from that, trying results, {6, 5, 4, 3, 2, 1} i not sure of go here. can do? thanks guys. question answered. you can use overloaded integer.parseint(string s, int radix) method such conversion. way can skip byte b = new byte(s[0]); piece of code. int result = integer.parseint(s[0], 2); // radix 2 binary

ios - Changing views in a view Controller -

so want make app 7 min workout, during workout view changes different exercise consists of image, timer , label displays exercise name. happens automatically example is, view 1. image shown of person doing push up, timer of 30 seconds displayed, title called table. after 30 seconds transitions new view. view 2. same above different pictures , titles view 3..... , on. i dont think necessary make different view controllers exercises, guys have suggestions on need make this. try #import "viewcontroller.h" @interface viewcontroller () { uiview *baseview; uilabel *titlelabel; uiimageview *viewforpic; float fadeduration; nsmutablearray *infoarray ; } @end @implementation viewcontroller - (void)viewdidload { [super viewdidload]; nsarray *imagesarray=[[nsarray alloc]initwithobjects:@"red.png",@"blue.png",@"yellow.png", nil]; nsarray *titlearray =[[nsarray alloc]initwithobjects:@"red",@"blue",@"yellow"

fopen in Mainframe (C language) -

i'm working on opening file mainframe. currently, can't access input file wanted. don't know if there wrong c code or jcl. me out? here code: int main() { file *ifp, *ofp; printf("ctrace1\n"); ifp = fopen("dd:inputf", "rb, recfm=vb, lrecl=50"); printf("ctrace2\n"); ofp = fopen("dd:outputf","w"); printf("ctrace3\n"); fread( buffer, sizeof( char ), linesz, ifp ); printf( "number of characters read = %i\n", num ); printf( "buffer = %s\n", buffer ); dstr = (datastr*) buffer; printf("var_a = %.*s\n", sizeof(dst

javascript - PhoneGap File Transfer Error 1, where to write FileTransfers? -

related to: https://stackoverflow.com/questions/21044197/download-file-and-store-them-locally-in-sdcard-using-phonegapbuild questions has never been answered. about app, i'm writing little app displays bunch of pdf's, it's written using jquerymobile + phonegap , it's being build phonegap build service. i realize function cannot work, since root-directory not valid place write anything. but, unable working directory of application, nor able figure out error code 1 meant using documentation. from config.xml: <preference name="androidpersistentfilelocation" value="internal" /> <preference name="permissions" value="none" /> <feature name="http://api.phonegap.com/1.0/file"/> <feature name="http://api.phonegap.com/1.0/device" /> <gap:plugin name="org.apache.cordova.file" /> <gap:plugin name="org.apache.cordova.file-transfer" /> and build servi

Breakpad init - per library? -

sorry newbie question.i have libnative_exception_handler.so breakpad init: google_breakpad::minidumpdescriptor descriptor("."); google_breakpad::exceptionhandler eh(descriptor, null, breakpad_callback, null, true, -1); and libfunc.so unsafe functions. both libs loaded in android using system.loadlibrary(); if breakpad init done in libnative_exception_handler.so signals not catched , breakpad callback not invoked. if change libfunc.so source init breakpad signals catched. breakpad need init in same library unsafe function are?. update: i've create lib , demo app demonstrate issue: https://github.com/4ntoine/acra-breakpad google_breakpad::exceptionhandler eh needs init in heap, not in stack.

c# - Listbox items slide show -

in application consuming web service , displaying 100 items using listbox . it's working fine. the items displaying in single page. want display 10 items in 1st slide , if slide screen right left next 10 list items should display. how can in window phone development using c#? is concept there in windows phone? there options issue: you can display data in pivot control , add new pivotitems listbox each 10 items. you can use stackpanel orientation="horizontal" gives possibility slide content horizontally.

c++ - Fill the QRect on enter event -

i have task: qrect object should painted when mouse cursor entering it. after couple of hours made this. void myobj::mousemoveevent(qmouseevent* event){ int x1, y1, x2, y2; qpoint point = event->pos(); rect->getcoords(&x1, &y1, &x2, &y2); if((point.x() >= x1) && (point.x() <= x2) && (point.y() >= y1) && (point.y() <= y2)){ changerectcolour(); }else{ brush->setcolor(qt::green); repaint(); } } myobj inherited qwidget. think idea isn't efficient. because on every mouse move outside qrect changes color green(even if it's green). unfortunatelly, qrect hasn't enterevent() function. can you, please, give advice how properly. qwidget::repaint() means "paint now!!! can't wait!" . use qwidget::update() instead, fold several paint requests 1 (better explanation in doc). btw reimplementing qrect::contains() . new code be void myobj::mousemove

c# - Why is the file not downloading? -

Image
i followed this link download file in file system. except did using ext.net link button, , in click event of button added same download code. the design part is: <ext:linkbutton id="lnkdownload" text="download" runat="server"> <directevents> <click onevent="lnkdownload_click"> <eventmask showmask="true" /> </click> </directevents> </ext:linkbutton> and codebehind is: protected void lnkdownload_click(object s, directeventargs e) { string filepath = // path file fileinfo file = new fileinfo(filepath); if (file.exists) { response.clear(); response.addheader("content-disposition", "attachment; filename=" + file.name); response.addheader("content-length", file.length.tostring()); if (file.extension == "

javascript - Auto Detect change of DOM with RactiveJS -

i'm using ractivejs making big form change values of field automatically. a little plunkr example => http://plnkr.co/edit/eonfqfll6d2g7gdvcfm6?p=preview when change first select, second updated value stay older. on project, don't have juste 2 select maybe ten lot of options , changes when select differents values. it's possible update automatically value actual options ? you can same thing ractive.observe : var ractive = new ractive({ el: 'container', template: '#template', }); ractive.observe('*', function(){ settimeout(function(){ ractive.updatemodel(); }) }); http://plnkr.co/edit/t4czra6fwidmmqhlqako?p=preview see http://docs.ractivejs.org/latest/observers more info on using keypaths , wildcards tailor observe.

cordova - Phonegap plugin (Version >=3.0) to retrieve registered email address of an Android device -

i need registered email of android device within cordova app. have cordova 3.3.0 app working; , find cordova plugin version 2.5 @ this place plugin not compatible version using. has provided updated plugin this? how update plugin built 2.5, make compatible 3.3.0? the plugin needs permission android.permission.get_accounts update: did following accountlist.java file package com.seltzlab.mobile; import org.json.jsonarray; import org.json.jsonexception; import org.json.jsonobject; import android.accounts.account; import android.accounts.accountmanager; import android.content.context; import org.apache.cordova.*; import org.apache.cordova.cordovainterface; import org.apache.cordova.cordovaplugin; import org.apache.cordova.cordovawebview; import org.apache.cordova.pluginresult; public class accountlist extends cordovaplugin { private context ctx; public pluginresult execute(string action, jsonarray args, string callbackid) { try { jsonobject obj = args.getjsonobject(0);

paypal android sdk customization -

i need integrate paypal library application have requirement when ever user registering application can enter paypal account information , check whether user exist or not. if user exists register application after steps ..........when ever user click pay button redirects paypal library payment processing . have queries paypal sdks allows customize library? how customize user interface(pay pal library) ? sorry, cannot ask paypal whether user exists, nor can customize sdk other configuration available through extras (see javadocs ).

objective c - Set Title String to Settings Bundle iOS -

i need localize setting screen text dynamically based on iphone setting language/user preferred language. in scenario, localized text fetching server. storing text in database , showing on screen. setting screen should localized based on user preferred language/device language. tried access title string of item in root.plist. returns value need title. how can access/change title of item. for eg: { defaultvalue = 1; key = "enabled_preference"; title = "keep me logged in"; type = pstoggleswitchspecifier; } [[nsuserdefaults standarduserdefaults]valueforkey:@"enabled_preference"]; which return value 1 need title "keep me logged in" needs changed. i need "title" localized (ie) instead of using .lproj file, have set of localized strings in dictionary. need set title value dictionary. how can accomplish this. thanks here way can values , keys. this might you, keys , traverse key

Python named keyword by variable -

i'm new python , i'm trying figure out if can pass named keywords string without calling them explicitly. here example: def test(height, weight): print("h=" + str(height)) print("w=" + str(weight)) test(weight=1, height=2) # output = "weight" b = "height" test(a=1, b=2) # same output is possibile? thanks! use dict . kwargs = {a: 1, b: 2} test(**kwargs)

javascript - Jquerymobile: label text is not changing with slider value -

hi in jquery mobile app trying change label text on moving jqm slider , in jsfiddle working fine , when try run on browser nothing working. below code: <label for="slider">choose:</label> <input type="range" name="slider" id="slider" value="0" min="0" max="5" /> <label id="sliderlabel">strongly agree</label> below script <script type="text/javascript"> $("#slider").change(function() { sval = $(this).val(); if(sval ==1 ) { $('#sliderlabel').text('neither agree nor disagree'); } }); </script> not sure wrong doing. appreciated. try use: $(document).on('pagecreate', function() { $("#slider").change(function () { sval = $(this).val(); if (sval == 1) { $('#sliderlabel').text('neither agree nor disagree');

mysql - Check response time on sent message - possible with using only SQL? -

i trying figure out general response time per. message. so, every time sender sends message receiver, how many seconds (think converting unix timestamp suitable solution, , dividing) went, before user responded. i have table: +--------------+----------+ | field | type | +--------------+----------+ | msg_id | int(11) | | msg_sender | int(11) | | msg_receiver | int(11) | | msg_date | datetime | | msg_message | longtext | +--------------+----------+ i have tried hour figure out how put up, , solutions horrible long, complicated and/or inefficient, , made me wonder, if possible/most efficient via mysql. maybe of point me in right direction. select t1.*, min(t2.msg_date) response_date mytable t1 join mytable t2 on t1.msg_sender=t2.msg_receiver , t2.msg_sender=t1.msg_receiver , t2.msg_date>t1.msg_date group t1.msg_sender,t1.msg_receiver,t1.msg_date for each message in t1 corresponding answers sent after t1 message , group them min

java - How to get a two level list view to work within a swipe tab layout -

i'm trying create app user can select item in list , click item in list opens page, i've got work on own , i've managed put swipe tab layout when user clicks on item doesn't did before in own activity can help? i've been told need create activity class implements onarticleselected method , let mainactivity , softwaresearchactivity extend activity class avoid code-duplication. but don't know means or how implement it. i've literally been doing month i'm not familiar of terms used. i think of code in there had working before don't know how rearrange work within in swipe tab layout. articlefragment.java /* * copyright (c) 2012 android open source project * * licensed under apache license, version 2.0 (the "license"); * may not use file except in compliance license. * may obtain copy of license @ * * http://www.apache.org/licenses/license-2.0 * * unless required applicable law or agreed in writing, software * distri

full text search - MySql "MATCH" is not woking using a specific word -

i'm having weird problem in mysql query, using match-against works on words , not on others, specific query returns 0 rows: select * series match (name_e,name_a) against ("one"); 1- i'm using utf8_general_ci , not case sensitivity issue 2- other 3 characters searches return propper results (like "key" example) not minimum characters issue. here tables structure: create table `series` ( `series_id` int(10) unsigned not null auto_increment, `brand_id` int(10) unsigned not null, `merchandise_id` int(10) unsigned not null, `name_a` varchar(45) not null, `name_e` varchar(45) not null, `desc_a` text, `desc_e` text, `added_by` int(11) not null default '4', `approved` tinyint(1) not null default '1', primary key (`series_id`), key `uniqueentry` (`brand_id`,`name_e`), fulltext key `nameindex` (`name_e`,`name_a`) ) this sample data used test: insert `series`(`series_id`,`brand_id`,`merchandise_id`,`name_a`,`name_e`,`desc_a`,`desc_e`,

javascript - Regex containg a variable -

this question has answer here: javascript regex: how put variable inside regular expression? 4 answers regex , variables seem current issue here, yet didn't find answer problem. it quite simple, using nosql database system javascript called nedb. pretty neat way. github link here part matters : // finding planets name contain substring 'ar' using regular expression db.find({ planet: /ar/ }, function (err, docs) { // docs contains mars , earth }); as see, expression /ar/ means "containing substring ar", classic regex. want replacing ar variable (the result of user search). like : var search = ‘ar'; //taken html form db.find ({planet : ‘/‘ + search + ‘/‘}, fonction (err,docs) { } this unfortunately not work. neither : var search = ‘/ar/'; db.find ({planet : search}, fonction (err,docs) { } do have ideas ? mig