Posts

TypeScript - pass to constructor entire object -

i have class @ type script: export class child { name:string; age:number; } i want force class instances have properties class declaration has. for example, if firebase object: myfirebaseservice.getchild(id).then(function(child){ var currentchild = new child(child); }) so when object is: {name:"ben", color:"db"}, want result be: currentchild = {"name":"ben"} becouse "color" not field of "child". i tried this: export class child { name:string; age:number; constructor(tempchild:child = null) { if (tempchild){ (var prop in tempchild) { this[prop] = tempchild[prop]; } } } } but not help. "currentchild" of fields , attached them class instance. (of course, can use following code: export class child { name:string; age:number; constructor(tempchild:child = null) { if (tempchild){ this.nam = tempchild.name; this.age =tempchild.age...

excel - Python - TypeError: 'Cell' object is not iterable -

what i'm trying write new excel file data list. contents of list row contents i'm trying write in new excel file using xlsxwriter (specifically xlsx because i'm using xlsx). assuming have code snippet below, yields me error : typeerror: 'cell' object not iterable the whole stacktrace points out during write event. traceback (most recent call last): file "desktop/excel-copy.py", line 33, in <module> sheet.write_row(row_index, col_index, cell_value) file "/usr/local/lib/python2.7/dist-packages/xlsxwriter/worksheet.py", line 64, in cell_wrapper return method(self, *args, **kwargs) file "/usr/local/lib/python2.7/dist-packages/xlsxwriter/worksheet.py", line 989, in write_row token in data: typeerror: 'cell' object not iterable import xlrd import xlsxwriter new_workbook = xlsxwriter.workbook() sheet = new_workbook.add_worksheet('stops') #copy row , column contents new worksheet row_inde...

visualization - How do I visualize the intersection of spheres in MATLAB? -

Image
it seems question has been asked in few places ( including on so ). came across need when visualizing results of trilateration problem. in every case, answer directs inquiry @ wolfram math excludes code. math great reference, if i'm asking question on programming, code might well. (it appreciated when answers code question avoid pithy comments "writing code trivial"). so how can 1 visualize intersection of spheres in matlab? have simple solution below. i wrote small script this. feel free make suggestions , edits. works checking if surface of each sphere falls within volume of of other spheres. for sphere intersection, it's better (but slower) use larger number of faces in sphere() function call. should give denser results in visualization. sphere-alone visualization, smaller number (~50) should suffice. see comments how visualize each. close clear clc % centers : 3 x n matrix of [x;y;z] coordinates % dist : 1 x n vector of sphere radii...

Running python codes from outside the directory when script has filepaths -

so have python script my_script.py inside folder test , outside folder. script requires access input data file my_data.dat stored inside folder test . now, when try run script outside folder test , using simple python my_script.py , tries locate my_data.dat in folder running script , fails. how can tell use correct path without modifying path in my_script.py? i don't want modify paths in script because script used generically various paths , whole thing automated later. you need use absolute file path instead of relative file path. to absolute path of directory containing python file: import os root_dir = os.path.dirname(__file__) and can absolute path of my_data.dat data_file_path = os.path.join(root_dir, 'my_data.dat') afterward use data_file_path instead of "my_data.dat"

How to disable business hours in FullCalendar -

i trying incorporate fullcallendar in 1 of our application show events. facing problem business hours. in month view showing wrong end date (one day less actual) if event ends before 9 am. example, have 2 following events event 1: start date&time : 2016-11-09t10:00, end date&time : 2016-11-20t17:30 event 2: start date&time : 2016-11-09t10:00, end date&time : 2016-11-20t08:30 in case in month view, event 1 covering dates 9 20, event 2 covering dates 9 19. i tried in google issue , found following link how set business hours but not solved issue. want disable business hours. tried setting false. nothing happen. please help please use nextdaythreshold option in full calendar nextdaythreshold: '00:00:00' for more information: https://fullcalendar.io/docs/event_rendering/nextdaythreshold/

javascript - Scrolling bar on IE using devexpress -

i use devexpress gridview vertical scroll bar, when user focus on record of gridview , press down arrow focuse move next record scroll bar dosen't move write code in javascript make scroll bar moving , record focused still visible me works on firefox , chrome doesn't work on ie 11 there way deal scroll bar in gridview in ie document.onkeydown=function(e){ e=(e || event) if(e.keycode == 40){ var ix = grid.getfocusedrowindex(); var v= grid.getvisiblerowonpage(); if(((ix%2==0) || (ix%3==0)) && (ix!=2)){ return true; } e.preventdefault(); return false; } } you may need use dx aspxgridview js scroll helpers like: aspxclientgridview.setverticalscrollposition - set vertical scroll position aspxclientgridview.getverticalscrollposition - vertical scroll position these methods should ie11 compatible since included in official release. see more details in following post: https://www.devexpress.com/support/c...

xcode - Manage provisioning profiles on my Mac OS Sierra build host -

i used have iphone configuration utility obsoleted on mac os after upgrade sierra . replaced apple configurator great managing external devices not mac os host itself. how can manage installed provisioning profiles (delete some) on mac os (sierra) build host?