share

Sharing a URL with a query string on Twitter

雨燕双飞 提交于 2019-11-26 18:53:02
问题 I'm trying to put a Twitter share link in an email. Because this is in an email I can't rely on JavaScript, and have to use the "Build Your Own" Tweet button. For example, sharing a link to Google: <a href="http://www.twitter.com/share?url=http://www.google.com/>Tweet</a> This works fine. The problem I'm having is when the URL has a query string. <a href="http://www.twitter.com/share?url=http://mysite.org/foo.htm?bar=123&baz=456">Tweet</a> URLs with query strings confuse Twitter's URL

How to make a custom LinkedIn share button

≡放荡痞女 提交于 2019-11-26 18:51:26
问题 I need to be able to add sharing functionality to my custom button. I'm not interested with their generator, as I can't change LinkedIn image there. I want to use my own image for the LinkedIn share button. 回答1: Official LinkedIn API for sharing: https://developer.linkedin.com/docs/share-on-linkedin Read Terms of Use! Example link using "Customized URL" method: http://www.linkedin.com/shareArticle?mini=true&url=https://stackoverflow.com/questions/10713542/how-to-make-custom-linkedin-share

Sharing memory between two processes (C, Windows)

允我心安 提交于 2019-11-26 18:42:11
Since I haven't found an answer to the question asked previously here I'm trying a different approach. Is there any way to share memory between two processes? The second process gets the information from an injection since it's a legacy program that it's not being supported anymore. My idea is to inject some code there, in the struct that I am passing to the injected program pass the address (or whatever) to the share memory where the data I need to run is located. Once I get the data I will populate my own variables inside the injected thread. Is this possible? How? Code is appreciated. EDIT:

Android 6: cannot share files anymore?

狂风中的少年 提交于 2019-11-26 18:05:53
问题 I am sharing an image, and this code works properly for devices before Android 6: Intent shareIntent = new Intent(Intent.ACTION_SEND); shareIntent.setType("image/*"); Uri uri = Uri.fromFile(new File(mFilename)); shareIntent.putExtra(Intent.EXTRA_STREAM, uri); mContext.startActivity(Intent.createChooser(shareIntent, mChooserTitle)); However I get the toast error " can't attach empty files " when I try to share using Android 6. I verified that the file exists and it's not zero-length. Anyone

How to share variables across scripts in python?

喜夏-厌秋 提交于 2019-11-26 18:02:35
问题 The following does not work one.py import shared shared.value = 'Hello' raw_input('A cheap way to keep process alive..') two.py import shared print shared.value run on two command lines as: >>python one.py >>python two.py (the second one gets an attribute error, rightly so). Is there a way to accomplish this, that is, share a variable between two scripts? 回答1: Hope it's OK to jot down my notes about this issue here. First of all, I appreciate the example in the OP a lot, because that is where

Make Android app listen to shared links

无人久伴 提交于 2019-11-26 17:41:10
问题 I want my Android app to appear listed as an option when the user shares an URL from another app (like the browser). How can I register my app to do that? How can I react to link shares? Thanks a lot. Edit: I've tried using IntentFilter like this without success: <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> </intent-filter> Any ideas? 回答1: At the

How to take a screenshot of current Activity and then share it?

徘徊边缘 提交于 2019-11-26 17:10:32
I need to take a screenshot of Activity (without the title bar, and the user should NOT see that a screenshot has actually been taken) and then share it via an action menu button "share". I have already tried some solutions, but they didn't work for me. Any ideas? SilentKnight This is how I captured the screen and shared it. First , get root view from current activity: View rootView = getWindow().getDecorView().findViewById(android.R.id.content); Second , capture the root view: public static Bitmap getScreenShot(View view) { View screenView = view.getRootView(); screenView

Got origin_mismatch error in Google+ share api

蓝咒 提交于 2019-11-26 16:35:21
问题 I want to share some dynamic content on google+. For this I checked it https://developers.google.com/+/web/share/interactive#rendering_the_button_with_javascript <head> <script type="text/javascript"> (function() { var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true; po.src = 'https://apis.google.com/js/client:plusone.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s); })(); </script> </head> <body> <button class="g

Python sharing a lock between processes

大城市里の小女人 提交于 2019-11-26 15:52:43
I am attempting to use a partial function so that pool.map() can target a function that has more than one parameter (in this case a Lock() object). Here is example code (taken from an answer to a previous question of mine): from functools import partial def target(lock, iterable_item): for item in items: # Do cool stuff if (... some condition here ...): lock.acquire() # Write to stdout or logfile, etc. lock.release() def main(): iterable = [1, 2, 3, 4, 5] pool = multiprocessing.Pool() l = multiprocessing.Lock() func = partial(target, l) pool.map(func, iterable) pool.close() pool.join() However

Portable way to pass file descriptor between different processes

亡梦爱人 提交于 2019-11-26 15:24:59
On most UNIX systems passing an open file between processes can be easily done for child/parent processes by fork(); however I need to share a fd "after" the child was already forked. I've found some webpages telling me that sendmsg() may work for arbitary processes; but that seems very OS dependent and complex. The portlisten seems like the best example I can find, but I'd prefer a good wrapper library like libevent that hides all the magic of kqueue, pool, .... Does anyone know if there's some library (and portable way) to do this? Curt J. Sampson Your best bet is to try sending the file