connect

Facebook Connect iPhone custom publish stream

青春壹個敷衍的年華 提交于 2019-12-06 04:06:00
问题 I just downloaded the Facebook SDK for iOS because I need to be able to publish custom streams to user's Facebook feeds. The sample app has a method called publishStream:(id)sender that appears to set up a custom description for the Publish Stream dialog, but when my dialog comes up all I see is an empty dialog to start typing in. The code in the sample app is this: `SBJSON *jsonWriter = [[SBJSON new] autorelease]; NSDictionary* actionLinks = [NSArray arrayWithObjects:[NSDictionary

Slave cannot connect to Master

感情迁移 提交于 2019-12-06 02:17:04
I'm trying to configure my laptop as a slave, my master would be a server where Jenkins is installed. I've followed these instructions . However, when it comes to access http://master:8080/ from my slave's browser, internet cannot display the webpage. So I tried the second way, by writing javaws http://master:8080/computer/Slave/slave-agent.jnlp in the cmd prompt and this time I have this error: Could not load file/URL specified: http://master:8080/computer/Slave/slave-agent.jnlp I am new to stuff with network etc so can you enlighten me? EDIT: I manage to reach the page, instead of user

How to decode a cookie secret, set using Connect's cookieSession?

非 Y 不嫁゛ 提交于 2019-12-06 01:13:00
I am setting a cookie using Connect's cookieSession() . This seems to encrypt the cookie's secret value, returning something like 's:j:{}.8gxCu7lVJHVs1gYRPFDAodK3+qPihh9G3BcXIIoQBhM' How do I decrypt the cookie's value? Example code: app.use(express.bodyParser()); app.use(express.cookieParser()); app.get('/setcookie', function(req, res, next){ res.app.use(express.cookieSession({ key: "test", secret: "test" })); console.log(req.cookies.test); res.end(); }); app.get('/', function(req, res, next){ console.log(req.cookies.test); res.end(); }); Hmmm... you seem to be a bit confused about the use of

How to configure the Express response object to automatically add attributes to JSON?

流过昼夜 提交于 2019-12-05 23:18:22
问题 I have an object: var obj = { "stuff": "stuff" } In Express, I send it the client like so: res.json(obj); Is there a way to configure the response object to automatically add attributes to the json it generates? For example, to output: { "status": "ok", "data": { "stuff": "stuff" } } Thanks! 回答1: Once the data has been added to the stream, that's too late to rewrap it, so you have to do it before. Either simply with a function: res.json(wrap(obj)); You could also add your own json method

My returned data is not gzipped with connect.compress()

非 Y 不嫁゛ 提交于 2019-12-05 21:38:23
I am trying to use the connect.compress() middleware to gzip my responses to the client. I am able to partially get it to work but when I add my own response using res.end the response is no longer gzipped. Gzipped responses: app = connect() .use(connect.compress()) .use(connect.query()) .use(connect.json()); Not gzipped responses: app = connect() .use(connect.compress()) .use(connect.query()) .use(connect.json()) .use(function (req, res) { res.end('hello'); }); I would like to be able to respond with my own message but still have the content gzipped. I had the same problem with small HTTP

How to change Android usb connect mode to charge only?

痞子三分冷 提交于 2019-12-05 18:15:13
问题 I've seen HTC android devices have connect mode selection when connected to PC via usb line, while mine always pops up a USB massive storage device dialog with a button turn on massive storage , which is boring, because sometimes my line could be loose, and off/on randomly, so the pop up always show up suddenly and intrudes my input when I'm doing something else. Is the a way to fix this? 回答1: The HTC devices have the PCSII.apk which allow them to select usb connect mode. For your device, you

WARNING: Failed to load the sqljdbc_auth.dll cause : no sqljdbc_auth in java.library.path

删除回忆录丶 提交于 2019-12-05 17:45:23
I am using Ubuntu 12.05 and trying to connect to a Windows Server 2012 for a database my database name is jobs the ip address of the pc is 192.160.1.33 which is hosted in 1433 yet when i try to connect it gives the following error WARNING: Failed to load the sqljdbc_auth.dll cause : no sqljdbc_auth in java.library.path Please advice how to set that. I think you have the wrong jdbc driver and you're on Ubuntu 12.04 (there is no 12.05). Rather then hacking around with an old native driver for Windows (Linux libraries end in .so not .dll ), I suggest you stop and use this Type-4 one from

How to use 'this' context in middleware

為{幸葍}努か 提交于 2019-12-05 15:08:28
I wrote my own middleware as module for my purposes that looks like the following: -- myMiddleware.js module.exports = { fn1: function (req, res, next) { console.log('fn1'); next(); }, fn2: function (req, res, next) { console.log('fn2'); this.fn1(req, res, function () { next(); }); } }; In my sserver.js I use this middleware as the following: app.set('views', __dirname + '/views'); app.set('view engine', 'jade'); app.use(express.favicon()); app.use(express.bodyParser()); app.use(express.methodOverride()); app.use(express.cookieParser('your secret here')); app.use(require('./myMiddleware').fn2)

Redirect all requests using Express 3?

余生颓废 提交于 2019-12-05 13:38:15
What is the best way to do this? I'd like to redirect all requests from www.mysite.com to mysite.com *.mysite.com to mysite.com would be ideal I would think some type of middleware. I still hate this, because it seems so inelegant and slightly wasteful, but I think my only option is to do this server-side. Since Express 3 doesn't use its own HTTP server (instead you pass your app to http.createServer ), it doesn't know what port it's running on unless you tell it. That said, you can do basically what you want to do with the following: app.use(function(request, response, next) { var newHost =

Nodejs: Express + RedisStore, req.session undefined

ε祈祈猫儿з 提交于 2019-12-05 11:42:14
I have done this before... I don't follow what I'm doing wrong this time, but I've been struggling for a couple of hours and now consider myself mentally blocked. The corresponding code: app.use(express.bodyParser()); app.use(i18next.handle); app.use(express.methodOverride()); app.use(express.static(__dirname + '/public')); app.set('views', __dirname + '/views'); app.set('view engine', 'swig'); app.set('view cache', false); var session_store = new RedisStore({ client : redis_client}); app.use(express.errorHandler({ dumpExceptions : true, showStack : true})); app.use(express.cookieParser());