Posts

Showing posts from March, 2015

MarkLogic server side API, Javascript, cts.search, search only in specific nodes -

in marklogic xquery server side api there possibility run cts.search method in following manner: cts:search(//speech, cts:word-query("with flowers")) => ... sequence of 'speech' element ancestors (or self) of node containing phrase 'with flowers'. my question is, possible achieve such result using javascript api? namely, able run word-query on specific root-level nodes (as database hosts couple of different document types). (as nodes mentioned root nodes, using elementwordquery not seem handy way achieve goal). in javascript version of cts.search there no expression parameter xquery api . search words within specific element , text descendants, can use cts.elementwordquery . example, var resultsiterator = cts.search(cts.elementwordquery(xs.qname('speech'), 'with flowers')); for(var doc of resultsiterator) { // … } this iterates through each of documents. contained speech element, use doc.xpath('

Android fragments fun with ViewPager -

i'm using viewpager in app. there 3 fragments inside pageadapter set in viewpager. works fine , can switch between 3 fragments. have 3 buttons allow me switch between adapters 1 3. problem noticed when click buttons 1 , 3 @ same time. here's happens: fragment 1 - fragment 3 onattach onviewcreated onresume onpause onattach onviewcreated onresume onpause as can see above, second fragment never paused , therefore never resumed. both fragments modify same recycler view onresume behaviour above end incorrect state of recycler view. any thoughts on why might happening , how can fix this? a viewpager loads (by default) current page, previous page , next page, since have 3 pages second fragment resumed. the solution set onpagechangelistener , modify recycler view in onpageselected instead in onresume

regex - Expression to match strings starting with string, but not containing some other string? -

how construct expression matches these: start?foo=bar start.php starter but not these dontmatch start?foo=dontmatch notstart?foo=bar i intend use in .htaccess file. how expression: \bstart.*$(?<!dontmatch) online demo

c++ - Extending object scope out of if statement -

i have following c++ design problem. suppose have following class: class model { model(int numberofmodels, int flag=-1) : _models(numberofmodels), _flag(flag){ } void buildmodel(){ (int id=0; id<_models.size(); ++id) { if (flag == -1){ builderone builder; builder.build(&_models[id]); } else { buildertwo builder; builder.build(&_models[id]); } } } private: vector<simplemodel> _models; int _flag; }; where member function "buildmodel" builds vector of "simplemodel" object. "builderone" , "buildertwo" different builder class implements "build" method (or can inherited same basebuilder class using crtp). but above implementation quite cumbersome, since type of builder should predetermined "_flag" before entering loop. want following implementation of "buildmodel" method: void buildmodel(){ if (flag == -

c# - Unable to resolve service for type 'Microsoft.Owin.Security.IAuthenticationManager' while attempting to activate ApplicationSignInManager -

i'm using vnext identity 2 , error unable resolve service type microsoft.owin.security.iauthenticationmanager while attempting activate applicationsigninmanager . in startup.cs have : services.addscoped<signinmanager<applicationuser, int>, applicationsigninmanager>(); in applicationsigninmanager.cs class public sealed class applicationsigninmanager : signinmanager<applicationuser, int> { usermanager<applicationuser, int> _usermanager { get; } signinmanager<applicationuser, int> _signinmanager { get; } public applicationsigninmanager(usermanager<applicationuser, int> _usermanager, iauthenticationmanager authenticationmanager) : base(_usermanager, system.web.httpcontext.current.getowincontext().authentication) { usermanager = _usermanager; } } i've tried many different approaches , can't hurdle.

python - How to mix asyncio code in with blocking code? -

this question has answer here: how combine python asyncio threads? 1 answer how go mixing code/statements/functions want run outside main thread mixed in code strickly runs on main thread. in mobile world have tools rxjava, asynctask, runnables, rxswift , stuff drop in lines run in background , not bother fluidness of main code. so how utilize asyncio lib , intermingle non blocking code blocking code? def mumbojumbocode(): regularstuff = dosomeregularstuff() illgetitlater = sendsomestufftoawebsocketinthebackground(regularstuff) moreregularstuff = dosomemoreregularstuff() idontcarewhatitreturns = sendamessageoverthewire(illgetitlater) if (moreregularstuff => regularstuff): triggeralambdasomewhereinthecloud(moreregularstuff) you can simulate blocking code while in async mode, not other way aroun

android - How to get "Main Process" in WebIDE -

Image
i trying run privileged code console in webide. android firefox verison 39. desktop firefox version 38 using ubuntu doenst sync firefox release cycle. so anyways followed tutorial t: https://developer.mozilla.org/en-us/docs/tools/remote_debugging/firefox_for_android and able connect firefox on android on cellphone (samsung galaxy) not able see "main process" in dropdown here screenshot: does know what's up? starting develop addons android, installation uploading github , installing directly there github installer addon. but test stuff on fly critical use scratchpad or browser console test code. editing addon , reinstalling everytime cumbersome. when connecting remote device, firefox android, it's important desktop firefox the same version or later device, or else can strange behavior you're seeing here. so, if still have 39 on android, make sure use 39 or later on desktop.

syntax - Python line break in long "with x1 as y1, x2 as y2, x3 as y3" statement -

this question has answer here: python multi-line statement 3 answers i break long statement like: with x1() y1, x2() y2, x3() y3: # long line # i have tried: with ( x1() y1, x2() y2, x3() y3): # but syntax error. seems following works, find relatively difficult read: with x1( ) y1, x2( ) y2, x3( ) y3: # are there suggestions on how best format long with statement this? thanks. with x1() y1, \ x2() y2, \ x3() y3: try that. think it's important keep individual statements 1 line. backslash helps keep explicit > implicit style of python. reference here: https://www.python.org/dev/peps/pep-0008/

shiny - Using R radiant, issues with MathJax -

i've installed radiant, , have updated r studio , r latests versions. yet i'm still receiving strange "mathjax" error. withmathjax() show traceback rerun debug error in normalizepath(directorypath, mustwork = true) : path[1]="/www/mathjax/": no such file or directory any ideas correct this? more info on error: error when trying run radiant: see in browser (chrome) error: path[1]="/www/mathjax/": no such file or directory i see on command line radiant("marketing") listening on http://127.0.0.1:7160 error in normalizepath(directorypath, mustwork = true) : path[1]="/www/mathjax/": no such file or directory error in normalizepath(directorypath, mustwork = true) : path[1]="/www/mathjax/": no such file or directory info: rstudio version 0.99.465 – © 2009-2015 rstudio, inc. r.version() $platform [1] "x86_64-apple-darwin13.4.0" $arch [1] "

javascript - Trying to access webcam in html5: Firefox works, Chrome and Opera don't -

i'm trying access webcam through javascript. when use following minimal example below, expect see @ least popup, asking permission access webcam. this works on firefox, not on chrome or opera (all latest versions). obviously actual webcam content not yet displayed here, i'm merely initiating getusermedia (or browser specific variant) doesn't work. i'm not getting 'yep' or 'nope' popup (except on firefox). <!doctype html> <html> <head> <meta charset='utf-8'> <script> function onsuccess(stream) { alert('yes') } function onerror(error) { alert('nope') } function onload() { navigator.anygetusermedia = navigator.getusermedia || navigator.webkitgetusermedia || navigator.mozgetusermedia || navigator.msgetusermedia; navigator.anygetusermedia( {video:true, audio:false}, onsuccess, onerror ); } </script> </head> <body onload='onload()'> </body> </h

Avoid wget appending index.html to links -

i trying make static html copy of wordpress site can upload somewhere else, github pages. i use command: option 1: wget -k -r -l 1000 -p -n -f -nh -p ./website http://example.com/website it downloads entire site etc. main issue here adds "index.html" every single link. understand need view site locally, not required on static website host. so there way tell wget not modify links , add index.html them? for example creates: <a href="blog/2015/07/11/hello-world/index.html">hello world!</a> on default worpress hello world post. option 2: use mirroring command -k convert links: wget -e -m -p -f -nh -p ./website http://example.com/website then not apply index.html , retain domain name. but crawls http://example.com , indexes there. not want that. want /website root (because wordpress multi site). how fix this? i want rewrite hostname instead of stripping or keeping it. should go http://example.com/website/ (wordpress multi sit

javascript - Can't access database from views using MongoDB NodeJS Express -

i'm having trouble accessing database 1 of 2 views created app. created app using node.js, express , mongodb data store. data stored in collection called entries key-value pairing (date: 'date', link: 'string'). in database view can access , loop through json object 'entries' after can't seem same index view despite fact wrote test console.log(entries) , when open both pages separately prints result. when run code error: error cannot read property of undefined i wonder if missing in how referencing them in code. below app.js code: var express = require('express'); var path = require('path'); var favicon = require('serve-favicon'); var logger = require('morgan'); var cookieparser = require('cookie-parser'); var bodyparser = require('body-parser'); var router = express.router(); var moment = require('moment'); //database stuff var mongoose = require('mongoose'); var schema = mongoo

sapui5 - How map authorizations (and other sub-infos) in oData structure -

Image
this base schema of odata edm: thanks image filippo i have db structure: product (code, description, iva, price) |n | | | |1 purchase(id, product, customer) i want expose data using odata; can map in natural way product , purchase in 2 entityset: productset , purchaseset . if require example items of productset receive collection of 100 products; each product have 4 properties, example: { code:01, description: "blue pen", iva: "19", price: "2.99" } ok based on user logged, business logic before odata want send me more information (for example editable sub property): { code: {value:01, editable:false}, description: {value:"blue pen", editable:false}, iva: {value:19, editable:true}, price: {value:"2.99", editable:true} } (i can't sent new information in mode, have entity sets , properties...) what right way map editable infos in edm? new property?? you can achieve creatin

selenium webdriver - Testing of pre -filled text in a text box -

i have text box , data gets pre-filled in text-box.how verify text inside text box. html code :- <div id="blkinner_first_name_readonly" class="bhtextfieldwrapper"> <label class="blk_lbl" for="id_first_name_readonly">your first name</label> <input id="id_first_name_readonly" class="bhtextfield" type="text" disabled="disabled" value="" name="first_name_readonly"> </div> </div> since have not mentioned binding using, assume it's java. if following should work webelement element = driver.findelement(by.id("id_first_name_readonly")); //find attribute value stores value of auto field name string name = element.getattribute("value");

html - How to Print a variable in a function in PHP -

i have form, post="modelselector", when submitted, go through these codes. issue i'm facing is, want check value of $_post, know getting set calling "isset()". i want print/alert/pushout variable $productselection function selectproduct() { // save post in variable $productselections = $_post['modelselector']; // want print $productselection check value $frmvars['productselections'] = $productselections; $frmvars['windowsize'] = $windowsize; $frmvars['pagenum'] = 1; saveformvalues(0,'rundefmgr', $frmvars); // clear checkboxes $sel = array(); deleterundef(0,"*","run_def_edit","*"); } if(isset($_post['modelselector'])) { selectproduct(); } i have tried echo, reason not printing value in html. in advance. i want check value of $_post $_post array. use print_r($_post) or var_dump($_post)

three.js - billboarding vertices in the vertex shader -

code demonstrating issue (comment/uncomment out gl_position lines in vertex shader) var scene; var book; var shadermaterial; var renderer = new three.webglrenderer({ antialias: true }); renderer.setclearcolor(0x000000); document.body.appendchild(renderer.domelement); var camera = new three.perspectivecamera(55, 1, 0.1, 40000); window.onresize = function () { renderer.setsize(window.innerwidth, window.innerheight); camera.aspect = window.innerwidth / window.innerheight; camera.updateprojectionmatrix(); }; window.onresize(); scene = new three.scene(); camera.position.z = 25; camera.position.y = 15; scene.add(camera); var grid = new three.gridhelper(100, 10); scene.add(grid); var controls = new three.orbitcontrols(camera); controls.damping = 0.2; var lettersperside = 16; function createglpyhsheet() { var fon

c# - StyleBundle IncludeDirectory can not match some files? -

some css files can not include them head tag use stylebundle includedirectory name ends min.css why? bundles.add(new stylebundle("~/content/css").includedirectory("~/content/css", "*.css")); problem according doc provided microsoft note: unless enableoptimizations true or debug attribute in compilation element in web.config file set false, files not bundled or minified. additionally, .min version of files not used, full debug versions selected. enableoptimizations overrides debug attribute in compilation element in web.config file read this . so in debug mode, think should have non-min versions of css files.

Rails Nesting paths, not resources -

i have author model name field - has_many articles. i have article model name , description fields - belongs_to author , has_many comments. finally, have comment model, comment_text , article_id fields - belongs_to article, i looking nesting paths i. e. ,(authors/:id/comments) how nest paths, not resources? to clarify, don't want use author_id in comment model, when visit authors/:id/comments, should able see articles associated author , comment on them. author has_many :articles has_many :comments, :through => :articles (this line give comments author) article belongs_to :author (means has author_id field) has_many :comments comment belongs_to :article if above structure there in model, can do: @author = author.where(:id => some_id) @comments = @author.comments you don't need have author_id in comment table.

java - Webservice restricted to a single thread? -

today, while testing code slow (had wait data slow source) in restlet, noticed wildfly not allow me start additional threads, , run restlet in single thread well, meaning multiple connections had wait previous 1 finish. oddly enough, using managedexecutorservice , configured through urn:jboss:domain:ee:3.0 subsystem allow more threads still limited spawning 1 new thread, worked off requests sequentially. have misunderstood how subsystem supposed work ? or restriction resteasy aspect somehow ? have in past used normal webservlets concurrency without experiencing behavior. maybe problem on client side. how test code? have tried access rest service in wildfly 8.2 putting thread.sleep(5000) in method. if i, example, open 2 tabs in firefox or chrome, 1 request processed concurrently, , takes 10 seconds . however, using firefox , chrom in parallel, both response in 5 seconds.

Oracle Date Format Mystery - Why is it not an acceptable format? -

i new sql have still written few queries similar 1 writing now. whatever reason when run query returned 'ora-01821: date format not recognized' error. looked , looked around here on stack , other places , believe syntax make sense confused why i'm thrown error. my query runs based on day of month is. if 1st, should run 15th-last day of previous month. if 16th, should run 1st-15th of current month. this code when first day of month: select case when to_char(sysdate, 'yyyymmdd') = to_char(sysdate, 'yyyymm' || '01') (do lot of things) . . . end firstreportgroup *datetable* between between to_char(sysdate, 'yyyymm' || '16') , to_char(last_day(sysdate), 'yyyymmdd'); and code when 16th: select case when to_char(sysdate, 'yyyymmdd') = to_char(sysdate, 'yyyymm' || '16') (do lot of things again) . . . end secondreportgroup *datetable* between to_char(sysdate, 'yyyymm&#

c# - How to map 2 routes to the same URL? -

i want webpage different things depending on webpage accessed before was. basically, know how make data ever-lasting persistence. however, method involves using query strings, don't want second user able access webpage query strings have been created before. so, trying around problem mapping multiple routes single url. possible in c# mvc? specifically, whenever click link view(it can found below), route called first route has url search_history_page. meaning route corresponding action method not called. the_search_history_page here route.config using system.web.mvc; using system.web.routing; namespace cbcm_audio_searcher { public class routeconfig { public static void registerroutes(routecollection routes) { routes.maproute( name: "route_that_leads_to_the_home_page_as_the_first_page", url: "the_home_page", defaults: new { controller = "first_", acti

java - Jtable is not printing (blank document is printed) -

jtable table=somevalues; table.print(jtable.printmode.fit_width,null,null,true,null,true,null); the print dialog box opening when print table not printed blank document printed. tell me going wrong? have **edited ** , code values is string data[][]=new string[1][9]; string head[]=new string[9]; head[0]="date"; head[1]="q1 rate per piece"; head[2]="q1 total pieces"; head[3]="q2 rate per piece"; head[4]="q2 total pieces"; head[5]="q3 rate per piece"; head[6]="q3 total pieces"; head[7]="total pieces"; head[8]="total amount"; data[0][0]="a"; data[0][1]="b"; data[0][2]="c";

Is there a function in r to read multiple data files which have matching columns into a single dataframe? -

i have multiple .txt files, of similar in format different values , want combine them single dataframe. is there function in r read multiple data files have matching columns single dataframe? if want append datasets, can following : store names of datasets in vector using dir() : > files <- dir("data/") read files using lapply() , read.csv or other similar function (ie read_csv() in readr package) : > lfiles <- lapply(files, function(x) {read.csv(paste0("data/", x))}) put dataframes using do.call() , rbind > df <- do.call(rbind, lfiles)

curve - Using cubiccurve in OpenLayers 2? -

i want use cubiccurve in openlayers 2.13, , have added necessary files, when drawing line drawn instead of curve. files available on website: http://trac.osgeo.org/openlayers/ticket/1715#no1 drawing curve important , no way control curve. can 1 me? <html> <head> <script src="http://dev.openlayers.org/openlayers.js" type="text/javascript"></script> <title>ya mahdi</title> <style> html,body { height: 99%; width: 99%; } #map { width: 100%; height: 100%; border: 1px solid black; } </style> <script> mmgetcurvepoints = function(ptsa, tension, isclosed, numofsegments) { if (ptsa.length <= 2) return ptsa; tension = typeof tension === 'number' ? tension : 0.5; isclosed = typeof isclosed === 'boolean' ? isclosed : false; numofsegments = typeof numofsegments === 'number'

javascript - Binded code executes only on one page, after redirect it stops working. Mobile jQuery -

heres scenario. i'm using mobile jquery. meaning html gets updated using ajax. i have navigation menu on top. i have 2 pages (id= "#p1" , id="#p10"). both pages contain same nav menu. when user clicks on icon on menu should slide 1 of divs screen. when user click "x" or outside of new div should closed. i'm handling using next js code. $(document).bind('pageinit', function() { alert('test'); $(document).on('click' , '.menu_open' , function() { $('.mask').addclass('mask_visible'); $('#menu').animate({ marginleft: "0%", opacity: 1 }, 200); $('#menu').css('display', 'block'); }); $(document).on('click','.menu_close , .mask ', function() { $('.mask').removeclass('mask_visible'); $('#menu').animate({ marginleft: "-100%", opacity: 0 }, 200); });

javascript - Loop within a loop appears to overwrite all results with the final result -

i'm trying loop through array of months within array of 'years' can calculate count each month using custom angular filter. below, in first single while loop create structure i'm going loop through. while(i < itemyears.length) { //chuck null end date. push year part of other end dates months array. if (itemyears[i].end !== undefined && itemyears[i].end !== null) { completebymonth.push({ year: itemyears[i].end.substring(0,4), months: months }); } i++; //increment } structure above loop creates: { year: 2015, months: [ { number: '01', text: 'january', count: 0 } ... ... ] } in while within while loop, loop through each month of each item. //iterate throught years while(j < completebymonth.length) { var year = completebymonth[j], k = 0; //iterate through months year.

OpenSSL OCSP Error -

i set openssl ocsp-responder , error when try verify certificate: waiting ocsp client connections... error creating serial number index:(2,5,6) 139796227208864:error:0e06d06c:configuration file routines:nconf_get_string:no value:conf_lib.c:335:group= name=unique_subject the index.txt looks this: v 20250623124428z "empty" 71 unknown /c=de/st=nrw/l=minden/o=fh bielefeld/ou=technik/cn=h4wrsuohq9@pqr36g64vq.brc v 20250623124434z "empty" c9 unknown /c=de/st=nrw/l=minden/o=fh bielefeld/ou=technik/cn=fyonrgqouf@ioyo0facqm.6vv r 20250623173301z 150626174629z 3 unknown /c=de/st=nrw/l=minden/o=fh bielefeld/ou=technik/cn=****@****.de v 20250623124441z "empty" da unknown /c=de/st=nrw/l=minden/o=fh bielefeld/ou=technik/cn=fovgwbka1j@otfd0az5ud.qah v 20250623124447z "empty" 81 unknown /c=de/st=nrw/l=minden/o=fh bielefeld/ou=technik/cn=reeu9ujiyu@tuloikdqcu.h23 r 20250623173250z 150626174629z 1 unknown /c=de/st=nrw/l=minden

java - Wrong column type on hibernate -

when change hibernate.hbm2ddl.auto value update to validate , gives me error message: caused by: org.hibernate.hibernateexception: wrong column type in public.element column phasefroma. found: float4, expected: float the field referencing is: @column(nullable = false) @basic private float phasefroma; and mapped postgresql real type. i've read solution put columndefinition in annotation, doesn't work correctly.

swift2 - Sorting a struct array or dictionary in Swift -

i have struct dictionary (taken swift: how declare 2d array (grid or matrix) in swift allow random insert , @rintaro ): struct matrix2d<keyelem:hashable, value> { var _storage:[keyelem:[keyelem:value]] = [:] subscript(x:keyelem, y:keyelem) -> value? { { return _storage[x]?[y] } set(val) { if _storage[x] == nil { _storage[x] = [:] } _storage[x]![y] = val } } } now sort dictionary x, can't find way achieve this. event possible sort dictionary? or should maybe use solution array instead of dictionary? struct matrix2d<t> { var _storage:[[t?]] = [] subscript(x:int, y:int) -> t? { { if _storage.count <= x { return nil } if _storage[x].count <= y { return nil } return _storage[x][y] } set(val) { if _storage.count &

magento - adminhtml tag in config.xml file does not work -

i new magento , making custom module , want work on admin end after installing extension error: fatal error: class 'submitdigital_customlogo_helper_data' not found in /var/zpanel/hostdata/zadmin/public_html/unisport_com/app/mage.php on line 547 after insatalling extension when clear cashe give me error. after somestudy found error due file @ path: app/code/local/submitdigital/customlogo/etc/config.xml <?xml version="1.0"?> <config> <modules> <submitdigital_customlogo> <version>0.1.0</version> </submitdigital_customlogo> </modules> <global> <helpers> <customlogo> <class>submitdigital_customlogo_helper</class> </customlogo> </helpers> <blocks> <customlogo> <class>submitdigital_customlogo_block</class> <

gwt - Vaadin extension: MouseOverHandler -

in simple extension add vhorizontallayout vlabel . layout add mouseoverhandler , method never invoked. wrong? (everything else works - i.e. label displayed below extended field) connector: @connect(myextension.class) public class myextensionconnector extends abstractextensionconnector { private static final logger log = logger.getlogger(myextensionconnector.class.getname()); private final vhorizontallayout layout = new vhorizontallayout(); @override protected void extend(serverconnector target) { log.info("-->extend"); vlabel label = new vlabel(); label.settext("some text"); layout.add(label); final widget field = ((componentconnector) target).getwidget(); field.addattachhandler(new attachevent.handler() { @override public void onattachordetach(attachevent event) { log.info("-->onattachordetach: " + event.todebugstring()); if (event.isattached()) { field.

ios - Cannot find an initializer for type -

i'm getting error saying cannot find initializer type 'smileyscene' accepts argument list of type '(filenamed: string)' i'm new swift please help. import uikit import spritekit introlabel?.runaction(fadeout, completion: { let doors = sktransition.doorwaywithduration(2.0) let smileyscene = smileyscene(filenamed: "smileyscene") self.view?.presentscene(smileyscene, transition: doors) the compiler telling type smileyscene not declare initializer arguments trying use initialize smileyscene constant. make sure implementation of smileyscene contains appropriate initializer , initializer visible "the outside world." is, initializer should not marked private .

Local vs Global imports python -

i not seeing answer out there, apologies if duplicate. basically, trying understand how force interpreter (2.7) import module site packages if there conflict. example imagine running python directory (top_level) has following structure: top_level ----cool_mod ----init.py ----sweet_module.py but have installed sweet module site packages. when in directory (but no others) if run: from cool_mod.sweet_module import * you import local module, not global one. can change somehow? this situation might arise case: top_level setup.py ----cool_mod ----init.py ----sweet_module.py you can run cool_mod.sweet_module before installing if working directory top_level. after installing can import cool_mod.sweet_module anywhere. however, if ever import directory, after installation, still import local copy inserting site package directory @ begining of sys.path, , import. or, use imp.load_source load module specified path.

iphone - iOS 8 Share Extension not working on device -

Image
i have creat new target share extension in xcode , run on device. don't know why when run share extension on devices (iphone 5c, iphone 5s, iphone 6) won't show. pls me! suggestions on how fix appreciated. i have creat new/target/ share extension i run app notes on device , extension not show i had same issue , solved changing "deployment target" of extension value below ios version of device. yes, extension has own deployment target!

csv - Repeating Data after web scraping using python and beautiful soup4 -

i trying scrape data garmin site golf. want name of golf course , address after running script. have noticed codes repeats first page data on , on again. noticed page numbers on website not start @ 1 @ 10 second page. how go extracting data website , getting , instead of repeat of first page. import csv import codecs import requests bs4 import beautifulsoup courses_list= [] in range(10): url = "http://sites.garmin.com/clsearch/courses?browse=1&country=us&lang=en&per_page={}".format(i) r = requests.get(url) soup = beautifulsoup(r.content) g_data2=soup.find_all("div",{"class":"result"}) item in g_data2: try: name= item.contents[3].find_all("div",{"class":"name"})[0].text print name except: name='' try: address= item.contents[3].find_all("div",{"class":"location"})[0].text except: a

javascript - Polymer 1.0 Paper Radio Group Conditions -

i can't function trigger when button selected in polymer 1.0. when, example, "medium" selected, alert should pop up. new polymer , trying head around it. <dom-module id="my-app"> <template> <paper-radio-group selected="{{selection}}"> <paper-radio-button name="small" label="small"></paper-radio-button> <paper-radio-button name="medium" label="medium">meduim</paper-radio-button> <paper-radio-button name="large" label="large"></paper-radio-button> </paper-radio-group> </template> <script> polymer({ is: "my-app", ready: function () { if (this.selection === "medium") { alert("medium"); } } }); </script> </dom-module> essentially, you'll need wire

mysql - Laravel 5 database query retrieve first table data but not in other table -

here give mysql sample code. want write code in laravel 5. e.g. select * employees employees.id not in(select team_employees.employee_id team_employees) please help. thanks. hi found bellow answer. pretty cool , easy. commenting....... think bellow code you........ > db::table('employees') > ->select(['employees.id', 'employees.code', 'employees.full_name']) > ->wherenotexists(function ($query) use ($request) { > $query->select(['team_employees.employee_id']) > ->from('team_employees') > ->whereraw('team_employees.employee_id = employees.id') > ->where('team_employees.team_id', $request['team_id']); > }); $request parameter send client side.....

java - Improve the code of an algorithm of combinations -

i realized algorithm generating combinations. works in following way, if have input: [a, b, c] the combinations [a], [b], [c]. [a, b], [a, c], [b, c], [a, b, c]. while if have in input: [1,1,2,3] the combinations be: [1], [2], [3], [4], [1,2], [1,3], [2,3 ], [1,1,2,3]. however, algorithm has running time of when input list of size 4, if list of size 5 or more program stops , gives me java.lang.outofmemory (i increased memory in java). 1 problem fact have used linkedlist , i'm not sure. is there better solution? private list<elemento> combinazionemassima = new arraylist<>(); private log logger = logfactory.getlog(combinazioni3.class); public combinazioni3(list<elemento> generacombinazionemassima) { this.combinazionemassima = generacombinazionemassima; } public void combine() { this.findallcombinations(combinazionemassima); } private static class node{ int lastindex = 0; list<elemento> currentlist; public