Posts

Showing posts from March, 2012

json - How to serialize relation -

try post json api serializer: from rest_framework import serializers models import order, orderproduct, delivery, payments class deliveryserializer(serializers.modelserializer): class meta: model = delivery fields = ('delivery_time','delivery_adress','phone')#'id', def create(self, validated_data): """ create , return new `snippet` instance, given validated data. """ return delivery.objects.create(**validated_data) class paymentsserializer(serializers.modelserializer): class meta: model = payments #fields = (title) #'id', def create(self, validated_data): """ create , return new `snippet` instance, given validated data. """ return payments.objects.create(**validated_data) class orderserializer(serializers.modelserializer): delivery = deliveryserializer(r

c# - SSL Certificate: A specified logon session does not exist -

i have created method create certificate, store certificate store , bind port. here method: private static void createstoreandbindcertificate(string a_ipaddress, string a_ipport) { guid _appid = guid.parse("b30f5be6-2920-4fa1-b0a6-5a56b63051bc"); var _rootcert = new rootcertificatecontainer("cn=myapp root ca", 1024); var _servercert = new servercertificatecontainer("cn=myappapi", _rootcert, 1024); //here certificate created , store string _pathrootcertcer = path.combine(path.gettemppath(), "root-cert.cer"); string _pathservercerpfx = path.combine(path.gettemppath(), "server-cert.pfx"); _rootcert.x509certificate.privatekey = null; file.writeallbytes( _pathrootcertcer, _rootcert.x509certificate.export(x509contenttype.cert) ); var _servercertpfx = new pfx(_servercert.x509c

CSS Timer text moves when it comes at number 1 -

does knows how change width of character? have timer , position good, when comes @ number 1, width of timer smaller. should same position time. there knows solution this? i'm using digital-7 font. css: #time { font-family: digital-7; font-size: 60px; position: absolute; margin: auto; top: 65px; left: 342px; color: white; text-align: right; display: block; width: 30px; text-align: right; letter-spacing:5px; } html: <span id="time"></span> the problem is, using font not monospaced (all letters use same "invisible box" placed behind), solution you, can switch font - , requires no additional coding. your font provided monospaced

asp.net - Can I Use one model attribute two times in one view -

i using visual studio 2013 framework 4. i have 1 model attribute firstname. this model [required] [display(name = "investigator")] public string firstname { get; set; } this view using: in dropdownlist: @html.dropdownlistfor(model => model.firstname, model.names, "enter new ...", new { @id = "ddlnames" }) @html.validationmessagefor(model => model.firstname) in textbox: @html.editorfor(model => model.firstname) i using dropdownlist selection , in dropdownlist have 1 option add new first name , on click on giving option add new first name text box having same name means (firstname) model of razor new entry. so question can use firstname attribute of model dropdownlist selection , new entry well. i getting value in dropdownlist selection when enter new first name value not coming. please knows me solve this. thanks in advance.

vb.net - Pass model to MVC controller -

so i'm having issue passing param through controller. when ajax.beginform , pass in follows: <% using ajax.beginform("multiprocess", "orders", new multiprocessrequestviewmodel {.searchparams = model.searchparams},new ajaxoptions {.updatetargetid = "ordersoutput", .onsuccess = "afterread", .loadingelementid = "readingorders"})%> the value appears 'nothing' . however on same page if following: <%=new javascriptserializer().serialize(model.searchparams) %> to try , gauge if value set. can see value indeed set , correct. the entire section reference: <% using ajax.beginform("multiprocess", "orders", new multiprocessrequestviewmodel {.searchparams = model.searchparams}, new ajaxoptions {.updatetargetid = "ordersoutput", .onsuccess = "afterread", .loadingelementid = "readingorders"})%> <%=new javascriptserializer().serialize(model.search

javascript - Error with $cordovaSQLite plugin on ionic -

i want query's on db ... problem when run app, screen blank, don't why. read in ionic.platform.ready() , run perfect when want use in controller wrong when blank screen... that's code in .ready() function: var primera=[]; var contador=0; var citas = window.sqliteplugin.opendatabase({name: "citas.db", location: 'default'}); var query= "select * usuario codigo=?"; $cordovasqlite.execute(citas, query, [0]).then(function(data){ contador=data.rows.length; (var = 0; < data.rows.length; i++) { var datos={ codigo:'', telefono:'', password:'', status:'' }; datos.codigo = data.rows.item(i).codigo; datos.telefono = data.rows.item(i).telefono; datos.password= data.rows.item(i).password; datos.status= data.rows.item(i).status; primera.push(datos); }//fin del //alert("selec

javascript - How can I convert React Element to Html element? -

now i've using ag-grid can create custom renderer each data cells it's required html elements for example they're elements can created calling document.createelement() but want use react element custom renderer convenient don't sure can or not ? you can try use getdomnode example: this.refs.giraffe.getdomnode() , or: import reactdom 'react-dom'; ... const submitbtn = reactdom.finddomnode(this.refs.submitbutton) but way has deprecation issues, more here: react.js: difference between finddomnode , getdomnode

r - How to create a double loop? -

i know how create double loop. in code, multiple regression on 1000 samples (each sample size: 25) then, create t test values each sample out of 1000 nullhypothesis: beta3 value sample = 'real' beta3 value. know 'real' beta3 value monte carlo simulation (beta 3 = value of third coefficient of regression). however, code works far. now, want same procedure sample sizes of 50, 100, 250, 500, , 1000 (each sample size 1000 times). how can realise goal loop. pleased if me! here can see code: n <- 25 b <- 1000 beta3 <- 1.01901 #'real' beta3 value t.test.values <- rep(na, b) for(rep in 1:b){ ##data generation d1 <- runif(25, 0, 1) d2 <- rnorm(25, 0, 1) d3 <- rchisq(25, 1, ncp=0) x1 <- (1 + d1) x2 <- (3 * d1 + 0.6 * d2) x3 <- (2 * d1 + 0.6 * d3) exi <- rchisq(25, 5, ncp = 0) y <- beta0 + beta1*x1 + beta2*x2 + beta3*x3 + exi ## estimation lmobj <- lm(y ~ x1 + x2 + x3) ## extract

java - How to do thread interacting? -

i want use multithreading (low -level threading) running problem. problem because of @ least wait method called 1 thread , notifyall called thread problem time run program seems me notifyall called before wait "will wait forever". my code below : public class reader extends thread { calculator c; public reader(calculator cal) { c=cal; } public void run (){ synchronized(c) { try { system.out.println("waiting calculation"); c.wait(); } catch (interruptedexception ex) {} system.out.println("total is:" +c.total); } } public static void main (string[] a) { calculator calculator=new calculator(); new reader(calculator).start(); new reader(calculator).start(); new reader(calculator).start(); new reader(calculator).start(); new reader(calculator).start(); } } class calc

php - How to setup F3 .htaccess with MAMP on Mac? -

i switched os windows mac , having problem running locally. installed mamp under /applications/mamp. /applications/mamp/htdocs/.htaccess file: rewriteengine on rewritebase /abc/ # skip files , directories rewrite rules below rewritecond %{request_filename} -l [or] rewritecond %{request_filename} -f [or] rewritecond %{request_filename} -d rewriterule ^ - [l] rewriterule (.+\.(?:gif|png|jpe?g|css|js|woff|ttf))$ /abc/$1 [nc,l] rewriterule .* /abc/index.php [l] this worked on windows environment loads of resources , throws following error: not found (404) - http 404 (get /index.php) array(1) { [0]=> array(6) { ["file"]=> string(42) "/applications/mamp/htdocs/abc/index.php" ["line"]=> int(27) ["function"]=> string(3) "run" ["class"]=> string(4) "base" ["type"]=> string(5) "->" ["args"]=> array(0) { }

navigation - NavigationExperimental Header cuts off top of AnimatedView scenes -

in react-native's navigationexperimental, animatedview's header rendered overlay. this means scenes rendered animated view have tops cut off header. what's best way prevent tops of scenes being cut off? can add padding top of every scene, seems hack. animatedview due deprecated int next release. can use navigationtransitioner instead. navigationtransitioner receive 1 render prop called render , unlike animatedview had renderscene , renderoverlay , should render header part of scene. solve issue reported. see this post more information.

angularjs - How to bind variable when calling directive using element.addClass -

i calling directive adding class element , compiling element eg var el = angular.element(document.queryselector(".ctrl-outer-container")); el.addclass('directive-name); $compile(el)(scope); while calling directive way how can bind variable passing directive (2 way binding) i tried el.attr('attr-name', attr.value)

How to pull in an array to a PHP MySQL output? -

i trying pull in date each part of database, missing element make work , not sure missing? $modified[] = array(date("m/d/y", strtotime($row[audit_modify_date]))."<br />".date("g:i a", strtotime($row[audit_modify_date])),); //query ($i=0; $i < count($result); $i++) { echo "<tr>"; echo "<td>$modified</td>"; echo"<tr>"; } they output says array. you printing array, not elements in array echo "<td>$modified</td>"; either for ($i=0; $i < count($result); $i++) { echo "<tr>"; echo "<td>".$modified[$i]."</td>"; echo"<tr>"; } or foreach ($modified $m) { echo $m; } edit what? don't understand you're doing

forEach mongodb PHP -

is there efficient way use foreach in mongodb php, problem able add new row csv file every element in result array. 1 of possible solution use $data mongo cursor $records = iterator_to_array($data); $file = fopen("contacts.csv","w"); foreach ($records $record){ fputcsv($file,$record); } but, loading entire data memory not scalable option problem, data can huge.is there better alternative way able use foreach. how use foreach mongo php $file = fopen("contacts.csv","w"); foreach ($data $record){ $contact = iterator_to_array($record); fputcsv($file,$contact); } this solution works $data remains cursor , iterator_to_array() inside loop converts individual record array placed in csv file.

c# - How to check the string formatting -

i learning simple console applications c# , have faced issue not manage solve. i've tried searching solution on stack overflow / internet, either don't know how search it, or there no answer i'm seeking. situation: creating simple console app asks following things user: first name, family name, age. every prompt (question) has been introduced user via following code: system.console.write("what date of birth? "); string dob = system.console.readline(); i have made simple checker names, seeks if they're between 1-30 characters , if are, application writes results in text document. question: how can check if date of birth has been written in following format: dd.mm.yyyy ? this return if it's valid date or not: string dob = system.console.readline(); datetime dtresult; bool isvalid = datetime.tryparseexact(dob, "dd.mm.yyyy", system.globalization.cultureinfo.invariantculture, system.globalization.datetimestyles.none, out dtr

excel - Searching for variable length, delimited string based on the location of another string -

Image
my first ever post... experienced excel, not string searching/parsing... i have bunch of fields/cells of following form: "formid";s:4:"1001";s:11:"mkto_mrm_id";s:6:"287227";s:15:"activity_name_m";s:59:"ca erwin data modeler community edition evaluation software";s:13:"csu_driver__c";s:0:"" the format - label, length of upcoming string, string - so, label 'formid' length of upcoming field 4 , value '1001' . the number of labels , values can vary field field what want parse data find half dozen label/value pairs out of data , stick values in separate cell in spreadsheet. there lots of delimiters, think simplest approach - if doable - find label want, return whatever between next set of quotes. so in above example search "mkto_mrm_id" return between next 2 quotes - in case "287227" . so have half dozen formulas each in column right of data parse data lo

javascript - How I convert this jQuery function to AngularJS Directive? -

i have onclick="starttimer({{ $index }},{{ product.time }})" reason databindings doesn't render, have use ng-click for rendering values ng-click no working jquery script <script> function starttimer(id, time) { $("#" + id).next("div").removeclass("claimactive"); $("#" + id).next("div").addclass("claimwait"); $("#" + id).removeclass("timeractive"); $("#" + id).addclass("timerwait"); $("#" + id).next("div").children("a").text("wait"); if (time <= 60) { if (time < 10) $("#" + id).children("#m").text("0" + time); else $("#" + id).children("#m").text(time); $("#" + id).children("#s").text("30"); } else { if (time < 600) $("#&quo

.net - I forgot to provide database connection in umbraco -

while installing umbraco forgot provide database configuration , want have database proper connection. checked web.config file couldn't understand should put connection , don't want reinstall unbarco. please me problem if installed umbraco database, can't switch connection strings , expect fine. asked same question before , got same answer - reinstalling best option, since umbraco bunch of database setup when installing. shouldn't problem @ all, since you've installed it, right? the connection string in web.config under <connectionstrings> named umbracodbdsn , pointing different database not fix anything. if want move data sql server, may though: http://carlosmartinezt.com/2014/03/umbraco-migrate-from-sql-ce-to-sql-server/

javascript - .append value of input text to <canvas> isnt displaying the output of .append('<p>' + value + '</p>') -

i have jsfiddle here: https://jsfiddle.net/gemcodedigitalmarketing/zn5ylwh3/ what want text in customtext input appended canvas. though unsure why not working. it works when tried yesterday append td , tr table. maybe because canvas needs different way of adding text? not sure... either way apprecaite help. $('#addtext').click(function() { var value = $('#customtext').val(); $('canvas').append('<p>' + value + '</p>'); }); this jquery @ bottom of page <div class="assets"> <h3>assets</h3> <div class="text"> <h4>text</h4> <input id="customtext" type="text"> <button id="addtext" class="btn btn-default">add text</button> <p></p> </div> <div class="image"> <h4>images</h4> <ul class="list-unstyled"> <!-- list o

c# - ASP.NET profile privatization -

while creating new account every user want create them have separate tables names , uploaded files of own, upload solved , working. easy do? because didn't find related privatization. if registers person else can see it. private defaultconnection db = new defaultconnection(); // get: persoana [allowanonymous] public actionresult index() { return view(db.persoane.tolist()); } // get: persoana/details/5 [allowanonymous] public actionresult details(int? id) { if (id == null) { return new httpstatuscoderesult(httpstatuscode.badrequest); } persoana persoana = db.persoane.find(id); if (persoana == null) { return httpnotfound(); } return view(persoana); } // get: persoana/create public actionresult create() { return view(); } // post: persoana/create // protect overposting attacks, please enable specifi

php - Slideshare/Linkedin API HTTP 403 response -

are these api calls disabled slideshare? we getting http 403 forbidden response. get_user_campaigns get_user_leads get_user_campaign_leads the api call point trying use https://www.slideshare.net/api/v4/lead-campaigns , using method parameter of api key, ts, hash, username, password , access token i have use access token linkedin api. ts timestamp , hash combined api secret , ts combine in sha1 api key , secret provided slideshare. then proceeded using php curl , kept returning 403 forbidden. have done wrong. can me? all other api call searching, uploading , deleting slide working fine.

javascript - jquery on click event not firing when using jquery 1.11.3.min.js . -

as per below html controls , if try change "id" of submit "save" , click of save not working then. html <html> <head> </head> <body> <input type="button" value="submit request" id="submit"class="buttonclass"/> <input type="button" id="cancel" value="cancel" class="buttonclass" /> </body> </html js code below : $("#submit").on({ click: function () { $(this).attr('id', 'save'); return false; } }); $("#save").on({ click: function () { alert("save event fired"); } }); you aren't binding click event #save because id #save exists after submit button has been pressed (there no #save on load). if put click event on body , accept #save, can bubble event , handle there. $(&q

How to set a firefox profile on a Selenium WebDriver remote with Ruby -

i want set firefox profile following driver: driver = selenium::webdriver.for :remote, :url => "http://localhost:4444/wd/hub", :desired_capabilities => :firefox i've tried adding: profile = selenium::webdriver::firefox::profile.new profile['browser.download.downloaddir'] = '/home/seluser' driver = selenium::webdriver.for :remote, :url => "http://localhost:4444/wd/hub", :desired_capabilities => :firefox, :profile => profile but profile option not exist thanks you should try below :- profile = selenium::webdriver::firefox::profile.new profile['browser.download.downloaddir'] = '/home/seluser' capabilities = selenium::webdriver::remote::capabilities.firefox(:firefox_profile => profile) driver = selenium::webdriver.for :remote, :url => "http://localhost:4444/wd/hub", :desired_capabilities => capabilities note :- should follow this learn more ruby binding. hope you...:)

css - Changing hover style for QComboBox -

i using qt 5.1.1 trying change background color , text color element when cursor on element. have tried following style sheet: qcombobox qabstractitemview::item:hover {color: black;background: white } but , many tried css code hasn't worked. correct way? this should work: qcombobox qabstractitemview { selection-color: red; selection-background-color: blue; }

java - why i can't access IPackageFragmentRoot? -

Image
i'll try develop plugins. so, i'm studying plugins , listeners. , try develop examples using listener , javamodel. however, when access ipackagefragmentroot element, not doing want. so, debugged it. then, see ijavaproject element not open! still can access project in eclipse. what's wrong in code? , how can access in ipackagefragmentroot? these examples not open states. this code snippet. currentproject iproject selected in package explorer. if (currentproject != null) { try { currentproject.open(new nullprogressmonitor()); } catch (coreexception e) { e.printstacktrace(); } ijavaproject javaproject = javacore.create(currentproject); projecttreenode root = createtreenode(javaproject.getelementname()); ipackagefragmentroot srcfolder = javaproject.getpackagefragmentroot("src"); root = getcontents(srcfolder, root); setinput(root); } add i imported projects in new workspace. is wrong way??

spring boot - Firebase Auth for Java -

i writing application uses oauth on front end of application using firebase auth. want use logged in validation calling backend controller on spring boot app. there way ensure that: 1) user token valid 2) retrieve information user via token 3) ensure token comes app? documentation kind of sparse except javadoc, wasn't sure if provide guidance. may late answer this. you can follow link configure spring boot application, app follow firebase security (i.e have update app.yaml file security config). and on client side add header follows, authorization: bearer so if follow above steps 1 question addressed. for 2nd question can follow link give client code access user details. i not sure 3rd question.

jquery - How to make a page reload when it is visited -

i have rails app https://hr4d.herokuapp.com problem when visit new page, page doesn't load properly, makes jquery ineffective. can visit site, , see mean. here jquery: $('document').ready(function() { $('.dropdown-services').hide(000); $('#caret').click(function() { if($('.dropdown-services').is(":visible")) { $('.dropdown-services').slideup(300); } else { $('.dropdown-services').slidedown(300); } }); }); here navbar's code: <div class="navbar"> <div class="box first"> <a href="/pages/home" class="link-disabled">hr4d</a> </div> <div class="box second"> <span class="tagline">define, develop, deliver, , differentiate</span> <br> <a class="link" href="/pages/home">

c# - Comparing two csv files by column and value and displaying line numbers of differing values -

i'm doing comparer 2 csv files has columns , corresponding values each column on every new line. columns specified on first line of file. each line after contains data each column. i'm trying create program can handle files differing line numbers , number of columns , 1 display line number of values differed , create new text file displays line number, column name , value of file 1 , file 2. the comparison should done based on identifier instead of line line. if column data missing specified in column row, display number of columns data missing. so example: worker1.csv: name;age;height;gender; bob;21;190;male john;35;182;male rose; mary;20;175;female worker2.csv name;age;height;gender bob;21;185;male john;30;186;male mary; output.csv differences found in mary: file 2, line number 3, missing 3 values differences found in bob: file 1, line number 1, height: 190 file 2, line number 1, height:

oauth - OAuth1Session Encoding of URL Django -

alright, need assistance think easy question, after digging quite while i'll leave brilliant people show me why i'm not! i'm attempting access provider api, url i'm attempting access being: .../proposals/anothertestproposal/city_furniture/items?filter=description$cont"ag" :: way want passed, , should return items who's descriptions contain string "ag". know have 2 of currently. i'm using django 1.9.4, , requests_oauthlib create oauth1session, i'm doing also, because can access resources without url params. trouble can't "?filter=description..." part encode , it's giving me 401. when render .contents html get: {"status": 404, "message": "", "data": [], "arguments": {"id": "items?filter=description$cont\"ag\"", "collection": "city_furniture"}} which telling telling me "ag" part being escaped, don

How to convert 12-hour timestamp to 24-hour timestamp in hive? -

hive timestamp am/pm 24-hour timestamp hive> select from_unixtime(unix_timestamp('20-jun-84 11.25.32.000000021 pm','dd-mmm-yy hh.mm.ss.sssssssss aa'),'dd-mmm-yy hh.mm.ss.s') test.dual; hive> select from_unixtime(unix_timestamp('20-jun-84 11.25.32.000000021 pm','dd-mmm-yy hh.mm.ss.sssssssss aa'),'dd-mmm-yy hh.mm.ss.sssssssss') test.dual;

python - tensorflow 0.9 skflow model save and restore doesn't work -

i have updated tensorflow 0.7 0.9 on python3.and can't restore previous saved models skflow(tensorflow.contrib.learn).here sample code example worked on tensorflow 0.7. import tensorflow.contrib.learn skflow sklearn import datasets, metrics, preprocessing boston = datasets.load_boston() x = preprocessing.standardscaler().fit_transform(boston.data) regressor = skflow.tensorflowlinearregressor() regressor.fit(x, boston.target) score = metrics.mean_squared_error(regressor.predict(x), boston.target) print ("mse: %f" % score) regressor.save('/home/model/') classifier = skflow.tensorflowestimator.restore('/home/model/') on tensorflow 0.9 have recieved errors. attributeerror: 'tensorflowlinearregressor' object has no attribute '_restore' i belive save , restore have been deprecated in favor of model_dir param when building estimator/regressor : regressor = skflow.tensorflowlinearregressor(model_dir='/home/model/')

java - Eclipse Error No Idea InterruptedException error -

i use ide eclipse everyday. today decided not work me, , have work , need to.. if help, that'd great. when startup eclipse pops error message leading me error. !session 2016-05-14 09:11:04.108 ----------------------------------------------- eclipse.buildid=4.5.2.m20160212-1500 java.version=1.8.0_25 java.vendor=oracle corporation bootloader constants: os=win32, arch=x86, ws=win32, nl=en_us framework arguments: -product org.eclipse.epp.package.java.product -product org.eclipse.epp.package.java.product command-line arguments: -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.java.product -data c:\users\station8\desktop\development\minecraft\tripex development -product org.eclipse.epp.package.java.product !entry org.eclipse.egit.ui 2 0 2016-05-14 09:35:37.423 !message warning: environment variable home not set. following directory used store git user global configuration , define default location store repositories: 'c:\users\station8'. if not correct pl

variables - Javascript photoshop data sets -

i have create series of images in photoshop basic background text in middle, varies according data set. photoshop can set variables , data sets, , have no problems. size of text vary depending on number of characters in word, can fill text size. images must have usual name of word printed on 'image. sorry language i'm not english native! examples of 2 images

javascript - Filter Records from JSON with Node or ES6 -

i'm not sure best way go this. want iterate json , find companies in example. json might way more complex app grows too, in levels, objects, etc. want know ways people doing simple searching filtering out subsets of data json , node.js and/or es6 or libraries maybe such lodash , etc. so example json, ways can search , pull companies in usa? [{ "id": 0, "name": "company1", "logourl": "/lib/assets/company1-logo.png", "location":{ "country": "usa", "state": "california", "city": "napa" }, "active": false }, { "id": 1, "name": "company2", "logourl": "/lib/assets/company2-logo.png", "location":{ "country": "germany", "state": "", "city": "berlin"

Maven build - Directory Structure -

please guide since wanted understand on build tool maven 'directory structure' intelli j ide main/test divided 2 separate folders both have same files. ps- moved qa automation want understand better. fyi per maven main website: a. main directory root directory source code related application itself, not test code. b. test directory contains test source code. maven search files in below directory structure. src/main/java - source java files src/main/resources - source resource files src/test/java - test cases src/test/resources - test resource files

symfony - what changes need to do for working symfony_demo project? -

i downloaded symfony_demo project not able run properly. i have symfony3 ,get following error if update schema : [doctrine\dbal\exception\driverexception] exception occured in driver: not find driver [doctrine\dbal\driver\pdoexception] not find driver [pdoexception] not find driver doctrine:schema:update i mention installed sqlite3 , tables shown there. this default parameters.yml file : parameters: database_driver: 'pdo_mysql' database_url: 'sqlite:///%kernel.root_dir%/data/blog.sqlite' mailer_transport: smtp mailer_host: 127.0.0.1 mailer_user: mailer_password: null locale: en secret: secret_value_for_symfony_demo_application so please me. have been trying resolve 2 days. with sqlite3 parameter database_driver should : 'pdo_sqlite'

python - Can't install Pillow in Fedora23 -

(.newenv)[max@cyber life_besto]$ sudo pip install git+https://github.com/python-pillow/pillow.git collecting git+https://github.com/python-pillow/pillow.git cloning https://github.com/python-pillow/pillow.git /tmp/pip-zsgmxr-build installing collected packages: pillow found existing installation: pillow 3.0.0 uninstalling pillow-3.0.0: uninstalled pillow-3.0.0 running setup.py install pillow ... error complete output command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-zsgmxr-build/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-bmrc40-record/install-record.txt --single-version-externally-managed --compile: running install running build running build_py creating build creating build/lib.linux-x86_64-2.7 creating build/lib.linux-x86_64-2.7/pil _____there codes_____

jQuery hover - div with dynamic id - mouseover works, mouseout doesn't -

i have page of thumbnails - when hover on each one, box of text displayed. when mouseout box should disappear. when hardcode works well. when try , use dynamic variables shows not hide text box here code $(function() { $('[id^=trigger]').hover(function () { var roll = this.id.replace(/trigger/, 'roll'); $('#' + roll).show(); }, function() { $('#' + roll).hide(); }); }); and here html <div id='trigger".$id."' style='width:300px;height:200px;'><img src='http://www.example.com/uploads/".$id."/0.jpg'></div><div id='roll".$id."' style='background-color:#ffffff;display:none;width:284px;position:absolute;top 300px;padding:8px;'><h1 class='h1box'>$title</h1><p class='pbox'$text</p></div> so id each image trigger1, trigger 2 etc , text box roll1, roll2 etc where going wrong? in advance

asynchronous - Start Android activity when receiving the last response from multiple Volley requests -

in oncreate method of splashscreen, make 2 different volley requests : requestqueue queue = appcontroller.getinstance().getrequestqueue(); gsonrequest<wpposts> myreq = new gsonrequest<wpposts>(urljson, wpposts.class, null,createmyreqsuccesslistener(),createmyreqerrorlistener()); queue.add(myreq); and 1 categories. i start mainactivity when receive last response these 2 resquests : private response.listener<wpposts> createmyreqsuccesslistener() { return new response.listener<wpposts>() { @override public void onresponse(wpposts response) {...} regardless response arrives first or last. would semaphorical approach ? you don't need extend listeners or that. you can set in splashscreen static int, increment in onresponse of these requests. onresponse delivered in main thread don't need worry threading issues here. note want have value incemented onerror if error occurs never able go main activity :)

Using android DataBinding library how to pass parameters to binding events -

i followed examples android developers binding events , implementing step-by-step. working fine. want send parameters adapter handlers, how can achieve using data binding handlers i got answer. in xml onclick use lambda expression layout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"> <data> <variable name="movie" type="embitel.com.databindingexample.helper.movie" /> <variable name="handler" type="embitel.com.databindingexample.helper.myhandlers" /> </data> <android.support.v7.widget.cardview android:id="@+id/cardview" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="center" android:layout_margintop="4dp" android:onclick="@{(view)->handler.onit

Union type subtyping in Scala -

i can following dotty: trait ex {type t <: int | seq[int]; def f:t} trait ex2 extends ex {override type t = seq[int]; override def f = seq(2)} trait ex3 extends ex {override type t = int; override def f = 2} how can union type subtyping without dotty? the simple solution upper bound type: trait ex {type t >: int seq[int]; def f:t} trait ex2 extends ex {override type t = seq[int]; override def f = seq(2)} trait ex3 extends ex {override type t = int; override def f = 2}

Plone catalog rebuild: AttributeError portal_setup -

since few days, following error, if rebuild portal_catalog traceback (innermost last): module zpublisher.publish, line 138, in publish module zpublisher.mapply, line 77, in mapply module zpublisher.publish, line 48, in call_object module products.cmfplone.catalogtool, line 446, in manage_catalogrebuild module plone.app.discussion.patches, line 47, in patchedclearfindandrebuild module ofs.findsupport, line 239, in zopefindandapply module ofs.findsupport, line 198, in zopefindandapply module products.zcatalog.lazy, line 190, in __getitem__ module plone.folder.ordered, line 94, in <lambda> module plone.folder.ordered, line 59, in _getob attributeerror: 'portal_setup' has idea, wrong? plone 4.3.4 the old language root folder implementation left garbage ids in iordering of folder. needs manual cleanup. example here https://gist.github.com/jensens/356ab35614c4c0a7c626d8ba4a7a8479 - may need append values blacklist, depending on language ,

typescript - error TS2322: Type 'Comment[]' is not assignable to type 'Comment[]' -

i must missing obvious not understand error. error message: wwwroot/app/comments/commentlist.ts(25,13): error ts2322: type 'comment[]' not assignable type 'comment[]'. type 'comment' not assignable type 'comment'. wwwroot/app/comments/commentlist.ts(25,13): error ts2322: type 'comment[]' not assignable type 'comment[]'. type 'comment' not assignable type 'comment'. property 'id' missing in type 'comment'. component: @component({ selector: 'blog-comment-list', templateurl: './app/comments/commentlist.html' }) export class commentlist implements oninit { @input() contentitemid: number; private comments: comment[]; constructor(private sessionservice: sessionservice, private blogservice: blogservice) { } ngoninit() { this.blogservice.getcommentsforcontentitem(this.contentitemid).subscribe(x => { this.comments = x; // *** build er