Posts

python - Values from a class instance's attribute being added to a different instance of the same class -

this question has answer here: “least astonishment” , mutable default argument 29 answers i'm parsing pdfs extract table data using pdftable class. when create class instance create class instance seems first class instance file_1.cells being prepended second class instance file_2.cells. cannot figure out why happening don't think i'm creating class variables instance variables. reason data set_cells persisted when class instance instantiated. happening? from pdfminer.pdfdocument import pdfdocument pdfminer.pdfpage import pdfpage pdfminer.pdfparser import pdfparser pdfminer.pdfinterp import pdfresourcemanager, pdfpageinterpreter pdfminer.converter import pdfpageaggregator pdfminer.layout import laparams, lttextbox, lttextboxhorizontal, lttextlinehorizontal tabulate import tabulate utils import clean_string collections import namedtuple class pdftable(...

java - Accessing nested objects in JSP View -

i have list of objects. object of following class: @entity @table(name="user") public class user { @id @column(name = "userid" ,unique=true, nullable=false) private string id; @column(name="firstname") private string firstname; @column(name="lastname") private string lastname; @column(name="title") private string title; @embedded private address address; @manytomany @jointable(name="phone_user", joincolumns={@joincolumn(name="userid")}, inversejoincolumns={@joincolumn(name="phoneid")}) private list<phone> phones; public string getid() { return id; } public void setid(string id) { this.id = id; } public string getfirstname() { return firstname; } public void setfirstname(string firstname) { this.firstname = firstname; } public string getlastname() { return las...

javascript - Chrome does not show my website -

website not loading javascript on chrome not know why, while mozilla shows properly. not know whats wrong. website main function 1. geo-location of client (first lat long , find nearest city) 2. weather data openweathermap api 3. display in website. link website // taken , modifed https://roessland.com/blog/free-code-camp-3-a-random-quote-machine/ $(document).ready(function () { // geo if (navigator.geolocation) { navigator.geolocation.getcurrentposition(function(position) { var lat_lat = position.coords.latitude; var lon_lon = position.coords.longitude; //google maps var geocoder = new google.maps.geocoder(); var latitude = lat_lat; var longitude = lon_lon; var latlng = new google.maps.latlng(latitude,longitude); geocoder.geocode({ latlng: latlng }, function(responses) { if (responses && responses.length > 0) { // starting weather api var add...

python - Adding car make model year country to dictionary -

this function supposed loop through dictionary(database): { data_base = { "mercedes": [("e-class", 1970, "classic" , "germany"),("clk", 2000, "sport" , "poland")] "fiat": [("uno" , 1980, "coupe" , "italy")] "jaguar" : [("s-type", 2000, "classic", "england"),("x-type", 2005,"luxury", "england")] } function accepts database (above example), updates other information it. if car in , attributes match, no duplication. also, sort asciibetically car model. function updates only, no returns. functionx (data_base,make,model,year,style,country): key,value in data_base.items(): if key == make , value[0] != model: # condition ensure update not duplicate database[key].extend((model,year,style,country)): when looping on data_base.items() , value not think is. list of models a...

gradle - Strange javafx app look on android -

Image
i've got problem javafx ported app on android. after first launch looks that: but when go home screen , rejoin application looks should be. build.gradle: buildscript { repositories { mavencentral() maven { url "https://plugins.gradle.org/m2/" url 'http://nexus.gluonhq.com/nexus/content/repositories/releases' } } dependencies { classpath 'org.javafxports:jfxmobile-plugin:1.1.1' } } apply plugin: 'org.javafxports.jfxmobile' repositories { mavencentral() maven { url 'http://nexus.gluonhq.com/nexus/content/repositories/releases' } } mainclassname = 'pl.siemaeniu500.wszywka.main.main' ext.charm_down_version = "2.0.1" dependencies { compile "com.gluonhq:charm-down-common:2.0.1" //compile 'com.gluonhq:charm-glisten:3.0.0' compile 'com.gluonhq:charm:2.1.1' compile files('d:/android/sdk/platf...

c++ - compiler seems cannot find boost/shared_ptr.hpp -

i using mac os 10.11.6 i trying install opengv on mac. part of dependencies needed build opensfm library. so, did is: brew install homebrew/science/ceres-solver brew install boost-python brew install eigen git clone https://github.com/paulinus/opengv.git cd opengv mkdir build cd build cmake .. -dbuild_tests=off -dbuild_python=on make install but got error: in file included /users/hilman_dayo/opengv/src/relative_pose/modules/main.cpp:47: /users/hilman_dayo/opengv/include/opengv/math/sturm.hpp:43:10: fatal error: 'boost/shared_ptr.hpp' file not found #include <boost/shared_ptr.hpp> ^ 1 error generated. make[2]: *** [cmakefiles/opengv.dir/src/relative_pose/modules/main.o] error 1 make[1]: *** [cmakefiles/opengv.dir/all] error 2 make: *** [all] error 2 how can solve this? checked, , file there @ /usr/local/include/boost/shared_ptr.hpp . if ever needed, output during cmake : -- c compiler identification appleclang 7.3.0.7030031 -- cxx compiler iden...

css3 - Is it possible to select nth-child(x) but only if it is not the last child? -

i want select third element within ul , if not last element in ul . sample 1: <ul> <li>home</li> <li>cat 1</li> <li>subcat 1</li> <li>product</li> </ul> sample 2: <ul> <li>home</li> <li>cat 1</li> <li>product</li> </ul> i want single css selector, which, sample 1, selects li "subcat 1", , sample 2, not select anything. ul > li:nth-child(3) work sample 1, match 'product' li in sample 2, don't want do. in case i'm not able modify html. you use :nth-child :not achieve need. here example. ul li:nth-child(3):not(:last-child) { color: red; } <ul class="sample1"> <li>home</li> <li>cat 1</li> <li>subcat 1</li> <li>product</li> </ul> <ul class="sample2"> <li>home</li> <li>cat 1...