Posts

Showing posts from April, 2015

python - Count no. of specific values in a dataframe pandas -

Image
this question has answer here: count frequency of values in pandas dataframe column 4 answers i newbie in data analysis stuff. trying analyse dataset using python. i want count no. of 1s in survived column no. of male , female in sex column passengerid survived pclass sex 0 1 0 3 male 1 2 1 1 female 2 3 1 3 male 3 4 1 1 female 4 5 0 3 male i tried groupby() giving error. in[88] titanic_data.groupby('survived') out[88] <pandas.core.groupby.dataframegroupby object @ 0x000000000bffe588> please suggest solution use value_counts : df['survived'].value_counts() df['sex'].value_counts()

javascript - How to conditionally set specific class property with angular js? -

Image
i have 1 div in want conditionally set background color property of class.i using boostrap progress bar , want use below class because contains custom settings progress bar. below div: .statistics .progress-bar { background-color: black; border-radius: 10px; line-height: 20px; text-align: center; transition: width 0.6s ease 0s; width: 0; } <div class="statistics" ng-repeat="item in data"> <div class="progress-bar" role="progressbar" aria-valuenow="70" aria-valuemin="0" aria-valuemax="100" ng-style="{'width' : ( item.statistics + '%' )}"> </div> </div> condition below : if statistics > 100 backgroundcolor=red; else backgroundcolor=black; can me this?? you can using simple expression ng-style="<condition> ? { <true-value> } : { <false-val

ionic framework - Not getting current location using cordovaGeolocation -

i tried current location of app using cordovageolocation failed get. gps on can't current location following code var posoptions = {timeout: 20000, enablehighaccuracy: false}; $cordovageolocation .getcurrentposition(posoptions) .then(function (position) { lat = position.coords.latitude long = position.coords.longitude console.log("lat " + lat + " long " +long); }, function(err) { // error console.log("error"); }); var watchoptions = {timeout : 20000, enablehighaccuracy: false}; var watch = $cordovageolocation.watchposition(watchoptions); watch.then( null, function(err) { console.log(err) },

linux - Get a radius of a circle in bash shell -

i need write script find radius of circle , find area while circumference given #!/bin/bash echo -n "enter circumference: " read circ pi=3.14 let rad=$(($circ/((2*$pi )) )) let area=$pi * $rad * $rad echo "the area of circle is: "$area"" the formula is: radius=circumference/(2 * pi) problem cant make formula work because bash doesn't accept decimal division read lot of answers there still can't want i have like let rad=$(($circ/((2*$pi )) )) was trying lot of different variants,used bc -l still can't right , there mistakes echo -n "enter circumference: " read circ pi=3.14 rad=`bc -l <<< "$circ/(2*$pi)"` echo $rad area=`bc -l <<< "$pi*$rad*$rad"` echo "the area of circle is: "$area""

php - How to keep authenticated with an API using JWT -

i writing application in laravel5 communicates api, how can keep authenticated api after jwt token expired. login credentials stored in environment file. first time login , save token session. have token can expire , returns 401 message { "message": "token expired" } how can detect without user noticing application had re-authenticate, can use middleware catch 401 message token expired , authenticate again , store new token? the flow this. user requests url on application -> application asks data api -> checks token in storage 1 in api -> returns 401 message token expired -> requests new token -> returns data api user. i have , user should not notice , don't want authenticate api on every request. have no idea start. good question. this can achieved via refresh tokens, if you're using laravel jwt package found: here you able utilise refresh tokens realtively easily. can add middleware like: protected $routemi

swift - NSURLErrorDomain with code=-1100 -

Image
i trying download picture app from request failed error nsurlerrordomain , code -1100. url should correct since checked in browser. knows why? let userimageurl: string! = "http://i.imgur.com/qhczqor.jpg"; let url = nsurl(fileurlwithpath: userimageurl); let request:nsurlrequest = nsurlrequest(url: url!) nsurlconnection.sendasynchronousrequest(request, queue: nsoperationqueue.mainqueue(), completionhandler: { (response:nsurlresponse!, imagedata:nsdata!, error:nserror!) -> void in let image = uiimage(data: imagedata!); }) the reason getting problem because have used let url = nsurl(fileurlwithpath: userimageurl); instead should use: let url = nsurl(string: userimageurl)

Does opening a file in append mode to write in c++ allocates memory for whole file? -

does opening file in append mode write in c++ allocates memory whole file? say have file, opened in append mode , after final append file 34 gb . if file write operation frequent , done different tasks, opens file every time append data it. before final write(when size of file 30 gb ) os allocate 30 gb opening file? short answer: no. opening file, in mode, not allocate memory whole file. may have confused memory-mapping file, can , does.

Firebase: First date > open is greater than -

Image
i tried create audience: users open app later 25.07.2016. (screenshot). comparison works dates?

adding property to javascript object in typescript without errors -

i found this article quite interesting, not me when try extend global variable window . test.ts window.test = {}; //error: property 'test' not exist on type 'window'. (function (test) { //do stuff } (window.test)); //build: property 'test' not exist on type 'window' error message: error: property 'test' not exist on type 'window'. how can solve ? it's called declaration merging : interface window { test(): void; } window.test = function() { // ever } ( code in playground ) as can see need declare new method in window interface , compiler won't complain when add actual implementation.

typescript1.8 - Changed Typescript-Version -

i have project written in typescript v.1.4 "ecma6" , want use 'async' because of calculations needed asynchronous. but after upgrade typescript version 1.8 in visual studio 2013, got big problems extended classes , have no idea why? the exception is: class constructor "xyz"cannot invoked without 'new' the classes looks extend b, b extend c... class xavobject { constructor() { } } class xavwidget extends xavobject { constructor(control: jquery, name?: string, id?: number) { super(); } } class widget_constructionkitcontainer extends xavwidget { constructor(control: jquery, controlname: string) { super(control, controlname, 1); // ---> here throws exception } } why exception occurs , can resolve it? edit: try give more information... i have webservice written in c# wich makes .js-files .ts-files accessible. " http://localhost:8080/dllname/xavobject.js " so html looks like:

Is there a function similar to PHP's isset() in Go? -

in http request, want know if request contains specific parameter, similar php's isset function. how test in go? thanks. once have parsed request, can check parameter's value type equal type's 0 value. for example, can use "comma, ok" idiom check query parameters: u, err := url.parse("http://google.com/search?q=term") if err != nil { log.fatal(err) } q := u.query() if _, ok := q["q"]; ok { // process q }

sql server 2012 - No display of database names using php by a dropbown -

the names of database in sql server not displaying in drop down. here codes.can suggest solution. <body> <?php $query = "select [name] master.dbo.sysdatabases dbid > 4"; $params = array(); $options = array( "scrollable" => sqlsrv_cursor_keyset ); $stmt = sqlsrv_query($conn, $query, $params, $options ); echo '<select name="test" style="width: 100px;>'; while( $row = sqlsrv_fetch_array ($stmt, sqlsrv_fetch_assoc)) { //unset($code); //$code= $row['org_code']; echo '<option value="'.$row['name'].'</option>'; } echo '</select>'; ?>

multithreading - Java FXML Updating UI with new Thread throws error -

i'm trying periodically update google maps marker in fxml. tried timer , new thread , can't of work. i tested new thread simple task update textfield in ui, works fine. however, when use actual code need update map: @fxml public void handletracking() throws ioexception, interruptedexception { new thread() { @override public void run() { while (true) { try { double ar[] = fileimport.getgpsposition(); system.out.println("latitude: " + ar[0] + " longitude: " + ar[1]); double ltd = ar[0]; double lng = ar[1]; webengine.executescript("" + "window.lat = " + ltd + ";" + "window.lon = " + lng + ";" + "document.gotolocation(window.lat, window.lon);"); try { thread.sleep(555

php - PDO dblib not catching warnings -

i have made symfony app connect mssql database using realestateconz/mssql-bundle , free tds. my problem when try execute stored procedure, procedure throws exception if goes wrong, pdo reports nothing back. if same thing using mssql_* functions warning correct error message mssql. what pdo doing differently? here 2 samples of code; //pdo version try { $conn = new pdo($dsn, $user, $pass); $conn->setattribute(pdo::attr_errmode, pdo::errmode_exception); } catch (pdoexception $e) { var_dump($e->getmessage()); die; } $stmt = $conn->prepare("insert importex_parteneri (id_importex, cif_cnp, denumire) values (1, 9671891, 'nexus media')"); $result = $stmt->execute(); var_dump($result); //true $stmt = $conn->prepare("exec dbo.importex_parteneri_exec 1"); $result = $stmt->execute(); var_dump($result); //true the mssql_* example $connection = mssql_connect($server, $user , $pass); mssql_select_db($nexus_

Switch from Asp.net Rc1 to Rtm throws exception that i dont understand -

i made new project in rtm , transferred code project. got far don’t errors in vs. when try start iis error: could not load file or assembly 'system.interactive.async, version=3.0.0.0,culture=neutral, publickeytoken=94bc3704cddfc263'. located assembly's manifest definition not match assembly reference. (exception hresult: 0x80131040) it happens when dbcontext created iservicecollection. any idea cause it? sorry i’m not posting code don’t know start because don’t understand error. if want see code ask. it seems 3rd-party libraries use not upgraded/compatible rtm. check non-microsoft dependencies in project.json also, read upgrade guide carefully: migrating asp.net 5 rc1 asp.net core 1.0

javascript - In dropdown list, onchange function is works only when change in the first item ? -

this html code list item database using foreach loop: <select class="form-control select" id="inventoryitem" name="inventoryitem" onchange="getunit();"> <option>---select item---</option> <?php foreach($item $i) { ?> <option><?php echo $i->name; ?></option> <?php } ?> </select> this script code: function getunit() { var item = $('#inventoryitem').val(); alert(item); } please remove onchange="getunit();" select , try code below: $( "#inventoryitem" ).change(function() { var item = $( "#inventoryitem option:selected" ).text(); alert(item); });

Template file not working in ElasticSearch -

i have external json template file load elasticsearch this do: curl -xput 'http://localhost:9200/_template/mytemplate' -d @file.json the command correctly acknowledged unfortunately when index created rules defined inside json file not applied edit this json file { "template" : "log-*", "settings": { "index": { "number_of_shards": 1, "number_of_replicas": 0 } }, "mappings": { "logevent": { "properties": { "timestamp": { "type": "date", "format": "dateoptionaltime" }, "message": { "type": "string" }, "messageobject": { "type": "object&quo

r - AWK, Unix command: How to match two files using corresponding first column in unix command -

i have 2 file, first single column (with repeated ids), second file 3 columns file, first column ids same first file unique number, want print remaining 2 columns of second file corresponding first file ids. example: first file: ids 1 3 6 7 11 13 13 14 18 20 second file: ids freq status 1 1 jd611 2 1 qd51 3 2 5 6 7 2 11 2 13 2 14 2 desired output 1 1 jd611 3 2 6 7 2 11 2 13 2 13 2 14 2 18 20 you can use awk : awk 'nr==fnr{a[$1]=$2 fs $3; next} {print $1, a[$1]}' f2 f1 to skip header line, awk 'fnr==1{next} nr==fnr{a[$1]=$2 fs $3; next} {print $1, a[$1]}' f2 f1 if second file has multiple columns, awk 'nr==fnr{c=$1; $1=""; a[c]=$0; next} {print $1, a[$1]}' f2 f1

javascript - How to reduce image size from URL obtained from server? (React-native) -

i have implemented fetch() request call api carries large number of images server. want images load in application , when implemented swiper due large size of image, application crashed. can resize image url because have imageurl obtained result. can view code as:` render(){ var pages = []; (var = 0; < this.props.items.length; i++) { const imageurl = 'http://photoos.boondrive.com/'+ this.props.items[i].large_file_path + this.props.items[i].display_name; pages.push( <view style={{flex:1, backgroundcolor:'black', justifycontent:'center', alignitems:'center'}} key={i}> <view> <image style={{width:width,height:height}} source={{uri:imageurl}}> </image> </view> </view> ); } return( <view style={{flex:1}}> <view> <androidtoolbar title={'photos'} navicon={jresource.back} flowicon={jresource.expandarrow} onpress={()=>this.props.navigato

r - How to replace numbers with NAs with condition -

i have 2 matrices, x1 , x2, same dimensions. x2 has nas values. how can put nas values in x1 in same position of x2 (replacing values in x1)? we can use replace replace(x1, is.na(x2), na) # [,1] [,2] [,3] #[1,] na 4 7 #[2,] 2 5 8 #[3,] 3 na 9 or x1 * na^is.na(x2) # [,1] [,2] [,3] #[1,] na 4 7 #[2,] 2 5 8 #[3,] 3 na 9 or @roland mentioned in comments is.na(x1) <- is.na(x2) btw, x1 + x2 - x2 #error in x1 + x2 : non-numeric argument binary operator bottomline both solutions posted general , works non-numeric matrices well. data x1 <- matrix(1:9, 3, 3) x2 <- matrix(c(na, "a", "b", "c", "a", na, "c","f", "a"), 3, 3)

MySQL: group by and nearest integer -

i have following table location: userid | zip | ---------------- 1 | 12383 | 1 | 10253 | 2 | 10523 | 2 | 14856 | 2 | 10251 | 3 | null | for given integer x, want sort user according has integer in column zip closest x, corresponding number of zip . if user has value null in field zip should shown @ end. example: x = 5000, output userid | zip | ---------------- 2 | 10251 | 1 | 10253 | 3 | null | i managed userid's correctly sorted with: select userid, min(abs(3-zip)) dist location group userid order -dist desc producing table userid | dist | ----------------- 2 | 5251 | 1 | 5253 | 3 | null | but how can nearest zip code? select t1.userid, t1.zip location t1 inner join ( select userid, min(abs(3-zip)) dist location group userid ) t2 on t1.userid = t2.userid , (abs(3 - t1.zip) = t2.dist or t2.dist null) -- pay careful attention here o

algorithm - What's the fastest way to obtain the highest decimal digit of an integer? -

this question has answer here: how retrieve first decimal digit of number efficiently 10 answers what's fastest way implement template <typename t> unsigned highest_decimal_digit(t x); (which returns e.g. 3 356431, 7 71 , 9 9)? the best can think of is: constexpr-calculate "middle-size" power of 10 fits t. perform binary search (over powers of 10, possibly using constexpr-constructed lookup table) find p, highest power-of-10 lower x. return x divided p ... maybe there's approach. notes: i expressed question , approach in c++14ish terms, , solution in code nice, abstract solution (or solution in x86_64 assembly) fine. want work (unsigned) integer types, though. you may ignore signed integral types. i didn't specify "fast" is, hardware-conscious please. the best option seems to combine clz approach ,

javascript - How to run a function inside AJAX success with process data and content type set to false? -

i'm playing around php, boostrap, ajax , jquery. on form submit, use ajax upload image , store data in database. data consists of firstname, middlename, lastname , image. it works fine , stored in database , image uploaded no error or warnings, modal function inside success isn't called. due processdata , contenttype being set false? how can make work? html <form enctype="multipart/form-data" method="post" id="form-info"> <input type="text" class="form-control" placeholder="firstname" name="fname" id="fname"> <input type="text" class="form-control" placeholder="middlename" name="mname" id="mname"> <input type="text" class="form-control" placeholder="lastname" name="lname" id="lname"> <input type="text" class="form-control" pla

Calling Asp.Net MVC 5 View from AngularJS Controller -

i trying redirect home page after successful login. currently, using asp.net mvc 5, angularjs, entityframework 6, bootstrap , repository pattern. below code logincontroller: public jsonresult userlogin(studentmanagementuser data) { var user = repository.userlogin(data); return new jsonresult { data = user, jsonrequestbehavior = jsonrequestbehavior.allowget }; } code angularjs controller: app.controller("mvcloginctrl", function ($scope, loginajservice) { $scope.isloggedin = false; $scope.message = ''; $scope.submitted = false; $scope.isformvalid = false; $scope.logindata = { username: '', userpassword: '' }; //check form valid or not // here f1 our form name $scope.$watch('f1.$valid', function (newval) { $scope.isformvalid = newval; }); $scope.login = function () { $scope.submitted = true; if ($scope.isformvalid) { loginajservice.getuser($scope.logindata).then(function (d) {

CDC not working for update data on SQL Server 2014 SP2 -

please me fix problem. use sql server 2014 service pack 2. have enabled cdc on database , table. it worked when did insert , delete operations (the tracking records added cdc table) problem is: when did update operation, there nothing added cdc table. so, should handle or fix problem? are sure table has nothing? 1) depends. in implementations, when example, update column used in clustered index when not primary key, update statement treated system combination of delete/insert operations, may see 1 delete , 1 insert operation in such cases. note such insert/delete operations may in incorrect order (this cdc bug confirmed ms, they're fixing @ moment), net changes function may return incorrect results (duplicate or missing rows). 2) kind of updates did perform? if update column same value, change won't there. please post scripts better understand problem.

How to add a fade in within overlay with FFMPEG ? -

i'm wondering how add option "fade in" in -filter_complex 'overlay'. the basic overlay ffmpeg -i movie.mp4 -i image.jpg -c:v libx264 -filter_complex 'overlay=x=main_w-overlay_w-100:y=main_h-overlay_h-100' output.mp4 does image.jpg fade=in should in filter_complex ? ffmpeg -i movie.mp4 -i image.jpg -c:v libx264 -filter_complex 'fade=in:st=0:d=5:alpha=1, overlay=x=main_w-overlay_w-100:y=main_h-overlay_h-100' output.mp4 thanks lot on construction of -filter_complex parameter ! use ffmpeg -i movie.mp4 -loop 1 -i image.jpg -filter_complex "[1]format=yuva420p,fade=in:st=0:d=5:alpha=1[i]; [0][i]overlay=w-w-100:h-h-100:shortest=1" -c:v libx264 output.mp4 your fade filter set operate on alpha channel, jpegs don't have alpha, image needs converted pixel format does. also, ffmpeg time-based processor of streams , single image treated 1 frame @ 25 fps, lasting 0.04 s, added loop generate video stream out of

java - push notification has been successfully forwarded to apns but iphone does not receive any notification -

push notification getting forwarded com.notnoop.apns api succesfully not forward notification iphone.initially working fine , able receive notification same code stopped working. kindly suggest me if u have idea my code : if (!p12file.equals(null) && !password.equals(null)) { try { classloader classloader = getclass().getclassloader(); file file = new file(classloader.getresource(p12file).getfile()); if (file.exists()) { if (pushnotification.getpushservice().equals("apns")) { apnsservice service = null; if (pushnotification.getp12file().equals("dev")) { service = apns.newservice().withcert(file.getabsolutepath(), password).withsandboxdestination().build(); } else if (pushnotification.getp12file().equals("dis")) { service = apns.newservice().withcert(file.getabsolutepath(), password).withproductiondestination().buil

c# - Looping through Model Collection and filter a query in asp.net mvc -

i have model in web-application this: class myclass { int id; list<anotherclass> foo {get; set;} } class anotherclass { int id; string bar; } i have list of filter-strings given user. list<string> filter = new list<string> { "foo", "bar" } //as example what want filter myclass given strings this: var result = context.myclass.include(mc => mc.foo); result = result.where(x => filter.any(f => f == x.foo.select(d => d.bar))); the problem is: select() returns list of strings , can't compare string list of strings. anyone idea how fix issue? if putting words want is: find whichever item in result, if of inner class items present in filter list try: result.where(item => item.any(inneritem => filter.contains(inneritem.bar))) or in other syntax: var output = (from item in result inneritem in item.foo filter.contains(inneritem.bar) select i

Keep Java Program Window Open even if show button is used -

i have java program want keep window open have in window gadgets . for example if want keep window on top can following jframe frame.setalwaysontop( true ); but if use show desktop button i.e. button in bottom right corner of windows 7 , java windows minimised . windows gadgets clock etc not minimised . do have way in java keep java window open if show desktop button clicked ?

javascript - Control body class when open/close aside menu -

using concept described on w3schools (can't paste 2 links yet :/, if google 'w3schools how js sidenav' , first result). i'd control body style make sidenav off canvas push effect. body{ transition: .3s ease-out; &.aside-open{ margin-left:-320px; margin-right:320px; @media(max-width: 991px){ margin-left:-240px; margin-right:240px; } } } it works on opening closing not working, seems stacking animations (wait until aside closed remove body 'aside-open' class), proven on pen http://codepen.io/huggaf/pen/xkyokw/ stack: angular v1.5.5 angular-animate v1.5.5 angular-strap v2.3.6 twitter-bootstrap v3.3.5 angular-motion v0.4.4 bootstrap-additions v0.3.1 i did test adding body class 'aside-closing' inside hide function... $modal.hide = function() { if (!$modal.$isshown) return; bodyelement.addclass(options.prefixclass + '-closing'); //... ... , removing on leaveanimatecallback function.

How to ignore null and empty value when use Neo4jOperations.save() to update properties with Spring Data Neo4j? -

spring-data-neo4j : 4.1.2 neo4j:3.0.3 node : person {id:1, name:"aa", cover:"1.jpg"} class: @nodeentity public class person{ @graphid private long id; private string name; private string cover; ... } new object: person p = new person(); p.setid(1); p.setname("bb"); then update data: p = neo4joperations.save(p,0); or: personrepo.save(p,0); // interface extends graphrepository<person> result: person {id:1, name:"bb"} question: cover property has been deleted,because p.cover null. there way can ignore null value when update? no, not supported in sdn. null value means property removed underlying graph. you can still write custom cypher query though (this defeat purpose of sdn if major use case)

java.net.UnknownHostException: www.google.co.in - error with JMeter 3 -

i'm using jmeter 3 firefox browser. have changed proxy settings localhost , 8080 . i'm trying record. i'm getting below error. please let me know why issue coming. need change settings ? java.net.unknownhostexception: www.google.co.in @ java.net.abstractplainsocketimpl.connect(abstractplainsocketimpl.java:184) this error indicates browser not able connect internet via jmeter's proxy. happens when you're sitting behind corporate proxy , host doesn't have direct internet access. try figuring out corporate proxy details , provide them jmeter via command-line arguments: launch jmeter providing several proxy-related command line arguments, wit -h, --proxyhost <argument> set proxy server jmeter use -p, --proxyport <argument> set proxy server port jmeter use -n, --nonproxyhosts <argument> set nonproxy host list (e.g. *.apache.org|localhost) -u, --username <argument> set username proxy server

javascript - How to create more than one drop zones while drag enter using jquery? -

is there way generate more 1 drop zones on page while using drag , drop field or element container? example, if have container generate dynamically top, left, right, , bottom drop zones when field dropping on it. can have option format fields rows , columns wise. demo page . store field styles/settings database. anyone come across this? sure, use class dropzone selector (code based on https://jqueryui.com/droppable/ ) <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>jquery ui droppable - default functionality</title> <link rel="stylesheet" href="//code.jquery.com/ui/1.12.0/themes/base/jquery-ui.css"> <style> #draggable { width: 70px; height: 70px; padding: 0.5em; margin: 10px 10px 10px 0; border: 1px solid #000000} .droppable { width: 150px; height: 150

Crash at NSOperationQueue addOperation Custom NSOperation -

i have nsoperationqueue, maxconcurrentoperationcount = 1, and custom nsoperation has property block, when nsoperationqueue addoperation, app crash, in ios 9.x, the nsoperation not nil. following apple crash report, can't reappear: exception type: exc_bad_access (sigsegv) exception subtype: kern_invalid_address @ 0x1000000013ed199e 0 foundation 0x0000000182f3b4e8 ____addoperations_block_invoke607 + 524 (nsoperation.m:193) 1 foundation 0x0000000182f3b488 ____addoperations_block_invoke607 + 428 (nsoperation.m:204) 2 foundation 0x0000000182f26170 -[nsobject(nskeyvalueobservingprivate) _changevalueforkeys:count:maybeoldvaluesdict:usingblock:] + 672 (nskeyvalueobserving.m:2406) 3 foundation 0x0000000182e7afc0 -[nsobject(nskeyvalueobservingprivate) _changevalueforkey:key:key:usingblock:] + 64 (nskeyvalueobserving.m:2432) 4 foundation 0x0000000182f392e4 __addoperations + 1400 (nsoperation.m:2100) thanks!

beautifulsoup installation in pyCharm with two versions of python installed -

Image
i use pycharm write python, @ first configurated pycharm python 2.7.12, , installed beautiful soup package under 2.7.12 environment. however, have installed python 3.5.2 in pycharm , want use beautiful soup in pycharm 3.5.2, can't import bs4 because interpreter cant find beautiful soup package in 2.7.12 package folder. so tried pip install bs4 in 3.5.2 console, tells me pkg has been installed in 2.7.12 folder. how can import beautiful soup in 3.5.2 in pycharm? to sure install package right version of python, can use pip module : python3.5 -m pip install [package] so bs4 : python3.5 -m pip install beautifulsoup4

html - How to control each delete button on the every <li> tags. (asp.net) -Code behind -

Image
i've been trying write onclick function, couldn't figure out how it. wrote function in page load() , provides when pages loading, data coming database. , <li> , delete buttons creating right there. mean didn't write <li> or button tags. (you can see structure on screen shot, i'll share here). can insert records, need delete on delete buttons. in case problem is: want use onclick function in code behind (or can advice way) can control <li> (like selectedrow) , anchor <a> . this page load (creating <li> , <a> , button ) for (int = 0; < db.machines.length; i++) { li = new htmlgenericcontrol("li"); ancor = new htmlgenericcontrol("a"); btn = new button(); btn.text = "delete"; btn.attributes.add("runat", "server"); btn.attributes.add("class", "deletebutton"); li.controls.add(btn); li.attributes.add("class", "lis

wix - TFS Build Server doesn't pick up environment variables? -

i've been trying use heat generate .wxs wix install project pre-build event command line. everything works fine locally despite installing wix on build machine, configuring environment variables, restarting build machine etc nothing seems recognise variables when run build on tfs. for example: "$(wix)bin\heat.exe" dir $(solutiondir)myproject\$(outdir) -cg myclient -gg -scom -sreg -sfrag -srd -dr clientfolder -var var.clientsourcedir -out "$(projectdir)client.wxs" outputs "bin\heat.exe" dir correct_path -cg myclient -gg -scom -sreg -sfrag -srd -dr clientfolder -var var.clientsourcedir -out "correct_path"" exited code 3 if echo $(wix) outputs echo , whereas running locally outputs wix directory seems suggest picks no environment variables. if log on build machine , use command line on these variables fine.

erp - Where the production run data is saved in the database of apache ofbiz -

does know manufacturing production run data saved in database of apache ofbiz. need find out current routing task, when production run started. can guide me find out data of production run. thank you. both production run , tasks saved in entity named workeffort (i.e. database table work_effort); different values in workefforttypeid field used production runs , tasks.

c# - Why XamlParseException has place while LiveCharts loading? -

i write c# wpf mvvm application using ms vs 2015 , .net framework 4.5.2. try use livecharts. when livecharts loading folowing error has place: xamlparseexception in presentationframework.dll. not load file or assembly "livecharts.wpf, publickeytoken=3b585c2a5f1a92c1" or 1 of dependencies. below present xaml: <usercontrol x:class="devicereading.views.devicereadingview" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:prism="http://prismlibrary.com/" xmlns:lvc="clr-namespace:livecharts.wpf;assembly=livecharts.wpf" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" prism:viewmodellocator.autowireviewmodel="true"> <grid> <grid.rowdefinitions> <rowdefinition/> </grid.rowdefinitions> <g

java - The path of the tomcat log file -

i'm working intellej seems there problems logging want watch tomcat log file terminal. the problem tomcat server embedded since i'm using spring boot, , cant find path of catalina.log file. normally, i'm using command keep track on changes made on catalina.out file : tail -f /var/log/tomcat7/catalina.out so how can watch log file of embedded tomcat server ? thanks in advance.

c# - Using Variable as a class name reference -

i have interesting question today. have table stores void name , class file came from. is possible read table , assign var object based off data in variable? if , save ton of coding. public void callmyfunction() { try { var checkerlist = conn.queryasync<functionlist>("select * functionlist",null ); using (ienumerator<functionlist> enumer = checkerlist.result.getenumerator()) { while (enumer.movenext()) { functionlist current = enumer.current; string myfunctiontocall = current.functionname ; string myobjecttocall = current.functionobject; methodinfo dynmethod = this.gettype().getmethod(myfunctiontocall, bindingflags.nonpublic | bindingflags.instance); dynmethod.invoke(myobservertocall, new object[] { myfunctiontocall }); } } } catch { } }

spring boot - SpringBoot app starts multiple times and disconnects from logstash -

i have springboot application (spring boot v1.3.5.release) run on docker ./mvnw; it "restarts" after 1-2 minutes , after second start don't send log logstash.. in first start see below log 2016-07-27 08:54:29,616 debug [background-preinit] logging: logging provider: org.jboss.logging.slf4jloggerprovider found via system property bug after second 1 logging provider log missing.. **2016-07-27 08:54:25,386 info [restartedmain] demoapp: starting demoapp on 7adf92b8bc96 pid 85 (/home/infoowl/project/target/classes started infoowl in /home/infoowl/project)** 2016-07-27 08:54:25,471 debug [restartedmain] demoapp: running spring boot v1.3.5.release, spring v4.2.6.release 2016-07-27 08:54:25,487 info [restartedmain] demoapp: following profiles active: dev 2016-07-27 08:54:29,616 debug [background-preinit] logging: logging provider: org.jboss.logging.slf4jloggerprovider found via system property 2016-07-27 08:54:32,436 info [restartedmain] demoa

how to pass a label value to session variable in c# in asp.net -

how pass label value session variable in c# in asp.net? the subtotal label shows value not pass value session variable: .session["subtotal"]=subtotal.text; my code below please # <%@ page title="" language="c#" masterpagefile="~/siteproduct.master" autoeventwireup="true" codebehind="checkout.aspx.cs" inherits="ecommerce.checkout" %> <asp:content id="content1" contentplaceholderid="contentplaceholder1" runat="server"> <!-- check out --> <div class="container"> <div class="check-sec"> <div class="col-md-3 cart-total"> <a class="continue" href="default.aspx">continue basket</a> <div class="price-details"> <h3>price details</h3> <span>total</span> <div class="total">

How to convert String to Date in php? -

this question has answer here: convert 1 date format in php 12 answers i trying date in d/m/y h:i format. here's code $datestr = "28/07/2016 10:00"; echo date('d/m/y h:i', strtotime($datestr)); here's ouput: 01/01/1970 01:00 i trying convert other formats, result still same date. know kind of obvious still can't understand why i'm getting date result. you can use datetime class , it's createfromformat method parse string date in required format. like this, $date = datetime::createfromformat('d/m/y h:i', "28/07/2016 10:00"); $date = $date->format('y-m-d h:i:s'); echo $date;

ajax - Jquery invoke $.when after a function finished -

i have following code: ispublisher.done(function(isactive) { if (isactive) { addroletouser(inlineuid, "publisher"); } $.when(setcountryandlanguage(), getuserroles()).done(setinlinemanualtracking); }); //add role inline manual table in db. function addroletouser(userid, role) { return $.ajax({ type: "post", url: "../publisher/service.asmx/addroletouser", data: json.stringify({ id: userid, role: role }), contenttype: "application/json; charset=utf-8", datatype: "json" }); } i want $.when occur after addroletouser function finished. how can achieve that? i want $.when occur after addroletouser function finished. that's current code does. assuming addroletouser starts asynchronous process, , want wait until process completes, addroletouser need accept callback or return promise. if assume returns promise, can have call $.when wait resolve

css - qtoxygen style without shadow frame -

i'm using qtoxygen style. know how disable shadow frame on qplaintextedit? if customise css { border: none } shadow still painting.((( solved via css qabstractscrollarea { qproperty-frameshape: noframe; }

javascript - How to customize Angular based Bootstrap Event Calender? -

i using tool in 1 of application event management. tool angular version of this tool. original tools uses various templates , underscore templating engine rendering calendar , various views. i not have knowledge of underscore, able tweak original code's template make few changes , customize view. however, since mine angular app, migrated angular version now. now, having hard time, understanding how templates have been converted in angular. placed? how identify 1 , above how change template. for example: change the way event shown in month view (circle) the way shown in week view (strips) . there few other customization require. there seems no questions on tool on so. few links found across internet not relevant. while tweaking around found : var map = { "./calendar.html": 14, "./calendardayview.html": 15, "./calendarhourlist.html": 16, "./calendarmonthcell.html": 17, "./calendarmon

c++ - CMake OSX issues with Assimp -

i building cross-platform framework , need because have troubles "deploying" assimp library on osx. let's take start. what's goal? end user runs cmake files , creates project platform (e.g. visual studio solution) runs on system , works on it. requirements libraries used being provided me (e.g. sdl.lib, assimp.lib e.t.c) , cmake uses them link against executable. 1 of libraries used assimp library. in windows , linux provide them assimp.lib , dll files , .a , .so files , works fine. what's problem then? problem osx cannot same. have built assimp on macbook cmake , has created following files -> libassimpd.3.1.1.dylib , libassimpd.3.dylib, libassimpd.dylib . fine , works on computer . problem when try "ship" files on computer . user creates xcode.project cmake opens .proj file , builds target. when runs though gets runtime error has path computer (where assimp built source) /users/.../assimp3.1.1-build -> reference libassimp.3.dyl

Bootstrap website not responsive in mobile -

i have website must responsive mobile phones. i've created using desktop. when adjust browser window it's working mobile phone when check on real mobile phone: oneplus 2 it's not responsive mobile view. what wrong? i think missing below meta tag in html. <meta name="viewport" content="width=device-width, initial-scale=1"> place above meta tag in html head tag , see if works.

ibm mobilefirst - MobieFirst v7.1 Application Center not sending push notifications to devices -

we implementing gcm push notification app updates on appcenter client app we have setup following values in server configuration jndiname="ibm.appcenter.gcm.signature.googleapikey value="***" jndiname="ibm.appcenter.push.schedule.period.unit" value="seconds" jndiname="ibm.appcenter.push.schedule.period.amount" value="40" and our app still not receiving push notifications gcm, there additional in appcenter client modify enable feature? we have set config.json file gcmproject attribute gcm project number , rebuilt apk accordingly. the logs don't show exceptions , no registered devices available push notification update this type of question not fit stackoverflow, meant programming-related questions. please open ibm pmr (support ticket) address kind of server configuration question.

javascript - get value of checked radio button with jquery -

i want value of selected radio field on change. if selected value admin want disable group of fields id permissions_forms , checkboxes inside should checked. otherwise,if value not admin should enabled. i tried value function of change not working in case. can me, please? here jsfiddle here html code: <ul class="radio" id="role"> <li> <input id="role-0" name="role" type="radio" value="user"> <label for="role-0">user</label> </li> <li> <input checked="" id="role-1" name="role" type="radio" value="admin"> <label for="role-1">admin</label> </li> </ul> <br/><br/><br/><br/> <ul class="checkbox" id="permissions_forms"> <li> <input checked="" id="diagnsosis_forms-0" name=&