Posts

Showing posts from July, 2013

How can I have watir recognize an input tag with a custom class? -

How can I have watir recognize an input tag with a custom class? - in our application have input tags next attrbutes: <input class=input-time id=projects-projects_project_0_task_0_entryhours_0> i have tried of watir input methods nil works recognize object. can shed little lite me? my watir version 1.6.5. summary page @ watir wiki links few pages lot of useful data. take @ how , what, html elements supported watir , ways available identify html element. examples (tested on mac os 10.6 firewatir 1.6.6.rc1): browser.text_field(:id => "projects-projects_project_0_task_0_entryhours_0").set "test" browser.text_field(:id => /project_0/).set "test" browser.text_field(:class => "input-time").set "test" watir

jquery - how to load an external css file if javascript is disabled -

jquery - how to load an external css file if javascript is disabled - how load external css file if javascript disabled. should work in ie 6 9, firefox google chrome, safari i tried <noscript> , keeping <noscript> within it's not working in ie 7 i'd other way around. load css contain rules prefixed body.jsenabled . add together class "jsenabled" on body via javascript. this way of "discovering capabilities" approximately how http://www.modernizr.com/ works. javascript jquery css xhtml

automation - Autofill text box on Windows programs -

automation - Autofill text box on Windows programs - i have no programming skills please bear me. (i did search prior asking question didn't find useful.) the purpose of programme cut down redundant text box filling automating it. there 2 programs, p1 , p2. human fills text boxes in p1 , in p2 same information. how can create "mirroring" (or copying) automated? these programs run on windows. there text file generated p1 has text needed, maybe can approach autofill p2? what programming language capable of doing this? can share examples? thanks! automation

java - Fragment getting crashed on orientation change .Though it is being removed in orientation change.Why? -

java - Fragment getting crashed on orientation change .Though it is being removed in orientation change.Why? - mainactivity.java package com.example.amanpreet.fragments1; import android.app.fragmentmanager; import android.app.fragmenttransaction; import android.support.v7.app.actionbaractivity; import android.os.bundle; import android.util.log; import android.view.menu; import android.view.menuitem; public class mainactivity extends actionbaractivity { @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); log.i("activity","oncreate()"); if(savedinstancestate == null) { fragmentmanager fragmentmanager = getfragmentmanager(); fragmenttransaction fragmenttransaction = fragmentmanager.begintransaction(); fragmentno1 fragmentno1 = new fragmentno1(); fragmenttransaction.add(r.id.activitylayout...

Banner in html and css width -

Banner in html and css width - i have 1 problem can't solve, need banner total width, not boxed. example: page 1024px witdh , banner 800px width, need banner 100% width. if understand me, so, friend , me trying lot of options didnt figured out. here css code banner: #banner{ background-image: url(mats/banner.jpg); width: 100%; height: 470px; background-repeat: no-repeat; position: relative; background-position: center; display: block; } i have tried nil successful. it background-size. background-size: 100%; on applying property, background image(800px width) strech 1024px, results in image quality loss. improve applying property on images width > 1200px if height: 470px intended background height, dont utilize it. never set height & width on image, changes aspect ratio. if 1 set, other auto adjust according to, else images looks shrinked or stretched html css

unit testing - Fluent NHibernate PersistenceSpecification can't test a collection of strings -

unit testing - Fluent NHibernate PersistenceSpecification can't test a collection of strings - i'm using fluent nhibernate map a class has collection of strings this: public class foo { public virtual icollection<string> strings { get; set; } } public class foomap : classmap<foo> { public foomap() { hasmany(f => f.strings).element("somecolumnname"); } } when write unit test using persistencespecification class included in fnh package, fails: [testmethod] public void canmapcollectionofstrings() { var somestrings = new list<string> { "foo", "bar", "baz" }; new persistencespecification<foo>(currentsession) .checklist(x => x.strings, somestrings) // mappingexception .verifythemappings(); } this test throws nhibernate.mappingexception: no persister for: system.string when calling checklist() . however, if seek persist object myself, works fine. [testmethod...

javascript - Acync JS HTTP Request Advice Request -

javascript - Acync JS HTTP Request Advice Request - i'm creating javascript library project im doing makes rest calls based on params feed it. sec day of project , i'm looking advice. if set request async returns request can't access object value, if set false in phone call returns object. i read stack articles on async js request, , can't seem wrap head around phone call backs , promises. this works: request.open("delete", url, false); this doesn't: request.open("delete", url, true); (function(window){ function definecynergi(){ var cynergi = {}; cynergi.get = function(url){ var request = makehttpobject(); request.open("get", url, false); request.send(null); homecoming json.parse(request.responsetext); } cynergi.delete = function(url){ var request = new xmlhttpreque...

node.js - Chaining Express.js 4's res.status(401) to a redirect -

node.js - Chaining Express.js 4's res.status(401) to a redirect - i'd send response code of 401 if requesting user not authenticated, i'd redirect when request html request. i've been finding express 4 doesn't allow this: res.status(401).redirect('/login') does know of way handle this? might not limitation of express, since i'm asking pass 2 headers, don't see why should case. should able pass "not authenticated" response , redirect user in 1 go. there subtle diferences methods sending new location header. with redirect : app.get('/foobar', function (req, res) { res.redirect(401, '/foo'); }); // responds http/1.1 401 unauthorized x-powered-by: express location: /foo vary: take content-type: text/plain; charset=utf-8 content-length: 33 date: tue, 07 apr 2015 01:25:17 gmt connection: keep-alive unauthorized. redirecting /foo with status , location : app.get('/foobar', function (req, re...

angularjs - How to get the text of all elements in protractor -

angularjs - How to get the text of all elements in protractor - i want fetch li texts of suggestions after entering in google search bar "webdriver". have wrote code this: this.getelements = function(){ element.all(by.css('ul.sbsb_b')).then(function(text){ for(var i=0; < text.length;i++) { console.log(text[i].gettext()); } }); }; on execution m getting like: { ptor_: { controlflow: [function], schedule: [function], getsession: [function], getcapabilities: [function], quit: [function], instead of text values of suggestions. there set of javascript array-like functions in protractor allows filter() or map() result of async promise. illustration if original "element.all(by.css('something'))" homecoming list of elementfinders, map() allows transform array of gettext()s, in resolved state array of strings. can utilize want. element.all(by.css('something')).ma...

android - Where do I bind my service? -

android - Where do I bind my service? - i have fragementactivity class sub classed various activities. have service class handles communication between phone , device(ble device). not know bind activity? in base of operations framgmentactivity class? if how work when switch between activities ? unbind every time because oncreate() called every time subclass called? android android-service

Adding a widget to the Ubuntu Login Page -

Adding a widget to the Ubuntu Login Page - in ubuntu (12.04 reference) possible build widget login screen? i add together custom widgets toolbar contains powerfulness icon, network icon, keyboard etc. i haven't found in ubuntu developers pages, might have missed something. ubuntu

angularjs - Cannot Get Partial View To Show -- Jade/Angular -

angularjs - Cannot Get Partial View To Show -- Jade/Angular - i using boilerplate: https://github.com/jakemmarsh/angularjs-gulp-browserify-boilerplate i added back upwards jade in regards gulp , builds out jade files html files. when kicks browser, shows index.html header/footer partials loaded in. beingness said, doesn't load in home.html partial angular should loading in ui-router. i new angular, sure missing simple. index html file (built jade): <!doctype html> <html> <head> <meta charset="utf-8"> <meta http-equiv="x-ua-compatible" content="ie=edge,chrome=1"> <!--title('{{title}}')--> <meta name="description" content="{{description}}"> <meta name="keywords" content="{{keywords}}"> <meta name="author" content=""> <meta name="viewport" content="width=device-width,i...

How to create vowel counter in python -

How to create vowel counter in python - title says all! trying create " display stats" alternative in menu created. display next after inputing sentence. example: string analysis: 6 words 26 characters 9 vowels 17 consonants. made whole word , character counter need vowel , consonants, can help me please? id highly appreciate support! what got far: def displayst(): print() print("you said following:") time.sleep(1) length = str(input("please come in sentence: ")) word = dis(length) lengths = diss(length) vowel = disv(length) print(length) time.sleep(1) print() print("string analysis:",'\n', word, "words",'\n', lengths, "characters",'\n',vowel,"vowels",'\n') again() the vowel = disv(length) need finish , if help consonants great! if not need vowels done consonants guess give seek haha. then in disv(length): vowels = ...

python - how to get subset of matrix in class numpy.matrix.defmatrix.matrix -

python - how to get subset of matrix in class numpy.matrix.defmatrix.matrix - the original matrix variable n , shape (138, 210). tried utilize n[:][:-1] , n[:][-1] subset of matrix n. shape of these 2 subsets (138,209) , (138,1). however, method not work. response (137,210) , (1,210). tried n[:-1][:], not work neither. the type of n numpy.matrix.defmatrix.matrix how can right answer? does work you? in [42]: n = np.random.rand(138, 210) in [43]: n[:, :-1].shape out[43]: (138l, 209l) in [44]: n[:, -1].shape out[44]: (138l,) n[:, :-1] (138, 209) shape , n[:, -1] (138, 1) shape. python numpy matrix

.net - How set a GroupBox height to size a window, if content is larger heigh, then need show ScrollViewer -

.net - How set a GroupBox height to size a window, if content is larger heigh, then need show ScrollViewer - i want have groupbox height size window , if content larger height, show scrollviewer. set size size content or maxheight (if set). <stackpanel> <groupbox> <scrollviewer verticalalignment="top" horizontalscrollbarvisibility="auto" verticalscrollbarvisibility="visible"> <stackpanel> <button verticalalignment="top">button</button> <button verticalalignment="top">button</button> <button verticalalignment="top">button</button> <button verticalalignment="top">button</button> <button verticalalignment="top">button</button> <button verticalalignment="top">button</button> <button verticalalignment="top">button...

java - Why use a database instead of singleton bean fields? -

java - Why use a database instead of singleton bean fields? - my utilize case real-time spring mvc application deals little amount of non-critical info "churns" rapidly. info consists of around 20 key-value string pairs. pulled in on schedule external api, can modified end user interacting webapp, , used produce parameters in post external api on schedule. this may obvious, perhaps obvious have reply can find anywhere, why maintain info in db opposed using dedicated singleton class thread-safe fields such concurrenthashmap, injected @services need it? initial feeling class such allow quicker read/writes in-memory db, yet every illustration have seen relies on "proper" db: @repository public class datastore{ private map info = new concurrenthashmap<string, string>(); //...getters , setters etc.. } thanks thoughts! you can utilize concurrentmap store key/value pairs in memory, nil wrong it. "proper" db provides ...

tfs2008 - TFS - Moving to a new server. How to update solutions with new server info? -

tfs2008 - TFS - Moving to a new server. How to update solutions with new server info? - tfs setup on vm , have 6 devs using it. we've been going on year. have move vm new info center , ip address going change. referenced tfs server it's ip instead of host or dns (yes, know!) everything hardcoded ip address. how update local config piont new server ip? i've found 'servers' entries in registry , i've found solution file has ip server hardcoded it. is there easy way create these changes without manually editing files/registry? here have done solve issue. steps edit ep2.sln in notepad. alter sccteamfoundationserver = http://123.123.123.123:8080/ sccteamfoundationserver = http://123.123.123.124:8080/ save. note: file marked read only. uncheck read in file properties. open vs (do not have solutions open). view -> team explorer 3. right click on server node (123.123.123.124) , take 'disconnect' click 'add existing team p...

linux - How to access Google Drive from CLI CyberDuck? -

linux - How to access Google Drive from CLI CyberDuck? - after long search discovered seems best practices solution users need transfer files between linux , google drive: https://cyberduck.io/?l=en the cli version recent , documentation, unclear. the url google storage of form: gs://[container]/[key] my google drive business relationship basic, freebie. have looked around don't know how determine [container] , [key]. tia. addition: i have found that "[container]" same "bucket". however, "[key]" remains mystery. per info found here, google storage , google drive — storage api should application use? google provides 2 different storage services: google cloud storage, , google drive. both services allow programmatic access functionality, goals of apis quite different. google drive sdk works google drive ui , chrome web store create ecosystem of apps can installed google drive. these apps enhance user experience allowi...

perl - HTTP::Proxy - match corresponding header and body -

perl - HTTP::Proxy - match corresponding header and body - i'm using awesome http::proxy http::proxy::bodyfilter , http::proxy::headerfilter. bodyfilter , headerfilter working great, need header , body together. the problem don't know how match corresponding body header. i have log whole http request (header , body), in reality don't have alter request itself. http::proxy right path? how can match header , body of same request? perl http perl-module

php - how to update table using api in codeigniter -

php - how to update table using api in codeigniter - i'm stuck @ updating table row using api in codeigniter, have read tutorial code tutsplus but there's no spesific it, tried myself , got stuck :-( url request: http://localhost/work/bnilife/v1/signup/user/post?nopol=a1b2c3d4e5&username=agus&password=kucingtikus&captcha=c12ds here's json respon: { "error": "error :-( " } my controller below: public function user_post() { date_default_timezone_set('asia/jakarta'); $datestring ="%y-%m-%d %h:%i:%s"; $time =time(); $datetime =mdate($datestring, $time); $data = array ( 'nopol' => $this->input->get_post('nopol'), 'username' => $this->input->get_post('username'), 'password' => sha1($this->input->get_post('password')), 'created_at' => $date...

Gruntjs dr-svg-sprites custom Css background-image URL in output -

Gruntjs dr-svg-sprites custom Css background-image URL in output - i've opened dr-svg-sprites github ticket regarding question: i'm using grunt , dr-svg-sprites generate svg (and png) sprites css output. currently css output file contains image paths relative css file: .no-svg .sprite-main-image-01, .no-svg .sprite-main-image-02 { background-image: url("../img/sprites/main-sprite.png"); } .svg .sprite-main-image-01, .svg .sprite-main-image-02 { background-image: url("../img/sprites/main-sprite.svg"); } i want alter them root relative paths (or hardcoded paths cdn setups). .no-svg .sprite-main-image-01, .no-svg .sprite-main-image-02 { background-image: url("/themes/main/img/sprites/main-sprite.png"); } .svg .sprite-main-image-01, .svg .sprite-main-image-02 { background-image: url("/themes/main/img/sprites/main-sprite.svg"); } this because our backend code minifies, bundles , serves css different url...

android - Can I get position of specific link in webview? -

android - Can I get position of specific link in webview? - i want touch specific url using code. information url. if can position of url, easy. can coordinate of url, or there improve way? (i can send touch event using code , can html source of viewing page webview.) now thought wanted click on link posted code snippet. since asking getting position haven't seen api provide position of links. however can seek the link. basically loading page in httpurlconnection , extracting html , running through regex way go. android url webview position touch

json - Conditional sampling in Pig -

json - Conditional sampling in Pig - i using elephant-bird parse nested json in pig. i'd store sample probability of sampling depends on value of binary attribute "c" in parsed json. one way conditional sampling split relation based on value of "c", , apply sample operator both subrelations, each different sampling probability. is there more direct , efficient way accomplish this, in 1 pass? if not, recommended way split , combine subrelations together? operating big files, efficiency concern. thank you! json apache-pig sample random-sample

alias - Rails 4 - alias_method in Concern -

alias - Rails 4 - alias_method in Concern - i'm trying add together alias_method :zzz_delete, :delete concern doesn't work. have tried wrap in included do , singleton_class.class_eval do , class << self , various combination of of blocks. what missing? it's alias_attribute not alias_method . , utilize alias_attribute :zzz_delete, :delete in model , utilize in controller. alias_attribute used assign new name field. ruby-on-rails alias activesupport-concern

Ruby on Rails app planning - login system routing when not logged in -

Ruby on Rails app planning - login system routing when not logged in - i'm building rails app, , far i've set pretty basic user registration/login system, next railcast found stack overflow. i've left same railcast, used strong parameters instead of attr_accessible , added additional fields (username, bio, img url) table. now want app redirect users onto login page if they're not logged in, no matter page seek access, , if are, redirect normal path. loging page root_path. need in controllers separately or can write appcontroller? how go writing controller? thinking this: if session[:user_id] == nil redirect_to login_path else redirect_to current_controller_path end now how check if user logged in, , how redirect current controller path (for instance articles_index_path? i new ruby on rails, , still trying wrap head around models, views , controllers, please assume know nil when writing explanations :) help oh i'm using rails 4 ruby 2.2.1 ...

d3.js - d3 selectAll and accesing item with index gives different result -

d3.js - d3 selectAll and accesing item with index gives different result - when selectall , expand returned array shows 1 result below prevchart.selectall(".line") result in console shows [array[1]0: pathlength: 1parentnode: g__proto__: array[0] but when prevchart.selectall(".line")[0] retun matching dom element below <path class="line" d="m20,46.753246753246756l152,37.40259740259741l284,28.051948051948052l416,9.350649350649356l548,0l680,18.701298701298704"></path> if notice selectall homecoming different result javascript object , using index in array returns dom element. i have attached image create more clear why behaving this. what need javascript object on can other operations. the question not clear me think of import topic. a selection array of groups a grouping array of nodes. of nodes may null , may place holder objects __data__ fellow member (if it's come in selection), rest dom...

asp.net - Coolite EXT GridPanel -

asp.net - Coolite EXT GridPanel - i'm new in using extjs library , want utilize gridpanel don't know how utilize aspnet , any help appreciated thanks in advance checkout sample extjs web : http://examples.ext.net/#/gridpanel/arraygrid/simple/ asp.net ajax extjs

Two clicks to generate word document from access form, with double rich text copied using vba -

Two clicks to generate word document from access form, with double rich text copied using vba - i've been working in exporting rtf (rich text) form memo field in access 2010 word file bookmark. problem is necessary 2 clicks open word document, , then, text inserted twice. i'm still not able find problem. here code: option compare database private sub comando72_click() 'saves current record --> me.dirty = false dim appword word.application dim doc word.document dim objword object '' word.application dim fso object '' filesystemobject dim f object '' textstream dim myhtml string dim tempfilespec string ' grab formatted text memo field myhtml = dlookup("descripactivaejecutarse", "planificacionserviciosinstitucionales", "idpsi = form!idpsi") set fso = createobject("scripting.filesystemobject") '' new filesystemobject tempfilespec = fso.getspecialfolder(2) & "\" & fso...

SharePoint Link Click Error -

SharePoint Link Click Error - whenever click on link in sharepoint, ex: excel document, ssrs report, etc.; error page cannot found. because "_layouts/15/download.aspx?sourceurl=" default behaviour on click. if wight click , take open in new tab, works fine. how can remove "_layouts/15/download.aspx?sourceurl=" beingness default behaviour on click in sharepoint? this can caused setting in central admin adds headers browser download types of files. you can alter setting going central admin >> manage web applications >> select web application >> general settings , under "browser file handling" alter "strict" "permissive" or vice versa. the automatic downloading forced "strict" security feature, can create terrible user experience. 1 time it's set "permissive" can command behavior each mime type individually, defaults should fine. if need alter settings mime type here...

java - How to activate JTextField with a keyboard -

java - How to activate JTextField with a keyboard - i have 2 jpanels within jpanel. 1 of them has jtextfield inside, few jbuttons. want focus set on jtextfield every time user starts typing (even when 1 of buttons has focus @ moment). keylistener won't work, because in order trigger key events, component registered must focusable , have focus, means you'd have attach keylistener every component might visible on screen, not practical idea. instead, utilize awteventlistener allows register listener notify of events been processed through event queue. the registration process allows specify events interested, don't need seek , filter out events not interested in for example. now, can automatically focus textfield when key triggered, should check see if event triggered text field , ignore if was one of other things need re-dispatch key event text field when isn't focused, otherwise field not show character triggered it... something like... if ...

java - I want to read what inside this form -

java - I want to read what inside this form - i have line entered user : bring together <person> <department> i want programme read between <>. programme invoke bring together method. 2 arguments person , department. for example: bring together phone call method: join("jhon mary","customer service"); join method defined : public boolean join(string name, string department){...} something next work, should refine in case user doesn't input valid. string input = ...; string[] tokens = input.split(" "); string name = tokens[1]; string section = tokens[2]; join(name, department); again, encourage refine , utilize base. user come in many or few arguments java string split token stringtokenizer

Getting Error When Trying TO Update URL keys in magento with PHP script -

Getting Error When Trying TO Update URL keys in magento with PHP script - i trying update url keys in magento, set url keys same name of product. have tried using next script found online. <?php require 'app/mage.php'; mage::app(); $amount = 0; $model = mage::getmodel('catalog/product'); $products = $model->getcollection(); foreach ($products $product) { $model->load($product->getid()); $product->seturlkey($model->getname())->save(); set_time_limit(); $amount++; } ?> however, presented next error: fatal error: phone call fellow member function getattributecode() on non-object in /home/replaysp/public_html/app/code/core/mage/catalog/model/product/type/configu rable.php on line 404 this line of code error points too: $this->getproduct($product)->setdata($attribute->getproductattribute() ->getattributecode(), null); any ideas on why happening? thanks in advance! try if works (discl...

php - Issues with returning Array from Connection Class -

php - Issues with returning Array from Connection Class - i having issue returning array. this part of connection class. public function createdataset($incomingsql) { $this->stmt = sqlsrv_query($this->conn, $incomingsql); if ($this->stmt) { $this->rows = sqlsrv_has_rows($this->stmt); if ($this->rows) { while($this->row = sqlsrv_fetch_array($this->stmt, sqlsrv_fetch_numeric)) { $this->myarray[] = $this->row; } } homecoming $this->myarray; //$this->result = $this->row; //return $this->result; } } and how calling on page... $conn3 = new connectionclass; $mydataset = $conn3->createdataset('select top (100) city, state, postalcode store'); echo $mydataset[0]; i using echo test. the $mydataset echoing nothing. can see $myarray fill 100 records when debug, not homecoming it.. ...

install.packages - failure to install R package after upgrade my MacOS to Yosemite -

install.packages - failure to install R package after upgrade my MacOS to Yosemite - this question has reply here: error “.onload failed in loadnamespace() 'tcltk'” 3 answers i upgrade macos yosemite , have r problems kinds of packages. $ devtools::install_github("dvanclev/gtrendsr") downloading github repo dvanclev/gtrendsr@master installing gtrendsr installing dependencies gtrendsr: googlevis --- please select cran mirror utilize in session --- error: .onload failed in loadnamespace() 'tcltk', details: call: dyn.load(file, dllpath = dllpath, ...) error: unable load shared object '/library/frameworks/r.framework/versions/3.1/resources/library/tcltk/libs/tcltk.so': dlopen(/library/frameworks/r.framework/versions/3.1/resources/library/tcltk/libs/tcltk.so, 10): library not loaded: /usr/x11/lib/libxft.2.dy...

How to multiply objects of different template type in C++ -

How to multiply objects of different template type in C++ - how can create (with objects of different template types) a*b , b*a give same result, where type of result determined according usual c++ type promotion rules? for example: int main() { number<float> a(2.0f); number<double> b(3.0); a*b; // want 6.0 (double) b*a; // want 6.0 (double) homecoming 0; } at moment, can multiply objects of same template type. example, this: template<typename t> class number { public: number(t v) : _value(v) {} t get_value() const { homecoming _value; } number& operator*=(const number& rhs) { _value *= rhs.get_value(); homecoming *this; } private: t _value; }; template<typename t> inline number<t> operator*(number<t> lhs, const number<t>& rhs) { lhs *= rhs; homecoming lhs; } edit: or, in answers, can multiply ...

jquery - Internet Explorer hangs up when window is not active while using setinterval with some SVG animation -

jquery - Internet Explorer hangs up when window is not active while using setinterval with some SVG animation - i using net explorer 11 jquery , raphaeljs. problem facing animating lines on svg after every 10 secs (using setinterval). if net explorer window active works fine switch window , come net explorer it's hanged , need close , reopen webpage in new instance of net explorer. $(document).ready(function () { hidecontextmenu(); //showdeliverytimedial(); //showrevenuedial(); displaygraph(); var refresh = setinterval(displaygraphint, 10000); }); jquery svg setinterval internet-explorer-11 hang

c# - Postman error parsing number -

c# - Postman error parsing number - i attempting pass info using postman getting error: additional information: unexpected character encountered while parsing number: ;. path 'waiverid', line 2, position 16. raw: { "waiverid": 0; "carrierid": 0; "expression": 0.0; "categoryid": 1; "rategroup": ""; "fuelcap": 0.0; "startdate" : ""; "enddate" : ""; "accountnumber" : ""; "zone" : ""; "origincountry" : 202; "destinationcountry" = 202; "customerid" : "0"; } c# object public class surchargewaiversaverequest : isurchargewaiver { public int waiverid { get; set; } public int carrierid { get; set; } public decimal? look { get; set; } public int categoryid { get; set; } public string rategroup { get...

c++ - std::sort on a vector of Objects containing Objects* pointers -

c++ - std::sort on a vector of Objects containing Objects* pointers - let's define next struct: struct dockpose { complex* pose; int cluster; struct dockpose* dp; float distance; int density; }; typedef struct dockpose dockpose; then, declare vector sorted density value using std::sort() function. after phone call std::sort, dockpose* dp pointers still point same dockpose instance pointing before? if not, can sure dp pointers points same dockpose pointing before sorting (if there can do) ? yes, pointers still point same instance. may not want. when phone call std::sort on vector, not alter location of instances (that's not thing can in c++). swaps values each other. improve explained simplified example. take struct: struct foo { int x; foo* buddy; }; bool operator<(foo const& lhs, foo const& rhs) { homecoming lhs.x < rhs.x; } now, lets create vector of these, decreasing x values, , each 1 having poin...

excel vba - How to access different menus and tabs in webpage? -

excel vba - How to access different menus and tabs in webpage? - i new vba. i have open webpage in ie. webpage has menu on left side , in each menu there different tabs. i have check these menus & tabs up. along have check errors on these pages (displayed if any). i have been able write code open webpage. here bit of code wrote months ago. retrieves html dom of webpage , tries find elements/ids/classes within dom , returns either text or html. maybe can utilize find menus/tabs , check if content corret. furthermore htmldocument/ihtmlelement classes of vba useful you. as note: requires microsoft net controls , microsoft html object library references. public function getwebpage(url string, optional resulttype string = "innertext", optional selector variant) variant dim obrowser internetexplorer dim htmldoc htmldocument dim doctext string dim arrselector variant dim element ihtmlelement dim long dim tmpelementname string dim timer long const waitt...

ios - Place SCNNode Intersecting Detection -

ios - Place SCNNode Intersecting Detection - is possible find out if 1 scnnode touching another? i want randomly place nodes in plane without of them intersecting. let's have box. scnnode *box = [scnnode node]; box.geometry = [scnbox boxwithwidth:1 height:1 length:1 chamferradius:0]; let's create plane position boxes in well. cgrect plane = cgrectmake(0,0,3,3); now let's place 3 random boxes in 3x3 square. for (int = 0; < 3; i++) { int randomx = arc4random() % 3; int randomz = arc4random() % 3; scnnode *node = [box copy]; node.position = scnvector3make(randomx, 1, randomz); [self.rootnode addchild:node]; } as stands now, boxes share same coordinates, , result undesirable. thinking of putting contents of loop in do-while loop. for (int = 0; < 3; i++) { bool isintersecting; { isintersecting = no; //above placement of node. (scnnode *child in self.rootnode.childnodes) if ([self testintersectingbetween:(scnn...

php - Need assistance cURL'ing a link -

php - Need assistance cURL'ing a link - i trying curl next link: http://soundstreamradio.serverroom.net:7424/currentsong?sid=1 it's page displays plain text. curl php code i'm using: function get_web_page( $url ) { $user_agent='mozilla/5.0 (windows nt 6.1; rv:8.0) gecko/20100101 firefox/8.0'; $options = array( curlopt_customrequest =>"get", //set request type post or curlopt_post =>false, //set curlopt_useragent => $user_agent, //set user agent curlopt_cookiefile =>"cookie.txt", //set cookie file curlopt_cookiejar =>"cookie.txt", //set cookie jar curlopt_returntransfer => true, // homecoming web page curlopt_header => false, // don't homecoming headers curlopt_followlocation => true, // follow redirects curlopt_encoding => "", // hand...

asp.net - call pageload event in aspx pages of a .vb page -

asp.net - call pageload event in aspx pages of a .vb page - i have many aspx pages in 1 folder (100 pages) , maintain increasing. have 1 vb.net file has code these pages. can phone call pageload event in vb.net file these pages? im using code, not reading pageload event. <%@ page language="vb" %> <script runat="server"> protected sub page_load(byval sender object, byval e system.eventargs) newone_load(page) end sub </script> vb.net page code - public module newone public sub newone_load(byref page web.ui.page) end sub end module i found little error in code: add together handles me.load page_load sub protected sub page_load(byval sender object, byval e system.eventargs) handles me.load else sub never bound load event. asp.net vb.net pageload

visual studio 2015 - How do I handle a C# codebase being edited in both VS 2013 and VS2015 with regards to the breaking change of "using static" in C# 6.0? -

visual studio 2015 - How do I handle a C# codebase being edited in both VS 2013 and VS2015 with regards to the breaking change of "using static" in C# 6.0? - i have c# codebase beingness edited in both vs 2013 , vs 2015 ctp 6. ctp 6 has come c# v6 requires "using static" on imports. is there way in can determine version (either vs or c#) beingness used such can utilize preprocessor directive utilize either "using" or "using static"? e.g. #if cs6 using static ... #else using ... #endif a preprocessor directive initial thought. if there way ears. the static using shouldn't required; syntactic sugar has been added c# 6.0. should always able specify qualified name of static method phone call it, e.g. instead of using system.environment; // class , method declaration elided var path = getfolderpath(...); you have // no static using here! // class , method declaration elided var path = system.envir...

encryption - Encoding/Decoding client (android) and server (PHP) side -

encryption - Encoding/Decoding client (android) and server (PHP) side - i have project in have send info android app mysql database via php webservices. of course of study want info encrypted. we decided utilize rsa 1024 encrypt , decrypt, i've found troubles utilize public&private keys agreed use. this code encrypting privatekey = 'abcdefghijk'; byte[] encodedbytes = null; seek { cipher c = cipher.getinstance("rsa"); c.init(cipher.encrypt_mode, privatekey); encodedbytes = c.dofinal(thetesttext.getbytes()); } grab (exception e) { log.e(tag, "rsa encryption error"); } and 1 decrypting publickey = 'secretpubkey'; byte[] decodedbytes = null; seek { cipher c = cipher.getinstance("rsa"); c.init(cipher.decrypt_mode, publickey); decodedbytes = c.dofinal(encodedbytes); } grab (exception e) { log.e(tag, "rsa decryption error"); } publickey , privatekey aren...

Python - convert list of tuples to a list of int -

Python - convert list of tuples to a list of int - i have x = [[1], [2, 3], [1, (3, 5)], [(3, 9), 7, 5]] and want x = [[1], [2, 3], [1, 3, 5], [3, 9, 7, 5]] how can this? you accomplish through series of loops. >>> x = [[1], [2, 3], [1, (3, 5)], [(3, 9), 7, 5]] >>> l = [] >>> in x: m = [] j in i: if isinstance(j, tuple): m.extend(j) else: m.append(j) l.append(m) >>> l [[1], [2, 3], [1, 3, 5], [3, 9, 7, 5]] python list tuples

node.js - nodejs cluster socket.io nginx configuration -

node.js - nodejs cluster socket.io nginx configuration - i running nodejs cluster socket.io library. proxing request via nginx server. websocket connections working fine in of cases not working polling transport protocol in socket.io. here's pseudo code: if (cluster.ismaster) { // fork workers. (var = 0; < numcpus-1; i++) { cluster.fork(); } else{ var server = http.createserver(function(request, response){ console.log('connecting server'); response.end(); }); server.listen(port); var socket_io = require('socket.io')(server); var redis_adapter = require('socket.io-redis'); //config.redis.ip,config.redis.port socket_io.adapter(redis_adapter({ host: config.redis.ip, port: config.redis.port })); socket_io.use(function(socket, next){ }); socket_io.on('connection', function (socket) { }; would know there issue in code. need utilize sticky-session .if yes right way utilize in case. websockets sticky default. ...

html - Custom checkbox don't work -

html - Custom checkbox don't work - i'm using bootstrap 3 , css template. want stylize checkbox using template , isn't work, because can't utilize input area. when click it, nil appear. this code: html: <div class="checkbox check-primary "> <input type="checkbox" value=""> <label>guardar usuario</label> </div> css: .checkbox { display: block; min-height: 20px; vertical-align: middle; } .checkbox input[type=checkbox] { display: none; } .checkbox label { display: inline-block; cursor: pointer; position: relative; padding-left: 25px; margin-right: 15px; font-size: 13px; margin-bottom: 6px; color: #777a80; transition: border 0.2s linear 0s,color 0.2s linear 0s; } .checkbox label:before { content: ""; display: inline-block; width: 17px; height: 17px; margin-right: 10px; position: absolute; left: 0px; top: 1.4px; background-color: #fff; borde...

mean - When to define new columns in krige in R? -

mean - When to define new columns in krige in R? - i wondering: ever necessary redefine own columns when kriging? error below seems indicate this: warning: singular model in variogram fit > sk1 <- krige(formula=zs~1, locations=~xs+ys, data=sampled, newdata=pred.grid, model=fit.sph, beta=0) error in `[.data.frame`(object, , -coord.numbers, drop = false) : undefined columns selected is there problem i'm not seeing? or, need define own columns? thanks. the next programme reproducable , runnable here down: library(gstat) x <- seq(0,2000,by=20) y <- seq(0,2000,by=20) x = sample(x,10,replace=t) y = sample(y,10,replace=t) z = sample(0.532:3.7,10,replace=t) samples = data.frame(x,y,z) # detrend samples: print(mean(samples$z)) #create object of class gstat h <- gstat(formula=z~1, locations=~x+y, data=samples) samples.vgm <- variogram(h) # create method of class "gstatvariogram" plot(samples.vgm,main='variogram of samples not detre...

css - Sticky widget being cut off Wordpress -

css - Sticky widget being cut off Wordpress - i trying create sidebar scroll page on this page. i've done adding code wordpress custom code section: .sidebar .widget { position: fixed; } however, can see, sidebar beingness cutting off , displaying few of around 8 fields. want create sure sidebar starts below header , ends before footer. relatively comfortable using css if jquery prepare total beginner. thanks! css wordpress widget sidebar sticky

javascript - Style properties not working in IE using AngularJs and HTML -

javascript - Style properties not working in IE using AngularJs and HTML - <head> <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script> </head> <body> <div ng-app="myapp" ng-controller="myctrl"> <div style="color:{{color}}">testing</div> </div> <script> var app = angular.module('myapp', []); app.controller('myctrl', function($scope) { $scope.color = "#996600"; }); </script> </body> color properties not working in ie, chrome , firefox working this updated code: <body> <div ng-app="myapp" ng-controller="myctrl"> <div ng-style="{color:color}">testing</div> </div> <script> var app = angular.module('myapp', []); app.controller('myctrl', ...

c++ - Overloaded ostream operator in template -

c++ - Overloaded ostream operator in template - i got confused in overloading ostream operator<< template class. (unnecessary code deleted) sparsearray2d.h: #include <iostream> using namespace std; template <typename t> class sparsearray2d { private: //... public: //... friend ostream& operator << (ostream&, const sparsearray2d<t>&); //... } template <typename t> ostream& operator << (ostream& os, const sparsearray2d<t> &_matrix) { //... os<<"overloaded operator works"; homecoming os; }; and main: #include "sparsearray2d.h" int _tmain(int argc, _tchar* argv[]) { //... sparsearray2d<int> *matrx = new sparsearray2d<int>(10, 9, 5); cout << matrx; //... } no errors , no warnings in vs2012, in console have 8 symbols link or pointer @ object. "0044fa80". what's going wrong? that's because...