Posts

javascript - Issues with CORS, Jquery and Coldfusion. Headers -

i using following code handle jquery stuff: var data = $('#loginform').serialize(); alert(data); $.ajax({ url: 'https://devport.mywebsite.com/login.cfm?method=login', crossdomain: true, type: "post", data: data, cache: false, beforesend: function (xhr) { xhr.setrequestheader("access-control-allow-origin", "*"); }, success: function (data) { alert(data); }, error: function (xhr, teststatus, error) { alert(teststatus + " " + error); } }); it time going error, not sure why problem is. error is: sec7123: request header access-control-allow-origin not present in access-control-allow-headers list. script7002: xmlhttprequest: network error 0x80070005, access denied. the coldfusion side this: <cfcontent type='text/html; charset=utf-8'> <cfheader name="access-control-allow-origin" value="*"> <cfheader name="acc...

javascript - How to render multiple HighCharts using a queue to prevent long load times -

i using mvc razor foreach render charts, on 150. this how generate script: @{chartcount = 0;} @foreach (var item in model.chartrows.where(m => !m.summaryrow)) { $('#container_@(chartcount)').highcharts({ //code removed brevity }); chartcount++; } and in html use render containers: @for (int = 0; < chartcount; i++) { <div id="container_@(i)"></div><br /> } however, when there 100's of items in chartrows , page can take long time load before of charts appear. have taken on highcharts website , have found chart type called " sparkline " , jsfiddle example shows way rendering can delayed using settimout rendering them in "chunks". for me make work way need, have remove of data script (or @ least being populated item. ) , instead add 7+ data attributes onto each of html containers , use jquery data attributes populate chart data. i'm not ...

c++ - Is using "this" in contructor's initialization list specificly dangerous with Qt? -

i need reliable information "this" subject: class myclass, public qwidget { public: myclass( qwidget * parent = null ) :qwidget( parent ), mpanotherwidget( new qwidget( ) ){}; private: qwidget * mpanotherwidget; }; of course, calling virtual functions in contructor or initialization list bad idea. question is: can code mpanotherwidget( new qwidget( ) ) lead undefined behavior?! , if so: why ? please quote sources if can! thanks! it depends on qwidget pointer given. fine pass around reference or pointer half-constructed object long called code not access underlying object. need documentation of qwidget know whether touches object or stores pointer. in particular case of qt, reading documentation, calling constructor of qwidget , argument of type qwidget* , , this used cast base pointer. obtaining pointer base guaranteed in 12.7/3 requirement conversion the construction of x , construction of of direct or indirect bases ...

javascript - Nested loops in Knockout.js with if:clause -

i having problem nested foreach statements in ko. the following statements work fine on own when combine them inner 1 doesn't work , doesn't throw error either. ideally inner join conditional have tried without if clause , still no luck. experts have property array of expertroles assigned particular user. outer loop meant print expertroles , inner loop meant print experts match expert role of outer loop 1st foreach: works <ul data-bind="foreach: expertroles"> <li class="expert ui-menu-item" role="menuitem" data-bind="attr: { 'data-cid': id }, text: name"> </li> </ul> 2nd foreach: works <ul data-bind="foreach: experts"> <li class="expert ui-menu-item" role="menuitem" data-bind="attr: { 'data-cid': connectionid, 'title': username }"> <a href="javascript:void(0);" data-bind="text: ...

android - JSON and location distance calculate -

i planning this. first device location , info json. json includes latitude , longitude. after, calculate every items distance device. if less x number show in list view. have used use json parsing , list view basic. and here code location calculate location locationa = new location("point a"); locationa.setlatitude(lata); locationa.setlongitude(lnga); location locationb = new location("point b"); locationb.setlatitude(latb); locationb.setlongitude(lngb); float distance = locationa.distanceto(locationb); i use code. i think this. json items. before on list check distance if lover x put in list else return getting json item i need codes it. so have code calculate distance 2 points coordinates? make web page. can save coordinates database, when have phone position can take coordinates near position (like filter). after can use code check witch coordinates inside range x , put class contain coordinates. your coordinates class: p...

meteor - How to update a collection on jQuery (drag and) drop -

i'm building meteor app let's user organize lists of items in tags. i use jquery draggable , droppable update collection when user drags item 1 tag another. i find hard understand how/where/when should call function. i've tried few different options (including this "hacky way of doing it". the blaze documentation mentions functions can called on dom events, lacks drag , drop events i'm looking for. i've settled on calling function under template.rendered, means item can dropped once per render. i've tried counter tracker.autorun, don't think understand how works , item can still dropped once per render. how can make .item draggable several times per render? template.tag.rendered = function () { //wait on subscriptions load if (session.get('data_loaded')) { tracker.autorun(function () { $(".item").draggable({ revert: true, start: function (event, ui) { var movingitem = blaze.g...

google app engine - gcloud is stuck when trying to ssh to the virtual machine -

i running terminal. until yesterday, worked. gcloud compute --project my_project ssh --zone us-central1-a server_name no it's stuck no error message hours. have installed docker , boot2docker yesterday , it's possibly connected that. tried uninstalling docker still no luck.