Posts

Showing posts from January, 2011

excel - No Object Variable Set when using multiple range.find and findnext() -

Image
i trying search persons' name within range.find keep getting run-time error 91 - object variable or block variable not set. happens "rngfound" within "getpaid". sub emailclick() dim lastseasonrow double lastseasonrow = worksheets("season 2014-2015").range("a" & worksheets("season 2014-2015").rows.count).end(xlup).row dim lastseasonemailrow1 double lastseasonemailrow1 = worksheets("email").range("a" & worksheets("email").rows.count).end(xlup).row dim rng range dim rngfound range dim getpaid range dim erroremail string dim colmycol new collection 'our collection j = 2 lastseasonrow set rng = worksheets("email").range("a2:a" & lastseasonemailrow1) set rngfound = rng.find(worksheets("season 2014-2015").cells(j, 1).value) if not rngfound nothing ' if found if doesitemexist(colmycol, rngfound.offset(0, 1).value) = false ...

php - get values from select query and put them into variables -

i'm beginner in php , mysql, want know how can put values got select query variables. for example used mysql query : $req="select type, titre, auteur, abstract, keywords manusrit file='$name';"; $req1=mysql_query($req); i want put value of column type in $type variable , value of auteur in variable called $auteur , same abstract, , keywords. how can this? first of use pdo instead of mysqli . example : $link = mysql_pconnect($hostname, $username, $password) or die('could not connect'); //echo 'connected successfully'; mysql_select_db($dbname, $link); $name = $_post['name']; $query ="select type, titre, auteur, abstract, keywords manusrit file='$name';"; mysql_query("set names 'utf8'", $link); $result = mysql_query($query, $link); //now fetch result , read 1 one while ($row = mysql_fetch_assoc($result)) { //access colmn print $row[...

java - Is it possible to display toString() result in value column in Eclipse debugger? -

Image
is possible display tostring() result in value column in eclipse debugger? by default displays values built-in types , type name + id user types: note, debugger can display tostring() , in separate section (below), not in value column. it possible, if bit clumsy. 1 picture, more thousand words: in preferences, search "detail formatters". optionally define simple return command each type want inspect (if want choose details yourself). then down below, select "show variable details > label variables" (if tostring() enough you) , or "> label variables detail formatters" if want use custom formatters. former makes "type + id" display vanish, tho. simple formatter "not tostring()":

jquery - Jssor image change linked to dropdown menu -

i'm using jssor slider display product images on 1 of sites. i'm using slider thumbnail navigation , products standard implementation works standard. however, there number of products various options chosen drop-down list (each of has it's own specific image). load thumbnails loop through database table , same populate drop-down list. what selection of specific drop-down option trigger same action clicking on relevant thumbnail , load full size image. before added jssor slider product page had used javascript selected index , change main image source way: http://www.scotcrest.com/singleproduct.php?action=more+details&productid=18&productname=clan%20cloot%20tea%20towels (that's current version - without jssor) but i'm not experienced jquery (i'm working php) i'm @ loss how work in jssor functions. i've tried looking @ code triggered on clicking on thumbnail , trying fire on changing select box didn't anywhere. this new versio...

elasticsearch - Multi match query in elastic not matching initial character -

hello trying setup single search box partial searches on fields , standard searches on others. there failing past following hurdle: this index: put /my_index { "mappings": { "blogpost": { "properties": { "firstname": { "fields": { "autocomplete": { "index_analyzer": "autocomplete", "type": "string" }, "firstname": { "index_analyzer": "standard", "type": "string" } }, "type": "string" } } } }, "settings": { "index": { "ana...

ios - Storing class in NSUserDefaults and accessing in next view -

i created swift class called userdetails , below structure: import foundation class userdetailsclass { var fullname: string! var mobile: string! var email: string! var password: string! } in current view controller , create instance , store values want move next view in instance variables shown below: var userdetailsinstance = userdetailsclass() userdetailsinstance.fullname = fullnametextfield.text userdetailsinstance.mobile = mobiletextfield.text userdetailsinstance.email = emailtextfield.text userdetailsinstance.password = passwordtextfield.text var prefs = nsuserdefaults.standarduserdefaults() prefs.setobject(userdetailsinstance, forkey: "currentguest") prefs.synchronize() in next view (where there segue connected, try this: override func viewdidload() { super.viewdidload() // additional setup after loading view. var prefs = nsuserde...

matlab - Function defined as an integral: trapz? -

i want calculate function p of x,y: p(x,y) defined integral of function of x , y: p(x,y) = integral(indefinite) of v(x,y) dx now, if have matrix expressing p on uniform grid x , y , how construct function p (which should matrix). obviously if integrated using trapz , obtain vector: x=linspace(-1,1,10); v=magic(10); p=trapz(x,v); size(p) gives 1 10 , not 10 10. assuming that the formula p defined like: p ( x , y ) = integral[ x 0 .. x ] v ( ξ , y ) d ξ ; the integration grid x × y uniform, norm dx × dy ; the rows of matrix v have x constant, first row corresponding the smallest x ; then integral is: p = cumtrapz(v) * dx;

oop - How to implement an abstract class in Go? -

how implement abstract class in go? go doesn't allow have fields in interfaces, stateless object. so, in other words, possible have kind of default implementation method in go? consider example: type daemon interface { start(time.duration) dowork() } func (daemon *daemon) start(duration time.duration) { ticker := time.newticker(duration) // call daemon.dowork() periodically go func() { { <- ticker.c daemon.dowork() } }() } type concretedaemona struct { foo int } type concretedaemonb struct { bar int } func (daemon *concretedaemona) dowork() { daemon.foo++ fmt.println("a: ", daemon.foo) } func (daemon *concretedaemonb) dowork() { daemon.bar-- fmt.println("b: ", daemon.bar) } func main() { da := new(concretedaemona) db := new(concretedaemonb) start(da, 1 * time.second) start(db, 5 * time.second) time.sleep(100 * time.second) } this won't c...

performance - Android: Navigation Drawer slows down on adding Ongoing Notification -

i had created foreground service. adding ongoing notification in notification drawer. if open navigation drawer on starting service, ui starts lagging. intent contentintent = new intent(this, mainactivity.class); contentintent.setflags(intent.flag_activity_new_task | intent.flag_activity_clear_task); pendingintent pendingintent = pendingintent.getactivity(this,0,contentintent,0); intent stopintent = new intent(this,manager.class); stopintent.setaction(types.action_stop_service); pendingintent stopserviceintent = pendingintent.getservice(this,0,stopintent,0); notification notification = new notificationcompat.builder(this) .setsmallicon(r.drawable.logo) .setlights(0x008080, 100, 500) .setticker(types.noti_title) .setcontenttitle(types.noti_title) .setcontenttext(types.noti_connect_text) .setcontentintent(pendingintent) .addaction(0, "tap here stop", stopservice...

objective c - How to return method object from inside block iOS -

return type of method nsarray, when call method nil or empty array. here it's below method implementation: - (nsarray *)startparsing { __block nsarray *array; allproductsid = [[nsmutablearray alloc] init]; nsstring *string = [nsstring stringwithformat:@"http://%@:@%@",kprestashopapikey, kprestashopurlstring]; nsurl *url = [nsurl urlwithstring:string]; afhttprequestoperationmanager *manager = [[afhttprequestoperationmanager alloc] initwithbaseurl:url]; manager.responseserializer = [afxmlparserresponseserializer serializer]; [manager get:@"categories/21" parameters:nil success:^(afhttprequestoperation *operation, id responseobject) { nsxmlparser *parser = (nsxmlparser *)responseobject; [parser setshouldprocessnamespaces:yes]; parser.delegate = self; [parser parse]; //nslog(@"first response %@", responseobject); (int = 0; i< [[self.xmlshop objectforkey:@"product...

shell - Recursively search directory of binary files for hexadecimal sequence? -

the current commands i'm using search hex values (say 0a 8b 02 ) involve: find . -type f -not -name "*.png" -exec xxd -p {} \; | grep "0a8b02" || xargs -0 -p 4 is possible improve given following goals: search files recursively display offset , filename exclude files extensions (above example not search .png files) speed: search needs handle 200,000 files (around 50kb 1mb) in directly totaling ~2gb. i'm not confident if xargs working 4 processors. i'm having difficulties printing filename when grep finds match since piped xxd . suggestions? if: you have gnu grep and hex bytes search never contain newlines ( 0xa ) [1] if contain nul ( 0x ), must provide grep search string via file ( -f ) rather direct argument. the following command there, using example of searching 0e 8b 02 : lc_all=c find . -type f -not -name "*.png" -exec grep -fhoab $'\x{0e}\x{8b}\x{02}' {} + | lc_all=c cut -d: -f1-2 the...

dns - The computer does not exist on the domain, laptop -

i have been having issue 1 laptop cannot connect our domain anymore. worked until 1 point , of sudden stopped. i took on our dc , computer still registered there blank shell. manually edited attributes match used , did not fix either. tried removing , re-adding computer ad no avail. i had laptop sent office , had @ , worked perfectly. no issue signing in @ all. when sent original issue appeared again. is due wireless connection connected to? or coincidence? thanks. the laptop still connected main domain trying use wireless router it's domain. removing computer domain , putting on resolved issue.

sql - Using case and like statment without duplicate results -

i trying use case , statement. when run below query duplicating results on rows y on particular columns. using sql server 2000. select distinct [rjvn_pound_reference] ,t_reference ,t_street_name ,t_zone_name ,( case when rjvn_note '%correspondence%' 'y' else 'n' end ) correspondencereceived ,( case when rjvn_note '%review form complete%' 'y' else 'n' end ) reviewformcomplete ,( case when rjvn_note '%manually issued nto - drive off%' 'y' else 'n' end ) manuallyissuednto ,( case when rjvn_note '%manually issued ntk - drive off%' 'y' else 'n' end ) manuallyissuedntk ,( case ...

javascript - Uncaught ReferenceError: Factory is not defined -

i trying set sample angular.js project mvc. i had project returning message controller. when tried read webapi factory getting following error @ run time. angulartutorial?v=exngsrzkujrjharmvxi_00qqlywtra533io1lciemd81:1 uncaught referenceerror: homefactory not defined(anonymous function) @ angulartutorial?v=exngsrzkujrjharmvxi_00qqlywtra533io1lciemd81:1 angular.js:11655 error: [$injector:unpr] unknown provider: homefactoryprovider <- homefactory <- homecontroller http://errors.angularjs.org/1.3.15/$injector/unpr?p0=homefactoryprovider%20%3c-%20homefactory%20%3c-%20homecontroller @ regex_string_regexp (angular.js:63) @ angular.js:4015 @ object.getservice [as get] (angular.js:4162) @ angular.js:4020 @ getservice (angular.js:4162) @ object.invoke (angular.js:4194) @ $get.extend.instance (angular.js:8493) @ angular.js:7739 @ foreach (angular.js:331) @ nodelinkfn (angular.js:7738)(ano...

Exception when using UDT in Spark DataFrame -

i'm trying create user defined type in spark sql, receive: com.ubs.ged.risk.stdout.spark.examplepointudt cannot cast org.apache.spark.sql.types.structtype when using example. has made work? my code: test("udt serialisation") { val points = seq(new examplepoint(1.3, 1.6), new examplepoint(1.3, 1.8)) val df = sparkcontextforstdout.context.parallelize(points).todf() } @sqluserdefinedtype(udt = classof[examplepointudt]) case class examplepoint(val x: double, val y: double) /** * user-defined type [[examplepoint]]. */ class examplepointudt extends userdefinedtype[examplepoint] { override def sqltype: datatype = arraytype(doubletype, false) override def pyudt: string = "pyspark.sql.tests.examplepointudt" override def serialize(obj: any): seq[double] = { obj match { case p: examplepoint => seq(p.x, p.y) } } override def deserialize(datum: any): examplepoint = { datum match { case values: seq[_] =...

entity framework - How do I execute a stored procedure that takes a parameter in Code First? -

i have stored procedure takes parameters , run codefirst implementation of ef 6.1.3. particular sp deletes rows table , doesn't return except number of rows deleted. i'm not quite sure how it. let's stored procedure sp_deletetheserows , takes single parameter, @theparam. how look? guess use executesqlcommand. be: mycontext.database.executesqlcommand("exec dbo.sp_deletetheserows @theparam", new sqlparameter("@theparam", usersuppliedparam)); make sure have defined type of command storedprocedure like, cmd.commandtype = storedprocedure;

sharepoint - How to intercept XML parsing errors in JAXB processing of SOAP messages? -

can use jaxb intercept xml parsing inspect payload? i have generated code bindings sharepoint wsdl using java's wsimport tool. i'm calling soap method called getlistitems in sharepoint, generated code doing xml parsing me comes server. that parse failing; it's known issue in sharepoint it's possible users put special characters in things breaks xml sharepoint generating. this stack trace gives hint character reference "&#]) (notice lack of closing double quote there) - best guess right there's non-printable character or funky in xml busting parse. fixing begins knowing more how it's happening. suggestions? com.sun.xml.internal.ws.encoding.soap.deserializationexception: [failed localize] failed deserialize response.(javax.xml.bind.unmarshalexception - linked exception: [javax.xml.stream.xmlstreamexception: parseerror @ [row,col]:[2399,354] message: character reference "&#]) @ com.sun.xml.internal.ws.client.sei.syncm...

xcode - changing one file in swift causes lots of rebuilds -

Image
i'm using xcode version 6.3.2 (6d2102) , have problems compile times... changing 1 swift file causes loooots of files compile - reason or how can debug/track down?

Put Validation on Filename using batch script -

i have bat file eg. test.bat have period attached. example test.bat_mar-15_mar want put validation if first month i.e. mar = second month in file i.e. mar, run test.bat file else generate message - invalid filename. month should match in correct case well. file test.bat_mar-15_apr or test.bat_mar-15_mar treated invalid filename. believe need call test.bat in validation script. regards audi there mistakes in if exist !month1!==!month2! echo true else echo false firstly, mustn't write exist because compare month1 , month2. exist used check whether file exist. these situations different. secondly, must use () if block (echo true). finally, code must like: if !month1!==!month2! (echo true) else echo false and advise see explanation of if. because answer exists in there.

javascript - React ES6 component inheritance: working, but not recommended? -

i'm inheriting es6 react base component in following way: model.js (base component): class modelcomponent extends react.component { render() { // re-used rendering function (in our case, using react-three's reactthree.mesh) ... } } modelcomponent.proptypes = { // re-used proptypes ... }; export default modelcomponent; then have 2 extending components both this: import modelcomponent './model'; class robotretrocomponent extends modelcomponent { constructor(props) { super(props); this.displayname = 'retro robot'; // load model here , set geometry & material ... } } export default robotretrocomponent; ( full source code here ) this appears work fine. both models showing , working expect. however, have read in multiple places inheritance not correct approach react - instead should using composition. again, mixins not supported in react v0.13? so, approach i...

Data attributes with css selectors -

this question has answer here: select elements data attribute in css 4 answers i trying remove div targeting data selector. css [data-id="b5c3cde7-8aa1"] { display:none; } does not work. is possible? you have add attribute div hide it: [data-id="b5c3cde7-8aa1"] { display:none; } <div data-id="b5c3cde7-8aa1">hide me</div>

How to get mongoDB aggregated month wise data using java -

here data in db. "accounts" : [ { "total_credits" : 4000, "total_debits" : 0, "date" : "25-05-2015" }, { "total_credits" : 1000, "total_debits" : 0, "date" : "26-05-2015" }, { "total_credits" : 1000, "total_debits" : 0, "date" : "10-07-2015" }] i want extract sum of total credits , debits month wise. want in java. use aggregation framework following aggregation pipeline (mongo shell implementation): db.ledger.aggregate([ { "$unwind": "$accounts" }, { "$project": { "total_credits" : "$accounts.total_credits", "total_debits" : "$accounts.total_debits", ...

c++ - When is it safe to call this-> in constructor and destructor -

i've not been able find conclusive answer far. when safe call this-> within object. , in particular inside constructor , destructor. and also, when using public inheritance. safe use , downcasting on result of call? so example: class foo { foo(): a(), b(this->a)//case 1 { this-> = 5; //case 2 } int a; int b; }; class bar: public baz { bar(): baz(this)//case 3 - assuming baz has valid constructor { } } and unlikely one foo() { if(static_cast<bar*>(this));//case 4 } which of above cases legal? note: i'm aware lot of practices above inadvisable. within non-static member function, this points object function called on. it's safe use long that's valid object. within body of constructor or destructor, there valid object of class being constructed. however, if base sub-object of derived class, base sub-object valid @ time; it's not safe down-cast , try access members of ...

javascript - How to ease between two y-coordinates? -

for school assignment have make graph in javascript. teacher see animated graphs. build graph tweets in 1 week, cannot find how ease between 2 y-coordinates. you can find project here on jsfiddle , or on website . var canvas = document.getelementbyid('canvas'); var ctx = canvas.getcontext('2d'); var form = document.getelementbyid("form"); var data = []; var huidigeypos = []; var nieuweypos = []; var count = []; var snelheid = 0; function init(){ ctx.fillstyle="rgb(255,255,255)"; ctx.fillrect(0,0,canvas.width,canvas.height); ctx.translate(0, 445); for(var = 0; < 7; i++){ data[i] = form[i].value*30; } draw(); } function draw(){ ctx.fillstyle="rgb(255,255,255)"; ctx.fillrect(0,0,canvas.width,-canvas.height); ctx.beginpath(); ctx.moveto(0,0); for(var = 0; <= 750; += 125){ ctx.lineto(i,-data[i/125]); huidigeypos.push((data[i/125])); } if(huidigeypo...

c# - Drog and Drop TableLayoutPanel in a panel? -

i'm trying drag , drop tablelayoutpanel in panel using winforms/c#, drag of tablelayout works problem tablelayoutpanel droped doesn't appear !! solution please ?? private void registration_load(object sender, eventargs e) { panel2.allowdrop = true; tablelayoutpanel1.allowdrop = true; panel2.dragenter += panel2_dragenter; panel2.dragdrop += panel2_dragdrop; tablelayoutpanel1.mousedown += tablelayoutpanel1_mousedown; } private void panel2_dragenter(object sender, drageventargs e) { e.effect = dragdropeffects.move; } private void panel2_dragdrop(object sender, drageventargs e) { ((tablelayoutpanel)e.data.getdata(typeof(tablelayoutpanel))).parent (panel)sender; } private void tablelayoutpanel1_mousedown(object sender, mouseeventargs e) { tablelayoutpanel1.dodragdrop(tablelayoutpanel1, dragdropeffects.move); } the code inadequate, you'll need @ least set location property of dropped tlp ensure with...

sql - Update query that will set specific columns in a record with values from another record of same table -

look @ query; update user_data set old_status= 'snnnns', user_group='15', default_rate='default', entity_num='1001' user_name='dasu'; i know write query , result, dont want writing values. these values record user_name 'sys' in same table. want query update these particular columns in 'dasu' values 'sys'. any idea? in oracle, can use merge self-join. alternatively, can write correlated subqueries in update : update user_data set (old_status, user_group, default_rate, entity_num) = (select old_status, user_group, default_rate, entity_num user_data user_name = 'sys') user_name='dasu';

javascript - How to write jQuery inside of C# -

i need javascript or jquery inside codebehind in c# works should if place inside div. want script inside if else look @ part id chart2 <div style="position: absolute; top: 0; left: 0; height: 100%; width: 100%; z-index:0; "> <asp:literal id="ltrrenderchart" runat="server"></asp:literal> </div> <div id="chart2"style="position: absolute; top: 0; left: 50%; height: 100%; width: 100%; z-index:-1"> <script>$("#chart2").css("z-index",0);</script> <asp:literal id="ltrrenderchart2" runat="server"></asp:literal> </div> <div style="position: absolute; top: 50%; left: 0; height: 100%; width: 100%; z-index:-1;"> <asp:literal id="ltrrenderchart3" runat="server"></asp:literal> </div> <div style="position: a...

axapta - Getting array from .Net parm method -

i trying use .net class microsoft.visualbasic.fileio.textfieldparser read in csv. problem having value of variable netarray appears being set single string, without values being split separate array entries. idea why happen? int counter, xpparraylength; str xppvalue; str arr[]; system.string[] netarray; system.string[] delimeters = new system.string[1](); microsoft.visualbasic.fileio.textfieldparser parser = new microsoft.visualbasic.fileio.textfieldparser(mypath); delimeters.setvalue(",",0); parser.set_delimiters(delimeters); parser.set_hasfieldsenclosedinquotes(true); netarray = parser.readline(); while(netarray.get_length()) { xpparraylength = netarray.get_length(); for(counter = 1; counter <= xpparraylength; counter++) { xppvalue = netarray.getvalue(counter-1); arr[counter] = xppvalue; } netarray = parser.readline(); } } because textfieldparser.readline() supposed return single string (as documented he...

MySQL: Check if I want to insert an already existing value using JAVA -

i have table column want insert data not existing data. to give example have day column , customer. same customer cannot have same date twice, have customer named karl , on monday. if try add karl monday, when existing on monday, should not that. how do this? assuming using jtextfields type name , day. so far got insert data works (though without checking if it's existing!) s.executequery ("select * customer"); s.executeupdate("insert customer values ('"+name.gettext()+"', '"+day.gettext()+"')"); how check if type in name textfield , day textfield both exist in same row? thanks in advance try this preparedstatement s = connection.preparestatement("select * customer name=? , date=?"); s.setstring(1, name.gettext()); s.setstring(2, day.gettext()); resultset result = s.executequery (); if(result.next()) { // dupilcate records present. don't add } else { // add records table. s.ex...

android - When is SQLiteOpenHelper onCreate() / onUpgrade() run? -

i create tables in sqliteopenhelper oncreate() receive sqliteexception: no such table or sqliteexception: no such column errors. why? note: (this amalgamated summary of tens of similar questions every week. attempting provide "canonical" community wiki question/answer here questions can directed reference.) sqliteopenhelper oncreate() , onupgrade() callbacks invoked when database opened, example call getwritabledatabase() . database not opened when database helper object created. sqliteopenhelper versions database files. version number int argument passed constructor . in database file, version number stored in pragma user_version . oncreate() run when database file did not exist , created. if oncreate() returns (doesn't throw exception), database assumed created requested version number. implication, should not catch sqlexception s in oncreate() yourself. onupgrade() called when database file exists stored version number ...

c++ - no viable conversion from 'value_type' (aka 'char') to 'string' (aka 'basic_string<char, char_traits<char>, allocator<char> >') -

string convert(string name) { string code = name[0]; ... } i "no viable conversion 'value_type' (aka 'char') 'string' (aka 'basic_string, allocator >')" line. if change to: string convert(string name) { string code; code = name[0]; ... } then works. can explain why? class std::string (correspondingly std::basic_string) has assignment operator basic_string& operator=(chart c); and assignment operator used in code snippet string convert(string name) { string code; code = name[0]; // using of assignment operator ... } however class not has appropriate constructor write string code = name[0]; you can write either like string code = { 1, name[0] }; or like string code( 1, name[0] ); using constructor basic_string(size_type n, chart c, const allocator& = allocator());

How to create a MONGODB data source in weblogic -

Image
i new weblogic , trying setup new data source connect mongodb in weblogic. driver.classname: jdbc:mongodb:server=10.10.10.1;port=27017;database=test; url:jdbc:mongodb i not sure add mongodb jar weblogc can find jar. weblogic installation path is: c:\oracle\middleware\wlserver_12.1 can suggest how connect mongodb succesfully??? add jar in /lib folder in domain folder.

r - return column index condition on column names -

i have data frame named dat . has columns prefix vix . eg. date, vo, vix2, vix3, vix4, ... vix24, other columns in case, start = which(names(dat) == "vix2") end = which(names(dat) == "vix24") but problem is, don't know number arrangement after vix . in case, there way return start , end ? you can try range(grep('vix', names(dat))) suppose if columns not consecutive v1 <- c('date', 'vix2', 'v0', 'vix3', 'v5', 'vix4') range(grep('vix', v1)) #[1] 2 6 will give first , last entry 'vix', if going subset dataset 'vix' columns, don't need range , grep enough grep('vix', v1) #[1] 2 4 6

python - linux - starting a thread immediately -

here's example code while true: #main-loop if command_received: thread = thread(target = doitnow) thread.start() ...... def doitnow(): some_blocking_operations() my problem need "some_blocking_operations" start (as command_received true). since they're blocking can't execute them on main loop , can't change "some_blocking_operations" non-blocking either for "immediately" mean possible, not more 10ms delay. (i once got whole second of delay). if it's not possible, constant delay acceptable. (but must constant. few milliseconds of error) i'm working on linux system (ubuntu, may 1 in future. linux) a python solution amazing.. different 1 better nothing any ideas? in advance from threading import thread class worker(thread): def __init__(self, someparameter=true): thread.__init__(self) # how "send" parameters/variables # thread on start-up threa...

MQTT: Message queuing at server side -

i using mqtt implement 1 of kind of email notification system. planning use trigger notifications inside webapp. confused between whether mqtt stores data @ server side when throw on mqtt url publisher id in json format? reason asking because in case, mqtt stores last thrown data, if send 1 previous 1 disappeared. want know present @ mqtt side birth(as mq stands message queuing) & haven't used or need implemented @ server/consumer side? there common error on internet ... mqtt stands mq telemetry transport , not message queueing telemetry transport. created ibm (with eurotech) , part of mq products family in ibm. mqtt hasn't queue. broker receives message on topic , forwards on subscribers on topic. there 2 main variations on behaviour: if publisher send message "retain" flag active, broker store message (only this). if client subscribes topic, broker sends last storage message. it's called "last known message" if subscriber connects ...

How to Fetch Dynamic input field array items value with different name php mysql? -

i have form below: <form id="bookform" method="post" class="form-horizontal"> <div class="form-group"> <label class="col-xs-1 control-label">book</label> <div class="col-xs-4"> <input type="text" class="form-control" name="book[0].title" placeholder="title" /> </div> <div class="col-xs-4"> <input type="text" class="form-control" name="book[0].isbn" placeholder="isbn" /> </div> <div class="col-xs-2"> <input type="text" class="form-control" name="book[0].price" placeholder="price" /> </div> <div class="col-xs-1"> <button type="button" class="btn btn-default addbutton"><i class="fa fa-plus"...

angularjs - Destroy angular $http success/error snippets after route change -

the issue can seen here: http://embed.plnkr.co/qcw1ya/ i run route1 , have $timeout function. switch route2, delayed code route1 shows up. want destroy code running in $timeout function, in real case scenario $http service request , shows error messages previous routes. solution here is: clean after ourselves. best practices ... add teardown code controllers , directives controller , directives emit event right before destroyed. given opportunity tear down plugins , listeners , pretty perform garbage collection. subscribe $scope.$on('$destroy', ...) event so, instead of (there a updated plunker ) controller: function($timeout) { $timeout(function() { alert("hey i'm message route 1!"); }, 5000) } we should this: controller: function($scope, $timeout) { var removetimer = $timeout(function() { alert("hey i'm message route 1!"); }, 5000) $scope.$on('$destroy', functi...

image - Python: os.system() redirecting stdout to file in home directory fails -

i used following command : os.system('scanimage > ~/test.pnm') but can't find image. any suggestions? maybe ~ not expanded. try os.system("scanimage > $home/test.pnm") and os.system("scanimage > /tmp/test.pnm") or if running different unix user (root) home not expect.

objective c - iOS UITableView header with sticky menu -

Image
i want create uitableview collapsable view on top , sticky menu. show mean made 3 images: i thought make uitableviewcontroller , place view above table dont know how implement sticky menu. whats best way accomplish that? don't use uitableviewcontroller , won't able add besides table view. you should use standard uiviewcontroller , top view housing sticky menu, , uitableview below it. you can open/close menu using autolayout: sticky menu has "fixed height" constraint, , table view has no "top" constraint, "vertical spacing" constraint between sticky menu , itself. just animate constant "height" constraint of menu have collapse/expand animation.

grails - Evaluating a path in json from groovy - list elements are no longer returned as string -

i've got tests api within framework written in grails, , part of tests evaluate paths in json @ run-time. the json looks bit (really hope i've got brackets right!): {"someid":"big id here", "structure": [ {"name": "item1", "questions":[ {"name":"question1","answers":["i cake"]} ] } ] } it's read in via: json.parse(this.response.tostring()) i evaluate paths using eval.x(jsonvariable, 'x.' + pathvariable) where pathvariable example path below. problem occurs when try return/check list. an example path is structure.find{it['name']=='item1'}.questions.find{it['name']=='question1'}.answers a couple of days ago happily on grails 2.2.4 , worked fine. got back ["i cake"] i've upgraded 2.3.2 , get [i cake] i've checked api directly it's s...

powershell script to copy files from windows to multiple linux systems -

i trying copy file windows multiple linux machines using powershell script. list of machines read txt file. tried using pscp copy not work. issue here? there better way of doing this? thanks $list = get-content c:\list.txt foreach($host in $list) { start-process 'c:\program files (x86)\putty\pscp.exe' -argumentlist ("-scp -pw mypasswd c:\patch.sh root@$host:/root/") } in addition @obfuscate's note, $host reserved, read-only varible, might have issues root@$host:/root/ because of colon. colon namespace identifier variables. if need follow variable literal colon, should use curly braces. try: $list = get-content c:\list.txt foreach($remotehost in $list) { start-process 'c:\program files (x86)\putty\pscp.exe' ` -argumentlist ("-scp -pw mypasswd c:\patch.sh root@${remotehost}:/root/") }

Java socket, client hangs when get input from server output -

i have socket in client connects server send , receive string, uses writeutf() , readutf() read , write socket, when write string client socket , read them on server it's work. when server receive string socket , write "flag" socket read them on client client hang @ read line. here code. server public void run(){ datainputstream input = null; try{ output = new dataoutputstream(socket.getoutputstream()); input = new datainputstream(socket.getinputstream()); while((true)&&(this.active)){ string receive = input.readutf(); string[] str = receive.split("@"); if (str[0].equals("get_list")){ output.writeutf("flag"); } } }catch(ioexception ex){ } client public void run(){ dataoutputstream output = null; try{ output = new dataoutputstream(socket.getoutpu...

Capture the URL in the javascript initiated HTTP GET/POST requests using selenium -

i'm using selenium automating procedure use on site. when press on specific element on site runs complex javascript code downloads csv file using http request. can see url of request looks like: www.somesite.com/somepage.php? token=rapo09834hrolq340hgie309w &.... my question is: how can token in url selenium? (i need executing other http requests extracting more data site) i using firefox driver on windows. i tried search html, js, cookies site, token not there. (its generated javascript code before http request) i understand kind of session id token javascript generated http requests using same token during session.

android - MapFragment zero height upon landscape orientation -

i have android activity map fragment , couple of text views , linear layouts <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <textview /> <textview /> <fragment android:id="@+id/map" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" class="com.google.android.gms.maps.mapfragment" /> <textview /> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="hor...

node.js - Heroku deployment, git remote not added -

i'm new heroku, trying follow "getting started nodejs tutorial" , got stuck @ " deploy app " stage. when run "heroku create" not "git remote heroku added". realized missing after trying "git push heroku master" step , getting "fatal: not git repository (or of parent directories): .git". did wrong? please following command enter: git init after can git push heroku master again

javascript - How To Get Masonry and ImagesLoaded To Work With Wordpress -

some 4 hours after 20 minutes expected take set masonry new wordpress themes i've decided i'd better ask help. i have masonry working fine imagesloaded in html mockup sites, here stripped down html code. <!doctype html> <html> <head> <meta charset="utf-8"> <script src="imagesloaded.pkgd.min.js"></script> <script src="masonry.pkgd.min.js"></script> </head> <body> <div class="masonry-container js-masonry" data-masonry-options='{ "isfitwidth": true }'> <div class="block-wrapper">content</div> <div class="block-wrapper">content</div> <div class="block-wrapper">content</div> </div><!-- end masonry-container js-masonry --> <script> var container = document.queryselector('.masonry-container'); var msnry; // initialize masonry after images have l...