Posts

Showing posts from May, 2013

javascript - iframe tag not loading some URL's -

i passing url's dynamically http://ip:port/myproject/dashboard.do?method=loaddashboard . methods of same action class not loading loading in browser. here method name loaddp. http://ip:port/myproject/dashboard.do?method=loaddp . $("#containerid").html(' <ifrme id="iframeid" src= '+ url +' style="width: 100%; height: 100%;"></iframe>'); you have typo issues, should have iframe not ifrme missing quotes in src attribute: $("#containerid").html('<iframe id="iframeid" src="'+ url +'" style="width: 100%; height: 100%;"></iframe>'); //----------------------^^^^^^^^------------------^--here---^

php - PayPal IPN OPENSSL error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure -

Image
my current php version 5.3. have updated 5.2 5.3 i have searched in google can't find solution regarding paypal ipn validation. i saw phpinfo() there enabled openssl still getting error message - warning: fsockopen() [function.fsockopen]: ssl operation failed code 1. openssl error messages: error:14077410:ssl routines:ssl23_get_server_hello:sslv3 alert handshake failure in /home/xxx/public_html/paypal_test/socketopen.php on line 5 warning: fsockopen() [function.fsockopen]: failed enable crypto in /home/xxx/public_html/paypal_test/socketopen.php on line 5 warning: fsockopen() [function.fsockopen]: unable connect ssl://www.sandbox.paypal.com:443 (unknown error) in /home/xxx/public_html/paypal_test/socketopen.php on line 5 () my code - <?php $fp = fsockopen ( 'ssl://www.sandbox.paypal.com', "443", $err_num, $err_str, 60); if (!$fp) { echo "$errstr ($errno)<br />\n"; } else { $out = "get / http/1.1\r\n"; $out ....

php - While downloading pdf file from another server forward slash is get replaced with underscore -

i trying download pdf file server. while downloading file replaces forward slash(/) underscore , file path become this( 127.0.0.1_file_upload_demoform1.pdf ), because of not able download file. here code. header('content-type: application/pdf'); $download_path = "127.0.0.1/file_upload/demoform1.pdf"; header('content-disposition: attachment; filename='.$download_path); readfile('downloads/'.$download_path); can suggest issue in it. i got answer. trying download pdf file server. not allow me directly download location. here solution. $content = file_get_contents('http://127.0.0.1/file_upload/demoform1.pdf'); header('content-type: application/pdf'); header('content-disposition: attachment; filename=demoform1.pdf'); echo $content;

iphone - Animating Values in UILable IOS Swift -

i want display values 1-10 repeatedly in uilable animation user should able see fluctuation of values how can achieve functionality ? you can use : var timer : nstimer = nstimer.scheduledtimerwithtimeinterval(1, target: self, selector: "change_label", userinfo: nil, repeats: true) func change_label() { count = count+1 label.text = string(format: "%d",count) }

Php and MySQL Querys using values in other tables -

so i'm trying fetch of user_id's users-events table event_id equal passed in variable (let's it's 2 now.) in database there 2 id's registered event_id 1 , 2. this code returns first of these values. feel need incorporate first query while loop dont know how go it. any appriciated! function showregisteredplayers($id){ $eventq = mysql_fetch_assoc(mysql_query("select user_id `users-events` event_id = '".$id."'")); $rosterq = mysql_query("select username `users` `user_id` = '".$eventq['user_id']."'"); while($player = mysql_fetch_assoc($rosterq)){ echo(" <tr> <td>".$player['username']."</td> </tr> "); } } use sub query kill first one. select username `users` `user_id` in ( select user_id `users-events` event_id = 5 ) rest fine, looping on second result set should do. unless have large nu...

sql - I want to fetch this data year wise -

select cidetail.itemname, sum(cidetail.taxamount+ cidetail.lineamount) [totalamount] cidetail (nolock) inner join ciheader on cidetail.invoiceno= ciheader.invoiceno ciheader.invoicedate between '2010-04-01' , '2014-04-01' group cidetail.itemname have derived table use ansi sql's extract year part out of date, , add amounts together. @ main level group by both itemname , year: select itemname, "year", sum(amount) totalamount ( cidetail.itemname, extract(year ciheader.invoicedate) "year", cidetail.taxamount + cidetail.lineamount amount cidetail (nolock) inner join ciheader on cidetail.invoiceno= ciheader.invoiceno ) dt group itemname, "year" no dbms tagged in question, if dbms doesn't support extract , try year(ciheader.invoicedate) example, or else.

netbeans - Read/Write bits for Huffman coding in java -

i have huffman coding project in first step obtain code of each character depends on huffman tree.i obtain code of each character example : = 01 , b= 101 , c = 111.these codes string , want save them in file .cmp extension in binary example have text such : abc , encoding is:01101111 how can write them file binary value in file .cmp extension , after read them , decode them? hopefully know bytes , integers consist of bits, need build little queue of bits single integer containing bits , integer tracks number of bits in first integer, accumulating bits using shift , or operators. once have accumulated byte, write out , shift out of queue. e.g. put n bits in buf |= val << bits; bits += n; , , pull bits out if have enough: while (bits >= 8) { write_out(buf & 0xff); buf >>= 8; bits -= 8; . make sure integer large enough handle largest value of n have. i.e., buf needs able hold maxn+7 bits, since while loop never leave more 7 bits in buffer.

java - questions on Spring @Autowired and Spring JDBC -

i had questions. in case @autowired not preferable? in scenario, have prefer spring-jdbc spring-hibernate ? what happens if autowire objects? please me on questions 1. in case @autowired not preferable? autowiring simplifying dependency injections. may seems easy , lucrative @ first later realize not maintainable in big real-life projects. default autowiring in spring by-type . not prefer when have more 1 instance of particular class , have force spring resolve injections by-name , have use additional @qualifier . prefer going javax @resource in such cases. also, might face situation have create , inject beans based on properties/arguments. in such cases @autowired might not work , might have opt xml based configuration. 2. in scenario, have prefer spring-jdbc spring-hibernate? the choice of selection between jdbc vs hibernate depends on project , how think can accommodate hibernate. both these implementations fast indeed. both of these have own adv...

C# directory search (the number) -

this question has answer here: number of folder inside directory 3 answers private int dreturn, freturn = 0; public maker() { initializecomponent(); } private void button1_click(object sender, eventargs e) { if (fd.showdialog() != dialogresult.ok) { return; } listview1.items.clear(); dreturn = 0; freturn = 0; textbox1.text = fd.selectedpath; scanner scanner = new scanner(); scanner.show(); fscan(fd.selectedpath); dscan(fd.selectedpath); scanner.close(); messagebox.show("file : " + freturn + ", folder : " + dreturn, "information", messageboxbuttons.ok, messageboxicon.information); } private int dscan(string path) { try { foreach (string d in directory.getdirectories(path)) { dreturn = dreturn + 1; dscan(d); application.doevent...

android - 9-patch background adds top and bottom padding. How to avoid it? -

Image
i'm trying customize togglebutton in app. i'm setting 9-patch image background written here . , in layout xml: <togglebutton android:id="@+id/toggle" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:background="@drawable/btn_toggle_bg" android:checked="true" android:gravity="center_horizontal|center_vertical" /> btn_toogle_bg.xml : <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android" > <item android:id="@+android:id/background" android:drawable="@android:color/transparent"/> <item android:id="@+android:id/toggle" android:drawable="@drawable/btn_toggle"/> </layer-list> btn_toggle.xml : <?xml ...

postgresql - How to upsert in Postgres on conflict on one of 2 columns? -

is possible upsert in postgres 9.5 when conflict happens on 1 of 2 columns in table.? have 2 columns , if either column throws unique constraint violation, perform update operation. yes, , behaviour default. unique constraint violation constitutes conflict , update performed if on conflict update specified. insert statement can have single on conflict clause, conflict_target of clause can specify multiple column names each of must have index, such unique constraint. are, however, limited single conflict_action , not have information on constraint caused conflict when processing action. if need kind of information, or specific action depending on constraint violation, should write trigger function lose all-important atomicity of insert ... on conflict ... statement.

javascript - What do querySelectorAll, getElementsByClassName and other getElementsBy* methods return? -

do getelementsbyclassname (and similar functions getelementsbytagname , queryselectorall ) work same getelementbyid or return array of elements? the reason ask because trying change style of elements using getelementsbyclassname . see below. //doesn't work document.getelementsbyclassname('myelement').style.size = '100px'; //works document.getelementbyid('myidelement').style.size = '100px'; your getelementbyid() code works since ids have unique , function returns 1 element (or null if none found). however, getelementsbyclassname() , queryselectorall() , , other getelementsby* methods return array-like collection of elements. iterate on real array: var elems = document.getelementsbyclassname('myelement'); for(var = 0; < elems.length; i++) { elems[i].style.size = '100px'; } if prefer shorter, consider using jquery : $('.myelement').css('size', '100px');

c# - How to integrate MouseWithFingerprint app into windows WBF framework? -

i have secugen mouse fingerprintsensor application / sdk, can enroll, , verify enrolled finger using sdk. now, i want use mousefingerprint application / sdk windows login credential. how can in windows 7 64 bit os. if information missing here, please mention in command area update. thanks. note : i new stackoverflow, if question editing bad please correct it.

javascript - Hide ad in Youtube frame -

is possible hide elements in third-party iframe? example — yt player iframe_api , ads. tried iframe content document or contentdocument browser blocked me. may tricks exists? example — awsmtv.com

java - How do you handle large traffic on load? -

we working project has huge traffic load on chinese new year eve. our target throughput 20w pqs , did not ever have experience handling such large traffic before. we using spring mvc backend , mysql percona cluster database layer , redis cache. our network infrastructure lvs->nginx->tomcat ->mysql/redis. what when working on such scenario? first need scale application running pat kind of testing. and, there 3 main strategies handling load: the site can invest in single huge machine lots of processing power, memory, disk space , redundancy. the site can distribute load across number of machines. the site can use combination of first 2 options. when visit site has different url every time visit (for example www1.xyz.com, www2.xyz.com, www3.xyz.com, etc.), know site using second approach @ front end. typically site have array of stand-alone machines each running web server software. have access identical copy of pages site. incoming requests pages spr...

java - JTable:How to initialize a empty cell(type is int/float...) to allow user to input number in JTable? -

Image
i know there's way initialize empty string cell this: object[][] tabledata={ {""},{""} }; string[] columntitle = {"aaa", "bbb"}; jtable jtable= new jtable(tabledata, columntitle); to avoids empty comments here i had read oracle tutorial didn't it. but it's type number(int/float/double), can right-justified , formatted. object[][] tabledata={{null},{null}}; doesn't satisfy me, because type not number or cannot right-justified , formatted. for example (mixing possible in jtable s , defaulttablesmodel s apis, btw based on oracle tutorial - how use tables ) import javax.swing.jframe; import javax.swing.jscrollpane; import javax.swing.jtable; import javax.swing.listselectionmodel; import javax.swing.scrollpaneconstants; import javax.swing.swingconstants; import javax.swing.table.defaulttablecellrenderer; import javax.swing.table.defaulttablemod...

android - Trying to implement WebviewClient..but failing -

i saw several articles here implementing webviewclient transitions in webview stay in webview rather go browser. when try run application webview loads still doesnt correct page transition problem. possible need replace "shouldoveride" "on create"? public class webviewactivity extends activity { /** called when activity first created. */ @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); webview wv = (webview) findviewbyid(r.id.webview1); websettings websettings = wv.getsettings(); websettings.setbuiltinzoomcontrols(true); wv.loadurl("http://www.yahoo.com"); } private class callback extends webviewclient { @override public boolean shouldoverrideurlloading(webview view, string url) { return(true); } } } if want show pages inside webview instead of openning in default browser, need speficy webviewclient . it's n...

How to save the result of a MS-Access select query in variables in C#.net? -

my question simple don't know how query is: " select * table1 id =" + textbox1.text; and want save result in variables table of query has 5 columns means want 5 variables save results don't know how can database in ms-access firstly need know, how make oledbconnection in c#. you don't need create variables!. can directly assign rows or selected 1 one of many datacontrols available in asp.net , winforms both. datacontrols automatically show db.table data in tabular layout on page or form. can control of automatically created layout. you can fetch data db , create dataset this: string query = "select * table1 id=?"; oledbconnection odc = new oledbconnection(strconn); odc.open(); oledbdataadapter dadapter = new oledbdataadapter(); oledbcommand cmd = new oledbcommand(query,odc); cmd.parameters.add("?", oledbtype.bstr, 5).value ="asdf"; dadapter.selectcommand = cmd; ds = new dataset(); dadapter.fill(ds); datag...

ruby - How to understand dynamic method creation -

i saw code: class myclass define_method :my_method |my_arg| my_arg*3 end end obj = myclass.new obj.my_method(2) # => 6 when create obj , have not yet called define_method , my_method should not have been created. then, why can call obj.my_method(2) directly? in other words, define_method executed @ time when myclass instantiated? any method executed when appears directly in context read. there no exception method define_method , defines method. method define_method called (and hence method my_method defined) in line 2, before obj created in line 7. , defined method not object.

php - Mailbox in website -

Image
i have "contact us" form in website mailto: function. mail goes yahoo account . want implement mailbox in website such can receive mail directly admin page , reply or delete them accordingly. how can that? i have template need explanation on functions , dynamic content implemented. this sample of code .. have change variable name here .. $sql = "select * request user_id='$user'"; $result = $conn->query($sql); $sr=1; if ($result->num_rows > 0) { // output data of each row while($row = $result->fetch_assoc()) { $sender_id=$row["sender_id"]; $receiver_id=$row["receiver_id"]; $req=$row['req_id']; $stat=$row['status']; if($stat==0){ $status="pending..."; } elseif ($stat==1) { $status="accepted."; } elseif ($stat==2) { $status="rejecte...

javascript - jQuery: use var shortcut to assign data and how to chain function to run on load and click -

i've got two-part question. one: can use last variable set update value on line after if (!last) { ? i.e., last = size; ? var j$ = jquery.noconflict(); function updatecount() { var self = j$(this), last = self.data('last'), size = self.val().length, span = j$('.currentcount'); if (!last) { self.data('last', size); } else if (last != size) { span.text(size); self.data('last', size); } } j$('textarea[id$=textbody]').on('propertychange change click keyup input paste', updatecount); secondly, can chain .on('propertychange ... line have updatecount run script loaded? question 1: no, can not use assignment variable because there no data-binding in jquery. updating last variable never update data-last of jquery object. question 2: this used do: j$('textarea[id$=textbody]').on(...

java - How to send custom object using serialization? -

i'm new java. need send on socket file content, double number. idea wrap these 2 fields custom object. since object file not serializable, how send/recv custom object? in advance. ps: sending party decide if needs send file according value of "double" number. example: class myobject{ double number; file file; } when sending, logic this: myobject = new myobject(); if(my.number > 0){ my.file = open_file(aaa.jpg); }else{ //not opening file } send(my); here quick example application sends data on socket s. public class app { private static final atomicinteger port = new atomicinteger(-1); private static final atomicboolean read = new atomicboolean(true); private static final class socketreader implements runnable { @override public void run() { try { final serversocket serversocket = new serversocket(0); system.out.println("connected on " + serversock...

ggplot2 - R: Non-normal distribution with specification limits -> quartiles & Cp/Cpk -

Image
i having problem plot quartiles of mixed distribution , furthermore calculate cp & cpk. my data: > dput(hist) structure(list(index = c(1, 10, 11, 12, 128044, 128045, 128046, 128047, 128048, 128049, 128050, 128051, 128052, 128053, 128054, 128055, 128056, 128057, 128058, 128059, 128060, 128061, 128062, 128063, 128064, 128065, 128066, 128067, 128068, 128069, 128070, 128071, 128072, 128073, 128074, 128075, 128076, 128077, 128078, 128079, 128080, 128081, 128082, 13, 14, 15, 150780, 150781, 150782, 150783, 150784, 150785, 150786, 150787, 150788, 150789, 150790, 150791, 150792, 150793, 150794, 150795, 150796, 150797, 150798, 150799, 150800, 16, 163525, 163526, 163527, 163528, 163529, 163530, 163531, 163532, 163533, 163534, 163535, 163536, 163537, 163538, 163539, 163540, 163541, 163542, 163543, 163544, 163545, 163546, 163547, 163548, 163549, 163550, 163551, 163552, 17), rundheit = c(0.24, 0.25, 0.23, 0.24, 0.23, 0.24, 0.22, 0.24, 0.21, 0.22, 0.23, 0.24, 0.22, 0.24,...

sql - Replace all occurrences of more than one whilespace character with a single one -

input: rammar narayana raja rani. output: rammar narayana raja rani. in c# code oculd this: while (name.contains(" ")) { name = name.replace(" ", " "); } that replaces double single spaces , should store in same variable. here want replace more 1 whitespace in string 1 whitespace, occurance. how can in oracle sql? try way: select regexp_replace('aa b cc d e f ', '( ){2,}', ' ') dual; for details, see here ; it's 1 of examples.

win universal app - Windows UWP crashing when uploaded to Store -

i'm having major problem app small acorns vegetarian recipes when uploaded windows store. when test app locally, create app package , test sideloading app cannot replicate errors occurring live app in store. have downloaded live app on 3 different windows 10 devices , app works without crashing. below crash report windows dev center recording error stowed_exception of type system.unauthorizedexception . there multiple errors same 1 below. 9nblggh2rqt4 small acorns 2016-w3 1/18/2016 12:00:00 e5fbe8d3-2fcc-9405-e339-795d8ec35826 "1 smallacorns_w10_7ffbdf7a0000 0xc179e8 2 smallacorns_w10_7ffbdf7a0000 0xfcd461 3 smallacorns_w10_7ffbdf7a0000 0xff7263" 9nblggh2rqt4 small acorns 2016-w3 1/18/2016 12:00:00 45df7950-ae20-259c-3f6e-4ec2a1758559 "1 smallacorns_w10_581b0000 0x98dc05 2 smallacorns_w10_581b0000 0x98de13 3 smallacorns_w10_581b0000 0xc14e95 4 smallacorns_w10_581b0000 0xc14e5e 5 smallacorns_w10_581b0000 0xc14e4...

multithreading - Does linux schedule a process or a thread? -

after reading this question got few doubts. please in understanding. scheduling involves deciding when run process , quantum of time. does linux kernel schedule thread or process? process , thread not differentiated inside kernel how scheduler treats them? how quantum each thread decided? a. if quantum of time (say 100us) decided process getting shared between threads of process? or b. quantum each thread decided scheduler? note: questions 1 , 2 related , may same wanted clear on how things working posted them both here. the linux scheduler (on recent linux kernels, e.g. 3.0 @ least) scheduling schedulable tasks or tasks . a task may : a single-threaded process (e.g. created fork without thread library) any thread inside multi-threaded process (including main thread), in particular posix threads (pthreads) kernel tasks, started internally in kernel , stay in kernel land (e.g. kworker , nfsiod , kjournald , kauditd , kswapd etc etc...) in other wor...

ios - UITableViewCell not being called correctly -

i have cell class below: class documentpartcell: uitableviewcell { @iboutlet weak var documentparttitle: uilabel! @iboutlet weak var documentpartnumber: uilabel! @iboutlet weak var documentpartprogress: uilabel! var documentpart: documentpart? { didset { if let documentpart = documentpart { self.documentparttitle.text = documentpart.title self.documentpartnumber.text = "\(documentpart.partnumber)" } } } } and can see, documentpart contains data. if understand correctly, didset should input data documentpart documentparttitle , documentpartnumber. in cellforrowindexpath following: func tableview(tableview: uitableview, cellforrowatindexpath indexpath: nsindexpath) -> uitableviewcell { let documentpartcell = tableview.dequeuereusablecellwithidentifier("documentpartcell", forindexpath: indexpath) as! documentpartcell return documentpartcell } however, when t...

javascript - Sails js policies not working -

i have written basic policies in sails js. in app/config/policies.js module.exports.policies = { '*': 'sessionauth' }; in app/api/policies/sessionauth.js module.exports = function(req, res, next) { console.log('reach'); if (req.session.authenticated) { return next(); } return res.forbidden('you not permitted perform action.'); }; but when requesting url, 'reach' not printing in console , basic policies not working. going controller's action define in route.js. the problem in policies.js file : you can try module.exports.policies = { //your controller usercontroller: { '*': 'sessionauth' } };

Android Studio "Error retrieving parent, No resource found that match the given name" on TargetSdkVersion update to 23 -

while updating targetsdkversion 23 on project build using older targetversion on android studio, got following error on build. /path/to/project/app/build/intermediates/res/merged/debug/values/values.xml error:(1334) error retrieving parent item: no resource found matches given name '@style/textappearance.appcompat.light.base.searchresult.subtitle'. error:execution failed task ':app:processdebugresources'. > com.android.ide.common.process.processexception: org.gradle.process.internal.execexception: process 'command '/path/to/androidsdk/build-tools/23.0.1/aapt'' finished non-zero exit value 1 the build.gradle is apply plugin: 'com.android.application' android { compilesdkversion 23 buildtoolsversion "23.0.1" defaultconfig { applicationid "com.myapplicaitonid" minsdkversion 15 targetsdkversion 23 versioncode 8 versionname "1.0.7" } buildtypes { ...

javascript - chrome notification list type notification won't display primary message -

i don't know why primary message in chrome notifications of type:"list" won't displayed. according official documents , message still required in options send create notifications doesn't show message in notification. have options object here- options={ type: "list", title: "test", message: "this message doesn't displayed", iconurl: "icon128.png", items: [{ title: "but", message: "this gets displayed."}, { title: "and", message: "this gets displayed."}, { title: "and this", message: "also gets displayed."}] }; am missing something? there workaround? didn't share manifest because notification working fine if change type:"list" type:"basic" , replace items contextmessage . want display message and list.

android - Why background color are included in png image of ImageView? -

Image
i absolute beginner android. learning how design layout. having problem imageview: when set src of imageview png file, dark color background automatically added images in screenshot: the real image of this: (there's no background) this xml layout toolbar , did not set background imageview: <?xml version="1.0" encoding="utf-8"?> <relativelayout android:layout_width="match_parent" android:layout_height="wrap_content" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/toolbar" android:fitssystemwindows="true" android:minheight="?attr/actionbarsize" app:theme="@style/themeoverlay.appcompat.dark.actionbar" android:background="?attr/colorprimarydark"> <imagebutton android:id="@+id/btn_open_sidebar" ...

angularjs - How to display the second word first with dot -

i have issue display name in web site. we clientusername(first , last name) in single string. now want display first , last name first char dot. if clientusername srirama reddy need display sriram r. also, accept first name 12 characters how can in angular my controller code this.loadcurrentclientuserdetails = function () { var clientuserdetails = common.getcurrentclient(); self.clientusername = clientuserdetails.username; self.clientname = clientuserdetails.clientname; }; you can use this var data=self.clientusername.split(' '); var finalname=data[0].substring(0,12)+" "+data[1].substring(0,1)+"." this provide required data(also, accept first name 12 characters).

How to solve this error in opencart? -

fatal error: allowed memory size of 67108864 bytes exhausted (tried allocate 16384 bytes) in /home/giftstore/public_html/myonlinegiftstore/system/storage/modification/catalog/controller/common/seo_url.php on line 152 this server problem. increase memory size. please contact server provider or if on local server increase memory limit php.ini file.

javascript - Get Global Variable Value After Applying Function in Another Script -

i have variable initialized no value in first javascript file, let's call first.js, this: var loggedinstatus; then, in main function of javascript file, variable assigned value this: loggedinstatus = true lastly, in javascript file, let's call 1 second.js, need access loggedinstatus variable value true assigned it. i understand concept of loading first.js before second.js in html files using script tags, i'm wondering there way of passing on associated true value loggedinstatus variable? if can define loggedinstatus inside global variable, can access it. for example, var loggedinstatus = 'j'; // global scope (function(){ // non-global scope loggedinstatus = true; // modifies global scope variable; })(); alert(loggedinstatus); // global scope you can use this, use apps. window.app = {}; app global object can hold related app environment. can defined modify, delete variables, objects, or functions. win...

apache zookeeper - Solr cloud client 5.3.1 Timeout Exception while using with spring hibernate transaction -

i connecting solr index database entries getting spring hibernate transaction. facing below exception. error while calling watcher java.lang.classcastexception: java.util.hashmap cannot cast java.lang.string @ org.apache.solr.common.util.executorutil$mdcawarethreadpoolexecutor.execute(executorutil.java:173) @ java.util.concurrent.abstractexecutorservice.submit(abstractexecutorservice.java:110) @ org.apache.solr.common.cloud.solrzkclient$3.process(solrzkclient.java:261) @ org.apache.zookeeper.clientcnxn$eventthread.processevent(clientcnxn.java:522) @ org.apache.zookeeper.clientcnxn$eventthread.run(clientcnxn.java:498) org.apache.solr.common.solrexception: java.util.concurrent.timeoutexception: not connect zookeeper x.x.x.x:8000 within 10000 ms @ org.apache.solr.common.cloud.solrzkclient.(solrzkclient.java:181) @ org.apache.solr.common.cloud.solrzkclient.(solrzkclient.java:115) @ org.apache.solr.common.cloud.solrzkclient.(solrzkclient.java:105) ...

c# - Property with getter only vs. with getter and private setter -

are these same? public string myprop { get; } vs. public string myprop { get; private set; } i mean in both versions property can set in own class readonly other classes? public string myprop { get; } - introduced in c# 6.0. , such properties called read-only auto-properties. assignments such members can occur part of declaration or in constructor in same class. can read detailed explanation in that msdn article or in jon skeet blog. explained in article, such property solves 4 problem automatically: a read-only-defined backing field initialization of backing field within constructor explicit implementation of property (rather using auto-property) an explicit getter implementation returns backing field public string myprop { get; private set; } - means property read-only in outside of class , can change it's value inside of class. by way, can set read-only auto-properties value using new auto-initialize syntax again introduced in c...

angularjs - ng-if condition with model which is updated using ajax -

i have model in controller updated via asynchronous call through $http. , using flag check whether model defined or not. function mycontroller(modelservice){ var vm = this; vm.mymodel = modelservice.data; // modelservice.data updated asynchronously later vm.showdetails = typeof vm.mymodel !== 'undefined'; //flag check whether model defined or not } html, <div ng-if='mycontroller.showdetails'> ... </div> currently div not shown after mymodel populated proper data later. please let me know i'm going wrong? $http return promise can use like modelservice.data() .then(function(response){ vm.showdetails = true; })

remote oracle database connection -

i working on project using oracle.the remote host pc ip address 10.100.59.30 database exists.i want connect database computer(ip:10.100.59.150). how should it?oracle listener working fine.but showing network adapter not connecting.i checked firewall.it off.all fine database connection not building up.i have tried every possible solution.am missing silly things?i have tried sqlplus username/password@hosta:1521 /xe in cmd.but not working.and not have oracle installed in pc. do have tnsnames.ora ? or here asktom answer how connect oracle without one.

How to upload an arbitrary number of files with Swift and Alamofire? -

i'm trying access rest api lets me upload different number of files, depending on situation. i've got following code alamofire i'm not sure how change can upload 1 file, 2 files, or ten files. alamofire.upload( .post, "https://httpbin.org/post", multipartformdata: { multipartformdata in multipartformdata.appendbodypart(fileurl: farmfileurl, name: "xml-file-farm") multipartformdata.appendbodypart(fileurl: farmfileurl, name: "csv-measurement-file-1") multipartformdata.appendbodypart(fileurl: farmfileurl, name: "csv-measurement-file-2") }, encodingcompletion: { encodingresult in switch encodingresult { case .success(let upload, _, _): upload.responsejson { response in debugprint(response) } case .failure(let encodingerror): print(encodingerror) ...

php - Why is there no records on my database? CakePHP -

i got around using cakephp. followed simple blog example. records show in cakephp web app when check database via phpmyadmin, new entries added weren't there @ all. what's happening , how make them appear on database? i'm confused because can view , edit data within web app reason isn't existent on database.

upgrade - rails actionmailer error with 'part' method -

i'm upgrading rails 2.3.2 app ot rails 3. have unknown error sending email message in mailerformerror. mailerformerror model: class mailerformerror < actionmailer::base at 1st have error 'deliver_send' method ( undefined method `deliver_sent' mailerformerror:class ), change 'send'. have this: nomethoderror in leadscontroller#create undefined method `part' # my code in controller: @msg = {} @msg["errors"] = @lead.errors @msg["params"] = params #mailerformerror.deliver_sent(@msg) mailerformerror.sent(@msg) this class sending method: def sent(msg, sent_at = time.now) @subject = ("Ошибка при заполнении формы").force_encoding('iso-8859-1').encode('utf-8') @recipients = 'mymail@gmail.com' @from = 'mymail@gmail.com' @sent_on = sent_at @headers = {} part( :content_type => "mu...

jquery - Calculate number of days between two dates with momentsjs -

i got 2 dates stored inside var (created date picker). format these using moments.js i want calculate number of days between these 2 fields , store number inside var days . code far: // when clicks submit button, create url stored in var url. $(".book_submit").on('click', function(e){ // datepicker , input fields data var = $('.from').val(); var = $('.to').val(); // can format "from" var way want = moment(from, "dd.mm.yyyy"); = moment(from).format("yyyy-mm-dd"); // can format "to" var way want = moment(to, "dd.mm.yyyy"); = moment(to).format("yyyy-mm-dd"); // want store number between 2 dates in var "days", place inside link below. have found ".diff(to, 'days') in moments documentation. //days = from.diff(to, 'days'); // =1 var url = "https://mycustomlink&days= " + days + ""; }); i can't from....

google app engine - Limit access to the Admin REST API of SyncGateway -

according documentation admin rest api of syncgateway shouldn't exposed. quote: by default, admin rest api runs on port 4985 (unless change admininterface configuration parameter). do not expose port —it belongs behind firewall. can reach port has free access , control on databases , user accounts. this makes sense i'm wondering how can grant application server runs on google appengine , handles sign-up / creation of sessions access api without exposing it? there option expose admin rest api limit access specific server sending request or requiring username / password combination gui on :8091 port? edit just clarification i'm adding comment question: the app server (running on gae) , couchbase server (running on digitalocean) 2 different physical devices , have different ip addresses. means: can't change admininterface configuration parameter in syncgateway_config.json loop-back address since connection gae server couchbase server won...

r - How to interpret the reconstruction MSE from H2O anomaly detection? -

i using h2o anomaly detection in data. data contains several continuous , categorical features , label either 0 or 1. now, because count of 1s less 1%, trying out anomaly detection technique instead of using usual classification methods. however, in end mse calculated per row of data , not sure how interpret able actual label 0 because of anomaly , should 1. the code using far: features <- names(train.df)[!names(train.df) %in% c("label")] train.df <- subset(train.df, label==0) train.h <- as.h2o(train.df) mod.dl <- h2o.deeplearning( x=features, autoencoder=true, training_frame=train.h, activation=c("tanh"), hidden=c(10,10), epochs=20, adaptive_rate=false, variable_importances=true, l1=1e-4, l2=1e-4, sparse=true ) pred.oc <- as.data.frame(h2o.anomaly(mod.dl.oc, train.h.oc)) head(pred.oc) : reconstruction.mse 1 0.012059304 2 0.014490905 3 0.011002231 4 0.013142910 5 0.009631915 6 ...

Can applications query datawarehouse repository directly; or should they always access the data via data marts? -

i plan on implementing inmon type of datawarehouse solution small/medium size company. datawarehouse solution have 3rd normal form repository , set of data marts. data flow "online" datasources (oltps) data warehouse repository , data marts. believe have grasp of theory. i've read few books ("the data warehouse mentor" laberge, books kimball , inmon) have questions regarding real-life solutions , best practices. questions: is idea have applications (reporting systems etc.) execute queries against data warehouse repository (i'm referring central 3nf data storage), or should access data through data marts? is there standard naming convention data repository , data mart objects (schemas, tables, fields etc.)? can point me examples of real-life datawarehouse schema examples? i've reviewed mssql adventureworksdw. i'd appreciate feedback. thanks. 1) depends. shouldn't reason have dimensional data marts @ if 3nf performs. data mar...

php - Indexing in the CSV file -

i have csv file indexing 1,2,3 if record 1 contain category xyz 2 contain abc , 3 contain tyu goes well.when subcategories added of xyz index 4 added below 1 , indexing goes 1,4,2,3 whereas want 1,2,3,4.i have used following way: $filepointer = fopen($category_filename_with_path, 'w') or error('ggg'); foreach($all_category_data_new $updated_data) { fputcsv($filepointer,$updated_data); } opening file in appending mode not working.sample format of csv : 62,inspirational||inspirational,1,n,,fande 64,dog$house||doghouse,1,n,,fande 65,doghouse||doghouse,1,n,,fande 66,testauthor||testauthor,1,n,,fande thanx in advance put ksort($all_category_data_new); before foreach solve problem, if want sort keys, independent values array_values($all_category_data_new); solve problem more efficiently. updated : please add ksort following. $filepointer = fopen($category_filename_with_path, 'w') or error('ggg'); ksort($all_catego...

php - mysql server has gone away error during installing migration (laravel) -

so using cmd on laravel folder , tried (php artisan migrate:install). 2 errors came up. [pdoexception] sqlstate[hy000] [2006] mysql server has gone away [errorexception] pdo::__construct(): mysql server has gone away can please explain did wrong? this not laravel issue, general mysql issue. maybe server not running. sure you're running mysql in background? check link: mysql gone away do following checks in system: the database engine running you have created database you have created user , granted permissions database you have setup user , database in laravel's .env file. after this, try run migrations command again, is: php artisan migrate as explained here let know if helps :).

java - log4j custom logger method not getting called -

i want override error(object message, throwable t) of log4j.logger class change few things. when extend mylogger extends logger, still not call implementation of error(..) method rather super class's method getting called. here's code public class mylogger extends logger { private static final string fqcn = mylogger.class.getname(); protected mylogger(string name) { super(name); // todo auto-generated constructor stub } public void error(object message, throwable t,final string codekey, final string messagekey) { system.out.println("codekey "+codekey+" messagekey"+messagekey); string fmessage=codekey+":"+messagekey; if (this.repository.isdisabled(40000)) return; if (level.error.isgreaterorequal(geteffectivelevel())) forcedlog(fqcn, level.error, fmessage, null); } } and test class i'm trying call implementation of error(..) public class t...

ios - How can we ensure the badge showing pending notifications is zero-ed on MobileFirst Platform 7.1? -

i working client who's developing hybrid application on mobilefirst platform 7.1. when send notifications ios platform, received , processed (i.e. function assigned wl.client.push.onmessage() fired). however, ios "badge" (the count of pending messages on home screen) never reduced - increases on time. how can ensure decremented/zeroed when notifications consumed? there callback function/api need call? you have implement wl.badge api: http://www-01.ibm.com/support/knowledgecenter/sshs8r_7.1.0/com.ibm.worklight.apiref.doc/html/refjavascript-client/html/wl.badge.html?lang=en you need handle badge on own...

node.js - Can a WebSocket connection be disconnected or messages lost due to poor signal strength? -

i have app uses native websockets on browser , node ws on server. have been testing on devices not have great wi-fi connections (on 5 bar signal strength indicator range 2 5 bars). it seems impacts performance. when device has 2 or bars, looks messages aren't transmitted / received server. can't check see if connection has been dropped because of this issue doesn't seem right because device has weak signal, messages not transmit. because based on tcp, don't websockets guarantee delivery of messages / , wouldn't connection persist long there internet connectivity?

php - Laravel blade dynamic directory -

i working on modular structure such below modules module controllers models views however struggling figure out how load views dynamic directory, instance there 20 different modules each 1 loading views own directory, possible way blade renders templates @ moment? although you're asking "modular" behaviour, mentioned in comments may want consider service providers , packages instead. laravel more service-oriented architecture . referenced can learn more soa on wikipedia. imho modules old practice , inflexible when comes dependencies - when 2 packages need override same dependency in package not know of each other - takes precedence? creating package in order started, quickest way create own package have it's own repository (which assume git , local repository - can anywhere however, private repository on github, bitbucket or own private server). first create repository, assume you're doing locally inside /users...

Regex that contain only alphanumeric and special characters in MySQL -

i'm trying select rows contain english , special characters in mysql using: select * table column regexp '^[a-za-z0-9 \-\:\(\)\&\.\,\?]+$' i don't know wrong when try adding - : ( ) & . , ? ! ' | < > . the special character want: - : ( ) & . , ? ! ' | < > note when add characters character class, not have blindly escape of them, , if have escape them, must use double \\ backslash in mysql regex. however, not necessary. when place - hyphen @ start or end of character class, or right after posix character class, treated literal hyphen. other "special" characters need not have escaped in character class. also, ' should doubled in single quoted string literal. so, use select * table column regexp '^[a-za-z0-9 :()&.,?!''|<>-]+$'

java - Android- cant get String from Resources for Static field- Non-static Method getResources cannot be referenced from a static-context" -

i passed images , text in grid view launchericons class. below codes, works fine. want change string as new launchericon(r.mipmap.ic_launcher,getresources().getstring(r.string.hello)) i want string resources(r.string.hello) , when implement getresources warning "non-static method getresources cannot referenced static-context" public class mainactivity extends appcompatactivity implements adapterview.onitemclicklistener { string activity="mainactivity"; context activity_context=mainactivity.this; static final launchericon[] icons = { new launchericon(r.mipmap.ic_launcher,"hello"), new launchericon(r.mipmap.ic_launcher, "about me"), new launchericon(r.mipmap.ic_launcher, "venky"), new launchericon(r.mipmap.ic_launcher, "noctilien"), new launchericon(r.mipmap.ic_launcher, "metro"), new launchericon(r.mipmap.ic_launcher, "r...

Android Canvas Gradient -

Image
i try draw on android canvas, , have qwestions.... 1)why shaders result have white , black? there no colors... 2)how set color more 2 points (x,y)? 3)where can find examples show simple combinations of usege? shader1 = new lineargradient(0, 0, 0,barheight,0xff696969 ,0xffffffff, shader.tilemode.clamp); shader2 = new lineargradient(barheight/2, barheight/2, 0,34,0xf0696969 ,0xfff34f5f, shader.tilemode.clamp); composeshader mshader = new composeshader(shader2, shader1, porterduff.mode.multiply); graundpaint.setshader(mshader); canvas.drawroundrect(rectf, 0, 0, graundpaint); you can set more 2 points using this constructor of lineargradient, takes array of colors , corresponding array of positions (between 0 , 1). for simple example using lineargradient, may here .

google app engine - View memcache items in GAE -

Image
trying view items in memcache in gae. https://code.google.com/p/googleappengine/issues/detail?id=7245 http://googleappengine.blogspot.com/2012/08/app-engine-171-released.html these links "namespaces in memcache viewer - admin console supports retrieving memcache values stored in non-default namespace." but still couldn't view item trying different combinations. tried, ns.key, ns_key, key (where ns namespace, key key set in program). use development sdk 1.7.6, go runtime. should enter in search space seen in picture, or best way? this not implemented in development server (but available in production admin console pointer jesse in comment). you should open a new feature request in dev_appserver2 projects. if feel contributing yourself, add support patching: memcache_viewer.html add new <input> field capture namespace. memcache_viewer.py add namespace arg memcache.get call