Posts

Showing posts from March, 2015

java - How can I unit test that I received correct PreparedStatement? -

i want pass in suitable object verify method, not any(). is there way it? i cannot take , copy lambda method , pass results verify. doesn't work because lambdas cannot tested directly. my unit test not close testing anything: @test public void testruntrigger() { campaigntrigger.updatecampaignstatus(); verify(jdbctemplate).update(any(preparedstatementcreator.class)); assertequals("update campaign set state = 'finished' state in ('paused','created','running') , campaign_end < ? ", campaigntrigger.update_campaign_sql); } and class i'm testing : @component @slf4j public class campaigntrigger { final string update_campaign_sql = string.format("update campaign set state = '%s' " + " state in (%s) , campaign_end < ? ", finished, stream.of(paused, created, running) .map(campaignstate::name) .collect(collectors.joining(&qu

ios - sudo cordova build android error related to plugin -

when running command sudo cordova build android , following error thrown: symbol: variable permissionhelper location: class cameralauncher /users/rd/desktop/kda1/mobile/platforms/android/src/org/apache/cordova/camera/cameralauncher.java:281: error: cannot find symbol permissionhelper.requestpermissions(this, take_pic_sec, permissions); ^ symbol: variable permissionhelper location: class cameralauncher 10 errors failure: build failed exception. * went wrong: execution failed task ':compiledebugjavawithjavac'. this project used have plugin org.apache.cordova.camera due ios incompatibility issues following 2 commands run: cordova plugin remove org.apache.cordova.camera cordova plugin add org.apache.cordova.camera@latest the ios part started work ok, after android build started fail. have tried: sudo cordova plugin remove cordova-plugin-camera but returns error message: error: cannot find plugin.xml plugin "org.apache.cordova.camera&quo

java - How to sort a hashmap whose keys are models? -

i have hashmap example map<emailcategorymodel, list<emailblogdetailsmodel>> map; how sort map based on property of key? use treemap sorted map , use comparator or comparable interface. code: // use treemap treemap<emailcategorymodel, emailblogdetailsmodel> map = new treemap<>(new comparatornew()); // , create comparator class comparatornew implements comparator<emailcategorymodel> { @override public int compare(emailcategorymodel o1, emailcategorymodel o2) { // sorting based on model attribute here. return 0; } }

javascript - Continuously swap two inline span elements in and out using jQuery -

i have webpage contains unordered list of text (languages). on each line the english translation , native translation of language wrapped in span tags: <li><span class="eng">german</span><span class="non">deutsche</span></li> <li><span class="eng">denmark</span><span class="non">dansk</span></li> all want have page toggle , forth between english span , native span ever 5 seconds or so. code below works fine except speeds on time. idea how can tweak keep constant? function myrepeat() { var anitime = 500; $('.eng').fadetoggle(anitime).delay(anitime); $('.non').fadetoggle(anitime).delay(anitime); } setinterval(myrepeat, 8000); you achieve using css on js. has benefit of being hardware accelerated , easier maintain. you can use keyframe animation fades elements in/out. same animation can applied both span elements, delay .

javascript - Ruby on Rails: Full Calender Gem not displaying pop up form -

i've been following driftingruby's tutorial interactive calendar , have run issue. the calendar displays fine when drag across date range input event nothing happens can offer insight? https://www.driftingruby.com/episodes/fullcalendar-events-and-scheduling the following javascript files think problem lies. //daterangepicker.js var date_range_picker; date_range_picker = function() { $('.date-range-picker').each(function(){ $(this).daterangepicker({ timepicker: true, timepickerincrement: 30, alwaysshowcalendars: true }, function(start, end, label) { $('.start_hidden').val(start.format('yyyy-mm-dd hh:mm')); $('.end_hidden').val(end.format('yyyy-mm-dd hh:mm')); }); }) }; $(document).on('turbolinks:load', date_range_picker); //fullcalendar.js var initialize_calendar; initialize_calendar = function() { $('.calendar').each(function(){ var calendar

php - Not able to assign On Delete Set null and on updated set Null in mysql -

bank_api_uat_user table create table if not exists `bank_api_uat_user` ( `id` int(11) not null auto_increment, `bank_name` varchar(255) default null, `role` varchar(10) not null, `bank_code` char(10) not null, `user_name` varchar(255) not null, `password` varchar(20) not null, `api_key` varchar(255) not null, `client_secret` varchar(255) not null, primary key (`id`), key `user_name` (`user_name`), key `user_name_2` (`user_name`), key `id` (`id`,`user_name`), key `role` (`role`) ) engine=innodb default charset=latin1 auto_increment=36 ; create_role table create table if not exists `create_role` ( `date` datetime not null, `role_name` varchar(50) not null, `role_code` varchar(5) not null, primary key (`role_code`) ) engine=innodb default charset=latin1; i want assign referential integrity bank_api_uat_user table each time add constraint gives below error mysql said: documentation 1215 - cannot add foreign key constraint below query used

C++ binary search tree implementation, dynamic array or structs/class? -

i'm tasked implementing binary search tree , going usual struct route: struct node { int value; node * left; node * right; node( int val ) { ... } } when thought implementing using dynamic array , using arithmetic figure out left , right nodes. question array implementation change time , space complexity of operations (insert, delete, inorder walk, et al.) better or worse? i can see how delete operation might issue, reorganize array , keep tree's structure, tree size small, hundred nodes max. will time , space complexity of operations (insert, delete, inorder walk, et al.) change? inserting , removing non-leaf nodes in array-based tree require moving elements come after in array. changes complexity o(log n) o(n log n). will array implementation better use of memory using structs? yes, without doubt. array based trees friendlier cache , take fewer allocations, plus there's no requirement store pointers per node.

javascript - How to retrieve and append data using the same web api get request in Angularjs -

here using "$http.get" request retrieve data web api in angular.js. an api url has parameter call "pageno=" , it's require add digit @ end of parameter retrieve data of respective page number maintain heavy request loads, each page has 10 list of records. i took scope variable ($scope.pagecount) , pass url, it's working fine , able retrieve 10 list of records @ once. now suppose rest of data on scroll down (like using infinite-scroll) , append existing list of data. is possible or way retrieve more data same request? have added 'infinite-scroll' application , getting alert on scroll down. following current working function. app.controller('spotlightctrl', function ($scope, $http, shareeventid) { $scope.pagecount = 1; $http.get("https://stg.myapi.svc/pageno="+$scope.pagecount+) .then(function (response) { $scope.data = response.data; $scope.loadmore = function () { ale

r - How to query date data with millisecond through mongolite? -

as below, type of 'stime' , 'etime' 'date' millisecond: { "_id" : objectid("58d843dd4da8fc62c8c6a0bd"), "stime" : isodate("2017-03-26t22:21:34.923z"), "etime" : isodate("2017-03-26t22:42:17.341z"), } and queried data this: data.names<-c("stime","etime") mongo.data <- mongo(collection = "data_1",db = "data_test", url = "mongodb://10.23.102.122:32800") journey <- mongo.data$find(query = '{\"_id\" : {\"$oid\":\"58d843dd4da8fc62c8c6a0bd\"}}', fields = paste('{\"_id\":true, ', paste('\"',data.names,'\":true', collapse = ', ', sep=''), '}', sep = '')) but data queried utc time-stamp without mill

jquery - customizeText devextreme not working -

datagrid = $("#gridcontainer").dxdatagrid({ columns: [{ datafield: "stcg", caption: "stcg", format: 'fixedpoint', allowfiltering: false, precision: 2, customizetext: function(cellelement, cellinfo) { var fielddata = cellinfo.value; if (fielddata >= 0) { cellinfo.cellelement.addclass("greencolortext"); } else { cellinfo.cellelement.addclass("redcolortext"); } } }] }).dxdatagrid("instance"); .greencolortext { color: #2dc48d; } .redcolortext { color: #bf4e6a; } i trying change font color of data in cell if data in greater or equal 0 text green else red the customizetext method doesn't take 2 arguments. if open browser console see javascript errors. in case can use celltemplate option: celltemplate: function($cell, cellinfo) { var fielddata = cellinfo.data.stcg; if (fielddata

php - Laravel Multiple Timezones -

i trying build database of user trips, involves storing: flightnumber departureairport departuretime arrivalairport arrivaltime note, both airports can in different timezones. need work out time difference, , number of days flight etc. i not sure how approach problem. should add more columns store local date time, , utc times? also, have seen laravel has datetimetz() column type. doesn't seem storing information timezone? posts table: $table->datetimetz('newtime')->nullable(); setting new time: $p->newtime = \carbon\carbon::now('asia/kolkata') => carbon\carbon {#841 +"date": "2017-03-28 16:23:33.490926", +"timezone_type": 3, +"timezone": "asia/kolkata", } >>> $p => app\post {#836 id: 1, user_id: 1, title: "et quaerat deserunt qui ullam voluptas.", body: "aut eos id ut qui laborum. tempore rerum ut quas deserunt v

python - Selenium, trouble with the Section tag -

i have been trying scrape website fanduel, have had been having trouble 'section' tag. want access data each player. here code far: from selenium import webdriver pandas.io.html import read_html driver = webdriver.firefox() driver.get(https://www.fanduel.co.uk/fixtures/211/lineups/create?contestid=211-4550213') table = driver.find_element_by_xpath('//*[@id="root"]/div/main/div/div') <section class="lineup__main lineup__main--show_fixturelist_players"> <section class="lineup__pitch_view"> <div class="lineup__pitch" style="position: relative;"> <div style="overflow: visible; height: 0px; width: 0px;"> <div class="pitch_view pitch_view--3d" style="left: 58.5px; top: 0px; width: 700px; height: 535px;"><div class="pitch_view__wrapper" style="transform: rotatex(90deg) translatey(-20px);"><div class="pitch_view__pitch"

user interface - Windows GUI filled with shields symbols instead of white background -

Image
this desktop when connect remotely it. basically, see lot of shield icons instead of white background. seems cache being used shouldn't be. if connect directly, it's fine. ideas? i running windows server 2016 on latest release , updates.

reactjs - How to make synchronous API call request in react js -

i beginner react js working on small application makes api requests frequently. problem facing there page form fields prefilled db, if user makes changes fields posting new filed values db. when submit button clicked saveandconttinue() called,from there addnewaddress() invoked based on condition. problem response addnewaddress has used next api call in queue, taking time response, , address_id having null values it's post call. there way make synchronous call in react out using flux/redux now? saveandcontinue(e) { e.preventdefault(); if(this.props.params.delivery === 'home_delivery' && this.state.counter) { this.addnewaddress(); } console.log('add id '+this.state.address_id); const config = { headers: { 'content-type': 'multipart/form-data' } }; let fd = new formdata(); fd.append('token', this.props.params.token); fd.append('dish_id', this.props.params.dish_id); fd.append('address_type', this.props.params.del

python - RuntimeError: can't re-enter readline -

i making python 3 app has prompt user enters commands. i'm running python 3.5 on macos sierra. i'm trying prevent exiting ctrl+c , having users exit instead typing exit prompt. i doing using method: https://stackoverflow.com/a/6019460/7450368 however, when prompting user again, runtimeerror: can't re-enter readline . is there way can fix this? here's code: import interpret import signal def siginthand(sig, frm): print("\nuse 'exit' exit.") prompt() signal.signal(signal.sigint, siginthand) version = ("v0.0.3") class commanderror(exception): pass def prompt(): try: task = input("einstein " + version + " > ") except runtimeerror: task = input("einstein " + version + " > ") try: execute(task) except commanderror e: print(e) prompt() def execute(command): command = command.lower() interpret.interp

c# - how to select assigned job to the user? -

Image
i have mission system in mvc. , give same mission or diffrent mission lot of users. , show title, description, start date , finish date , are/is in mission. these showing view page in grid.mvc. when login can see every mission. dont want every mission want see mission. of course other users see missions. in controller, split names. this codes, controller: ticketdbcontext db = new ticketdbcontext(); public actionresult index() { var result = db.missions.orderbydescending(x=>x.givendate).tolist(); string ad = string.empty; foreach (var item in result) { if (!string.isnullorempty(item.givenusers)) { string[] ids = item.givenusers.split(','); (int = 0; < ids.length; i++) { int id = convert.toint32(ids[i]); item.givenusers += db.users.firstordefault(x => x.id == id).name+ " " + db.users.firs

c# - Getting all types under a userdefined assembly -

i trying types defined under particular userdefined namespace assembly.getentryassembly().gettypes().where(t => t.namespace == "namespace") <>c__displayclass3_0 <>c__displayclass4_0 <>c__displayclass6_0 <>c__displayclass2_0 <>c__displayclass2_1 <>c__displayclass2_2 <>c__displayclass2_3 <>c__displayclass2_4 <>c__displayclass2_5 <>c__displayclass2_6 <>c__displayclass2_7 <>c__displayclass2_8 my question why getting these type not defined under namespace? how select type user defined types? some 1 explain me these , how defined under userdefined namespace. those types generated compiler. c# compiler generates types implement things like: lambda expressions , anonymous methods iterator blocks async methods anonymous types all of them should have compilergeneratedattribute applied the

ios - xcrun: error: unable to find utility "PackageApplication", not a developer tool or in PATH - Since updating xCode -

Image
updated xcode morning , ionic project wont deploy device. ionic run ios --device returns: ** build succeeded ** xcrun: error: unable find utility "packageapplication", not developer tool or in path error: error code 72 command: xcrun args: -sdk,iphoneos,packageapplication,-v no idea fix, googling returns lots of options none correct. cordova trying use "packageapplication" tool. removed since xcode 8.3. ( @guyromb this ) for coming error jenkins/fastlane here temporary fix till jenkins xcode plugin gives fix on this if have xcode 8.2.1 or version below 8.3, copy packageapplication script applications/xcode.app/contents/developer/platforms/iphoneos.platform/developer/usr/bin or can download link - https://gist.github.com/anonymous/48f3e4c5ae25313dc0fe10d9ec50c3fc go finder - applications/xcode.app/contents/developer/platforms/iphoneos.platform/developer/usr/bin paste copied/downloaded above file here.

Invalid identifier, cakephp 2.5 relationship -

i using cakephp 2.5, , have error message : warning (2): ociexecute(): ora-00904: "user"."uf": invalid identifier [root\app\model\datasource\database\oracle.php, line 432] at controller have conditions asking user uf collumn //verify controller $paginate['conditions']['user.uf'] = $this->passedargs['verify.uf']; $paginate['contain'][] = 'user'; at model have belongsto property user relationship: //verify model public $belongsto = array( 'user' => array( 'classname' => 'usuario', 'foreignkey' => 'user_id', ), how can relate user model verify model? add containable behavior model class. $actsas = array('containable'); you can load behavior on fly: $this->verify->behaviors->attach('containable');

How to use ng-bootstrap with AngularJS and Javascript -

does use ng-bootstrap (angular directives specific bootstrap 4) angularjs (not angular 2)? im using javascript , not typescript cant imagen how installation works. im using bower , grunt if matters anyone. i hope me this, bec. rly. use ng-bootstrap , bootstrap 4.o ng bootstrap requires angular 2. directly getting started guide : this repository contains set of native angular directives based on bootstrap's markup , css. result no dependency on jquery or bootstrap's javascript required. required dependencies are: angular ( requires angular version 2 or higher , tested 2.0.0) bootstrap css (tested 4.0.0-alpha.6) if using angular 1.x instead use angular ui bootstrap works bootstrap 3. don't know whether you'll find library of angular 1.x directives bootstrap 4 (yet).

javascript - Include jsp dinamically depends onChange comboBox -

the requirement following: depends on combobox selected value, have show form or form. each form developed on differents jsp´s pages. now, have jsp´s pages included in main jsp , jquery function, hide or show jsp needed. <div id="xx" style="display: none;"> <%@ include file="/xxx/xx/xx/jspxxxxxx.jsp"%> </div> <div id="yy" style="display: none;"> <%@ include file="/xxx/xx/xx/jspxxxxxx2.jsp"%> </div> $jq("#proceso").on('change', function() { ocultarpantallasprocesos(); var proceso = $jq(this).val(); switch (proceso) { case 'gc06': selectexportacion() $jq('#xx').show() break; case 'gc21': selectexportacion() $jq('#yy').show() break; this develop not optimize, because main jsp s have included html code of rest of jsp s

c++ - QTreeView - Hide controls for expanding and collapsing specific items -

i using c++/qt develop application. have custom model (derived qabstractitemmodel ) shown qtreeview . when item of model has children, qtreeview shows expanding/collapsing icon (a triangle) allows show/hide children. want hide icon on specific item. item has children has expanded always. want achieve following style tree (i use symbols + , - expanding/collapsing icon) a b c d <-i don't want show expanding/collapsing icon in item. -e e1 e2 +f -g -g1 g1.1 g1.2 g2 i have been able hide expanding/collapsing icon of first item (the a), following command: myqtreeview.setrootisdecorated(false); i have seen this answer shows how hide contro items. however, in case 1 specific item.

c# - Xamarin.Forms dynamic button styling -

i'd implement own custom button style. style has change, whenever button changes state (from enabled disabled i.e.). my current solution define style in android , custom buttonrenderer applies style button. button_style.xml: <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="true" > <shape> <solid android:color="#d7d7d7" /> <stroke android:width="1dp" android:color="#d7d7d7" /> <corners android:radius="6dp" /> <padding android:left="10dp" android:top="10dp" android:right="10dp" android:bottom="10dp" /> </shape> </item> <item android:state_enabled="false"> <shape> <solid android:color="#efefef" />

.htaccess - htaccess Redirect 301 to new url with dynamic subdomain,protocol -

i want redirect old url new url this: redirect 301 www.domain.ro/index.php www.domain.ro/ but in case have dynamic subdomain , , don't know how build line: redirect 301 www.domain.subsdomain.ro/index.php www.domain.subsdomain.ro/ now,besides subdomain dynamic, protocol can http or https , user can type in www or not, line like: redirect 301 domain.{*}.ro/index.php domain.{*}.ro/ {*} - wildcard matches every alphabetic char between dots you don't meed use domain name in target when same source url. besides cannot main host name in redrect directive. just use rule using mod_rewrite remove index.php : rewriteengine on rewritecond %{the_request} /index\.php[?\s] [nc] rewritecond %{request_uri} ^(.*/)index\.php$ [nc] rewriterule ^ %1 [l,r=301,ne]

css - ASP.Net label text as HTML not working -

we have formdata, of type xml holds value of asp:label , label in usercontrol . now load form data label text html as: <uctestcontrol.lbltestlabel><b>test value</b></uctestcontrol.lbltestlabel> so passing value html in case bold. but when retrieve value label "lbltestlabel" formdata binds text html tags <b>test value</b> . need displayed bold text. workaround: if go developer tool in browser f12 , navigate see html tags, when right click label element , select edit html renders bold text.

How can I pass a FnMut closure to a function using a reference in Rust? -

i've learnt how pass closure argument function. below: let closure = || println!("hello"); fn call<f>(f: &f) f: fn() { f(); } call(&closure); call(&closure); so can call closure twice. but when use fnmut : let mut string: string = "hello".to_owned(); let change_string = || string.push_str(" world"); fn call<f>(mut f: &mut f) f: fnmut() { f(); } call(&change_string); call(&change_string); it turn out error: error[e0308]: mismatched types --> src/main.rs:9:10 | 9 | call(&change_string); | ^^^^^^^^^^^^^^ types differ in mutability | = note: expected type `&mut _` found type `&[closure@src/main.rs:3:25: 3:53 string:_]` how can solve it? as error message says: expected type `&mut _` found type `&[closure@src/main.rs:3:25: 3:53 string:_]` it expecting mutable reference something ( &mut _ ), providing immutable

extjs - Change color of checkbox field when checked -

i have check box field box label colored in green. need change color of boxlabel (say: yellow) when user checks checkbox. tried validating checkbox, doesnt work. suggestions? xtype : 'checkbox', id: 'checkbox1', name : 'checkbox', style: 'background-color : #bcf5a9', boxlabel: 'mycheckbox' //i tried below handler function. doesnt work handler: function (checkbox, checked) { if (checked) { style : 'background-color: #ddd'; } } if need change color of boxlabel, try way. ext.create('ext.form.panel', { bodypadding: 10, title: 'checkbox test', items: [{ xtype: 'checkboxfield', id: 'checkbox1', name: 'checkbox', style: { color: 'green' }, boxlabel: 'mycheckbox', handler: function(checkbox, checked) { if (checked) { checkbox.el.setstyle("color","r

c# - Task unable to timeout -

i have implemented simple task using tpl. waits 10 seconds execute , returns true/false. var checkcfoptask = task.run(() => checkcfopexists()); checkcfoptask.wait(timespan.fromseconds(10)); if (checkcfoptask.result) { } else { } the problem code stuck within if statement. if (checkcfoptask.result) each time pause debugger still keeps waiting on above line of code. happened first time. ideally should return true/false within 10 seconds. below function definitions- checkcfoexists: executed task. private bool checkcfopexists() { bool found = false; try { while (!found) { try { if (iedriver.findelement(by.id("popup_message")).text == "não existem itens para realizar o rateio.") { resetinvoicesearchscreen(); break; } } catch (exception ex) { } try

All CURL functions returns null in php -

php5-curl installed curl_exec() returns null , curl_errno() returns 0 , curl_error() returns null , curl_getinfo() looks curl_exec() never fired. sample of code $this->curl = curl_init(); $agent = 'mozilla/5.0 (windows nt 6.1; wow64; rv:52.0) gecko/20100101 firefox/52.0'; $curloptions = array( curlopt_url=>str_replace(' ', '%20', $url), curlopt_returntransfer=>true, curlopt_useragent=>$agent, curlopt_binarytransfer=>true, curlopt_customrequest=>"get", curlopt_autoreferer=>true, curlopt_connecttimeout=>5, curlopt_timeout=>600, curlopt_followlocation=>true, curlopt_maxredirs=>20, curlopt_ssl_verifypeer=>false ); curl_setopt_array($this->curl, $curloptions); $result = curl_exec($this->curl); $status = curl_getinfo($this->curl); $this->log->tolog('http error on d

html - redirect including input type value at submit form -

any thoughts why redirect doesn't work @ form submit? should redirect user url specified in js function, appending value input form <form> <div class="input-wrap"> <input type="text" id="myinputtype" class="block" /> <input type="submit" name="submit" class="block" onsubmit="redirect()" /> </div> </form> ` <script type="text/javascript"> function redirect() { window.location = 'http://somewhere.com?url=' + document.getelementbyid('myinputtype').value; } </script> i think onsubmit='' goes form tag <form onsubmit="redirect();"> not on input

jinja2 - How implement/replace extending blocks from 2 different files in Nunjucks? -

i'm using nunjucks 2 days , have encountered situation, i'm not sure how handle best. on bottom simplified code of templates. the problem i'm having want abstract heading element (on bottom of maincontent block) in template1 , template2 file not repeat whole <div><h1>..</h1><h2>..</h2></div> structure classes in both files. can't partials, don't accept arguments , text contents of headings different in both contexts; structure same. ideally write inside of maincontent block {% extend "bases/heading.njk" %} , pass both h1 , h2 contents blocks: primaryheading , secondaryheading . impossible, can extend 1 template per file , both templates extending bases/base.njk . i know overcome delegating headings other partials: partials/template1-heading.njk , partials/template2-heading.njk , extend bases/heading.njk , seems me it's far complicated create 2 layers of inheritance (including partial extends tem

Gradle crashes when it's perform by a secod time -

i'm using gradle 2 scopes: command line , eclipse. when first time perform gradle on whichever scope, other 1 prints me out message: launching gradle tasks failed due error connecting gradle build. not execute build using gradle distribution 'https://services.gradle.org/distributions/gradle-3.3-bin.zip'. unable start daemon process. problem might caused incorrect configuration of daemon. example, unrecognized jvm option used. please refer user guide chapter on daemon @ https://docs.gradle.org/3.3/userguide/gradle_daemon.html please read following process output find out more: ----------------------- fatal error in native method: jdwp no transports initialized, jvmtierror=agent_error_transport_init(197) java hotspot(tm) 64-bit server vm warning: ignoring option maxpermsize=4g; support removed in 8.0 error: transport error 202: bind failed: address in use error: jdwp transport dt_socket failed initialize, transport_init(510) jdwp exit error agent_error_transport_init

python - `Optimal` variable initialization and learning rate in Tensorflow for matrix factorization -

Image
i'm trying simple optimization in tensorflow- problem of matrix factorization. given matrix v (m x n) , decompose w (m x r) , h (r x n) . i'm borrowing gradient descent based tensorflow based implementation matrix factorization here . details matrix v. in original form, histogram of entries follows: to bring entries on scale of [0, 1], perform following preprocessing. f(x) = f(x)-min(v)/(max(v)-min(v)) after normalization, histogram of data following: my questions are: given nature of data: between 0 , 1 , entries closer 0 1, optimal initialisation w , h ? how should learning rates defined based on different cost function: |a-wh|_f , |(a-wh)/a| ? the minimal working example follows: import tensorflow tf import numpy np import pandas pd v_df = pd.dataframe([[3, 4, 5, 2], [4, 4, 3, 3], [5, 5, 4, 4]], dtype=np.float32).t thus, v_df looks like: 0 1 2 0 3.0 4.0 5.0 1 4.0 4.0 5.0 2 5.0 3.0 4.0 3 2.0 3.0 4.0