Posts

Showing posts from June, 2010

charts - Get a live graph (info) from website and use it for a python script -

i need getting live data pie chart python script. http://www.transelectrica.ro i need chart linked live 1 website. final project make app link chart. note: not onwer of website; guest. thank ! wiki

apache - 301 Redirect for Query String on Root? -

i have tried multiple methods of trying redirect urls query string on root, example, if try match url http://example.com/?bloginfo=racing redirect 301 "/?bloginfo=racing" http://example.com/racing or redirectmatch 301 ^/?bloginfo=racing$ http://example.com/racing the condition never match. there method inside of .htaccess file write kind of redirect? if want match query string need use mod_rewrite , check query_string server variable in rewritecond directive. mod_alias directives (ie. redirect , redirectmatch match url-path only, not query string). for example, redirect http://example.com/?bloginfo=racing http://example.com/racing following: rewriteengine on rewritecond %{query_string} ^bloginfo=racing$ rewriterule ^$ /racing? [r=302,l] the trailing ? on substitution required in order remove query string request, otherwise, passed through target url. alternatively, use qsd flag on apache 2.4+ change 302 (temporary) 301 (permanent) if int

python - Bottle GET request is broken with certain strings when running with paste server -

i have problem similar one: python bottle: utf8 path string invalid when using app.mount() when try /languages/inglês receive error below (notice accent "ê"). when passing [az] strings works fine. critical error while processing request: /languages/inglês i tried fix mentioned on link above without success. working example : from bottle import route, run, debug @route('/languages/<name>') def hello(name): return name if __name__ == '__main__': debug(false) #run(reloader=false, port = 8080) # works run(server='paste', port = 8080) # fails running server='paste' causes crash, using bottle server runs ok. problem seems happen @ bottle._handle() method, unicodeerror thrown ( bottle.py line 844): def _handle(self, environ): path = environ['bottle.raw_path'] = environ['path_info'] if py3k: try: environ['path_info'] = path.encode(

python - Referencing dataframe index when checking for duplicates -

i looking duplicate entries in dataframe column. when find duplicate entry, want raise error message , point index. however, have many missing entries in column, not considered duplicates. my code right looks like: temp = df[pd.notnull(df['col1']) dups = temp.duplicated('col1') x in dups: if x == true: # print error message points index of x i tried adding in row counter, pd.notnull messes count not consider duplicates. there way of finding duplicates? thanks wiki

android - LinearLayout inside DrawerLayout not showing shadow -

i using linearlayout custom bottom bar should show shadow toolbar doing not being able make work, here layout: <?xml version="1.0" encoding="utf-8"?> <linearlayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <include layout="@layout/nav_toolbar"/> ... <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/green" android:elevation="2dp" android:orientation="vertical"> </linearlayout> </linearlayout> <include layout="@layout/nav_view"/> as understood setting elevation should show shadow, layout absolutely flat, doing wrong? wiki

Graph API - why am I receiving a deprecation error? (Error 12) -

i'm trying leverage graph api bi report, when use {page_id}/conversations i receive error: "error": { "message": "(#12) endpoint deprecated versions v2.4 , higher", "type": "oauthexception", "code": 12, i'm testing in graph api explorer, , have required access tokens. can't determine issue based on documentation i've reviewed. wiki

php - Page showing blank Laravel -

i have laravel project that's supposed person's referral 3 levels deep. here controller query. public function matrix() { $referrals = db::table('users')->where('referred_by', auth::user()->referral_id)->get(); if (empty($referrals)) { return view('matrix'); } elseif(isset($referrals[0])) { $referrals2gen = db::table('users')->where('referred_by', $referrals[0]->referral_id)->get(); if (!isset($referrals2gen[0])) { $referrals3gen = db::table('users')->where('referred_by', $referrals2gen[0]->referral_id)->get(); if (!isset($referrals3gen[0])) { return view('matrix3', ['referrals' => $referrals, 'referrals2gen' => $referrals2gen]); } elseif(isset($referrals3gen[0])) { return view('matrix4',

java - Firebase Database Query Data -

i new firebase database, making android app in structure of data : { posts={ -ks4aol7f-oktwd3m8ao={ address=address of mine, title=title , subcategory=e-waste, category=garbage, time=21-08-2017 07:54 p.m., mobilenumber=some mobile number, comment=hhdhdehsbsbhs, statustext=pending, imagepath=https://firebasestorage.googleapis.com/v0/b/path-to-image },... } so in structure want query posts on basis of mobile number i.e., if mobile number matches current post retrieved else skip post , check next post , on... you can refer this post , this wiki

android - Webview adding white space on right side -

how load html content fixed height , width android webview has height , width set wrap_content? html page i.e label.html loading assets. <!doctype html> <html> <head> <meta charset="utf-8"> <title>untitled document</title> <style> @charset "utf-8"; /* css document */ .main{ width:50%; height:200px; border: 1px solid #09ed1c; float:left; background-color:#00f3ff; } h1{ color:#fc1d21; } </style> </head> <body> <div class="main" align="center"> <h1>this page created using internal css</h1> </div> </body> </html> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/blue"> <webview android:id="@+id/wv_help" android:layout_width="wrap_conte

selenium webdriver - Missing c# assemble for PerfSDK single user -

i wend through documentation create performance test ax 365. cannot build project because missing assemble in vs 2015 'ms.dynamics.testtools.dispatcherproxylibrary.applicationforms'. point me in direction can download or how assemble? i assume working folder c:\perfsdk described in link . folder contains number of assemblies, such as ms.dynamics.testtools.applicationfoundationproxylibrary.dll ms.dynamics.testtools.applicationfoundationuihelpers.dll ms.dynamics.testtools.applicationplatformproxylibrary.dll ms.dynamics.testtools.applicationsuiteproxylibrary.dll ms.dynamics.testtools.applicationsuiteuihelpers.dll ms.dynamics.testtools.foundationtestcommonproxylibrary.dll ms.dynamics.testtools.subledgerproxylibrary.dll ms.dynamics.testtools.uihelpers.core.dll namespace ms.dynamics.testtools.dispatcherproxylibrary.applicationforms used in each of listed assemblies. need make sure required assemblies have been added references project. please take @ s

r - Multiply each observation by every other observation in another dataframe -

i have 3 sets of data. each observation in column multiply every observation in corresponding column in other datasets. example below explain; actual data has 200 rows. @ possible? need use loop? scale @ point more include more data sets. data set 1 [a] [b] [c] [1] a1 b1 c1 [2] a2 b2 c2 [3] a3 b3 c3 data set 2 [l] [m] [n] [1] l1 m1 n1 [2] l2 m2 n2 [3] l3 m3 n3 data set 3 [x] [y] [z] [1] x1 y1 z1 [2] x2 y2 z2 [3] x3 y3 z3 output [,1] [,2] [,3] [1,] a1*l1*x1 b1*m1*y1 c1*n1*z1 [2,] a1*l1*x2 ... ... [3,] a1*l1*x3 ... ... [4,] a1*l2*x1 ... ... [5,] a1*l2*x2 ... ... [6,] a1*l2*x3 ... ... [7,] a1*l3*x1 ... ... [8,] a1*l3*x2 ... ... [9,] a1*l3*x3 ... ... [...] [27,] a3*l3*x3 ...

java - What to do in Espresso when the recyclerView itself returns AmbiguousViewMatcherException? -

the problem have tabbed view, , each page contains same recyclerview different data pertaining tab. if i'm not describing well, it's same described in tutorial: https://github.com/codepath/android_guides/wiki/viewpager-with-fragmentpageradapter i creating instrumentation tests using espresso, , when try call onview(withid(r.id.recycler_view) to use recyclerviewaction, returned ambiguousviewmatcher telling me there more 1 recyclerview in hierarchy. how can specify particular recyclerview? assume need 'customrecyclerviewmatcher' of sort ok! first needed give each view tag (see petey's answer how catch view tag espresso in android? ) i found oncreate , added: recyclerview.settag(screentab.getid()) which enabled me set within test class (fyi i'm using kotlin) private val tab1recyclerview = onview( allof( withid(r.id.recycler_view), withtagvalue(`is`(id.tab1)) ) ) so tests begin : @test fun tab1test(

zip,move and size of file which is in a server path using java -

i have file in server, want create 3 java apis, below 3 operations in dependently. get file size move file different file name different server location zip file in existing code executing linux commands perform operations, unfortunately, linux commands not getting executed, due server/set issue, forced use java commands.(we use jdk 1.6) i not java developer. have gone through of answered questions, not explaining file in server path. appreciated. to file size in bytes: file file = new file("filename.txt"); long filesize = file.length(); to move file must first copy , delete original: inputstream instream = null; outputstream outstream = null; try { file fromfile = new file("startfolder\\filename.txt"); file tofile = new file("endfolder\\filename.txt"); instream = new fileinputstream(fromfile); outstream = new fileoutputstream(tofile); byte[] buffer = new byte[1024];

javascript - making web content semi transparent and more transparent upon click or hover -

i attempting make iframe invisible upon loading , visible when mouse hovering on it, i'm not sure doing wrong. can tell me doing incorrectly? $(document).ready( function makevisible(){ $(".video").hover(function(){ $('.youtube').css("visibility", "visible"); }) )} <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js" type="text/javascript"></script> <link rel = "stylesheet" type = "text/css" href = "stylesheet.css"> <script src="javascript.js" type="text/javascript"></script> <section class = "video"> <p>this section</p> <iframe class = "youtube" hover="makevisible()" width="700" height="397" src="https://www.youtube.com/embed/pmx5yyw5qp0" frameborder="0" allowfullscreen style="visibi

javascript - Event Calendar - how to add multiple <td> table elements -

i'm doing 'calendar event' app. after choosing day of week, times , short description can click on 'add event' button , add row table (not visible), don't know, how add cell it. trying add cell, grabbing '.event' class var eventcontent = document.queryselectorall('.event'); , , use appendchild() method, for(var j = 0; j < eventcontent.length; j +=1){ eventcontent[j].appendchild(tdelement1); eventcontent[j].appendchild(tdelement2); } but cells not inserting should be, after changing day of week. there html code: <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>daily programmer challenge #0004 | events calendar</title> <link rel="stylesheet" href="css/0004_eventscalendar.css"> </head> <body> <div id="container"> <div class="toolbar

Time Complexity of Counting Edges in OrientDB -

i retrieve total number of incoming or outgoing edges of given type to/from vertex in orientdb. obvious method construct query using count() , ine(myedgetype), oute(myedgetype), or bothe(myedgetype). however, concerned time complexity; if operation o(n) rather o(1), might better off storing number in database rather using count() each time need it, because anticipate number of edges in question becoming large. have searched documentation, not seem list time complexities of orientdb's functions. also, unsure of whether use in/out/both or ine/oute/bothe; presume e versions faster, depending on how orientdb stores edges under hood, may wrong. is counting set of incoming/outgoing/both edges of given type to/from vertex constant-time operation--and if not, time complexity? efficient, need use ine/oute/bothe, or in/out/both? or there other method entirely i've missed? in orientdb o(1): ine()/oute()/bothe().size() or without edge label parameter. wiki

python - Thread seems to be blocking the process -

class myclass(): def __init__(self): ... def start(self): colorthread = threading.thread(target = self.colorindicator()) colorthread.start() while true: print ('something') ... ... i have print statement inside colorindicator() . statement getting printed. print statement inside while loop of start() method isn't displayed on screen. the colorindicator() has infinite loop. gets data internet , updates counter. counter initialized inside __init__ self variable , i'm using variable inside other methods. i not understand why print inside while not being executed. colorindicator function: def colorindicator(self): print ('something else') ... while (true): ... print ('here') time.sleep(25) the output following: something else here here i stopped after that. so, colorindicator running completely. i&#

ios - Permanently saving data using swift 3 -

i made todo list app enter task in 1 view controller , saves data in array of view controller , adds table. problem when close app, new task data gone. can help? i tried using userdefaults didn't work quite or didn't use right. this code view controller type in new task: @ibaction func addtaskbutton(_ sender: any) { if (textfield.text != "") { task.append(textfield.text!) let task = userdefaults.standard.set(task, forkey: "xx") textfield.text = "" textlabel.text = "saved!" timer = timer.scheduledtimer(timeinterval: 1.6, target: self, selector: #selector(addtaskviewcontroller.hide), userinfo: nil, repeats: true) textlabel.ishidden = false } } this code view controller try save data , place in table var task = ["pray", "code", "work-out"] var school = ["email collin college","email pqc","create file doccumensts&quo

php - Check mongodb status before executeQuery() -

i may have simple problem don't know how resolve it. i'm using mongodb php, , every time go webpage have query on mongodb, error show (silex error) : whoops, looks went wrong. but no log in error.log of apache . happen when mongodb status : ● mongodb.service [...] active: inactive (dead) when start mongodb mongod work. i able handle possible problem. try (already tried no effect) on line : $cursor = $mongo->executequery('books.authors', $query); question : how can handle error if mongodb inactive or not started ? wiki

java - Deploy Magnolia CMS to Elastic Beanstalk -

i'm trying deploy magnolia cms elastic beanstalk following tutorial: http://dev.magnolia-cms.com/~gjoseph/dont-deploy-magnolia-deploy-your-project everything worked fine until part changes in tomcat/conf/catalina/localhost/root.xml have been made set magnoliainstance parameter , jdbc/magnoliaacmeds since don't know what's best practice here. the instance name shouldn't defined in war file since it's changing configuration based on instance app has been deployed at. anyone has suggestions what's best way this? wiki

Is passing text directly from user to `java.util.regex.Pattern` safe? -

is passing user input directly java.util.regex.pattern later used java.util.regex.matcher safe? if not, why? create infinite loop or exponential calculation? if so, other options? regexp never safe. personally, refrain using them if don't have to. can construct regexp take ages checked or ever crash system. some additional reading can found here: http://www.regular-expressions.info/catastrophic.html i can't think of use-case justify letting user pass regex server. wiki

tsql - Dynamic Query with if and UNION ALL -

i trying write select statement(s) insert data table. need select data databases starting 'centers' , tables in databases starting 'accthist'.i using cross join possible combinations of databasename.tablename. however, since such combinations not valid, trying check if table exists before select. added part of dynamic query... union between if statements. possible select cte valid db.table combinations? without doing in dynamic query? declare @tsql nvarchar(max) set @tsql = '' ;with cte_dbtabnames ( select d.name dbname,t.name tbname sys.databases d cross join sys.tables t d.name 'centers%' , t.name 'accthist%' ) select @tsql = @tsql + case len(@tsql) when 0 '' else ' union ' end + 'if object_id(''['+ dbname + '].dbo.['+ tbname + ']'') not null begin '+ ' select * [' + dbname + '].dbo.['+ tbname + '] end' cte

xaml - classic binding works but compiletime binding acts only onetime -

i not sure if retard not seeing mistake day googling can't see it. have flipview has multiple datatemplates. want view updated on propertychange in vm - use databinding. if use compile time binding, binding behave set onetime - if mode set oneway or twoway. thought may wrong onpropertychanged event- not find anything. therefore tried switch classic binding - and works . question doing wrong x:bind? here simplified version of xaml <page [...] datacontext="{binding source={staticresource locator}, path=galleryviewmodelinstance}"> <page.resources> [...] <datatemplate x:name="flipimagetemplate" x:datatype="gallery:imediaattachmentviewmodel"> <image stretch="uniformtofill"horizontalalignment="center" > <image.source> <bitmapimage urisource="{binding attachmentviewmodel.relativeattachmentpath, mode=oneway, converter=

PHP : Impossible to exec() under Android -

i'm willing develop small webapp on android (rooted, 4.2.2) smartphone. app designed in php run on local network. so, installed kickweb server app on phone play store. php works yet i'm unable use of functions related exec (system, passthru, shell_exec). apparently, reccurent problem when programming on android platform due unusual location of shell. (/system/bin/sh instead of traditionnal /bin/sh). someone had same problem here checked php.ini : safe mode off , there no deactivated functions. tried suggested workaround symlinking /system/bin/sh /bin/sh , trying fix ownership/permissions, still got nothing... here's php test file : <?php echo "hello world"; $out = system('date'); echo $out; ?> it results in hello world , nothing else, no error. i'm sure must have missed somthing yet can't figure out what. i'm not familiar developping under android. hope guys have clue, thanks. edit : after rebooting phone, noticed /bi

php - Multidimensional Array delete duplicated key values with condition -

i have array this: $ratesdata = [ 1 => [ 'id' => 1, 'amount' => 2 ], 0 => [ 'id' => 1, 'amount' => 1 ], 2 => [ 'id' => 1, 'amount' => 3 ], 3 => [ 'id' => 2, 'amount' => 2 ] ]; i want keep duplicated id arrays cheapest amount, result this: [ 0 => [ 'id' => 1, 'amount' => 1 ], 1 => [ 'id' => 2, 'amount' => 2 ] ] i have code works problem, i'm searching elegant way accomplish without loops: foreach($ratesdata $firstloopkey => $firstloopvalue) { foreach($ratesdata $secondloopkey => $secondloopvalue) { if($firstloopvalue['id'] === $secondloopvalue['id'] && $firstloopkey != $secondloopkey ) { if ($ratesdata[$secondloopke

Running Tests in Parallel with Django -

in django project have 55 tests. it's taking quite long time run them tried running them in parallel. failed @ first installed tblib , tests started running. unfortunately tests failing reasons haven't yet determined. might because initial calls need placed remote server populate test databases; before there one, there appear four. my question this: there "gotchas" should aware of when attempting run parallel tests django? robert wiki

wordpress - Replacing the home link in woocommerce breadcrumbs -

i know bit of daft question, fool cant find right answer. at moment breadcrumbs like home / male voice overs / derek doyle i need change home link name voice overs , link page. please great. thanks woocommerce provides filters this. add_filter( 'woocommerce_breadcrumb_defaults', 'jk_change_breadcrumb_home_text' ); function jk_change_breadcrumb_home_text( $defaults ) { // change breadcrumb home text 'home' 'voice overs' $defaults['home'] = 'voice overs'; return $defaults; } add_filter( 'woocommerce_breadcrumb_home_url', 'woo_custom_breadrumb_home_url' ); function woo_custom_breadrumb_home_url() { return 'http://yoursite.com/voice-overs'; } use these filters in functions.php file desired results. https://docs.woocommerce.com/document/customise-the-woocommerce-breadcrumb/ wiki

sql server - Can I create sub-folder in stored procedure folder in sql -

i wanted create sub-folder in stored procedure in sql it not possible create custom folders in sql server management studio. there third party add-ins offer feature (like sqltreeo or sql handy groupie) wiki

java - How can we get results of successfully run tests in TestNG even when the run gets terminated abruptly? -

i'm pretty new testng hailing cucumber background. in current project, jenkins jobs configured maven , testng, using java , selenium scripting. any job, 30 tests, if takes 2hrs complete, when abruptly terminated due reason on last minute, not results of tests run successfully. hence forced run again entire job. see error stack trace , result as: results :tests run: 0, failures: 0, errors: 0, skipped: 0 i sure there better way of designing this, hoping better approaches. how can make sure not lose results of tests did run successfully(though passed/failed)? is test management tool or entity store run time results , mandatory requirement or testng has provision built-in? how can make sure not lose results of tests did run successfully(though passed/failed)? there 2 ways in can build reporting testng driven tests. batched mode - how testng reports built. listener implements org.testng.ireporter interface built , within generatereport() , logic of cons

d3.js - Rotating around axis in d3js -

i'm trying create rotation controller rotate rectangle around center point in d3js. i've managed scrape using several resources, when try rotate around center point rectangle 'fly' away. here's jsfiddle showing rotation: self.attr('transform', 'translate(' + curx + ', ' + cury + ') rotate(' + newrotation + ')' ); https://jsfiddle.net/skoq1eww/1/ , , here's 1 showing fly away when trying rotate around rectangle's center point: self.attr('transform', 'translate(' + curx + ', ' + cury + ') rotate(' + newrotation + ', 50, 25)' ); https://jsfiddle.net/skoq1eww/3/ . i've found related stackoverflow posts relating rotating around axis , advise adding in origin coords rotation i've done above, reason can't seem work. i've been racking brain on few hours , i'm stuck. please point me in right direction? thanks in advance.

c# - Reusing code within a loop without using functions -

i have following code scans 2d array row row for (int = 0; < rows; ++i) { (int j = 0; j < cols; ++j) { // code here scans 2d array using & j indices } } this followed set of loops scan same array column column for (int j = 0; j < cols; ++j) { (int = 0; < rows; ++i) { // code near duplicate of code in previous set of loops } } the code inside above 2 sets of loops identical. there way can remove duplication? prefer not move code separate function code going run quite on pretty huge array, , afaik there isn't way force inlining in c#. you may interested in aggressiveinlining option on methods [methodimpl(methodimploptions.aggressiveinlining)] void method2() { // ... aggressive inlining. } source: https://www.dotnetperls.com/aggressiveinlining wiki

JAVA LWJGL SharedLibaryLoader version is equaling null and crashes my game -

this error shows when run game starting game exception in thread "main" java.lang.exceptionininitializererror @ org.lwjgl.system.sharedlibraryloader.getextractedfile(sharedlibraryloader.java:111) @ org.lwjgl.system.sharedlibraryloader.extractfile(sharedlibraryloader.java:71) @ org.lwjgl.system.sharedlibraryloader.load(sharedlibraryloader.java:36) @ org.lwjgl.system.library.loadsystem(library.java:114) @ org.lwjgl.system.library.loadsystem(library.java:66) @ org.lwjgl.system.library.<clinit>(library.java:49) @ org.lwjgl.system.memoryaccessjni.<clinit>(memoryaccessjni.java:13) @ org.lwjgl.system.pointer.<clinit>(pointer.java:22) @ org.lwjgl.system.platform.maplibrarynamebundled(platform.java:80) @ org.lwjgl.glfw.glfw.<clinit>(glfw.java:602) @ com.tyrellplayz.game.game.<init>(game.java:69) @ com.tyrellplayz.game.game.main(game.java:179) caused by: java.lang.nullpointerexception @ org.lwjgl.sy

c# - Multiple TextBox to Array -

my problem has simple solution, not grasping it. here's situation, wish register vehicle through several characteristics input in textboxes , on, user, , stored in array, can vehicle, or alter characteristics of said vehicle. breaking down in two-steps: first user selects value numericupdown , clicks button, therefore defining size of array in use. did following code, not know if 100% correct: int asize = convert.toint32(numericupdown1.value); int[] viaturas; viaturas = new int[asize]; now, user has several textboxes, datetimepickers , comboboxes, inputs characteristics of vehicle. clicks on button , information gets stored in array, in way each vehicle has it's characteristics stored, able 'em up. assuming first point ok, second 1 struggle, have no idea how code this. ideas? thanks in advance! it sounds want create object store data in. public class vehicle { public vehicle(string make...) { make = make; ... } publ

angularjs - Trying to highlight multiple cells from table row but only 1 column getting highlighted? -

i have create table looks this 5 11 24 "" "" "" "" 71 88 "" "" 25 "" 42 53 61 "" 90 7 14 "" 32 50 "" 65 "" "" i trying select multiple values it's not working. want if have selected number , going select should not remove previous one. tried store selected numbers in array , created method invoke ng-class ng-class calling without selecting number. var ticktstr = $scope.ticketsdata; console.log(ticktstr); var ticketlist = []; var ticktrow = []; var gamedata = ticktstr[0]; angular.foreach(ticktstr, function(value, index) { var ticketobj = new object(); ticketobj.id = json.parse(value.ticket.id); ticketobj.ticket = json.parse(value.ticket.ticket); ticketobj.number = []; ticketlist.push(ticketobj); }); console.log(ticketlist); $scope.tickets = ticketlist; $scope.selectnumber=function(row,number){

reactjs - Redux Form Typescript Pass Custom Props -

i trying pass custom props component decorated reduxform . new in typescript. the first problem can't wrap decorated component connect: export default connect(mapstatetoprops)( reduxform({ form: 'myform' })(mycomponent) ) the error: error:(89, 5) ts2345:argument of type 'decoratedcomponentclass<any, partial<configprops<any, {}>>>' not assignable parameter of type 'componenttype<{ addressvalue: any; isdeliveryaddress: any; customertypevalue: any; } & dispatchpr...'. type 'decoratedcomponentclass<any, partial<configprops<any, {}>>>' not assignable type 'statelesscomponent<{ addressvalue: any; isdeliveryaddress: any; customertypevalue: any; } & dispa...'. type 'decoratedcomponentclass<any, partial<configprops<any, {}>>>' provides no match signature '(props: { addressvalue: any; isdeliveryaddress: any; customertypevalue:

machine learning - Evaluate the classification model when we care both the positive and negative? -

there classification model problem, unless spam mail classification , care positive , negative data. for example, have classification of isa. if data isa=true, data , else if data isa=false, else it. if only care isa=true , care precision , recall isa=true. but, care both isa=true , isa=false , how evaluate classification model best result ? wiki

python - Getting lists of indices from pandas dataframe -

i'm trying list of indices out of pandas dataframe. first import. import pandas pd construct pandas dataframe. # create dataframe data = {'name': ['jason', 'jason', 'tina', 'tina', 'tina', 'jason', 'tina'], 'reports': [4, 24, 31, 2, 3, 5, 10], 'coverage': [true, false, false, false, true, true, false]} df = pd.dataframe(data) print(df) output: coverage name reports 0 true jason 4 1 false jason 24 2 false tina 31 3 false tina 2 4 true tina 3 5 true jason 5 6 false tina 10 i have indices on left of dataframe when coverage set true, have every name separately. preferably without explicit for-loop. desired output this. list_jason = [0, 5] list_tina = [4] attempted solution: thought should use 'groupby' , access coverage column. there don't know how proceed. appreciated.

machine learning - Why batch normalization over channels only in CNN -

i wondering, if in convolutional neural networks batch normalization should applied respect every pixel separately, or should take mean of pixels respect each channel? i saw in description of tensorflow's tf.layers.batch_normalization suggested perform bn respect channels, if recall correctly, have used other approach results. wiki

bash - psqlrc color modification resulting in funny line behavior -

trying edit ~/.psqlrc prompt1 : '\set prompt1 '%m [%n@%/] %# ' to have color: \set prompt1 '%[%033[1;32m%]%m [%n@%/] %# ' any time include color formatting, lines screwy. example, when recall last query in psql , go delete part of statement, part of lines disappears, blinking cursor ends on line above text, still deletes text doesnt match up. the customized prompt without color behaves expected. else encounter this? i experienced in bash customization process couldnt escaping work pscqlrc. https://apple.stackexchange.com/questions/37001/strange-behavior-in-terminal-with-custom-bash-profile my environment: os: macos 10.12.6 psql server version: 8.0.2 psql client version: 9.6.3 wiki

Select specific columns from table with JPA in java -

i want write query getting specific columns.using entitymanager.createquery("select u.name department u").getresultlist(); however returns object not instance of declaring class. correct way specific column table in jpa.as provider using hibernate it returns list of objects (it hard jpa guess types returning). luckily can give hint typedquery this typedquery<string> query = em.createquery("select u.name department u", string.class); list<string> departmentnames = query.getresultlist(); wiki