Posts

mysql - Spring Social Facebook App Setup for getting the user information -

i working on spring social login facebook. need user information(firstname,lastname , email).is there specific app setup these details??? the spring social facebook project extension spring social enables integration facebook https://spring.io/guides/gs/accessing-facebook/

Android SIP configuration doesn't work -

i little confused configuration of sip account. think here, clarify issues, based on sip stack documentation . all works fine, want add configuration working account. note, other methods protocol works fine. want use, configure methods: retryintervalsec() , delaybeforerefreshsec() , timeoutsec() . problem, methods doesn't work, below example of setting config. based on doc above delaybeforerefreshsec has value of 5 sec. registration refreshing after 5 sec, , when getting base value default config, it's equal default setting. but! refreshing doesn't firing after 5 sec! do ready magic? as can see, methods name "delaybeforerefreshsec", means use input seconds (for ex. delaybeforerefreshsec(5)). but, when setting methods value long (for ex. delaybeforerefreshsec(100000)), refreshing start firing every 5 sec! note, value above 500, start working periodic 5 sec! i know, maybe there verification , setting base value in source, if it's more higher val...

ffmpeg - Purpose of XOR-ing with 0? -

so have static hash table , before adding code in table, index being xor-ed 0. why case if index of table declared integer? h = 0; h ^= (i << lzw_hash_shift); if (h >= lzw_hash_size) { h -= lzw_hash_size; } s->tab[h].code = i; s->tab[h].suffix = i; s->tab[h].hash_prefix = lzw_prefix_empty; this source code part of ffmpeg lzw encoder lib. in original code, hash function called other places in code, , makes no sense duplicate function avoid 1 line in special case when line nothing. thus, nothing when called cleartable (wasting negligible amount of time), sensible when called parameter not zero. in case, sole purpose showcase how blind copy-pasting bad, suppose :)

ios - How to make a tableview snap to cells centers ? (with gif animation illustration) -

Image
the thing want achieve gallery, can contain 300 images, using uiscrollview result in non optimized ram/cpu usage since doesn't pooling (correct me if i'm wrong), , has limitation on width, can't make 300 times width of screen (again correct me if i'm wrong). so right choice use uitableview 1 - how make scroll horizontally in gif ? 2 - how make snap cells centers ? edit i'm using this, gives result want has problem, has no tolerance how should swipe move next cell, still need help.. func scrollviewdidenddragging(scrollview: uiscrollview, willdecelerate decelerate: bool) { // find collectionview cell nearest center of collectionview // arbitrarily start last cell (as default) var closestcell : uicollectionviewcell = collectionview.visiblecells()[0]; cell in collectionview!.visiblecells() [uicollectionviewcell] { let closestcelldelta = abs(closestcell.center.x - collectionview.bounds.size.width/2.0) let celldelta...

sqlite - Manually executing sql query in Android -

i have database in app using 3rd party library . library doesn't seem have drop table functionality. thinking directly change using sqliteopenhelper api. possible? i have created class extends sqliteopenhelper , give same db name 1 used in library. public class sqlitedatabasehelper extends sqliteopenhelper { // database info private static final string database_name = "mydatabase"; private static final int database_version = 1; private context context; public sqlitedatabasehelper(context context) { super(context, database_name, null, database_version); this.context = context; } @override public void oncreate(sqlitedatabase db) { } @override public void onupgrade(sqlitedatabase db, int oldversion, int newversion) { l.w("old: " + oldversion + ", " + "new: " + newversion); if (oldversion != newversion) { db.execsql("drop table if exists ...

curl - How to write PHP code to execute two functions -

i have php script (for docker remote api), i'm using stopping container "remotely": <?php $cid = trim(file_get_contents('cid')); echo "$cid\n"; function httppost($url) { $ch = curl_init(); curl_setopt($ch,curlopt_url,$url); curl_setopt($ch,curlopt_returntransfer,true); curl_setopt($ch,curlopt_post, true); $output=curl_exec($ch); curl_close($ch); return $output; } $url = "http://172.17.0.1:2375/containers/$cid/stop?t=5"; echo "$url\n"; echo httppost($url) ?> it works! have piece of code "stop" two docker containers, instead of one. i thinking this: $cid = trim(file_get_contents('cid')); $pid = trim(file_get_contents('pid')); then how rest of code like, stop both of them? switch part: $url = "http://172.17.0.1:2375/containers/$cid/stop?t=5"; echo "$url\n"; echo httppost($url) to this $url1 = "http://172.17.0.1:2375...

python 2.7 - maximum recursion depth error? -

so i'm new (3 days) , i'm on code academy, i've written code 1 of activities when run it displays maximum recursion depth error, i'm running in python console of code academy , simultaneously on own ipython console. hint on page not helpful, can explain how fix this? def hotel_cost(nights): return (nights * 140) def plane_ride_cost(city): if plane_ride_cost("charlotte"): return (183) if plane_ride_cost("tampa"): return (220) if plane_ride_cost("pittsburgh"): return (222) if plane_ride_cost("loas angeles"): return (475) def rental_car_cost(days): cost = days * 40 if days >= 7: cost -= 50 elif days >= 3: cost -= 20 return cost def trip_cost(city, days): return hotel_cost(nights) + plane_ride_cost(city) + rental_car_cost(days) maybe: def plane_ride_cost(city): if city == "charlotte": return (1...