Posts

Showing posts from May, 2011

web services - SOAP response Error using WSDL in php -

i using soap call wsdl file, getting below error.. below error soapfault exception: [a:internalservicefault] object reference not set instance of object. in /opt/projects/php/dev1/sopadatatest.php:40 stack trace: #0 /opt/projects/php/dev1/sopadatatest.php(40): soapclient->__call('accountsignup', array) #1 /opt/projects/php/dev1/sopadatatest.php(40): soapclient->accountsignup(array) #2 {main} $url = "signup.wsdl"; $data = array( "signupinformation" => array("accountname" => "secret", "affiliateid" => "secret", "comment" => "secret", "currencycode" => "secret", "dba" => "secret" ), "primarybankaccountinformation" => array("accountname" => "external",

windows - Batch setting REM as variable to make code look different -

lately started comment lines double :: , i'm aware of problems can make in long "for" or "choice" scripts , issues "goto" described what :: (double colon) mean in dos batch files? so i'm wondering if it's ok set variable rem , use it? i've seen somewhere in little cmd script, , liked it, since making batch code looks clearer me. wonder if wont create problems? @echo off set #=rem %#% show date echo it's %date% %#% let's wait few seconds... ping 1.1.1.1 > nul echo , it's %date% %#% whatever exit that no problem, what-so-ever. the variable serving macro, , use technique (though not remarks). batch parser expands code within variable prior interpretation of logic of code, functions hope/expect. there sophisticated technique create batch macros take arguments. post @ http://www.dostips.com/forum/viewtopic.php?f=3&t=2518 describes ultimate syntax, , http://www.dostips.com/forum/viewtopic.php?t=1827 sh

c++ - Idioms for effecively-runtime defined types, domain restrictions on interoperations -

strictly speaking types compile-time constructs in c++. there times constant runtime characteristics of object defined runtime type. for example, if 1 has geometrical vector, where, due framework restrictions dimension known @ runtime (otherwise make dimension template parameter), example read file. the fact dimension runtime, doesn't mean 1 should able compare, assign or combine vectors different dimension. if 1 wants introduce logic code, 1 have restrict bunch of operations. can done asserts or throwing, @ runtime. so, example, 1 implement this, class vec{ std::vector<double> impl_; public: vec(std::size_t size) : impl_(size){} bool operator==(vec const& other) const{ if(impl_.size() != other.impl_.size()) throw std::domain_error("cannot compare vectors of different size"); return std::equal(impl_.begin(), impl_.end(), other.impl_.begin()); } bool operator<(vec const& other) const{ if(impl_.s

osx - Distinguish things like .app/.xcodeproj and actual folders in Cocoa -

i trying build alternative file manager works similar default finder in cocoa. as can imagine, app needs show list of files/subfolders in directory, , when user click on item, checks whether it's folder or file user has clicked. if it's folder, app shows content of folder. if it's file, opened default application. i used nsfilemanager.file​exists(at​path:​is​directory:​) determine if item @ path folder. works in cases, things something.app or project.xcodeproj , considered directories according method. i know it's true technically folders, there way in cocoa distinguish them actual folders? use (ns)url . get values resource keys isdirectorykey , ispackagekey via resourcevalues(forkeys . in case of bundles ispackage true .

How to define email address with Jmeter user defined variables? -

Image
problem: in email address @ replaced %40. http header manager: user defined variables: http request: and result tree: i have researched this, , that, if http method post, should encoded automatically. not encoded automatically. advice, how can resolve this? note: jmeter version : 3.1 , trying test rest service. please try sending data in body data instead of sending in parameters.

oop - Finding an object with a certain property value in an array of objects in MatLab? -

i have class follows class car properties index price color end end i created array of these objects , added several cars array. cars have unique index. want find car in array index 5. how can this? you can 1 of 2 ways: create array indices , compare against 5 yield logical array can use index array grab ones meet criteria. item = obj_array([obj_array.index] == 5) use findobj locate object in array particular property/value pair (note works if using handle class , not value class) item = findobj(obj_array, 'index', 5)

php - Detect Category ID=4 in Joomla and show div -

i detect category id=4 , apply if/else add div display contents. <?php if (jrequest::getvar('view')=='categories' && jrequest::getvar('id')==4) { ?> <?php } ?> how achieve this? want show if article belongs category 4 else show div. imagining 2 different div <div class="category4">text here</div> <div class="categoryxxx">text here</div> do note <?php echo $this->item->catid;?> shows correct category id. apply if , else statement using catid==9 or something. not @ php. you can put directly html code, avoiding echo . may useful when html code sizeable. <?php if ($this->item->catid == 4): ?> <div class="category4">text here</div> <!--- other html code ---> <?php else: ?> <div class="categoryxxx">text here</div> <!--- other html code ---> <?php endif; ?>

javascript - how to add ellipsis to a String inside button angularjs -

i know how add ellipsis string inside button in given plunkr example. button width should 50px. https://plnkr.co/edit/7puz8a52fqs3ix9n4zx0?p=preview html: <html> <head> <script src="angular.min.js"></script> <script src="script.js"></script> <link rel="stylesheet" href="tree.css"/> <link rel="stylesheet" href="font-awesome.min.css"/> <link rel="stylesheet" href="bootstrap.min.css" /> </head> <body data-ng-app="testapp" data-ng-controller="button"> <hr> <button type="button" class="btn btn-success" data-dismiss="modal" data-ng-click="save()">savefilter</button> <button type="button" class="btn btn-default" data-dismiss="modal" data-ng-click="delete()"

How to Subtract Time in Rails? -

i'm new ruby , rails. have time type column in db stores user time inputs form. <div class="col-md-12"> <%= form_for(gotime.new) |f| %> <%= f.time_select :hours%> <%= f.submit "submit" %> <% end %> </div> i need subtract x minutes gotime.last new time. seems in order need somehow set gotime starting time count Х minutes back. how can this? idea correct or should done other way? if have time column gotime.last.time - 3.minutes if have hours , minutes column , want subtract time minutes : obj = gotime.last time = datetime.now.change({ hour: obj.hours, min: obj.minutes, sec: 0 }) time - 3.minutes if have date time can replace datetime.now it

java - createDataFrame() throws exception when pass javaRDD that contains ArrayType column in SPARK 2.1 -

i want create dataframe(aka dataset<row> in spark 2.1) createdataframe () , works when pass list<row> param, throws exception when pass javardd<row> . [code] sparksession ss = sparksession.builder().appname("spark test").master("local[4]").getorcreate(); list<row> data = arrays.aslist( rowfactory.create(arrays.aslist("a", "b", "c")), rowfactory.create(arrays.aslist("a", "b", "c")) ); structtype schema = new structtype(new structfield[]{ datatypes.createstructfield("col_1", datatypes.createarraytype(datatypes.stringtype), false) }); when try code works well ss.createdataframe(data, schema).show(); +---------+ | col_1| +---------+ |[a, b, c]| |[a, b, c]| +---------+ but when pass javardd 1st param throws exception javardd<row> rdd = javasparkcontext.fromsparkcontext(ss.sparkcontext()).parallelize(data); ss.createdataframe(

rest - Vue-resource can't get response body when HTTP error 500 -

i'm trying handle http 500 error using vue-resource (1.2.1) way: const resource = vue.resource('items'); resource.get().then( (response) => { // response.body }, (error) => { // error.body, // if http status code 500. // it's null... } ); there nothing in error.body , while actual server's response have say... , want data displayed in cool way app's users aware of what's going on (rather opening dev tools , inspect network's response data). is there i'm missing in vue http config? or maybe server-side, api needs respond in specific way? or respond special headers? or, limitation (or bug) of vue-resource? edit here content of error , picked console.log: response { body: "", bodytext: "", headers: headers…, ok: false, status: 0, statustext: "", url: "http://my.domain/items", data: "" } and, content of actual server respons

c# - Linq many to many selection -

Image
i have 2 tables many many relationship, in post-detail page want show related posts, related posts post have @ least category of current post. how can select related posts of current post? tried code , it's not want: [childactiononly] public partialviewresult getrelatedpost(int id) { var relatedposts = _db.posts.select(x => new { x.id, x.title, x.slug, x.image, x.isactive,x.posttype,x.postcategories }) .where(x => x.isactive && x.id != id && x.postcategories.intersect(_db.postcategories).any()) .orderbydescending(x => x.id).take(20) .tolist(); } update: solve problem code: var posts = _db.posts.select(x => new { x.id, x.title, x.slug, x.image, x.isactive,x.posttype,x.postcategories }) .where(x => x.isactive && x.id != id && x.postcategories.intersect(_db.postcategories.where(y=>y.posts.any(p => p

python - How do I group colours (Blue, Green, Purple, Red) from a csv file when the syntax (iePURPLE or PURPAL) is wrong? -

how group colours (blue, green, purple, red) csv file (50000 rows, example below) using python when syntax (ie. case, spelling - purple or purpal) wrong in several cases? can give blue 5642 purpal 5640 red 5610 blue 5583 red 5541 green 5523 purple 5503 green 5491 red 5467 ...... you going need clean data. unique whatever situation data in, if trying identify misspelled color names perhaps filter dataframe show not blue, green, purple, or red. you following identify misfits , figure out how fix them. df.color = df.color.str.lower() colors = ['blue', 'red', 'purple', 'green'] misspellings = df.color[~df.color.isin(colors)].values print(misspellings) ['purpal'] from there individually fix each entry or write intelligently fix them. it's once you've done can group normal. fix entry or entries 'purpal' like: df.loc[df.color == 'purpal', 'color'] = 'pu

c# - How to trigger FocusVisualStyle by clicking on a button? -

here questions : is possible trigger focusvisualstyle when click event of button occurs ? is possible make button not have focusvisualstyle ? i found kind of answer second question. i assigned new focusvisualstyle button below, , deleted rectangle control in controltemplate controltemplate empty. i appreciate if have better way or if can answer first question. <window.resources> <style x:key="myfocusvisualstyle"> <setter property="control.template"> <setter.value> <controltemplate> <rectangle stroke="red" strokethickness="1" margin="-2"/> </controltemplate> </setter.value> </setter> </style> </window.resources> <button x:name="button" content="button" horizontalalignment="center" verticalalignment="center" width=&

c++ - Handling multiple client sockets with SFML -

i trying write networking part of little multiplayer game, , facing problem store tcp sockets are, in sfml, non-copyable (i beginner in c++). i have 3 classes : server , client (a server-side class used store informations connecting client) , clientmanager , in charge of storing clients , giving them ids, etc. clientmanager.h class clientmanager { public: clientmanager(); std::map<int, net::client*> getclients(); int attribid(); void addclient(net::client *client); sf::tcpsocket getclientsocket(int id) throw(std::string); void setclientsocket(int id, sf::tcpsocket); private: std::map<int, net::client*> m_clients; std::map<int, sf::tcpsocket> m_clientsockets; std::vector<int> m_ids; int m_lastid; }; what planned originally, when client connects, : void net::server::waitforclient() { while(true) { if(m_listener.accept(m_tcpsocket) != socket::done) {

node.js - Recover an object requested with MongoDB Driver on node JS -

i try recover object mongo db database, in node js file , doesn't work. in file called db.js , have made following code : var mongoclient = require('mongodb').mongoclient; module.exports = { findincoladsl: function() { return mongoclient.connect("mongodb://localhost/sdb").then(function(db) { var collection = db.collection('scollection'); return collection.find({"type" : "adsl"}).toarray(); }).then(function(items) { return items; }); } }; and, try use in file server.js : var db = require(__dirname+'/model/db.js'); var collection = db.findincoladsl().then(function(items) { return items; }, function(err) { console.error('the promise rejected', err, err.stack); }); console.log(collection); in result have "promise { }". why ? i want obtain object database in order manipulate in others functions situated in server.js file. then then function called o

javascript - Trigger is not working in jquery -

<div id="divuploadpic"> <form name="uploader" method="post" action="upload.php" enctype="multipart/form-data"> <input type="file" name="uploadedpic" id="uploadedpic" style="display: none;" /> <input type="submit" name="submituploadedpic" id="submituploadedpic" /> </form> </div> <script> $(function(){ $("#divuploadpic").click(function(){ $("#uploadedpic:hidden").trigger('click'); }); }); </script> i have hidden input file tag , onclicking div , should triggered.$("#divuploadpic").click(function() works fine trigger not working here. how resolve it? for suggestion: better use label tag instead of div perform without js <label id="divuploadpic" for="uploadedpic">click <form name=&q

spring - Partition step remains in started state with multiple nodes -

spring integration working fine on single node cluster. partitionstep not getting completed , remains in started state forever when deploy our application on multiple nodes. seems partitionstep waiting in receive method , never marks step completed. below configuration using. there way start aggregator on master node only? master configuration: <bean id="jnditemplate" class="org.springframework.jndi.jnditemplate"> <property name="environment"> <props> <prop key="java.naming.factory.initial">weblogic.jndi.wlinitialcontextfactory</prop> <prop key="java.naming.provider.url">t3://localhost:7001</prop> </props> </property> </bean> <bean id="connectionfactory" class="org.springframework.jndi.jndiobjectfactorybean"> <property name="jnditemplate" ref="jnditemplate" /> &l

php - How can you determine which submit button was pressed, when the name attributes are in an array? -

echo "<form action='edit.php' method='post'>"; while ($display = mysqli_fetch_assoc($newarticles)) { .... echo "<input type='submit' class='col-sm-offset-5 btn btn-default' name='delete[]' value='delete article'>" . "<input type='submit' class='col-sm-offset-1 btn btn-default' name='edit[]' value='edit article'>" ."<br/>" .... } echo "</form> after iterations finished end several panels have both delete , edit buttons inside. searching solutions on how distinguish between names, , found add them in array. have unique values of name attributes. here comes question - how can determine 1 of them pressed? should go different approach? p.s. new php excuse me bad formatting , coding. when clicking on submit-button, clicked sub

javascript - show currency in slider issue -

i'm using slider, works fine this: {literal} <script> $( function() { $( "#slider-revenue-max" ).slider({ range: "max", min: 0, max: 10000, step: 100, value: {/literal}{if $revenue == ''}0{else}{$revenue}{/if}{literal}, slide: function( event, ui ) { $( "#revenue" ).val ( ui.value); } }); $( " #revenue" ).val("£" + $( "#slider-revenue-max" ).slider( "value" ) ); } ); </script> {/literal}` but when moving slider, "£" doesn't show, did this: {literal} <script> $( function() { $( "#slider-revenue-max" ).slider({ range: "max", min: 0, max: 10000, step: 100,

c++ template specialization and number of template arguments -

i have started learning templates, going through example typelist implemented , saw implementation of length method typelist. template <class tlist> struct length; template <> struct length<nulltype> { enum { value = 0 }; }; template <class t, class u> struct length< typelist<t, u> > { enum { value = 1 + length<u>::value }; }; my question primary length template has 1 parameter (tlist) specialization has 2 parameters. how possible, read in other places specialization have less number of parameters the first : template <> struct length<nulltype> is full specialization, second: template <class t, class u> struct length< typelist<t, u> > is partial specialization. with full specialization give exact type on specialize. partial specialization allow types adheres restrictions, in case ability create type : typelist<t, u> , 2 template type arguments must provided. for more deta

ruby - Upgrading rubygems not working -

i wanted upgrade rubygems , did following c:\>gem install --local c:\rubygems-update-2.6.10.gem c:\>update_rubygems gem install worked fine when update_rubygems get the system cannot find path specified. i not sure path picking , where. pointers this? you need update $path variable include path ruby's bin directory. can add path using along lines of: set path=%path%;c:\ruby200-x64\bin just replace ruby200-x64 path bin directory

java - Libgdx - Desktop Application doesn't launch -

i'm trying start libgdx project in intellij. used libgdx setup generate project , imported in intellij desktop application doesn't run. runs fine, no error or exception there no game window @ all. the application declared few seconds running terminates without sign of error exit code -1073740791 (and no lwgjl window of course). this code: package com.game.pole.desktop; import com.badlogic.gdx.backends.lwjgl.lwjglapplication; import com.badlogic.gdx.backends.lwjgl.lwjglapplicationconfiguration; import com.game.pole.game; public class desktoplauncher { public static void main (string[] arg) { lwjglapplicationconfiguration config = new lwjglapplicationconfiguration(); config.title = "game"; config.usegl30 = false; config.width = 480; config.height = 320; new lwjglapplication(new game(), config); } } and applicationclass: package com.game.pole; import com.badlogic.gdx.applicationadapter; import com.badl

angular - How can I get a parameter from the URL in my components constructor using ActivatedRoute -

i in constructor: this.articleslug = _route.url._value[1].path; but typescript doesn't it: property: "_value" not exist on type observable<params> is there cleaner way? i'm using angular 4 typescript , webpack. this when use: _route: activatedroute in contructor. you need subscribe on route , extract callback function. like: _route.url.subscribe(values: urlsegment[] -> /* url segments available in values array */) // or if need url parameters _route.params.subscribe(params: params -> console.log(params['paramname']));

ios - Calling swift function from objective c gives linker error -

i trying call swift function objective c file. swift function implementation: @objc class fxformvariables : nsobject { class func fxfontname() -> string { return fontname } class func fxfontsize() -> cgfloat { return fontsizelarge } class func fxhiddencell() -> nsarray { return hiddenelementfromformindex nsarray } } objective c: nsarray *hidearray = [fxformvariables fxhiddencell]; if ([hidearray containsobject:@(cellindexpath)]){ return 0.0; } linker error in buildtime: undefined symbols architecture x86_64: "_objc_class_$__ttcc13social_engine11appdelegate15fxformvariables", referenced from: objc-class-ref in fxforms.o ld: symbol(s) not found architecture x86_64 clang: error: linker command failed exit code 1 (use -v see invocation) this code works fine in xcode 7.3 after upgrade 8.3 start throwing linker error. please help. in advance. import file named project name appending -swift.h in objective-c file p

python - Django - How to access elements in list by parent loop counter in template -

i have code {% time in listoftimes %} {% booking in someotherlist.forloop.parentloop.counter0 %} {{ booking }} {% endfor %} {% endfor %} the booking variable not printed. think because cannot access someotherlist using forloop counter. how booking value? assuming data follows: listoftimes = ['time1', 'time2'] someotherlist = [['booking1', 'booking2'], ['booking3', 'booking4']] then in template can this: {% time in listoftimes %} {% booking in someotherlist|get_index:forloop.counter0 %} {{ booking }} {% endfor %} {% endfor %} notice get_index filter in above code, need write custom filter in app templatetags : from django import template register = template.library() @register.filter def get_index(l, i): return l[i] note: 2 list should of same size, otherwise indexerror might raised.

javascript - JS for loop showing only last value (Not iterating whole values) -

function addmsg(type, msg) { if (type = 'new') { $('#ntfcn').html(type); var notify = ["new message", "new mail", "new event", "new assignment"]; var i; (i = 0; < notify.length; i++) { $('#ntfcn_msg').html("<a href='employee-dashboard.jsp' id='' class='msg_show'><div class='media-body'><h6 class='media-heading'>" + notify[i] + "</h6></div></a>"); } } } this line overwrites what's in ntfcn_msg element on each loop iteration: $('#ntfcn_msg').html("<a href='employee-dashboard.jsp' id='' class='msg_show'><div class='media-body'><h6 class='media-heading'>" + notify[i] + "</h6></div></a>"); you mean have meant append : $('#ntfcn_msg').app

covariance - ANOVA output incorrect -

i'm working through large dataset include different trawl sites , species abundance , biomass. i'm trying run anova each site looking @ abundance factor of biomass (i'm trying find significance of sediment type on biodiversity). far, has worked me on 1 site i'm getting following result: laov<-(abundance~biomass) > summary(laov) length class mode 3 formula call can point me in right direction please? i'm still getting head around r gentle me! also, other advise on tests might interesting run data appreciated! thank you.

Google Chrome Extensions - Not Searchable -

Image
my first chrome extension worked fine when first made, search on google or chrome app store , first or second. week ago disappeared google searches, thing can find when searching in google report abuse page. convenient right? here link extension . i wasn't bothered issue until created next extension, paid time. right get-go after publishing wouldn't appear in chrome store searches or google searches. way click direct link. convenient right? here link extension . if has tips please let me know. or if there chrome staff out there, please me out :}. it shows first me. maybe account/computer. try searching on public or not-yours computer see.

javascript - Why does navigator.geolocation.getCurrentPosition() returns different coordinates even while standing at the same location? -

i have created app used calculate distance. works saving starting location , evaluates distance of current position position using logic working fine. problem navigator.geolocation.getcurrentposition() returns me varying coordinates while standing @ same point, coordinates range distance of 30 meters exact location. can suggest how can exact coordinates? did try enablehighaccuracy true ? var options = { enablehighaccuracy: true, timeout: 5000, maximumage: 0 }; function success(pos) { var crd = pos.coords; console.log('your current position is:'); console.log(`latitude : ${crd.latitude}`); console.log(`longitude: ${crd.longitude}`); console.log(`more or less ${crd.accuracy} meters.`); }; function error(err) { console.warn(`error(${err.code}): ${err.message}`); }; navigator.geolocation.getcurrentposition(success, error, options); source: https://developer.mozilla.org/en-us/docs/web/api/geolocation/getcurrentposition

How can I change the scale of a 3D Object and the Audio Source's radius in a proportionally way in Unity 5 using C#? -

i'm using array multiply 3d object randomly in space, i'm getting lot of nice objects floating randomly on y, x , z axes. object has audio source sound attached it, means after applying random-array-positioning different objects different audio sources well. the problem i'm changing scale of objects, it's working super well, size/scale/radius of audio source it's not changing @ all. how can change scale of objects , change size/scale/radius of audio source @ same time, match both equally or proportionally in size? i'm looking here can't figured out. https://docs.unity3d.com/scriptreference/audiosource.html this code i'm using for: using system.collections; using system.collections.generic; using unityengine; public class multipleobjectsgrandes : monobehaviour { public gameobject prefabgrandes; public gameobject[] gos; public int cantidad; public float minscaleobj; public float maxscaleobj; void awake() { gos = new gameobject[ca

javascript - detect ctrl key pressed or up, keypress event doesn't trigger -

i see similar questions here (like javascript: check if ctrl button pressed ) problem event triggering. js code: // listen keyboard. window.onkeypress = listentothekey; window.onkeyup = listentokeyup; /* gets key pressed , send request associated function @input key */ function listentothekey(e) { if (editflag == 0) { // if delete key pressed calls delete if (e.keycode == 46) deletenode(); // if insert key pressed calls add blank if (e.keycode == 45) createblank(); if (e.keycode == 17) ctrlflag = 1; } } the event triggers other keys except ctrl . need trigger ctrl . can't use jquery/prototype/whatever solutions not acceptable. so... how can detect ctrl ? try using if (e.ctrlkey) . mdn: event.ctrlkey

sql - Deleting rows without CASCADE DELETE? -

i have database in sql server, have 1 table customers, , each customer can have multiple bookings, booking can belong 1 customer. point have written api , client side app using wpf, noticed cannot delete customer without deleting associated bookings customer. t-sql looks roughly: set ansi_nulls on go set quoted_identifier on go create table [dbo].[customer]( [id] [int] identity(1,1) not null, [fullname] [nvarchar](50) not null, [dateofbirth] [date] not null, [phone] [nvarchar](20) not null, primary key clustered ( [id] asc )) set ansi_nulls on go set quoted_identifier on go create table [dbo].[booking]( [id] [int] identity(1,1) not null, [amount] [decimal](10,2) not null, [customerid] [int] not null, primary key clustered ( [id] asc )) alter table [dbo].booking check add constraint [fk_booking_customer] foreign key([customerid]) references [dbo].[customer] ([id]) go alter table [dbo].[booking] check constraint [fk_booking_customer] go then,

java - Customize String serialization with hibernate 5 -

i'm using spring boot 1.4.2.release hibernate 5.0.11. i have entity on have field must persist depending on field. let's entity it's this: package com.forty2apps.entity; import javax.persistence.column; import javax.persistence.convert; import javax.persistence.entity; import javax.persistence.generatedvalue; import javax.persistence.generationtype; import javax.persistence.id; import javax.persistence.table; import java.io.serializable; import lombok.builder; @builder @entity @table(name = "max_power") public class maxpower implements serializable { @id @generatedvalue(strategy = generationtype.identity) @column(name = "id") private long id; @column(name = "problematic_field") private string problematic_field; @column(name = "charset", nullable = false) private string charset; } i have write problematic_field byte_array bypass table encoding. first try using converter, using annotation

html5 - Adding SVG as <object> in Ruby on Rails -

i trying friend game project. using svg graphics in rails. problem when attempt add svg graphics using rails image helper fails render, i'm told chrome problem , need use <object> tag instead of <img> tag. also, seems it's not possible manipulate svg javascript when svg file sourced <img> tag, whole reason me wanting use svg. however, i'm not sure how use rails asset pipeline correctly when not utilising helper functions (there doesn't seem 1 objects of sort). can foresee manual referencing causing sorts of problems once hit production server... inform me correct way this?

python - How to getText of an element from a search result using Selenium Webdriver -

i trying pick url search results on tripadvisor.com using element efforts have been unsuccessful. here code: from selenium.webdriver.common.keys import keys selenium import webdriver selenium.webdriver.support.ui import webdriverwait selenium.webdriver.common.by import selenium.webdriver.support import expected_conditions ec import time driver = webdriver.chrome() base_url = 'https://www.tripadvisor.in/' driver.get(base_url) hotel = webdriverwait(driver, 10).until(ec.presence_of_element_located((by.id, 'mainsearch'))) #hotel = driver.find_element_by_id("mainsearch") hotel.send_keys('the leela palace') time.sleep(0.5) loc = webdriverwait(driver, 10).until(ec.presence_of_element_located((by.id, 'geo_scoped_search_input'))) #loc = driver.find_element_by_id("geo_scoped_search_input") loc.send_keys('new delhi, india') time.sleep(0.5) search = webdriverwait(driver, 10).until(ec.presence_of_element_located((by.id, 'sear

kubernetes go client patch example -

after searching i'm unable find golang kube client example performs @ patch using strategy...i'm looking golang example of doing this: kubectl patch pod valid-pod --type='json' -p='[{"op": "replace", "path": "/spec/containers/0/image", "value":"new image"}]' i'm using https://github.com/kubernetes/client-go v2.0.0 can point me example? thanks. so, think have example working after digging thru kubectl resource helper.go code, here is: first, create structure this: type thingspec struct { op string `json:"op"` path string `json:"path"` value string `json:"value"` } then create array of those: things := make([]thingspec, 1) things[0].op = "replace" things[0].path = "/spec/ccpimagetag" things[0].value = "newijeff" then convert array bytes array holding json ver

asp.net mvc - Implement Dependency injection in MVC (Webservices) -

in project, iám calling code repository mvc controllers. repository have function work exchange server, echange managed api. now, want implement dependency injection in project. i can not figure out in code must modified call repository dependency injection can ? her repository: public class exchangeews : iexchangeews { public list<datetime> getavaliablebookingdays(exchangeservice service, list<advisor> advisors, datetime startdate, datetime enddate, int num_appt) { list<datetime> avaliablebookingdays = new list<datetime>(); foreach (advisor adobj in advisors) { // user's calendar folder calendarfolder calendar = calendarfolder.bind(service, new folderid(wellknownfoldername.calendar, adobj.emailaddress), new propertyset()); // appointments retrieve.(calendarview return recurring appointment)

c# - How to create a Countdown (javascript ?) in Razor? -

i trying create auction site asp.net mvc using on razor, want create countdown on list of bid items. how put countdown in list? has got idea, these dates types must included. model segment took auction model. [required] [display(name = "auction start time")] [datatype(datatype.date)] [displayformat(dataformatstring = "{0:yyyy-mm-dd}", applyformatineditmode = true)] public datetime starttime { get; set; } [required] [display(name = "auction end time")] [datatype(datatype.date)] [displayformat(dataformatstring = "{0:yyyy-mm-dd}", applyformatineditmode = true)] public datetime endtime { get; set; } i using asp.net mvc entity framework generate views..(i new asp.net mvc entity framework) . please if body know answer, let me know.. thank you. you need use javascript or javascript based library so, otherwise need refresh view every second not want. need have java

php - I want to get the value of the span (checkout_date) -

this code allows user enter following details hotel booking reservation: phone number number of rooms number of nights whether require breakfast or not booking date the checkout date outputs when user enters booking date , number of nights. however, i'm trying update database whenever user clicks book , checkout date saves in database. jquery code checkout date happen , total cost stay: <style> #checkout_date, #total_price { color: red; } </style> <script> $(document).ready(function() { $('#date, #numberofnights').on("change", updatecheckout); $('#price, #numberofnights, #numberofrooms').on("change", updatetotalprice); function updatecheckout() { var bookingdate = $('#date').val(); var numofnights = $('#numberofnights').val(); if (bookingdate != '' && numofnights != '') { var new_date = moment(bookingdate,