Posts

Showing posts from August, 2010

ruby - Active Record unexpected i18n error -

i building ruby project uses active record not rails. inside 1 of tests trying following: it "fails no driver name" command = "driver" expect {command_file.process_driver command}.to raise_error(activerecord::recordinvalid) end and here method trying call def process_driver command driver_name = command.split[1] driver.create! :name => driver_name end i expect passing :name => nil driver.create! should throw recordinvalid instead i18n::invalidlocaledata . here backtrace expected activerecord::recordinvalid, got #<i18n::invalidlocaledata: can not load translations /users/me/.rbenv/versions/2.3.1/lib/r...ems/activesupport-5.1.3/lib/active_support/locale/en.yml: expects return hash, not> backtrace: # ./command_file.rb:81:in `process_driver' # ./command_file.rb:63:in `block in process' # ./command_file.rb:51:in `each' # ./command_file.rb:51:in `each_with_index' # ./command_file.rb:51:in `process' # ./s...

javascript - HTML for Dynamic Reporting/Visualization -

i have been tasked researching technology generating dynamic report charts & visuals. there countless bi tools available , online solutions fit bill, however, customers have considerable restrictions preventing installation of applications or sharing data across internet. one solution i've dreamed serve html document offline consumption in browser. javascript bundled in & data added dynamically prior sending client, believe possible in same way website functioning offline possible. how feasible this? if it's possible, technologies recommended? far i've considered building using angularjs since spa mimic one-page report & javascript bundling readily available . are there better solutions? which?

java - Android - Arraylist size always zero -

i try make application. use facebook sdk , can login facebook. app getting movies user likes. can graph api , can add name of movie arraylist. ok far. when try access in oncreate method arraylist null. when use debug can see json value. how can solve this. know english not trying explain issue. hope :) public class list extends appcompatactivity { arraylist<string> movielist = new arraylist<string>(); public void getinfo(){ graphrequest request = graphrequest.newmerequest( accesstoken.getcurrentaccesstoken(), new graphrequest.graphjsonobjectcallback() { @override public void oncompleted(jsonobject object, graphresponse response) { jsonobject jsonobject = response.getjsonobject(); try { jsonobject movies = jsonobject.getjsonobject("movies"); jsonarray data = movies.get...

Error compiling Grails 2.4.2 application when adding Spring Security Rest plugin to BuildConfig.groovy -

i have grails 2.4.2 application working spring security core , i'm trying implement restful api authentication. this, added spring security rest v1.5.4 plugin in buildconfig.groovy file, follows: grails.servlet.version = "2.5" grails.tomcat.nio=false grails.project.class.dir = "target/classes" grails.project.test.class.dir = "target/test-classes" grails.project.test.reports.dir = "target/test-reports" grails.project.work.dir = "target/work" grails.project.target.level = 1.6 grails.project.source.level = 1.6 grails.project.war.file = "target/${appname}.war" grails.project.dependency.resolver = "maven" // or ivy grails.project.dependency.resolution = { inherits("global") { } log "info" checksums true legacyresolve false repositories { inherits true mavencentral() ...

c++ - vector pair sorting by the difference of the pair elements -

is there way in c++, sort me pairs of vector based on difference of pair values. example, suppose have 4 pairs 1 3, 5 6, 2 3, 12 5, so, differences of pairs 2 1 1 7, if sort in descending order sorted vector be, 12 5, 1 3, 5 6, 2 3, i hope understood problem is. there way sort elements way? i have tried way sort elements based on first or second element. not problem. problem need sort based on difference. bool sortinrev(const pair<int,int> &a, const pair<int,int> &b){ return(a.first > b.first) ; } int main() { vector< pair <int,int> > pq; for(int i=1; i<=4; i++){ int x,y; cin >> x >> y; pq.push_back(make_pair(x,y)); } sort(pq.begin(), pq.end(), sortinrev); for(int i=0; i<4; i++){ cout << pq[i].first << " " << pq[i].second << endl; } return 0; } if container is std::vector<std::pair<int, int>...

Nativescript - Keep keyboard open when TextField returned on Android -

how can keep keyboard open after user tap on "return" key on soft keyboard? i'm calling focus method on "returnpress" event, works fine on ios not on android: text() { let textfieldelement = <textfield>this.textfield.nativeelement; textfieldelement.focus(); } so turns out need overrde "oneditoraction" method on "oneditoractionlistener" this: let tv = <textfield>this.textfield.nativeelement; if (tv.android) { tv.android.setoneditoractionlistener(new android.widget.textview.oneditoractionlistener({ oneditoraction: function (callbacktype, result) { if (result == android.view.inputmethod.editorinfo.ime_action_done) { // whatever want when user presses return } return true; } })); }

sql - How can I get data for one field from multiple tables? -

i have column contentid in table identifies content exists in other tables. example, refer pageid , productid , etc. plan use pull through other information need, such page name or product name. have far: select tl.id, tl.tablename, tl.filename, tl.contentid, p.pagename content translationlog tl left join pages p on tl.contentid = p.pageid left join categories c on tl.contentid = c.categoryid left join productdescriptions pd on tl.contentid = pd.sku the idea each row, want data specified content using tablename , contentid fields. currently, i'm able pagename selecting p.pagename content . however, i'd each of tables; if row corresponds pages table, query table - same categories , product descriptions. need have alias "content" , regardless of field table we're using, such pagename or productname . is possible this? edit: the solution posted rd_nielsen perfect, turned out there bit of overlap contentid . here's ended fix it: select tl.id,...

ios - Only one label appearing on a BarChart created with Charts -

i want create barchart charts library. working except labels on x axis. first label "jan" appearing on line. code override func viewwillappear(_ animated: bool) { dobarchart() } func dobarchart(){ barchartview.drawbarshadowenabled = false barchartview.drawvalueabovebarenabled = true barchartview.chartdescription?.enabled = false barchartview.maxvisiblecount = 60 let xaxis = barchartview.xaxis xaxis.axislinecolor = uicolor.black xaxis.labelposition = .bottom xaxis.drawaxislineenabled = true xaxis.drawgridlinesenabled = false xaxis.granularity = 1.0 xaxis.labelcount = 1 // xaxis.setlabelcount(7, force: true) let months = ["jan", "feb", "mar", "apr", "may", "jun", "jul",] xaxis.valueformatter = indexaxisvalueformatter(values:months) //also, want add: let...

C++ How to dispatch to different template function by tag -

there's lots of template functions called f1,f2,f3… how dispatch runtime-known int different template functions? of course can use switch that, every time add more template functions or delete template functions, have modify switch again , again. how can in more elegant way? templates not real-exsited functions can't make std::map of functions pointers. template<typename t> std::optional<t> f1(){...} template<typename t> std::optional<t> f2(){...} template<typename t> std::optional<t> f3(){...} template<typename t> std::optional<t> f4(){...} template<typename t> auto dispatch(int tag){ switch(i){ case 1: return f1<t>(); case 2: return f2<t>(); case 3: return f3<t>(); case 4: return f4<t>(); }// have modify these if add or delete template functions } here explanation command pattern , guess looking for. there no templated functions, rewrote it. not d...

vue.js - How to disable v-select options dynamically in Vuejs -

i'm trying build application on vuejs 2.0 i'm having following codes <div class="col-sm-6"> <label class="col-sm-6 control-label">with client*:</label> <div class="radio col-sm-3"> <input type="radio" name="with_client" v-model="withclient" value="1" checked=""> <label> yes </label> </div> <div class="radio col-sm-3"> <input type="radio" name="with_client" v-model="withclient" value="0"> <label> no </label> </div> </div> i want disable v-select i.e. http://sagalbot.github.io/vue-select/ element if v-model withclient = 0 , enable withclient= 1 <v-select multiple :options="contacts" :on-search="getoptions" placeholder="contact name"...

aframe - Set look-at camera attribute on javascript created a-box -

i'm creating several a-frame (version 0.60) objects in javascript dynamically, manage set sorts of attributes successfully. when comes look-at attribute set camera, ignored. markup use: <a-camera id="camera" camera look-controls> <a-cursor id="cursor" color="#ff0000"></a-cursor> </a-camera> and js code: var aboxel = document.createelement('a-box'); aboxel.setattribute('look-at', 'camera'); thank hint thank andrew told me add look-at component source. <script src="https://rawgit.com/ngokevin/aframe-look-at-component/master/dist/aframe-look-at-component.min.js"></script> the funny thing don't have add look-at source when doing markup

batch file - How to extract, using cmd, string between quotes from a particular line -

hope clear problem , search for. have long script in .sjs file (basically txt different extension), part of following lines. in comments below either referred input.txt or builder.sjs var want_spring_aid_file_update = 0; var front_spring_aid_file = "name_1.pspck"; var rear_spring_aid_file = "name_2.pspck"; i have been looking around .bat script can probe lines, 2 , 3 in case above, in .sjs file , write string between double quotes in text new file. in comments below new text file referred comments.txt. i have found on marvelous website script outputs strings between quotes in file. want on particular lines. script talking below. >"output.txt" ( /f usebackq^ tokens^=2^ delims^=^" %%a in ("input.txt") echo "%%a" ) also helpful me understand role of characters in above script. these ^, 2^, ^=^. thanks guys ! the command for option /f used process lines of file, or single string specified in double quote...

javascript - Better way to clearTimeout in componentWillUnmount -

i have working loading component cancels out when has been loading 8 seconds. code works feels off me , i'm wondering if there better way this. without setting this.mounted error: warning: can update mounted or mounting component. means called setstate, replacestate, or forceupdate on unmounted component. no-op. please check code loading component. this make me think timer not getting canceled continues this.sestate . why if set cleartimeout in componentwillunmount ? there better way handle using global this.mounted ? class loading extends component { state = { error: false, }; componentdidmount = () => { this.mounted = true; this.timer(); }; componentwillunmount = () => { this.mounted = false; cleartimeout(this.timer); }; timer = () => settimeout(() => { (this.mounted && this.setstate({ error: true })) || null; }, 8000); render() { const { showheader = false } = this.props; const { ...

node.js - request promise: invalid url -

when use node js request-promise function following parameters, error: invalid uri. can please help var request = require('request-promise'); request({ method: 'get', url: '/api/test /api/test path on server as error says url path incorrect. url requires protocol(http/https in case)://ip-address/domain-name:port(optional if configured in nginx)/route-to-api-endpoint. example: https://192.168.2.44:3000/api/test or http://jasmine.website.com/api/test update url , can make api requests.

ios - Xcode building different environments for the same app -

Image
i have app talks server. have 2 versions of server: production 1 , testing one. means i'd need have production ios app , testing ios app. logic same both versions of app, except need use configurations depending on server connects to. right now, solution use plist file contains informations 2 versions need. plist contain bunch of key-value pairs like: url: test-server.domain.com username: test-subject password: test-password i have 2 git branches: production branch , testing branch each of ios app version. content of said plist file different on each branch. question is: there more elegant way solve this? preferably i'd have 1 branch. i've looked using xcode's environment variables, don't stick when archive/build apps. i use preprocessor macros this. define variable debug debug , nothing in release. and use like enum appconfig { case debug case testflight case appstore var host: string { switch self { ...

windows - Delete all but one file loop with bat script -

i have loop in batch file delete 1 file in directory (windows 7). hangs because still sends commands screen, though i'd thought i'd suppressed it. here command i'm using: for %i in (*) if not %i == update.bat del /s %i >nul 2>&1 tested batch script, log shows stops right @ command. tested command @ command line, outputs "del /s file.ext >nul 2>&1" command prompt each file in directory, causes batch file hang. what need change here? if directly in open cmd window , not batch, can suppres output of current command leading @ sign. @for %i in (*) @if /i not "%i"=="update.bat" @del "%i" >nul 2>&1 in batch toggle output of commands @echo off , double % signs of variable. @echo off %%i in (*) if /i not "%%i"=="%~nx0" del "%%i" >nul 2>&1

apache - 301 redirect ?___store=default -

i need make 301 redirection urls have kind of ending in them: ?___store=default&___from_store=com for example: 301 url https://www.example.com/page.html?___store=default&___from_store=com to: https://www.example.com/page.html?___store=default_migrated&___from_store=com server has apache in , magento 2 cms have running there. if more details needed i'm happy provide them. you setup rewriterule in apache this. need check %{query_string} server variable see if matches query string "?___store=default&___from_store=com" (you can change bit less strict in matching regex if needed). rewritecond %{query_string} ^___store=default&___from_store=com$ [nc] rewriterule ^(.*)$ https://www.example.com/$1?___store=default_migrated&___from_store=com [l,r=301] you can read more apache rewriterules here .

javascript - How to make 2nd Trigger script in paired image button? -

set scripted paired button image. when click image, change pair or set of image. now if have set, set b, , want make set b work set without disrupting each other. how this? tried give set b new unique id confused how integrate new id in script. $(document).ready(function() { $('img').click(function() { $(this).add($(this).siblings()).toggleclass('hide'); if($(this).attr('id') == 'predator_only') { $('.predator:not(.hide)').add($('.predator:not(.hide)').siblings()).toggleclass('hide'); } else if($(this).attr('id') == 'mixed') { $('.predator.hide').add($('.predator.hide').siblings()).toggleclass('hide'); } else { if($('.predator.hide').length > 0) { $('#mixed').removeclass('hide'); $('#predator_only').addclass('hide'); } else { $('#mixed...

javascript - How to exclude default node packages from webpack -

i want exclude child_process , os package being bundled in webpack bundle. have multiple files requiring these default node modules. what have tried worked somehow: externals: [ 'child_process', 'os' ], but others, not seem work: ./~/neataptic/src/multithreading/workers/node/testworker.js module not found: error: can't resolve 'child_process' in '[...]/node_modules/neataptic/src/multithreading/workers/node' @ ./~/neataptic/src/multithreading/workers/node/testworker.js 7:9-33 @ ./~/neataptic/src/multithreading/workers/workers.js @ ./~/neataptic/src/multithreading/multi.js @ ./~/neataptic/src/neataptic.js how should default node packages included? keep in mind bundle browser ( umd ).

visual studio 2017 - Error in VisualStudio PackageManagerConsole? -

i have c# project multiple nuget dependencies in vs2017. want restrict version update of nugets, changed project file follow: <itemgroup> <packagereference include="microsoft.aspnetcore.http.abstractions" version="[1.1.1, 2.0.0)" /> <packagereference include="microsoft.aspnetcore.localization" version="[1.1.2, 2.0.0)" /> </itemgroup> this work expected when work ' manage nuget packages ', when use packagemanagerconsole ignore version restriction , try load version '2.0.0' of package! also if update package using manage nuget packages , package updated correct version (1.1.2 @ moment) override restriction , project try update version '2.0.0'. can tell me how should update nuget packagemanagerconsole , keep version restriction??

colors - How to set theme dynamically coming from server ANDROID -

i getting color codes in server , have set theme. know can individually setting colors on each element. there way create theme dynamically or declare colors of theme programmatically. main aim group of users can set own theme. private void setcolors(colors color) { int toolbarcolor = 0; int statusbarcolor = 0; switch (color) { case green: settheme(r.style.apptheme_noactionbar_green); toolbarcolor = r.color.green; statusbarcolor = r.color.greendark; break; case red: settheme(r.style.apptheme_noactionbar_red); toolbarcolor = r.color.red; statusbarcolor = r.color.reddark; break; case blue: settheme(r.style.apptheme_noactionbar_blue); toolbarcolor = r.color.blue; statusbarcolor = r.color.bluedark; break; } mtoolbar.setbackgroundcolor(contextcompat.getcolor(mainactivity.this, toolbarcolor)); if (build.version.sdk_int >= build.versio...

jenkins - How to change Email-ext plugin to load script from custom location -

i commit jenkins email script working copy , use email-ext. so wrote : pipeline { agent stages { stage('build') { steps { echo 'building...' } } } post { { echo 'sending email...' emailext body: '''${script, template="${workspace}\\src\\scripts\\jenkins\\groovy-html2.template"}''', mimetype: 'text/html', subject: "[leeroy jenkins] ${currentbuild.fulldisplayname}", to: "user@company.com", replyto: "user@company.com", recipientproviders: [[$class: 'culpritsrecipientprovider']] } } } but following mail: groovy template file [${workspace}srcscriptsjenkinsgroovy-html2.template] not found in $jenkins_home/email-templates. templates must live in correct directory security reasons. if want keep them ...

php - Errors getting values from 2 MySQL tables -

Image
i having table relationship. have table adds new procurement items, has 2 columns - line_manager_remark , c_level_remark shows approval status line manager , c level executive. the values these columns gotten table now, having issues getting status (definitions) of items. not work. this have done select a.*, b.* request_items a, request_status b a.line_manager_remark = b.id , a.c_level_remark = b.id , a.request_id = '$id' , state = 'active' select request_items.*, request_status_line_manager.definition line_manager_status, request_status_c_level.definition c_level_status, request_items inner join request_status request_status_line_manager on request_items.line_manager_remark = request_status_line_manager.id inner join request_status request_status_c_level on request_items.c_level_remark = request_status_c_level.id request_items.state = 'active' ...

python - SHA256 doesn't yield same result -

Image
i'm following on this tutorial , in part 2 (picture below) shows sha256 yields result different when ran python code: the string is: 0450863ad64a87ae8a2fe83c1af1a8403cb53f53e486d8511dad8a04887e5b23522cd470243453a299fa9e77237716103abc11a1df38855ed6f2ee187e9c582ba6 while tutorial sha256 comes to: 600ffe422b4e00731a59557a5cca46cc183944191006324a447bdb2d98d4b408 my short python shows: sha_result = sha256(bitconin_addresss).hexdigest().upper() print sha_result 32511e82d56dcea68eb774094e25bab0f8bdd9bc1eca1ceeda38c7a43aceddce in fact, online sha256 shows same python result; missing here something? you're hashing string when you're supposed hashing bytes represented string. >>> hashlib.sha256('0450863ad64a87ae8a2fe83c1af1a8403cb53f53e486d8511dad8a04887e5b23522cd470243453a299fa9e77237716103abc11a1df38855ed6f2ee187e9c582ba6'.decode('hex')).hexdigest().upper() '600ffe422b4e00731a59557a5cca46cc183944191006324a447bdb2d98d4b408...

asp.net mvc - Old technologies (SQL Compact) in Visual Studio 2015 or 2017? -

i need new project in asp.net mvc. have use these technologies: entity framework, jquery, ms sql server compact (4.0), mvccontrib, simplemembership. can create in visual studio 2015 or 2017? because of these technologies: ms sql server compact, mvccontrib, simplemembership better use visual studio 2012 prefer use visual studio 2015 or 2017. can i? best regards! :) thank answer! :-) i have problem in visual studio 2017 enterprise sql server compact 4.0. i cant find in vs 2017. please screen image png: https://zapodaj.net/08da49566728d.png.html https://zapodaj.net/be28f18fdbe02.png.html best regards!

Different conventions for main() in C -

this question has answer here: what should main() return in c , c++? 18 answers my exposure programming has been java,where have not encountered (up now) different conventions writing main method.i have been following sources learning c (k&r , c programming modern approach) use different forms of main method (function). k&r version now: main() { blah blah blah; } c programming modern approach int main() { blah blah blah; return 0; } or int main() { blah blah blah; //returns nothing } to make matters more confusing have seen people : int main(void) { blah blah blah; } while either returned 0 or did not. don't in uneducated assumption think standards issue maybe bit more conceptual or deep. shed light on issue? k&r style outdated , isn't correct according c standard more. valid signatures int...

css - HTML Button Group: how to handle margin overwrite -

i´m building button group class, follows: .ux-button-group button { border-radius: 0; z-index: -1; margin: -4px; } .ux-button-group button:first-child { border-radius: 4px 0 0 4px; } .ux-button-group button:last-child { border-radius: 0 4px 4px 0; margin-left: -1px; } .ux-button-group button:not(:last-child):not(:first-child) { margin-left: -1px; } .ux-button-group button:only-child { border-radius: 4px; margin-left: 0; } .ux-button-group button:hover { z-index: 1; } button { background-color: transparent; color: black; border: 1px black solid; margin: 0px; } button:hover { border-color: red; } and simple usage: <div class='ux-button-group'> <button input='text'>button 1</button> <button input='text'>button 2</button> <button input='text'>button 3</button> </div> all fine, expept when hover mouse button elements right margins no...

ios - Swift: 'Authorization to share the following types is disallowed: HKQuantityTypeIdentifierAppleExerciseTime' -

i trying use healthkit following tutorial ( https://www.raywenderlich.com/86336/ios-8-healthkit-swift-getting-started ) requiring different hkquantitytypeidentifier. code in healthkitmanager class: import foundation import uikit import healthkit class healthkitmanager { let healthkitstore:hkhealthstore = hkhealthstore() func authorizehealthkit(completion: ((_ success:bool, _ error:nserror?) -> void)!) { let healthkittypestowrite: set<hksampletype> = [ hkobjecttype.quantitytype(foridentifier: hkquantitytypeidentifier.appleexercisetime)! ] let healthkittypestoread: set<hkobjecttype> = [ hkobjecttype.quantitytype(foridentifier: hkquantitytypeidentifier.appleexercisetime)! ] // if store not available (for instance, ipad) return error , don't go on. if !hkhealthstore.ishealthdataavailable() { let error = nserror(domain: "com.example", code: 2, userinfo: [nslocalizeddescriptionkey:"healthkit no...

Read a PDF File in ColdFusion -

problem: way determine pdf file belongs who? meaning, lets have 30 doctors, , have 35 pdf files. let doctor has 5 pdf files belonging doctor a. way know 35 pdf files belong doctor? this read pdf comes play. however, not sure how read pdf file in coldfusion , determine when read should end when doctor name has been found. open jquery , javascript know in coldfusion first. any appreciated.

perl - Checking if filename exists in current directory -

i have script trying modify depending on location executed from, checking see if there file name regression_user.rpt , if so, make new file called regression_user1.rpt . i've found solutions im not sure how change want. what have following: my $filename = 'c:\temp\test.txt'; if(-e $filename){ //create file new name print("file $filename exists\n"); }else{ //create base file print("file $filename not exists\n"); } except, path $filename variable. there way incorporate execution location variable check? the purpose of make sure dont overwrite existing files (has happened 1 many times). if execution location mean current work directory, need following: my $filename = 'test.txt'; if execution location mean directory in script being executed found, can use following: use findbin qw( $realbin ); $filename = "$realbin/test.txt";

java - When and where are static variables/ methods useful? -

unless class private or part of java api, don't see using static advantageous part of oop. the time see using static being useful when need object incrementer every time create new object of same type. for example: public class duck { static int duckcount = 0; private string name; public duck(string name) { this.name = name; duckcount++; } } public class ducktesting { public static void main(string[] args) { system.out.println(duck.duckcount); duck 1 = new duck("barbie"); system.out.println(duck.duckcount); duck 2 = new duck("ken"); system.out.println(duck.duckcount); } } output: 0 1 2 update: useful answers found in java: when use static methods/variable so here's little exemple : let's need create people profiles, we'll make class named profile , need every profile have id public class profile{ int id; string name; public profile(string name,int id) {this.name=name; ...

android - Need to stretch TextView spans to fill whole view -

Image
is there solution stretch text spans parent bounds , take similar amount of space each one? desired result: i have now: p.s. trying use spans draw week (may try month later) because page drawing slow 365+ textviews each day. since didn't post of code, don't know how achieve layout. but if want customize own calendar view instead of provided calendarview component of native android, may use gridview , displays items in two-dimensional, scrollable grid. grid items automatically inserted layout using listadapter . this absolutely solve alignment issue of textview , may take @ sample of using gridview here: grid view . also may refer blog use gridview create custom calendar: android customization: how build ui component want , java native android, xamarin, they're quite similar.

css - How to run postcss and its plugins in bootstrap-loader? -

import new styles , details through. appstyles: ./src/scss/app.scss unfortunately autoprefix or css fix not working webpack 😞 webpack.config.js const webpack = require('webpack'); const path = require('path'); const extracttextplugin = require('extract-text-webpack-plugin'); const htmlwebpackplugin = require('html-webpack-plugin'); const cleanwebpackplugin = require('clean-webpack-plugin'); const bootstrapentrypoints = require('./webpack.bootstrap.config'); const extractplugin = new extracttextplugin({ filename: '[name].css' }); const dist_dir = path.resolve(__dirname, 'dist'); const src_dir = path.resolve(__dirname, 'src'); const config = { // entry: [src_dir + "/index.js"], entry: [src_dir + "/index.js",bootstrapentrypoints.dev], output: { path: dist_dir, filename: "bundle.js" // publicpath: "/app/" }, module: { loaders: [ { ...

java - Error while downloading plugin from eclipse oxygen -

i have eclipse oxygen , jdk 8 installed having trouble in downloading plugin e.g tomcat plugin.if try installing eclipse marketplace getting below error http server unknown http response code (301): http://tomcatplugin.sf.net/update/content.xml general connection error response code=301 , header(0)=http/1.1 301 moved permanently my experience eclipse market place not stable , have issues trying install software whatever reason. suggest install different route downloading zipped archive site of plugin below. https://sourceforge.net/projects/tomcatplugin/files/latest/download?source=files this give zipped archive of update site download locally. once downloaded go eclipse ide , go -> install new software. in dialog appears click on "add.." in top right corner , popup appears, click on "archive.." (button on left side near bottom) , point zip file downloaded using file explorer dialog. after doing you'll see tomcat plugin tree node in m...

Python For Loop over XML -

i need iteration. root in xml sdnentry. if use [0] without iteration in doc, can retrieve text value it, when doing loop receive errors "last_names = sdns.getelementsbytagname("lastname"). attributeerror: 'nodelist' object has no attribute 'getelementsbytagname'" my working code- wihout iteration looks this: from xml.dom import minidom xmldoc = minidom.parse("/users/cohen/documents/project/sdn.xml") sdns = xmldoc.getelementsbytagname("sdnentry")[0] last_names = sdns.getelementsbytagname("lastname")[0] ln = last_names.firstchild.data types = sdns.getelementsbytagname("sdntype")[0] t = types.firstchild.data programs = sdns.getelementsbytagname("programlist")[0] #program.firstchild.data s = programs.getelementsbytagname("program")[0].firstchild.data akas = sdns.getelementsbytagname("akalist")[0] #child lastname.fourthchild.data = akas.getelementsbytagname("aka")[0]...

c++ - Does "Undefined Behavior" really permit *anything* to happen? -

this question has answer here: undefined, unspecified , implementation-defined behavior 8 answers edit: question not intended forum discussion (de)merits of undefined behavior, that's sort of became. in case, this thread hypothetical c-compiler no undefined behavior may of additional interest think important topic. the classic apocryphal example of "undefined behavior" is, of course, "nasal demons" — physical impossibility, regardless of c , c++ standards permit. because c , c++ communities tend put such emphasis on unpredictability of undefined behavior , idea compiler allowed cause program literally anything when undefined behavior encountered, had assumed standard puts no restrictions whatsoever on behavior of, well, undefined behavior. but relevant quote in c++ standard seems be : [c++14: defns.undefined]: [..] permissible...

angularjs - md-tab content and body overlapping -

i'm using md-tabs of angular material tabs getting overlapped. got fix when i'm visiting each tab @ least one's. below code. angular js version: 1.4  <md-content class="md-padding"> <md-tabs md-selected=0> <md-tab id="tab1" label="one" md-active="true" md-no-select-click="true"> <md-tab-label>item one</md-tab-label> <md-tab-body> view item #1 <br/> data.selectedindex = 1; </md-tab-body> </md-tab> <md-tab id="tab2" label="two" md-no-select-click="true" md-active="false"> <md-tab-label>item two</md-tab-label> <md-tab-body> ...

pandas - Merge multiple columns into one column list with [key:value] combination in Python -

let me preface question noting combined column not dictionary. resulting dataframe has square brackets within 'combined' column - appears list within dataframe int format [key1:value1, key2:value2, etc]. i'm trying convert dataframe this: import pandas pd test = pd.dataframe({'apples':['red','green','yellow'], 'quantity': [1,2,3],'tastefactor':['yum','yum','yuck']}) apples quantity tastefactor 0 red 1 yum 1 green 2 yum 2 yellow 3 yuck to format, combining keys values in each row new column: apples quantity tastefactor combined 0 red 1 yum ['apples':'red','quantity':'1','tastefactor':'yum'] 1 green 2 yum ['apples':'green','quantity':'2','tastefactor':'yum'] 2 yellow 3 yuck ['...

angular2 routing - Proper way to handle nested subscriptions in Angular 2 -

i'm trying create pagination angular 2 web app query parameters , observables. i've gotten things work code below, have feeling nesting subscriptions isn't idea. there better way this? blogs:any; page = 0; sub; ngoninit() { this.sub = this.route.queryparams .subscribe(params => { this.page = +params['page'] || 0; this.requestservice.getdata('posts', '..query string...') .subscribe(data => this.blogs = data.data); }); } nextpage() { this.router.navigate(['./'], { queryparams: { page: this.page + 1 }, relativeto: this.route } ); } you use .switchmap chain observable. ngoninit() { this.sub = this.route.queryparams .switchmap(params => { this.page = +params['page'] || 0; return this.requestservice.getdata('posts', '..query string...') }) .subscribe(data => this.blogs = data.data); }

php - Managing multiple related entities in one form -

i have form creating/editing parent element repeatable child element contains repeatable child entities. for sake of example, looks this: list group [root] list item item list item item how manage updating 3 sets of entities without having drastic wiping original items (list, item) database? storing encrypted value each individual entity inside hidden form input , decrypting on post/patch sufficient, or should @ potentially splitting views , code create/update operations require own controllers , views?

html - Complex Jquery show / hide -

background: i'am trying make form shows , hides boxes depening on user clicked. thing makes complicated there multitude of states controlled 2 click events. problem: 1 user has either input energy , gas usage 2 energy usage, or 3 let system make guess energy , gass usage or 4 let system guess energy usage. depending on user clicked correct input , select boxes should show up: initial: -> energy , gass usage input displyed, user clicks 'guess consumption' -> select boxes displayed initial: -> energy , gass usage input displyed, user clicks 'compare energy only' -> gas input dissapears, text compare energy re-appears, user clicks 'compare gas well' -> gas input re appears all of above works, doesnt work: initial: -> energy , gass usage input dispalyed, user clicks 'guess consumption' -> select boxes displayed, user clicks -> 'compare energy only', select box gas dissapears, user clicks -> know ...

javascript - Uncaught TypeError: Cannot read property 'filter' of undefined -

import react, {purecomponent} 'react'; import {textinput} '../../shared'; import {array} 'prop-types'; import { employeetable } '../employeetable/employeetable'; import './headersearch.scss'; export class headersearch extends purecomponent { static proptypes = { employees: array } constructor (props) { super(props); this.state = { searchvalue: null }; } _updatesearchvalue (value) { this.setstate({ searchvalue: value }); } render () { const employees = this.props.employees; let filteredemployees = employees.filter( (employee) => { return employee.name.indexof(this.state.searchvalue) !== -1; } ); return ( <div classname='header_search'> <ul> {filteredemployees.map((employee) => { ...