Posts

android Facebook sdk login issue in 3.7 -

i developed app uses facebook login login. using default login button provided in facebook sdk 3.7 login functionality. issue is, devices unable login app. issue occurring on few devices, more 70% devices able login. the error is: session state:closed_login_failed, token:{accesstoken token:access_token_removed permissions:[]} seems hash generation issue. just use solution - packageinfo info = getpackagemanager().getpackageinfo("<your_package_name>", packagemanager.get_signatures); (signature signature : info.signatures) { messagedigest md = messagedigest.getinstance("sha"); md.update(signature.tobytearray()); log.d("keyhash:", base64.encodetostring(md.digest(), base64.default)); } this uses standard hash generation provided facebook. the same mentioned here . update: although problem related way generating hash , method have placed facebook login code, think there tutorials out there can ...

python - Value in MainWindow returned from childWindow -

how send value childwindow mainwindow once childwindow closed?. when "closebutton" in childwindow pressed, childwindow sends calculated value mainwindow. i did test this: def closeevent(self, evnt): value = 34 return value and didn't work, got this: typeerror: invalid result type childwindow.closeevent() here simple example how can that: import sys pyqt4 import qtgui class window(qtgui.qwidget): def __init__(self): qtgui.qwidget.__init__(self) self.button = qtgui.qpushbutton("make child") self.button.clicked.connect(self.openchildwindow) layout = qtgui.qvboxlayout(self) layout.addwidget(self.button) def openchildwindow(self): self.childwindow = childwindow(self) self.childwindow.setgeometry(650, 350, 200, 300) self.childwindow.show() def printresult(self, value): print value class childwindow(window): def __init__(self, parent...

javascript - Detect internet disconnection via socket -

currently i'm using node.js server has tcp socket connection(using socket.io ) using i'm showing real-time data via browser. consider scenario, have logged in application , real-time shown via web browser. of sudden network got disconnected. @ show message saying "expired" when client-side socket emits disconnect event. socket.on('disconnect', function () { console.log("disconnected server"); alert("disconnect"); }); now problem: above disconnect event emitted after 60 seconds; in-between when user tries update, not work , create bad impression us. how overcome situation , how emit disconnect event of sudden when network got disconnected? you have understand heartbeat interval , heartbeat timeout . earlier time when server emits heartbeat each 25 seconds (by default). , later timeout server keep specific client in memory. if client receives heartbeat within heartbeat timeout (60...

PHP function preg_match is not functioning precisley -

i use preg_match_all() function count number of words. what have found out removes numbers content. why? here function: define("word_count_mask", "/\\p{l}[\\p{l}\\p{mn}\\p{pd}'\\x{2019}]*/u"); $matches; function str_word_count_utf8($str) { global $matches; return preg_match_all(word_count_mask, $str, $matches); } what think causing issue??

How to perform select->cut/copy->paste/move the selected area in android finger paint? -

am developing painting app. want select painted area , cut, move / paste same doing in app link1 , link2 . using finger paint app in api demo. don't know how this. know please me thank you.

swing - How to add text to JText area without deleting the previous text it has? java -

i have jtext area in program contain text, , want add more text it, when button pressed without deleting text has on it. example jtextarea text = new jtextarea("including; "); when button pressed, have add text without deleting 1 has already, so; text.settext("including button1"); and when button pressed should this text.settext("including; button1, button2"); what effective way of doing this? use append feature, this text.append("button1,"); place in button / s , write name of button

html - Accessing a file on my domain relative to port -

i running node server on port 3000. have css file stored on http://mydomain.com/style.css but since every page right http://mydomain.com:3000/randompage.html how can access style.css file? can http://mydomain.com:3000/styles.css page working on, doesn't exist. what best way deal situation? suppose applies files need access. i don't know simple solution using relative url or html magic in page. the usual solution install module in apache or function in node.js redirect requests other server html, seems coming single source. this document should started when using apache: using mod_rewrite proxying