Posts

javascript - Asynchronous data input in highcharts -

i loading data mysql database using $.getjson method. data displayed in highcharts. there different buttons user can click in order change between datasets. problem when page first loaded, chart load empty. found out because $.getjson method using retrieving data asynchronous. not sure whether can resolved switching getjson method ajax method. have tried did not succeed. or whether javascript function switching chart data upon button-clicks problem. below code. fragments of code think responsible problem showed below. know might want jsfiddle since using database data know how display problem. <script> var d = new date(); var pointstart = d.gettime(); //------------------------------------------------------- //set 'line' marker type use in bullet charts highcharts.renderer.prototype.symbols.vline = function(x, y, width, height) { return ['m', x, y + width / 2, 'l', x + height, y + width / 2]; }; highcharts.renderer.prototype.symbol...

Change version of .net core in Azure App Service -

i have asp.net core app works correctly on computer not on azure app service: in 1 of api, return dynamic type. api runed on computer got (with .net core version : 1.0.1): {"id":2,"color":"#3da1e8 ","logo":"","name":"...","companysecurities":[]} from api runed on azure app service got (with .net core version : 1.1.0-preview1-001100-00): {"id":2,"color":"#3da1e8 ","logo":"","name":"...","companysecurities":[] you can see the last bracket disapear on azure app service. i want know if there way change .net core version of azure app service 1.0.1 .

c# - Web Api Response Standards -

i have 2 development paths regarding return value should restful architecture standpoint. pros , cons of each method below? first method. the client submit post of item hologram . here model in method one. public class hologram { public double holowidth { get; set; } public double holoheight { get; set; } public double holodepth { get; set; } public string hologuid { get; private set; } public hologram() { this.hologuid = new guid().tostring(); } } the idea is, method able provide faster response client, because return guid associated hologram . here repository method one, don't have database connection set yet _holos database. public string add(hologram hg) { hologram hig = new hologram(); hig = hg; asynccode(_holos.values.add(hig)); /// adds database via injection, running asynchronously. return hig.hologuid; } ...

dictionary - Scala - map function - Only returned last element of a Map -

i new scala , trying out map function on map. here map: scala> val map1 = map ("abc" -> 1, "efg" -> 2, "hij" -> 3) map1: scala.collection.immutable.map[string,int] = map(abc -> 1, efg -> 2, hij -> 3) here map function , result: scala> val result1 = map1.map(kv => (kv._1.touppercase, kv._2)) result1: scala.collection.immutable.map[string,int] = map(abc -> 1, efg -> 2, hij -> 3) here map function , result: scala> val result1 = map1.map(kv => (kv._1.length, kv._2)) result1: scala.collection.immutable.map[int,int] = map(3 -> 3) the first map function returns members expected second map function returns last member of map. can explain why happening? thanks in advance! in scala, map cannot have duplicate keys. when add new key -> value pair map , if key exists, overwrite previous value. if you're creating maps functional operations ...

python - Unknown label type sklearn -

i 'm new in sklearn. 'm trying code data = pandas.read_csv('titanic.csv') data= data[data['pclass'].notnull() & data['sex'].notnull() & data['age'].notnull() & data['fare'].notnull()] test = data.loc[:,['pclass','sex','age','fare']] target = data.loc[:,['survived']] test = test.replace(to_replace=['male','female'],value=[1,0]) clf=decisiontreeclassifier(random_state=241) clf.fit(target,test) and saw error valueerror: unknown label type: array([[ 22. , 3. , 7.25 , 1. ], [ 38. , 1. , 71.2833, 0. ], [ 26. , 3. , 7.925 , 0. ], ..., [ 19. , 1. , 30. , 0. ], [ 26. , 1. , 30. , 1. ], [ 32. , 3. , 7.75 , 1. ]]) what problem? you providing dataframe , not it's numpy array representation training input fit method. instead: c...

python - function returns previous value -

i want users input number, check validity , return it. if number invalid, wish repeat input process. if type: "5b" "50.4" the function doesn't return 50.4 . instead returns 5.0 , remainder of first function call executed. how can fix above issue, 50.4 ? def inputgoal (): goalfiltered = "" print ('1: ' + str(goalfiltered)) goal = input("input number: ") char in goal: matched = false sign in comparator: if (sign == char): matched = true if (char != ','): goalfiltered += sign elif (char == ','): goalfiltered += '.' if (matched == false): print ("please repeat input, valid characters are: 0 1 2 3 4 5 6 7 8 9 , .") inputgoal() #return goalfiltered = float(goalfiltered) return (goalfiltered) the comparator var...

javascript - jQuery - Have to press button twice or more to make the function stick -

i attempting make "etch-a-sketch" style block of divs. when "erase()" or "draw()" functions called via button press, work few seconds or increase or decrease opacity .1 until double press button. trying make can pressed once , continue increase/decrease opacity on hovered elements continually until other function stopped. missing here? function erase(){ $('.erase').toggleclass('draw').toggleclass('erase'); $('.box').hover(lighten); } function draw(){ $('.erase').toggleclass('erase').toggleclass('draw'); $('.box').hover(darken); } function darken(){ var currentdarkness = +$(this).css('opacity'); if (currentdarkness <= 1) currentdarkness += .10; $(this).css({"opacity": currentdarkness}); } function lighten(){ var currentdarkness = +$(this).css('opacity'); if (currentdarkness >= 0) currentdarkness -= .10; $(this).css...