Posts

Featured post

node.js - StackOverflow API not returning JSON -

i using node.js script gather data stackoverflow. know responses gzipped, put code in should take care of that. script follows: var request = require('request'); var zlib = require('zlib'); function getstackoverflowresponse(url, callback){ request(url, {encoding: null}, function(err, response, body){ if(response.headers['content-encoding'] == 'gzip'){ zlib.gunzip(body, function(err, dezipped) { callback(dezipped); }); } else { callback(body); } }); } var url = "https://api.stackexchange.com/docs/questions#pagesize=2&order=desc&min=2014-01-04&max=2014-02-02&sort=activity&tagged=apigee&filter=default&site=stackoverflow&run=true"; getstackoverflowresponse(url, function(questions) { console.log(questions); }); instead of getting json output, i'm getting following response: buffer 0d 0a 0d 0a 0d 0a 0d 0a 3c 21 44 4f 43 54 59 50 45 20 48

ios - Apple Push Notifications + TestFlight + Enterprise wildcard provisioning profile -

i work in organization have apple enterprise provisioning profile. developing ios application makes use of apple push notifications, , use testflight distribute many users in organizations without having register device ids in testflight. can use enterprise wildcard provisioning profile distribute via testflight application uses apple push notifications? or can use explicit provisioning profile distribute app via testflight without having register employees devices in testflight beforehand? thanks in advance, ido it should work! what enterprise apps? if registered apple's enterprise program , making enterprise apps, no worries...testflight works too. testflight supports enterprise apps , works ad hoc apps distribution. upload enterprise signed app , distribute team , approved members of team have access application installation. source: http://help.testflightapp.com/customer/portal/articles/402851-testflight-faq

linked list - Move value to end of queue in C -

i'm new c , i'm trying use function move value end of queue. works first 2 times, third time goes wrong regarding while loop , i'm not sure what's causing it. @ appreciated. :) void enqueue(queue q, int value) { if (q == null) { return; } // create new node node * newnode = (node *)malloc(sizeof(node)); if (newnode == null) { return; } // add node end of queue newnode->value = value; if (q->head == null) { newnode->next = q->head; q->head = newnode; } else { node * head = q->head; while (head->next != null) { head = head->next; } // update queue pointer head->next = newnode; } } if q->head non-null, never set newnode->next , leaving uninitialised. next code walk list follow uninitialised pointer, leading undefined behaviour , crash. to fix this, need initialis

android - Drag and drop in ScrollView -

Image
i have imageviews inside horizontalscrollview. i able drag , drop imageviews somewhere else, still maintain scrolling capability. dragging should activated when user starts vertical motion finger. for now, have drag , drop activate on long-press, not solution. to illustrate: i had well. after reading http://techin-android.blogspot.in/2011/11/swipe-event-in-android-scrollview.html adapted code follows: class myontouchlistener implements view.ontouchlistener { static final int min_distance_y = 40; private float downy, upy; @override public boolean ontouch(view view, motionevent event) { switch (event.getaction()) { case motionevent.action_down: { downy = event.gety(); return true; } case motionevent.action_move: { upy = event.gety(); float deltay = downy - upy; // swipe vertical? if (math.abs(deltay) > min

select - Joining the Column Outputs of Two or More Columns from a MySQL Query -

i trying join outputs of 2 or more mysql queries. if query 1 has n columns , query 2 has m columns, output should have n+m columns. example: select * (select 1,2,3) x, (select 4,5) y; the output here : 1 2 3 4 5 now issue second query may produce no results. case results in no output @ all: select * (select * table_0) x, (select * table_1) y; if table_1 returns no matches, combined output returns no rows. still entries of first table returned. while have workaround, involves individual queries each of m columns. not want create temporary tables , join them. a left join should it: select * (select * table_0) x left join (select * table_1) y on 1;

c++ - OpenCV findContours

i have c++ project using qt 5.1.1 , opencv 2.4.6. image processing algorithm runs in separate thread. works fine if call opencv function findcontours() program crashes stack overflow message (right in first time function called, not called several times before) "unhandled exception @ 0x56ec9a47 in sara.exe: 0xc00000fd: stack overflow." i found same problem in case matter of changing project visual studio 2010...but in case, project in vs2010. the algoritm runs fine if create separate console project, calls image processing algorithm, same code inside thread in qt project show stack overflow! if remove findcontours() function, woks should. in both projects use same libs , debug dlls (versioned xxx246d.dll), , compiling program debug. i tried make stack larger changing properties -> configuration properties -> linker -> system -> stack reserve size option, program still crashes, different message, saying "unhandled exception @ 0x76e5c41f in sara.

android - Passing current location to Marker -

i writing application opens maps app , able add marker object @ current location when opens. application correctly opens maps app , shows blue dot current location, having difficulty using current location in order create marker . here source code: import com.google.android.gms.common.connectionresult; import com.google.android.gms.common.googleplayservicesclient; import com.google.android.gms.common.googleplayservicesutil; import com.google.android.gms.location.locationclient; import com.google.android.gms.location.locationlistener; import com.google.android.gms.location.locationrequest; import com.google.android.gms.maps.cameraupdate; import com.google.android.gms.maps.cameraupdatefactory; import com.google.android.gms.maps.googlemap; import com.google.android.gms.maps.model.latlng; import com.google.android.gms.maps.model.markeroptions; import com.google.android.gms.maps.mapfragment; import com.google.android.gms.maps.supportmapfragment; import android.location.location; im