Posts

Showing posts from February, 2012

jquery - How do I get FormIt with ModX Revolution to redirect to a web page id (ie. www.myurl.com/index.php#contact)? -

okay, issue created 1 page html website multiple sections represent pages. problem having formit contact form works, cant redirect right id. once submit form, takes me top of page. ideas? check out below formit call: [[!formit? &hooks=`email` &emailfrom=`info@brickhousetitle.com` &emailtpl=`emailchunk` &emailto=`[[+email]]` &redirectto=`http://myurl/index.php#contact` &emailsubject=`bht website inquiry` &validate=`name:required, email:email:required, comment:required:striptags` &successmessage=` <div class="alert alert-success margintop25"> <button type="button" class="close" data-dismiss="alert">&times;</button> <h4>thank you! inquiry has been submitted successfully.</h4> </div> ` &validationerrormessage=` <div class="alert alert-error"> <button type="but

r - If else operator -

could please tell me switch in r returns second argument if true , third if false? i have searched switch , if else function , have looked through documentation when using ubiquitous terms if , else seems hard identify solution. i looking like: f(true,1,2); f(false,1,2) [1] 1 [1] 2 i working on reading through documentation of julia has made me aware of of gaps in knowledge in r. in julia there operator available. (true ? 1 : 2) 1 (false ? 1 : 2) 2 simply ifelse ifelse(true,1,2) ## [1] 1 ifelse(false,1,2) ## [1] 2

Android : Unfortunately, app has stopped -

i beginner android, trying run first application. there's error in log file , application terminated message "unfortunately, app has stopped"! here java file: public class mainactivity extends actionbaractivity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); button mclick=(button)findviewbyid(r.id.button1); mclick.setonclicklistener(new view.onclicklistener() { //@override @suppresslint("showtoast") public void onclick(view v) { // todo auto-generated method stub toast t = toast.maketext(mainactivity.this, r.string.hi, 3000).show(); } }); } } and log has these errors: 04-19 18:50:02.200: e/androidruntime(792): fatal exception: main 04-19 18:50:02.200: e/androidruntime(792): process: com.example.test, pid: 792 04-19 18:50:02.200: e/androidruntime(792): java.lang.runtimeexception: unabl

javascript - How to change a function from onblur, to onclick with submit button? -

here piece of code i'm trying make work submit button. works fine onblur, when try use onclick submit button doesn't work. how can that? here html name <br> <input size="16" placeholder="first name" id="firstname" name="firstname" type="text"> <br> <br>last name <br> <input placeholder="last name" name="lastname" id="lastname" type="text"> <br> <br> <button type="submit" id="submitbtn" name="submit">submit</button> here pure javascript window.onload = function () { document.getelementbyid("firstname").onblur = mandatoryfield; document.getelementbyid("lastname").onblur = mandatoryfield; }; // clear potential alert function clearalert() { var redalert = document.getelementbyid("redalert"); if (redalert) { document.body.removechild(re

objective c - Sending HTTP GET Requests with NSURLConnection -

i'm new site , decided ask question has been bugging me while. working on app requires calendar gets events posted on website that's going going along it. i'm new using xcode , objective c i've been using ios 7 programming cookbook me questions might have. however, problem having requests, titles says, , can't seem find dealing exact problem. appdelegate.m - (bool) application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions{ nsstring *urlasstring = <# place url of web server here #>; //this area problem urlasstring = [urlasstring stringbyappendingstring:@"?param1=first"]; //along urlasstring = [urlasstring stringbyappendingstring:@"&param2=second"]; //and nsurl *url = [nsurl urlwithstring:urlasstring]; nsmutableurlrequest *urlrequest = [nsmutableurlrequest requestwithurl:url]; [urlrequest settimeoutinterval:30.0f]; [urlre

php - remove double quotes from json encoded array -

$sql = "select column_type information_schema.columns table_name = 'mst_sim_data' , column_name = 'status'"; $result = mysql_query($sql); $row = mysql_fetch_array($result); $enumlist = explode(",", str_replace("'", '', substr($row['column_type'], 5, (strlen($row['column_type'])-6)))); foreach ($enumlist $key => $value) { $list["'$value'"] = $value; } return json_encode($list); this returns following json string. object {'instock': "instock", 'issued': "issued", 'soldout': "soldout"} but need replace single quotes on double quotes , should this, 'instock': 'instock', 'issued': 'issued', 'soldout': 'soldout'} how can this? is goal break json output? json strings , properties must use " quote. i believ

python - Do I need custom random-number generator for Perlin noise? -

Image
perlin explained in pseudo-code: http://freespace.virgin.net/hugo.elias/models/m_perlin.htm the tutorial gives me random number generator function writen in pseudo-code. returns floating number in range of (-1, 1). function intnoise(32-bit integer: x) x = (x<<13) ^ x; return ( 1.0 - ( (x * (x * x * 15731 + 789221) + 1376312589) & 7fffffff) / 1073741824.0); end intnoise function so if function returns number in range (-1, 1), can't use random.uniform(-1, 1) ? meet problem: function noise(x) . . end function function smoothnoise_1d(x) return noise(x)/2 + noise(x-1)/4 + noise(x+1)/4 end function i guess noise(x) function generates random numbers 1d noise. i can't seem understand x parameter is. seed? and, can't use random.uniform(-1, 1) the noise function used in perlin noise seeded random number generator. is, must return same value every time called same value parameter, x . can think of x position in

awk - How to isolate logical volume group UDID for shell script? -

i looking use "diskutil cs list" show logical volume groups. need able isolate udid. example line "diskutil cs list" +-- logical volume group b848bcc7-6ffa-4643-afe1-56fca333a6b5 previously though process to; diskutil cs list | grep 'group' i think awk better route show string of letters , numbers. have been unsuccessful in finding out how dow so ultimately, use udid in shell script reformatting fusion drive. using similar below. set (do shell script "diskutil cs list|grep 'group'") i'd set udid , not full line. try: diskutil cs list | awk '/group/{print $nf}' /group/ lines have word group in them. filter mechanism. if output lines have group in them, can remove /group/ part. once finds lines, print last element of line. awk default splits line on space.

go - How to use URI as a REST resource? -

i building restful api retrieving , storing comments in threads. a comment thread identified arbitrary uri -- url of web page comment thread related to. design similar disqus uses system. this way, on every web page, querying related comment thread doesn't require storing additional data @ client -- needed canonical url page in question. my current implementation attempts make uri work resource encoding uri string follows: /comments/https%3a%2f%2fexample.org%2ffoo%2f2345%3ffoo%3dbar%26baz%3dxyz however, before dispatching application, request uri gets decoded server /comments/https://example.org/foo/2345?foo=bar&baz=xyz this isn't working because decoded resource name has path delimiters , query string in causing routing in api confused (my routing configuration assumes request path contains /comments/ followed string). i double-encode them or using other encoding scheme uri encode, add complexity clients, i'm trying avoid. i have 2 specific quest

gnuplot - place label aligned to right, at certain y coordinate? -

i need place label @ right, above of fitted average horizontal rule. have y-coordinate of rule, don't know coordinate of right border of graph. i saw, use at graph 0.5,0.8 syntax, if horizontal rule fixed, isn't. you can use different coordinate systems x , y values. available coordinate systems are: first : value on left , bottom axes. second : value on right , top axes. graph : relative area within axes, 0,0 bottom left , 1,1 top right. screen : relative entire canvas. character : depends on chosen font size. so, if x-value should relative graph, use graph 0.5 , y-value can use first yval : set label @ graph 0.5, first yval+ofs here, yval y-value of horizontal line, , ofs offset in order displace label bit.

r - ggplot - change size of dots -

i plotting points on graph ggplot , geom_point. size of dots corresponds magnitude of data point. magnitude goes 2 10. draw dots applying factor of 0.5 magnitude sizes go 1 5. in legend, on side of graph, show real magnitude 2 10. how can that? there 2 possibilities: 1) divide magnitude 2: geom_point(aes(size = magnitude/2)) 2) use range = c(1,5) parameter: geom_point(aes(size = magnitude)) + scale_size(range = c(1,5))

javascript - RTCPeerConnection.addIceCandidate() - Uncaught SyntaxError: An invalid or illegal string was specified -

the addicecandidate() function giving me error post title, "uncaught syntaxerror: invalid or illegal string specified." the parameter pass rtcicecandidate object. can print out candidate -attribute result, of them a=candidate:1086438664 2 udp 41754367 41.117.144.193 64564 typ relay raddr 82.146.26.23 rport 58089 generation 0 , on. this function pass parameter: function receiveicecandidate(candidate) { parsecandidate = new rtcicecandidate(json.parse(candidate)); //console.log("parsecandidate.cand = " + parsecandidate.candidate); remotepc.addicecandidate(parsecandidate); //remotepc rtcpeerconnection } before function ever called, remotepc receives sdp offer , sets remotedescription, in following function: function receiveoffer(offer) { var ischrome = !!navigator.webkitgetusermedia; var stun = { url: ischrome ? 'stun:stun.l.google.com:19302' : 'stun:23.21.150.121' }; var turn = {

c# - NewtonSoft Json serializer performance -

i have object serializing json using newtonsoft json.net. object relatively large, resulting json 300kb, serialization process takes around 60 seconds. the objects serialized plain poco's. the code using string json = newtonsoft.json.jsonconvert.serializeobject(data, formatting.indented); is there can done speed serialization, adding attributes etc. edit: have tested servicestack.text json serializer , takes 48 seconds, still pretty slow. [serializable] public class appointmentitemviewmodel { public appointmentitemviewmodel() { data = new appointmentdata(); statuses = new list<status>(); closeddays = new list<closedday>(); openhours = new list<openhours>(); } public int currentday { get; set; } public int currentmonth { get; set; } public int currentyear { get; set; } public int day { get; set; } public int month { get; set; } public int year { get; set; } public int fi

Can't compile IntelliJ Android app with references to Maven libraries -

i'm new intellij. have android project i'm trying use bitcoinj. in intellij, go file | project structure... | new project library | maven..., search "bitcoinj" (which found "com.google:bitcoinj:0.11.1") , add it, adds android module's dependencies tab. however, when use "import com.google.bitcoin.core" in android app's source, following compiler error: error:(5, 1) java: package com.google.bitcoinj not exist i same behavior no matter library add. being new intellij, i'm missing simple, haven't been able find through google searches. you need add dependency pom file of project. way add dependencies maven project. intellij looks @ maven poms in order build project. what described opens other project in ide right next project absolutely no relation it. see https://code.google.com/p/bitcoinj/wiki/usingmaven as not on mvnrepo, following: http://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html

php - Route [name] not defined in laravel 4.1 -

i have problem within routes , variable. need pass variable in foreach loop routes. here error meesage "route [patientname] not defined". here homepage.blade.php: @foreach($patientslist $patients) <tr> <td>{{ $patients->name }}</td> <td>{{ $patients->email }}</td> <td>{{ $patients->address }}</td> <td>{{ $patients->phone_number }}</td> <td>{{ $patients->type }}</td> <td><a href="{{ url::route('patientname', array('pname' => $patients->name)) }}" class="view-profile">view profile</a></td> </tr> @endforeach routes.php: route::get('patientname/{pname}','patientscontroller@getpatientname'); controller <?php class patientscontroller

bluetooth - Send file to android device 4+ without selection picker -

good morning, i'm newer in android i'm working on android project send file specific device, got bluetooth device don't need use intent need send selected file device. make research , try use bluetooth share dont work on device 4+ because exception need granturipermission question how set granturipermission ? there method send items automatically device without user interaction? here code try : contentvalues values = new contentvalues(); values.put(bluetoothshare.uri, uri.getpath()); values.put(bluetoothshare.destination, device.getaddress()); values.put(bluetoothshare.direction, bluetoothshare.direction_outbound); long ts = system.currenttimemillis(); values.put(bluetoothshare.timestamp, ts); i try use intent this intent sharingintent = new intent(android.content.intent.action_send); sharingintent.putextra(intent.extra_stream, uri); sharingintent.putextra(bluetoothdevice.extr

c++ - Extra bytes between sections by GNU gcc/ld -

i use arm-eabi-gcc (ver 4.6.4 / binutils 2.24) newlib (ver 2.1.0) (without angelswi ). i not use exception nor rtti . linker script same default. in linked file, there 32k space after section .eh_frame . can remove space? idx name size vma lma file off algn 4 .rodata 00000498 402f23a0 402f23a0 0000a3a0 2**3 contents, alloc, load, readonly, data 5 .arm.exidx 00000008 402f2838 402f2838 0000a838 2**2 contents, alloc, load, readonly, data 6 .eh_frame 00000004 402f2840 402f2840 0000a840 2**2 contents, alloc, load, readonly, data 7 .init_array 00000004 402fa844 402fa844 0000a844 2**2 contents, alloc, load, data 8 .fini_array 00000004 402fa848 402fa848 0000a848 2**2 contents, alloc, load, data .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } .rodata1 : { *(.rodata1) } .arm.extab :

database - performance issue while querying with comparison operator with limit on dynamodb -

i querying table has both hash , range key. while querying, putting limit on limit restricts number of returning items. understand, using comparison operators range_key__lt=12345 scans items less given range key , returns first n items of specified limit argument. in case have problem query performance not want scan items less range key. not exist there index on range keys? seems retrieves items on bucket belongs hash key. scans items less or greater value , returns of it. not understand how filter/search mechanism works on range keys. is not question clear? think basic question related databases or dynamodb specifically. try explain in detail. when try retrieve item database, without indices created on specific column scans rows , compare if satisfies given condition. however, if there exist index on column b+ tree faster retrieve item since find direct address of row index table. problem that, have table on dynamodb has hash key (type not matter) , range key type of num

Java regex is working in my system but not in the server -

the regular expression is string regex = "^[\\p{ishangul}\\p{isdigit}]+"; and whenever do text.matches(regex); it works fine in system not in of system. not able track issue. thank in advance. exception: exception in thread "main" java.util.regex.patternsyntaxexception: unknown character property name {hangul} near index 13 ^[\p{ishangul}\p{isdigit}]+ ^ @ java.util.regex.pattern.error(pattern.java:1713) @ java.util.regex.pattern.charpropertynodefor(pattern.java:2437) @ java.util.regex.pattern.family(pattern.java:2412) @ java.util.regex.pattern.range(pattern.java:2335) @ java.util.regex.pattern.clazz(pattern.java:2268) @ java.util.regex.pattern.sequence(pattern.java:1818) @ java.util.regex.pattern.expr(pattern.java:1752) @ java.util.regex.pattern.compile(pattern.java:1460) @ java.util.regex.pattern.<init>(pattern.java:1133) @ java.util.regex.pattern.compile(patt

jms - serial execution in Java-ee -

i have incoming concurrent requests should processed in serial. have attempted achieve converting requests messages , post jms queue. use mdb process queue. using vendor specific config, understand can limit mdb 1 instance, recommended , portable way solve problem? edit: forgot mention don't need features of jms (reliability etc). assume have job this. class logjob implements runnable{ private final string name; public logjob(string name){ this.name = name; } @override public void run() { system.out.println(" starting ."+name); try { thread.sleep(1000); } catch (interruptedexception e) { // todo auto-generated catch block e.printstacktrace(); } system.out.println(" end ."+name); } } it display starting , ending job. placed sleep demo create list of jobs arraylist<logjob> jobs = new arraylist<logjob>(); (

eclipse - JBPM demo error; JBoss server will not start -

i trying run jbpm 6 on windows 7 computer. have downloaded installer , run ant install.demo . worked fine next step, running ant start.demo returns "build failed" followed message "jboss application server did not start within 5 minutes". weird thing worked first time ran it, froze computer. server not start. below pasted contents of boot.log found in ...\jboss-as-7.1.1.final\standalone\log. know how can started? thank you. 10:23:30,647 info [org.jboss.modules] jboss modules version 1.1.1.ga 10:23:31,337 info [org.jboss.msc] jboss msc version 1.0.2.ga 10:23:31,406 info [org.jboss.as] jbas015899: jboss 7.1.1.final "brontes" starting 10:23:31,408 debug [org.jboss.as.config] configured system properties: awt.toolkit = sun.awt.windows.wtoolkit file.encoding = cp1252 file.encoding.pkg = sun.io file.separator = \ java.awt.graphicsenv = sun.awt.win32graphicsenvironment java.awt.printerjob = sun.awt.windows.wprinterjob

Posting to Database with PHP -

i'm trying users add data database. however, it's not working , i'm not getting error. purely practice, it's still frustrating. thoughts? <form name="add" id="add" method="post" action="programadd.php"> <p>content name: <input name="program" type="text" id="program" style="width: 500px; height: 20px;" /> </p> <p>content air date <input name="airdate" type="date" id="airdate" /> </p> <p>description <input name="description" type="text" id="description" style="width: 500px; height: 20px;" /> </p> <p>production <input name="production" type="text" id="production" value="nothing" style="width: 500px; height: 20px;" /> </p>

python - How to configure ZeroRPC and timeouts -

i'm trying simple load-testing zerorpc python server , node.js client. notice if request takes longer 10 seconds, no data back. tried configure no heartbeat in python code: s = zerorpc.server(test(), heartbeat=none) as trying configure node.js client: new zerorpc.client({ timeout: 60, heartbeatinterval: 60000 }), but still see same behavior. how can requests taking longer 10 seconds return results? the last available release of zerorpc-node (0.9.3) use harcoded hearbeat timeout. as can see in https://github.com/dotcloud/zerorpc-node/blob/0.9.3/lib/channel.js : //heartbeat rate in milliseconds var heartbeat = 5000; ... //resets heartbeat expiration time channel.prototype._resetheartbeat = function() { this._heartbeatexpirationtime = util.curtime() + heartbeat * 2; }; however latest master release implement hearbeatinterval option try specify in client contructor. then code works installing lastest master command npm install git+https://github.

web services - Android Resolve Host -

i getting following error while trying access web-service. error in http connection java.net.unknownhostexception: unable resolve host "192.168.1.109" web-service working fine, when checked using browser. i using asynctask access web-service, cannot background thread issue. missed permission: <uses-permission android:name="android.permission.internet" /> as identified in answer below. mostly doubt has permission need give while running app. making sure setting the network permission in manifest? more information or code better answers though.

mysql - PHP show number of rows in a table with conditions -

so have mysql table called posted_ads want show statistic on website number of ads posted. there 2 types of ads type1 , type2 these in column in same mysql table called ad_type so question shortest possible php code show numbers e.g: number of type 1 ads = xxx (e.g: 500) number of type 2 ads = xxx xxx being number of ads (rows) code have working is... <?php $result = mysql_query("select count(1) posted_ads"); $row = mysql_fetch_array($result); $total = $row[0]; echo "number of ads " . $total; ?> however, want show 2 different stats, 1 shows number of type1 ads , number of type 2 ads. there column in table called 'ad_type' , value either 'type 1' or 'type 2' ---- solved it---- help. have figured out. using 2 bits of code, 1 each ad type follows: <?php $result = mysql_query("select count(1) posted_ads ad_type = 'type1';"); $row = mysql_fetch_array($result); $total = $row[0]; echo "number

java - How to use ArrayList while adding something to another Class's constructor ? -

i'm try create 1 simple reservation system, we'll read file, we'll add train, bus, etc., we'll writer output. import java.io.*; import java.util.*; public class company { private static arraylist<bus> bus = new arraylist<bus>(); static int buscount = 0, traincount = 0; public static void main (string[] args) throws ioexception { fileparser(); } public company() { } public static void fileparser() { try { file file = new file(); //i fill later file file2 = new file(); // fill later fileinputstream fis = new fileinputstream(file); fileoutputstream fos = new fileoutputstream(file2); bufferedreader br = new bufferedreader(new inputstreamreader(fis)); bufferedwriter bw = new bufferedwriter(new outputstreamwriter(fos)); string line; while ((line = br.readline()) != null) { string[] splitted = line.split(","); if(spli

bash - ssh wait for script to finish -

i using following script start process on node. main node: for dir in n9 n18 n27 n40 node=compute-2-10 ssh $node "cd $dir ; nohup ./process.sh > watchdog-$dir &" done the thing when connect compute-2-10 see no jobs running. think problem process can not completed since bash doesn't wait finish. correct or need else? i have been using like ssh $node "nohup myprogram > prog.out 2> prog.err < /dev/null &" if redirect 3 i/o should not create issue.

ios - Data passed to prepareForSegue is nil -

i'm trying ingredientviewcontroller update array belongs controller called via segue ( fridgeviewcontroller ) in ingredientviewcontroller fridgemanager nil no matter try the code: fridgeviewcontroller: - (void)prepareforsegue:(uistoryboardsegue *)segue sender:(id)sender { // new view controller using [segue destinationviewcontroller]. // pass selected object new view controller. ingredientviewcontroller *controller = (ingredientviewcontroller *)segue.destinationviewcontroller; [controller setfridgemanager:fridgemanager]; } ingredientviewcontroller: @property (strong, nonatomic) fridgedatamanager *fridgemanager; and in viewdidload fridgemanager nil (and in other method of coarse) synthesize fridgemanager property in ingredientviewcontroller.m @synthesize fridgemanager;

Comparing Matlab and Apache statistics - kurtosis -

Image
hi comparing statistics between matlab , apache functions. here apache functions tested in java. same set of data, different results double array (double[] ) follow: --------------------------------------- matlab vs apache --------------------------------------- max = 0.5451 vs 0.5450980392156862 min = 0.4941 vs 0.49411764705882355 var = 5.4154e-05 vs 5.415357603461868e-5 std = 0.0074 vs 0.007358911334879547 mean = 0.5206 vs 0.5205525290240967 kurtosis = 3.3442 vs 0.35227427833465486 skewness = 0.2643 vs 0.26466432504210746 i checked , rechecked data, each value matlabs same used in java. here can see statistics identical, except kurtosis. is possible kurtosis computed differently matlab , apache library? if so, data should trust then? edit my data subset of image matrix (containing pixels values). each subset compute above statistics. everytime, statistics match except kurtosis. the matlab

sql server - MySQL error code 1005 Can't create table (errno150) - (again) - in all the foreign keys -

background:- yesterday creating small database practice, , created 9 tables, , got error in create table statement of 1 of them. question located here . thankfully told alternative way creating table without foreign key , use alter table statement add foreign key constraint, , worked. today creating database, , getting error in tables contain foreign keys. have tried alternative way of creating table , adding foreign keys alter table statement. doesn't seem help. my research:- i know question has been been addressed before on website, have tried solutions on this , this page, except adding indexes because firstly, don't need them in such small database ( second point in first answer ), , secondly don't know them , want keep simple. none of answers helped. moreover, mentioned here , " if error message refers error 150, table creation failed because foreign key constraint not correctly formed. " please tell me what's wrong foreign key constr

html - Hover over div breaks positioning jquery css -

jsfiddle: http://jsfiddle.net/y78a2/ i have element like <div id="hoverdiv"></div> <div style="margin:0 auto;"> <div class="hover" hovertext="this div 1">div 1</div> <div class="hover" hovertext="this div 2">div 2</div> <div class="hover" hovertext="this div 3">div 3</div> </div> css this #hoverdiv{ display:none; position:absolute; font-size:12px; background: rgba(0,0,0,.6); color: #ddd; border: 1px solid #999; padding:10px; z-index:10000; } jquery this $(document).on('mousemove','.hover',function(e){ var hovertext = $(this).attr('hovertext'); $('#hoverdiv').text(hovertext) .css('top',e.pagey-95) .css('left',e.pagex+10) .show(); }).on('mouseout','.hover',function(){ $('#hoverdiv&#

javafx - JavaFX8 tree tabel view customize separate cells -

in tree-table-view there child items have in turn other child items. need customize, say, text of cells of pseudo-root items. is there way assign css class/style items? update: ok, got working following cellfactory: treetblcolumnname.setcellfactory(new callback<treetablecolumn<filemodel, string>, treetablecell<filemodel, string>>() { @override public treetablecell<filemodel, string> call(treetablecolumn<filemodel, string> param) { treetablecell<filemodel, string> cell = new treetablecell<filemodel, string>() { @override protected void updateitem(string t, boolean bln) { super.updateitem(t, bln); //to change body of generated methods, choose tools | templates. system.out.println(this.gettablecolumn().); label lbl = new label(t); lbl.setstyle("-fx-font-weight: bold; -

does Android SpeechRecognizer can recognize only English? -

i using following code recognize text. @ first invoke dialog choose language recognition. pass argument recognizerintent. unfortunatly, "en-us" recognized on phone(i tried "fr-fr" , "ru-ru"). there have not done or how can narrow list working languages? code public void recognize(view v) { intent detailsintent = new intent( recognizerintent.action_get_language_details); sendorderedbroadcast(detailsintent, null, new languagedetailschecker( context), null, activity.result_ok, null, null); } private class languagedetailschecker extends broadcastreceiver { context contextapp; public languagedetailschecker(context context) { this.contextapp = context; } @override public void onreceive(context context, intent intent) { bundle results = getresultextras(true); arraylist<string> languages = new arr

webserver - Nginx Wild Card Domains -

i have a name domain setup on nginx, have wildcard dns setup on digital ocean. i main domain point is: /usr/share/nginx/html/mission13.io i wildcard domains point respective folders: /usr/share/nginx/html/sub1.mission13.io /usr/share/nginx/html/sub2.mission13.io /usr/share/nginx/html/sub3.mission13.io here have, not sure them point proper location. can change that? server{ listen 80; root /usr/share/nginx/html/mission13.io; index index.php index.html index.htm; server_name mission13.io www.mission13.io *.mission13.io; location / { try_files $uri $uri/ /index.html; } include /usr/share/nginx/conf/mission13.io.conf; location ~ \.php$ { fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; fastcgi_param script_filename $document_root$fastcgi_script_name; include fastcgi_params; } } another way please change server name _ search folder host name inside

java - What is the principle ? When Spark deal with data bigger than memory capacity? -

as know , spark use memory cache data , compute data in memory.but if data bigger memory? read source code ,but don't know class schedule job? or explain principle of how spark deal question? om-nom-nom gave answer, comment reason, thought i'd post actual answer: https://spark.apache.org/docs/latest/scala-programming-guide.html#rdd-persistence

java - Remote EJB calling: No EJB receiver available for handling -

i trying connect remote ejb using tutorial , have got no ejb receiver available handling . how connect: public static boolean createcontext() throws servletexception { system.out.println("well-well"); boolean successcreate = false; final hashtable props = new hashtable(); // setup ejb: namespace url factory props.put(context.url_pkg_prefixes, "org.jboss.ejb.client.naming"); props.put("jboss.naming.client.ejb.context", true); // create initialcontext context context = null; try { context = new javax.naming.initialcontext(props); } catch (namingexception e) { e.printstacktrace(); } issapagehome ref = null; try { ref = (issapagehome)context.lookup("ejb:" + "/ejb667//theissapage!" + issapagehome.class.getname()); } catch (namingexception e) {

How to override rate.php in magento enterprise or magento 1.8? -

i need change app\code\core\mage\tax\model\calculation\rate.php if (!is_numeric($this->getrate()) || $this->getrate() <= 0) { to if (!is_numeric($this->getrate()) || $this->getrate() < 0) { so want override file in stead of changing in core folder. please help.... first of need rewrite core magento model in config.xml file of custom module: <config> <modules> <mypackage_mymodule> <version>0.0.1</version> </mypackage_mymodule> </modules> <global> <models> <mypackage_mymodule> <class>mypackage_mymodule_model</class> </mypackage_mymodule> <tax> <rewrite> <calculation_rate>mypackage_mymodule_model_calculation_rate</calculation_rate> </rewrite> </tax> </models>