Posts

Showing posts from March, 2015

variables - How to change string value label -

suppose have string variable takes on several string values: gen rand = runiform() sort rand gen var1 = "" replace var1 = "a" if rand < .3 replace var1 = "b" if rand>=.3 & rand < .7 replace var1 = "c" if var1=="" how change values of var1? example, a aaa , b bbb , , c ccc ? i want following (but rather replace variables), know incorrect: label define var1l "a" "aa" b "bbb" c "ccc" label values var1 var1l string variables can't have value labels. can interpret if labels string variables meant content of variable itself. can replace : clear set more off input /// str1 var1 b c end list replace var1 = "aaa" if var1 == "a" replace var1 = "bbb" if var1 == "b" replace var1 = "ccc" if var1 == "c" list you need more data , objectives more useful answer.

android file format of SMS to add SMS through Intent -

i using launch sms app add (restore) messages. intent sendintent = new intent(intent.action_view); sendintent.putextra("sms_body", "content of sms goes here..."); sendintent.settype("vnd.android-dir/mms-sms"); startactivity(sendintent); and save contacts. intent intent = new intent(intent.action_view); intent.settype(contactscontract.contacts.content_type); intent.setdataandtype(uri.fromfile(contact), "text/x-vcard"); intent.addflags(intent.flag_activity_new_task); startactivity(intent); while adding contacts have format text/x-vcard (vcf file) accepted contact app. so, passing in file. question: format should use add messages. want add messages @ time.

javascript - Angular Array instead of object -

i have following html in view. on ng-click on button when log out value, value object numbers keys in it, instead of array. know going wrong? what gets logged object key of 0, accessed like: objectname.0 <div class="equipitems" ng-repeat="(key,value) in day.equipment track $index"> <label class="item item-input item-select"> <div class="input-label"> {{key}} </div> <select ng-model="value[$index].itemname" ng-options="item item item in equipment.{{key}}"> <option value="">select option</option> </select> </label> <label class="item item-input"> <input type="number" ng-model="value[$index].value" ...

php - How do I get my old database back? -

yesterday installed xampp in local server. have both wamp ( c drive) , xampp(g drive) in local pc. while installing xampp mysql not working had uninstall mysql local server password 'abcd'. now both wamp , xampp can run can not able see old wamp (phpmyadmin) database have created while working wamp. want see databases when connect wamp localhost. there way see databases. thanks

virtualbox - Failed to import appliance . Could not find a SCSI controller -

i on mac , trying import virtual machine image (.ova file). try import file on vm , following error. could not find storage controller named 'scsi controller' any solutions out there exists problem. i got clue answer here: https://ctors.net/2014/07/17/vmware_to_virtualbox basically need change virtual disk controller eg change ddb.adaptertype "buslogic" or "lsilogic" "ide" however if don't have vmware boot original image , remove vmware tools , remove hard disk, can hack .ovf file in .ova file switch virtual scsi controller ide controller. here's how. first open ova archive, lets assume in current dir called vm.ova mkdir ./temp cd temp tar -xvf ../vm.ova this extract 3 files, *.ovf file, virtual disk *.vmdk file, , manifest .mf file. edit .ovf file, find scsi reference, lsilogicsas or "buslogic" or "lsilogic". replace word ide . while @ may want rename files don't have spaces or str...

java - Can I make a synchronous/blocking call via RabbitMQ using Spring Integration? -

imagine have 2 java apps, , b, using spring integration's rabbitmq support communication. can make synchronous/blocking call b? if so, how (roughly)? ideally, has spring integration gateway invokes via e.g. method called object dosomething(object param) then blocks while gateway sends on message via rabbitmq serviceactivator on b, , b returns return value, becomes result of dosomething() method. it seems may possible, docs , other stack overflow questions don't seem address directly. many thanks! actually that's true. gateway pattern implements requirement. your client blocked wait result gateway's method, underlying integration flow can async , paralleled etc. spring integration amqp provides <int-amqp:outbound-gateway> blocking request/reply scenarios rabbitmq. of course other, receiving side should take care of correlation send reply appropiriate replytoaddress request message. simples way use <int-amqp:inbound-gateway...

ios - how do you return nil if a certain type is passed to a function in Swift? -

Image
ok trying return nil if type passed function. in case im passing in instance of class "blogpost" , type within blogpost. have array called "types" , have assigned variable videos last index of array. if type passed function return nil (so assuming im going need optional here returning possible nil) have far :- so in need pass in instance of blog post return nil if type passed in. hope makes sense update: the types array defined follows: let types : [string] = ["technology", "fashion", "animals"] this array referring in function. if last entry of array entered function need return nil sure blogpost have empty string type great im getting there ive done change blogpost.type choose 1 @ random. if specfic type chosen array how still getting error. have updated to so need access 2 type in array , if access return nil. thoughts on that? drag on thanks you passing blog blogpost.type parameter. not c...

performance - Why is std::pair faster than std::tuple -

here code testing. tuple test: using namespace std; int main(){ vector<tuple<int,int>> v; (int var = 0; var < 100000000; ++var) { v.push_back(make_tuple(var, var)); } } pair test: #include <vector> using namespace std; int main(){ vector<pair<int,int>> v; (int var = 0; var < 100000000; ++var) { v.push_back(make_pair(var, var)); } } i did time measurement via linux time command. results are: | | -o0 | -o2 | |:------|:-------:|:--------:| | pair | 8.9 s | 1.60 s | | tuple | 19.8 s | 1.96 s | i wondering, why such big difference between 2 data structures in o0, should similar. there small difference in 02. why difference in o0 big, , why there difference @ all? edit: the code v.resize() pair: #include <vector> using namespace std; int main(){ vector<pair<int,int>> v; v.resize(100000000); (int var = 0; var < 100000000;...

Why won't my html / css code make a button? -

for reason page i've made has stopped showing image, it's showing small broken page icon, though showed before. haven't changed name of image or location. i'm trying create button, it's not showing up here's html code: <!doctype html> <html> <head> <title>title</title> <link href="design.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="pic"> <img src="c:\users\a\desktop\untitled.jpg" id="pic"> </div> <div class='banner'> </div> <div class="button"> </div> </body> </html> and here's css code: #pic { position: absolute; margin-left: 40px; margin-top: 4px; z-index: 1; } .banner { height: 100px; width: 100%; background-color: #ffffff; position: absolute; top: 0; left: 0; z-index: 0; } .button { ...

jython max function in an array -

a=[[10,1],[2,8]] i need find max number in 2nd column of above array. how in jython. simply doing max(a)[1] give 1. thanks in advance. -suresh for jython 2.5 onwards ... print max(a,key=lambda v:int(v[1]))[1] otherwise you're stuck loop ... m = none v in a: if m none or v[1] > m: m = v[1] print m

java - What I am doing incorrectly when creating a method in a class? -

i trying create program user enters 2d array, , program find highest value in array, , output value, , associated row , column. have created method (called locatelargest) inside class goes through points in 2d array, , sets aside maxvalue. returns maxvalue. errors ) , ] expected, illegal start of type, ; expected, , identifier expected. how can method , program overall work? thank time. import java.util.scanner; public class find { public static void main(string[] args) { scanner input = new scanner(system.in); system.out.print ("enter number of rows in the array: "); int numberofrows = input.nextint(); system.out.print ("enter number of rows in the array: "); int numberofcolumns = input.nextint(); double[][] anarray = new double[numberofrows][numberofcolumns]; system.out.println("enter array: "); (int = 0; < a.length; i++){ (int j = 0; j < a[i].length; j++){ a[i][j] = input.nextdouble(); } } location location = locatelargest(ana...

css - Making background image over all page conent? -

on website, having dilemma. (this website) . on homepage background across whole page (which want), on contact page not. have made transparent using: #sitewrapper{ background-color: rgba(0,0,0,0) } however, turns black? on header of page, there image not on background of body? can other way around body has image , header not (like this): #sitewrapper{ background-image: url("http://static.squarespace.com/static/545d45afe4b08eea0ac65e7a/t/54612b8ae4b0ca233d43bdee/141565 4282657/website%20background%20trees.png"); background-repeat: no-repeat; background-size: 100%; } however image covers of page (header , body background) - thanks addition i tried use background-size: cover; covered footer , not header (as stretched image). you can put background-image on body element, , set background-size:100% , , remove background image other elements on. work on page across site.

ssas - MDX calculated member for average sales for top 10 persons -

supposing have electronics store 10 types of articles , 50 sales persons. can average number of sold articles 10 persons more sales each type of article? i started creating named sets top 10 persons each article: create dynamic set currentcube.[top 10 persons - laptops] topcount([dim person].[person name].members, 10, ([measures].[sales], [dim article].[article name].&[laptop])); create dynamic set currentcube.[top 10 persons - tvs] topcount([dim person].[person name].members, 10, ([measures].[sales], [dim article].[article name].&[tv])); i other eight. then trying create calculated member each article type. each calculated member sum total sales particular article top 10 persons included in corresponding named set, , divide 10. how can this? or, recommend different approach? i able find solution this. not necessary create named set. ended doing: avg(topcount([dim person].[person name].children, 10, ([measures].[sales], [dim article].[article name]....

Can df.reset_index(drop=true) be set as default in Python Pandas? -

when slicing dataframe in python pandas remembers index of rows. if don't want can use df.reset_index(drop=true). there way can set default? want have indexes reset. also situations want remember index? thanks you can change default values set func_defaults : import pandas pd import numpy np pd.dataframe.reset_index.im_func.func_defaults = (none, true, false, 0, '') df = pd.dataframe(np.random.randint(0, 10, (10, 4)), columns=list("abcd"), index=np.ones(10)) df.reset_index()

java - Running Runnables in parallel in Android -

basically have 3 runnables download data internet, , want them run in parallel. right have following code: threadpoolexecutor executor = (threadpoolexecutor) executors.newfixedthreadpool(3); executor.execute(firstrunnable); executor.execute(secondrunnable); executor.execute(thirdrunnable); is correct way execute 3 runnables in parallel? thanks! your code correct. similar question has been answered here .

ruby - On Travis how do I modify tests to use minitest instead of rspec? -

the link ask question on travis dot com sent me here. tests fail because i'm using minitest in gem travis uses rspec. there way travis also? of course can modify tests use rspec i'm not sure how tests or spec structure of tests. have assert_equal not recognized respec valid method. there common way make either test work same *_spec.rb files? i found in the docs possible define custom commands running tests (rather default bundle exec rake test ) placing these lines in .travis.yml script: - bundle exec rake build - bundle exec rake builddoc

java - Is setCharacterEncoding() needed if charset is declared in content type? -

i confusing how work encoding. actually, read books , says should setcharacterencoding before firstly getparameter() . while according https://docs.oracle.com/javaee/6/api/javax/servlet/servletrequest.html#setcharacterencoding%28java.lang.string%29 overrides name of character encoding used in body of request. method must called prior reading request parameters or reading input using getreader(). otherwise, has no effect. so, think since container must know charset in http body, seems not need setcharacterencoding() if charset declared in http body. i tried existing project, submit request xml outputstream, use conn.setrequestproperty("content-type", "text/xml;charset=utf-8"); printwriter pw = new printwriter(new outputstreamwriter(conn.getoutputstream(), "utf-8")); to encode stream , , when submit request servlet, even though not call request.setcharacterencoding("utf-8");` can see chinese text decoded well. so see...

html - Email sending using smtp server in php -

<body> <form action="" method="post"> <input type ="text" name="email" value="<?php echo 'email'; ?>" /> <br> <button type="submit" id='delete' value="truncate"><b>mailto</b></button> <input type="hidden" name="submitted" value="1" /> </form> </body> <?php require_once("./phpmailer_5.2.4/class.phpmailer.php"); if(isset($_post['submitted'])==1) { $mail=new phpmailer(); $email = $_post['email']; echo $email; $mail->issmtp(); $mail->smtpdebug=1; $mail->smtpauth=true; $mail->smtpsecure='ssl'; $mail->host='smtp.bizmail.yahoo.com'; $mail->port='465'; ...

php - Use Push Notifications for Angular JS in Laravel 4 -

i building simple app laravel 4 backend, angular js frontend , mysql . so far, using long polling update in database, have fire $http request client server after every 5 minutes. i need push notifications notify client server there update in database server side. i've searched lot of things found push notification android , ios only. is there library or method available implement push notification angular js in laravel 4 ? help please, appreciated. the best solution use websockets . suggest using ratchet (websockets php) . there problem of websockets browser support need take consideration (but can overcome using websocket.js polyfill ).

php - Laravel Route model binding with relaionship -

i wondering if possible return relationship laravels route model binding ? say have user model relationship 'friends' other users, , want return both user info , relationship route or controller. eg route domain.tld/user/123 route::model('user', 'user'); route::get('/user/{user}', function(user $user) { return response::json($user); }); this return me user info fine want relationships, there easy/proper way ? i know can route::get('/user/{user}', function((user $user) { return response::json(user::find($user['id'])->with('friends')->get()); }); or route::get('/user/{id}', function(($id) { return response::json(user::find($id)->with('friends')->get()); }); but suspect there may better way, in advance keith you can populate $with property in user model. so; protected $with = ['friends']; this autoload relationship data automatically. please...

angularjs - Transport error in WebSocketServerSockJsSession - Cannot load platform configurator on a Spring Stomp websocket -

i'm trying add web sockets angularjs application. i set web socket using spring 4 on server , stomp sockjs on client. i access page @ http://localhost:9000/#/project/1/bts after grunt serve command. but 500 response when doing web socket handshake: websocket connection 'ws://localhost:8080/nitro-project-rest/api/socket/bts/405/bmtcztq4/websocket' failed: error during websocket handshake: unexpected response code: 500 the server has upon each failed websocket request: severe: servlet.service() servlet [nitro] in context path [/nitro-project-rest] threw exception [request processing failed; nested exception org.springframework.web.socket.sockjs.sockjsexception: uncaught failure in sockjs request, uri=http://localhost:8080/nitro-project-rest/api/socket/bts/970/2xoe6kls/websocket; nested exception org.springframework.web.socket.sockjs.sockjstransportfailureexception: websocket handshake failure; nested exception java.lang.runtimeexception: cannot load platform...

Android: Get Bluetooth RSSI value from specific BluetoothDevice -

i'm making android application in need able know rssi value of specific device continuously. have no problem getting rssi while scanning devices slow need. i thinking might possible rssi of specific instance of bluetoothdevice have no idea start, i'm asking here. is possible? , if is, know how it? or if know way proximity value specific devices please tell me! :) thanks!! if use case allows connect device should possible rssi @ higher frequency scanning. once connect device , bluetoothgatt object can call bluetoothgatt#readremoterssi() . results in callback bluetoothgattcallback#onreadremoterssi() .

Splitting Beatifulsoup4's findAll() of HTML into list of lines in Python -

i've begun learning python, there project had in mind suspected possible using method of web-crawling through python. i have been using tutorial series, , aware findall() appears looked down upon being primitive (i'm unsure why, , i'll gladly learn better alternatives, simple @ same time - started python yesterday). right now, have extremely project visits specified website , grabs code. however, want implement if statement - find if line present. (where using soup.findall('a', {'href': '/login'}) , soup = beautifulsoup(requests.get(url).text) ) - attempts, trying things like: if '/login' in soup have failed, , not sure how implement if statement find single word, or line, in html found. if aware of simpler methods use here i'd grateful, solution identified have html split lines and/or in array, , use if <the entire line> in soup: . i think want is if soup.findall('a', {'href': '/log...

schema - Spring mongodb how to use crudRespository with embedded documents -

why when created crudrespository search on embedded object none of queries work , of them return null. there i'm doing wrong? there example. hope not limitation of spring mongodb. maybe know different way extract embedded object? use @dbref read not recommended performance issues. country.class @document(collection="countries") @typealias("ctry") public class country { @id private biginteger id; private string name; private continent continent; public country(string name, continent continent) { setname(name); setcontinent(continent); } //get/set omitted } embedded document continent.class public final class continent { private final long id; private final string name; public continent(long id, string name) { this.id = id; this.name = name; } //get/set omitted } continentrespository.class - works fine data returned should public interface countryrepository extends repository<country, biginteger> { //------------...

Why does the CQS principle require a Command not to return any value? -

the cqs principle says every method should either command performs action, or query returns data caller, not both. makes sense query not else, because don't expect query change state. looks harmless if command returns piece of information. can either use returned value or ignore it. why cqs principle require command not return values? from understanding, 1 of benefits of cqs how works in distributed environments. commands become own isolated unit executed, placed in queue executed @ later date, executed remote event handler etc. if commander interface specify return type affect strength of cqs pattern in ability fit within distributed model. the common approach solving problem ( see article instance mark seemann ) generate unique id such guid unique event executed command handler. persisted allow data identified @ later date.

How to render variable of if-else block in Yii -

i new in yii.i have if-else block in action , need render value of variable. showing error "undefined variable". how can done?? please help. in advance!! first declare variable before if else statement, change variable's value per if else statment pass variable render. suppose variable name $model, render code $this->render('index.php', array('model' => $model)); in view, can access variable $model variable name.

android - How to prevent memory increase on Image Compression -

Image
i trying capture image, compress file & upload server. but, when doing that, memory size increases 60 mb. i doing following approach compress image file path. during process only,memory size increases & getting out of memory issue also. public string getscaledpic(string path) { bitmap img; try { string filepath =path;; string foldername = filepath.substring(0, filepath.lastindexof("/")+1); string tmpfilename = (filepath.substring(filepath.lastindexof("/")+1)).split("\\.")[0]+"_tmp.jpg"; file = new file(filepath); foldername=getactivity().getfilesdir()+"/"; file = new file(foldername+tmpfilename); try { copy(from, to); compress(foldername+tmpfilename); } catch (ioexception io){ return path; } return foldername+tmpfilename; ...

How do I add an android pop screen in Unity3D -

i'm doing android project unity3d now. want pop small screen when touch button on screen image below. how implement this? (my reputation low post picture) http://i.stack.imgur.com/9solr.png design popup guilabels , guitextures. create empty gameobject called popup, , place these gameobjects under hierarchy, , disable in inspector. make new script attached button. in script, create public gameobject variable popup called popup, , create new function called onmousedown(). within function place code popup.setactive(true); finally, in inspector, drag , drop disabled gameobejct popup variable of script, , should work want.

shell - Combining tail and sed command and redirecting them to new file -

i connecting multiple remote servers , displaying there log files using tail command local system. log files generating dynamically not able differentiate them. thinking redirect log file , serevrid each line of log file other temporary file , tail temporary file, on local machine can differentiate different servers log file. i using (sed -e '/s/^/192.168.12.1' /logs/a.log; tail -f /logs/a.log) > b.log tail -f b.log but few starting lines getting updated serverid , not lines after dynamically generating. kindly tell me how concatenate serverid each line of log file. sed --unbuffered -e 's/^/192.168.12.1/' /logs/a.log >> b.log tail -f b.log should enough if want file simple sed --unbuffered -e 's/^/192.168.12.1/' /logs/a.log will work normaly

javascript - Select child radio button if parent was chosen and vice-versa -

i have situation one: <!-- first parent --> <input type="radio" name="parent_1" data-smth="parent_1" /> <!-- children of 1 --> <input type="radio" name="child" data-parent="parent_1" /> <input type="radio" name="child" data-parent="parent_1" /> <input type="radio" name="child" data-parent="parent_1" /> <!-- second parent --> <input type="radio" name="parent_1" data-smth="parent_2" /> <!-- children of 1 --> <input type="radio" name="child" data-parent="parent_2" /> <input type="radio" name="child" data-parent="parent_2" /> <input type="radio" name="child" data-parent="parent_2" /> <!-- third parent --> <input type="radio" name="parent_1" data...

OpenGL Texture 2D arrays and mipmapping -

i trying understand how mipmap texture arrays .from understand,texture array 3 dimensional structure each texture 2d has depth param in gltexstorage3d sets given texture position in array.but how specify number of mipmaps per texture?can specify different number of mipmaps per texture? is right way it? gltexstorage3d(gl_texture_2d_array,10,gl_rgba8,width,height,numtextures); gltexparameteri(gl_texture_2d_array,gl_texture_min_filter,gl_linear_mipmap_linear); gltexparameteri(gl_texture_2d_array,gl_texture_mag_filter,gl_linear); gltexparameteri(gl_texture_2d_array,gl_texture_wrap_s,gl_clamp_to_edge); gltexparameteri(gl_texture_2d_array,gl_texture_wrap_t,gl_clamp_to_edge); for(int =0 ; <numtextures;++i){ gltexsubimage3d(gl_texture_2d_array,/*what goes here???*/, 0, 0, 0, width, height, /*what goes here?*/, gl_rgba, gl_unsigned_byte, data); } glgeneratemipmap(gl_texture_2d_array); i don't know pass second , 8 parameters of gltexsubimage3d. should second param numb...

javascript - Can we run cordova off jsfiddle or similar services? -

i blank, , in situation can't install complete cordova toolset (node.js, git cli, etc), , if did organization's internet policy doesn't allow these tools work properly. but, have proof-of-concept apps using cordova. i have not had hands-on on apache cordova development far. people including cordova.js files in html5 app trick. however, need hands-on on this. can add cordova.js file our page, write logic tries access native features (like camera), and, host off jsfiddle, , run pages on our device browser? work?! i sadly don't see cordova.js files available on cdn... simply adding cordova.js file doesn't achieve needs, must set cordova project. first create cordova project , build project platform want. after can use cordova plugins fulfill needs. actually, cordova.js file acts javascript bridge access native features of phone (camera, gps, etc.). if want more that, ionic framework best option in opinion.

python - How to ensure that no one will access my socket? -

i'm developing project in university need receive data set of arduino, sensor , cuhead v1.0 wifi-shield on other side of campus. need communicate thru sockets transfer data sensor server need ensure no 1 send data thru open socket. on server side, need open socket using python 3 or 2.7. on sensor side, library of cuhead wifi shield lacks important functions create secure connections. possible ensure level of security on server side? suggestions have me? use stunnel @ both ends, traffic @ both ends goes localhost stunnel encrypts , sends other end

Merging dictionary value lists in python -

i'm trying merge 3 dictionaries, have same keys, , either lists of values, or single values. one={'a': [1, 2], 'c': [5, 6], 'b': [3, 4]} two={'a': [2.4, 3.4], 'c': [5.6, 7.6], 'b': [3.5, 4.5]} three={'a': 1.2, 'c': 3.4, 'b': 2.3} what need items in values added 1 list. result={'a': [1, 2, 2.4, 3.4, 1.2], 'c': [5, 6, 5.6, 7.6, 2.3], 'b': [3, 4, 3.5, 4.5, 3.4]} i have tried several things, put values nested lists. e.g. out=dict((k, [one[k], two.get(k), three.get(k)]) k in one) {'a': [[1, 2], [2.4, 3.4], 1.2], 'c': [[5, 6], [5.6, 7.6], 3.4], 'b': [[3, 4], [3.5, 4.5], 2.3]} i tried updating looping through values: out.update((k, [x x in v]) k,v in out.iteritems()) but results same. have tried add lists, because third dictionary has float, couldn't it. check=dict((k, [one[k]+two[k]+three[k]]) k in one) so tried first add lists in values of ...

code generation with Xtend -

i implementing own dsl , using xtend generate c code. have developed small prototype using xpand/xtend need convert prototype xtend. in xpand, used define "generate" function generate c file don't know how can similar thing using xtend. in regard highly appreciated. «define generate dsl::defs::module» «file "com.c" -» /* date «datestring()» */ «expand com_c::com_def_c » «endfile» «enddefine» thanks , regards, hemal bavishi you this: def xtendfunc() ''' /* date «datestring()» */ ''' or def xtendfunc() { var = '''/* date «datestring()» */''' return var } (assuming 'datestring()' function in same class) in xtend called using template expressions(enclosed within 3 quotes '''...'''). can contain result of function in val (final variable in xtend) first case. use function other template com_c:com_def_c. append result variable , write file using simple java. ...

@Html.Action in Asp.Net Core -

where @html.action in mvc6? can see @html.actionlink not direct call action before. was replaced viewcomponents? for net core 2.0 using microsoft.aspnetcore.mvc.infrastructure; replace // var actionselector = getserviceorfail<iactionselectordecisiontreeprovider>(currenthttpcontext); var actionselector = getserviceorfail<iactiondescriptorcollectionprovider>(currenthttpcontext); and // var actiondescriptor = actionselector.decisiontree.select(routevalues).first(); var actiondescriptor = actionselector.actiondescriptors.items.where(i => i.routevalues["controller"] == controller && i.routevalues["action"] == action).first();

Adding id to pages in jquery mobile -

for internal linking in jquery mobile, seem need adding unique id each page div can handle each page separately. since page div being generated jquery mobile dynamically, best practice add dynamic id divs? edit: requesting new page follows: $(document).on("swipeleft", function () { nextpage = getnextpage(); $.mobile.pagecontainer.pagecontainer("change", nextpage, { changehash: true }); }); where nextpage dynamic url. use approach allow paging.

node.js - pass npm config into npm scripts entry -

i'm running entire project npm scripts, , i've namespaced few methods underneath test clarity. i'd use silent level of verbosity test related commands instead of normal, extremely verbose npm err! exit status 1... package.json { "name": "test", "version": "0.0.0", "scripts": { "test": "npm run test:unit && npm run test:integration", "test:unit": "mocha test/unit", "test:integration": "mocha test/integration" } } i've tried including --loglevel=silent in npm scripts commands, not work. not want enable commands, testing related ones, setting flag on environment or in .npmrc not option (unless there additional criteria can define in .nmprc ). the flag -s can : package.json { "name": "test", "version": "0.0.0", "scripts": { "test": "npm...

cordova - Ionic cannot add android platform -

i trying add android platform using following command ionic platform add android i presented following output: creating android project... module.js:340 throw err; ^ error: cannot find module 'which' @ function.module._resolvefilename (module.js:338:15) @ function.module._load (module.js:280:25) @ module.require (module.js:364:17) @ require (module.js:380:17) @ object.<anonymous> (/users/user1/.cordova/lib/npm_cache/cordova-android/3.6.4/package/bin/lib/check_reqs.js:27:13) @ module._compile (module.js:456:26) @ object.module._extensions..js (module.js:474:10) @ module.load (module.js:356:32) @ function.module._load (module.js:312:12) @ module.require (module.js:364:17) error: /users/user1/.cordova/lib/npm_cache/cordova-android/3.6.4/package/bin/create: command failed exit code 8 @ childprocess.whendone (/usr/local/lib/node_modules/cordova/node_modules/...

Using Try/Catch in JAVA -

i have following piece of code i'm trying user enter integers; if string entered display system out error message "please enter numbers" , show "enter id#:" again. tried using try/catch method not using correctly -- still beginner. know can use " numberformatexception " not sure where. can help? thanks! //get customer id , account number { system.out.print("enter id#: "); custid = integer.parseint(input.readline()); system.out.print("enter account number#: "); custacctnum = integer.parseint(input.readline()); //validate choice for(int i=0; i<people.length; i++) { if ((people[i].custid == custid) && (people[i].custacctnum == custacctnum)) { match = true; system.out.println("welcome " +people[i].firstname+ " jj dealership!"); for(int p=0; p<cluster....

android - ProgressDialog not showing up within a Fragment -

i have following class: ... public class fragmentmapa extends fragment { /* * atributos */ private static string log_tag = "fragmentmapa"; private homeactivity homeactivity; private googlemap mmapa; private drawerlayout mdrawer; private actionbardrawertoggle mdrawertoggle; private listview mdrawerlist; private listview mdrawerrightlist; private relativelayout mdrawerrelativelayout; private string[] mrightdrawermenutitles; private imageview mdiputacionlogo; private incidenciasfetchasynctask mfetchincidenciastask; private incidencias mis; private camarasfetchasynctask mfetchcamarastask; private camaras mcams; private viabilidadesinvernalesfetchasynctask mfetchviabilidadesinvernalestask; private viabilidadesinvernales mvis; private static latlng pos_central = new latlng(43.243968,-2.896957); private static latlng limitesuroestebizkaia = new latlng(42.895853,-3.594589); private s...