Posts

javascript - Automatic Serial Nos in ng-Repeat (Angular) -

Image
i using ng-repeat fill table data in controller (or services). however, need fullfill serial nos in first column automatically. getting static data 1 in columns. html: <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script> </head> <body ng-app="myapp" ng-controller="myctrl"> <table> <tr><th>s.no.</th><th>name</th></tr> <tr ng-repeat="x in people"><td>1</td><td>{{x.name}}</td></tr> </table> <script> var app = angular.module('myapp',[]); app.controller('myctrl',function($scope){ $scope.people = [ {name:"peter"}, {name:"lina"}, {name:"roger"} ]; }); </script> </body> </html> output: i want numbers in first column 1, 2, 3, etc. how can achieve ngrepeat ? use $index : ...

asp.net - Angular 2 import error with RequireJS -

i'm unable import angular2/core due following error: module name "angular2/core" has not been loaded yet context: _. use require([]) this typescript file: import {component, view} "angular2/core"; import {bootstrap} "angular2/platform/browser"; @component({ selector: "menu" }) class menucomponent { isactive(path: string) { return true } } bootstrap(menucomponent); which compiled configuration: { "compileroptions": { "noimplicitany": false, "noemitonerror": true, "removecomments": true, "sourcemap": true, "target": "es5", "module": "commonjs", "outdir": "../wwwroot/js", "experimentaldecorators": true, "emitdecoratormetadata": true }, "exclude": [ "node_modules", "wwwroot" ] } this compiled javascrip...

Save textfield's string in an array - Swift -

i creating application that, written string in textfield, saves in array. array showed in tableviewcontroller embedded in mainviewcontroller. situation following. http://i.stack.imgur.com/z5utc.png . want every time tap green "save" button, string wrote in textfield saved , showed in tableview , textfield returns empty, can re-write string, added in array. tableview, in case, shows 2 strings, wrote in same textfield. tried write code 2 viewcontrollers (the mainviewvc , tablevc). mainvc import uikit class mainvc: uiviewcontroller { @iboutlet var txtfield: uitextfield! var embtablevc: tablevc! override func viewdidload() { super.viewdidload() // additional setup after loading view. } override func didreceivememorywarning() { super.didreceivememorywarning() // dispose of resources can recreated. } override func prepareforsegue(segue: uistoryboardsegue, sender: anyobject?) { if segue.identifier == "embededtablevc" { embtablevc = segue.destinationvie...

python - Slice numpy array based on x number of other arrays -

i trying make current code dynamic. meaning should able adjust regardless of number of array inputs of user. current code: main1 = numpy.array([1,2,3,4]) array1 = numpy.array(['a','b','c','b']) my_list1 = ['a','b'] array2 = numpy.array(['cat','dog','bird','cat']) my_list2 = ['cat'] result_array = main1[np.in1d(array1, my_list1) , np.in1d(array2, my_list2)] the desired result of printing out result_array is: array([1, 4]) this because of intersection of a , cat & b , cat . my goal able n number of array1 , array2 ... , n number of my_list1 , my_list2 ... thanks in advance! version more 2 arrays, using logical_and.reduce : array3 = numpy.array(['cat3','dog3','bird3','cat3']) my_list3 = ['cat3'] my_arrays = [array1, array2, array3] my_lists = [my_list1, my_list2, my_list3] res1 = main1[numpy.logical_and.reduce(tuple(np.in1d(...

seo - Using noindex and nofollow to avoid duplicate content penalization -

scenario : i own website original content. support categories use creative commons licensed contents, is, of course, duplicate content. question : if want avoid penalization duplicate content , statements true? i should mention original author fair human being. i must use meta noindex avoid robots fetching content. i must use cannonical url metion original content , it's author. i don't need use nofollow meta along noindex, because has other purposes. i don't have use rel="nofollow" on incoming links inside site point duplicate content, because won't indexed anyways, given noindex meta tag. i did research , got it. not sure this, , understand before applying @ all. thank you. in order avoid penalization duplicate content, can of course use meta noindex , rel="nofollow". here syntax: <meta name="robots" content="noindex, nofollow"> this tells robots not index content of page, and/or not scan...

bluetooth - gatt.disconnect() is initiated host but not by the app -

Image
i've been breaking head issue.... i send gatt.write command remote device, getting response , not because gatt disconnects @ times app! (when using nrf app writing value doesnt disconnect) when exploring issue wireshark using btsnoop_hci.log see host initiating disconnect, app not sending!!! went on debugger on every possible disconnect. i'm attaching log output:

c# - WPF fixed rows are resizing -

Image
i'm new in wpf , try creat specific usercontrol display data single product. used grid inside usercontrol. create 5 columns , 3 rows. want ot make 4 columns fixed (image, green-clored, blue-colored , column controls) , last column (orange-colored) fill availabel space. here xaml , few screenshots: <grid margin="0,0,0,5" background="#ffdcd9d9" > <grid.columndefinitions> <columndefinition width="80" /> <columndefinition width="70" /> <columndefinition width="70" /> <columndefinition width="70" /> <columndefinition width="*" /> </grid.columndefinitions> <grid.rowdefinitions> <rowdefinition height="auto" /> <rowdefinition height="auto" /> <rowdefinition height="auto" /> <rowdefinition height="auto" /> </g...