w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
What's the difference between sharing a semaphore between threads of a process and sharing one between processes?
Well, the difference should be more or less obvious from man sem_init: If pshared == 0 then the semaphore will not be visible outside the current process, and it will likely be automatically destroyed when this process is finished. Therefore, it will only be useful to synchronize between threads that belong to this process, and since threads always share memory, the sem argument can be used directly by any thread, without further actions. If pshared != 0 then this semaphore will be available to other processes, provided they can access the memory pointed to by sem. For that you will need either shared memory or inherit it by using fork() after creating the semaphore. Also, if you don't explicitly destroy the semaphore, in some implementations (I don't know which ones) the semaphore may l

Categories : Multithreading

google drive api - copyfile working only with permission for accessing all files in drive (but jst need to copy)
According to the documentation, Files.copy() requires at least one of the following three permissions: https://www.googleapis.com/auth/drive: "View and manage the files and documents in your Google Drive" which is the one you want to avoid https://www.googleapis.com/auth/drive.file: "View and manage Google Drive files that you have opened or created with this app." Which means you can freely create any file but only open the files your app created. You can only copy a file you created, but you cannot copy any other files even if it is public. https://www.googleapis.com/auth/drive.appdata: "View and manage its own configuration data in your Google Drive" Which only lets you control your application-specific Appdata folder which is probably not what you want. You can only copy a file with

Categories : Javascript

Google drive: Get (root) file and folders with javascript api (get only deleted files on drive)
Same situation as following question: google drive api, javascript list files returns nothing I needed to add to the scope the path 'drive' at authorizing, I had only drive.file which is intent to create/edit files only. The weird thing is that the API returns deleted files when you don't have permissions to view files, I think it's a bug in the API (a serious one). Post this bug on google drive: https://productforums.google.com/forum/#!searchin/drive/security$20issue$20permission$20view/drive/pupjKxTz9FU/cUarGIl_Ah0J

Categories : Javascript

sharing on google Plus stream without showing sharing dialog box
Not yet. The current SDK uses Google plus app installed on device OR Chrome OR Safari for sharing. For more refer Google + iPhone API sign in and share without leaving app iOS Google Plus API - Sharing or Logging In without going to Safari

Categories : Iphone

Error while Retriving files from google drive using drive API. “Calling this from your main thread can lead to deadlock
You should do any code that could take a long time such as I/O or network activity on a different thread. In your situation your file retrieval would be best done within an ASyncTask. The reason for this warning is because when your code is being executed to retrieve the file from Drive, the code will block until the file retrieval has completed, this means that nothing else within the program will be able to respond, i.e. GUI will not update and input from the user trying to do stuff with the GUI will not be registered. After a few seconds, if the file retrieval still isn't complete, then the user will be presented with an ANR (Application Not Responding) message. This will either give the user the choice of waiting, if their patient, or most likely force closing your app.

Categories : Android

Monitoring changes in Google Drive files for whole domain using Drive API
Domain-wide delegation simplifies the authentication portion for your app but you'll still need to auth as each user to get their files and changes. It may be possible for your app to "grab" all files and make itself (or a special user) the owner, then you just have one user account to scan but the "grab" process would still need to run at regular intervals to find new files created or uploaded by end users. I believe most apps that need to scan content at this level do it via cron jobs or AppEngine task queues which make it easy to chunk up the scans throughout the day. Generally they expect to scan each user account once every 24 hours or so.

Categories : Google App Engine

Google Drive Javascript API: Detect drive changes - return changes only
Start with zero on your first call. Within the response is the current largest change id, which you need to store and use on the next request. In your code, it will materialise as "resp.largestChangeId".

Categories : Javascript

Windows: How to symlink drive to another drive?
No, mklink isn't going to do it for you. What you need to do is to create a virtual hard drive (VHD) and copy the client's data to it. (Or modify the export script, which is the best thing to do.) I used Windows 7 to test my instructions below. Start-> run-> diskmgmt.msc (accept all defaults... I'm not doing anything special below) From the menu bar select Action -> Create VHD Choose the location and name the file (which will be the vhd) and specify the size and click OK. Right click on the Disk # (underneath will be Unknown and the size and "Not Initialized"). Select "Initialize Disk" & click OK Right click on the black bar of the unallocated disk space and select "new simple volume". A wizard opens up an on the second page it lets you assign the drive letter. Complete the wizar

Categories : Windows

How do I create & edit a spreadsheet file on google drive using Google Drive APIs only from my Android app?
You should take a look at Google Spreadsheet API 3.0. It supports JAVA which you can use in your Android application.

Categories : Java

Google Drive sdk for android, Getting error 400 Bad Request when uploading file to Google Drive
You seem to be setting the mime type in the File object, but you need to set it in the FileContent object. When you create your file content, you can try passing in the type in the constructor new FileContent("image/jpeg", localFile); or using the method setType("image/jpeg"); but in your mediaContent instance, not in your body instance.

Categories : Android

Using Subclipse with share drive specifically an office-like share drive
You should start with the SVN book, chapter 1: http://svnbook.red-bean.com/en/1.7/svn.basic.html You need a SVN server and repository. That is what you will "share" with. All users that want to collaborate on the versions of a file will need to use a SVN client so that they can checkout and edit files stored in your repository and commit their changes back.

Categories : Eclipse

Listing of all folders of Google Drive through IOS Google Drive SDK
Assuming this code works, there is a problem in the query. Multiple queries should be combined by and. query.q = @"mimeType='application/vnd.google-apps.folder' and trashed=false"; For more examples of sample queries, take a look at Search for Files in official documentation. Also, in case this code doesn't work, you want to use Files.list() with query above. Check the link and there is a sample code for Object-c you might want to use.

Categories : Objective C

Sharing observables
I think what you want is something like the code below. Take a look at this fiddle for a working example. Try updating one field after you have selected the checkbox, you will see that the other field updates automatically. function addressModel() { var self = this; self.firstName = ko.observable(""); self.lastName = ko.observable(""); self.phoneNumber = ko.observable(""); self.address1 = ko.observable(""); self.address2 = ko.observable(""); self.city = ko.observable(""); self.state = ko.observable(""); self.postcode = ko.observable(""); } function deliveryModel(shipAddress, billAddress) { var self = this; self.shippingAddress = ko.observable(shipAddress); self.billingAddress = ko.observable(billAddress); self.addressesAreSame = k

Categories : Javascript

Security against sharing my app
You can do something like verify user on your server when app launched, but you cannot force user not to share .apk by technical means. Apk can be easily copied from non-rooted device, and there's absolutely impossible to prohibit user to copy .apk from rooted device even if Google adds some copy protection in future.

Categories : Android

Sharing option with iOS app?
Using UIActivityViewController you can Share, apple doc Example: UIImage *anImage = [UIImage imageNamed:@"SampleImg.png"]; NSArray *Items = [NSArray arrayWithObjects: @"your app info", anImage, nil]; UIActivityViewController *ActivityView = [[UIActivityViewController alloc] initWithActivityItems:Items applicationActivities:nil]; [self presentViewController:ActivityView animated:YES completion:nil];

Categories : Iphone

sharing file through other app
change this Uri uri = Uri.fromFile(getFileStreamPath("/storage/sdcard0/tweek/pdf.png")); to Uri uri = Uri.fromFile(getFileStreamPath("file:///mnt/storage/sdcard0/tweek/pdf.png")); or Uri.parse(new File("/mnt/storage/sdcard0/tweek/pdf.png")) it should solve your crash/error

Categories : Android

Session sharing in PHP
As long as you call session_start() at the top of each script, both scripts are on the same domain, and the session cookie isn't confined to a subdirectory, the variables you set in $_SESSION on the first request will still exist in the second.

Categories : PHP

Android NFC Sharing
Take a look at this document by Google (http://developer.android.com/guide/topics/connectivity/nfc/nfc.html) and look for Android Beam specifically. Android Beam will allow you to send one message from one device to another when they are close to each other. There's also an example in the SDK samples.

Categories : Android

Sharing variable between C# and C
If you want to build a reliable solution, you should use the following: Calls from C# to C++ functions. Keep types of parameters as simple as possible. Any C# thread can make these calls. Start your own C++ threads that read/modify only the C++ data and call only the C++ methods and functions. Use Windows kernel objects for synchronization and other similar stuffs. It is fine when one side signals the event and the other side waits for it. Other types of interaction are possible but I would discourage from using them. These additional types are not simple and not that clearly defined, contain caveats, etc. The 3 methods above allow building complex applications. To call a C++ finction, add to your assembly: [DllImport("User32.dll")] static extern Boolean MessageBeep(UInt32 beepType);

Categories : C#

Wordpress and social sharing
According to Facebook, it scrapes your page every 24 hours to ensure the description (and other share data) are up to date. However, you can manually refresh it by entering the post URL into the Facebook URL Linter Let me know if i could help you more.

Categories : Facebook

Image Sharing Using Google Plus in ios
you are not assigning client_ id of GPPSignIn class. Try this code in your appdelegate [GPPSignIn sharedInstance].clientID = @"MY_CLIENT_ID"; [GPPDeepLink setDelegate:self]; [GPPDeepLink readDeepLinkAfterInstall]; then try sharing link for implementing it in right way.

Categories : Iphone

Data sharing in ember
To share data beetwen controllers the correct way would be to use the needs API. Assuming your CompaniesController has all the data that you want to make available to other controllers you should define it via needs, this can be a simple string, or an array of strings if you define more then one. App.MyController = Ember.ObjectController.extend({ needs: ['companies'], myFunction: function() { // now you can access your companies controller like this this.get('controllers.companies'); } }); To make things more easy accessible you could additionally define a binding, for example: App.MyController = Ember.ObjectController.extend({ needs: ['companies'], companiesBinding: 'controllers.companies', myFunction: function() { // now you can access your companies controll

Categories : Ember Js

Sharing a word in Android
Here is Android copy/paste desciption: http://developer.android.com/guide/topics/text/copy-paste.html. But I don't think there is way to modify 3rd-party app's context menu to add custom option like share, without changing this app's source code or changing Android platform (to add your own sharing mechanism to context menu).

Categories : Java

PHP Codeigniter sharing session
I had the same problem and still reading about it: Extending session in another application you might want to look on Single Sign on, openid,or even the answer given in the link provided.

Categories : PHP

Sharing configuration between several VHosts
In apache documentation this is called mass VirtualHost configuration. Several solutions exists: mod_vhost_alias, with the VirtualDocumentRoot instructions, but it is usually too simple and managing other variations than DocumentRoot and the domain name are quite hard. advanced mod_rewrite tricks, as mod_rewrite is a swiss knife and can do everything, but everything seems quite complex when it is done with mod_rewrite. mod_macro is a module that allow the usage of an infinite list of macros with parameters that can be reused between Virtualhosts (for example), so you can add more parameters than DocumentRoot and ServerName and share single configurations files between serval Vhosts.

Categories : Apache

Git - 2 projects sharing features
This really has very little to do with Git. You would face these same organizational questions with any source control tool (including none). These questions persist because they are difficult to answer. I don't know enough about your projects to give you a recommendation, but I will offer some alternatives. These options aren't mutually exclusive. Different Branches in the Same Repository - This is practically having 2 different repositories except that they clone at the same time. Merging between the 2 branches wont make any sense, so there really isn't any advantage in keeping source for both projects together like this. Don't do this. One Repository; Distinguish at Build Time - Keep one repository with one master branch that contains 2 builds. You can either build project A or projec

Categories : GIT

Sharing audio file
Oké, found out what I did wrong. For people who have the same problem, this is how I solved it: I forgot to parse the String to an uri. Thats the only line of code I had to add. Uri uri = Uri.parse(sharePath); Here is the full rest: String sharePath = Environment.getExternalStorageDirectory().getPath() + "/Soundboard/Ringtones/custom_ringtone.ogg"; Uri uri = Uri.parse(sharePath); Intent share = new Intent(Intent.ACTION_SEND); share.setType("audio/*"); share.putExtra(Intent.EXTRA_STREAM, uri); startActivity(Intent.createChooser(share, "Share Sound File")); Also do not forget to add permission WRITE_EXTERNAL_STORAGE otherwise you'll get an error while running your application.

Categories : Android

AS3/Flash/Air: Database sharing
You can write to the file, but it won't work if multiple application tries to write the file at the same time. And, lets say app A changes one data, and app B changes another data. App A writes the new XML, then B writes its own version of the XML without acknowledging the changes from A. The changes from A are lost. One way to go here is SQLite. Natively supported in AIR. But then again, you can not write the file at the same time from 2 different apps. AIR is supposed to handle those writing issues, but i already experienced some problems with it. A much better way to go here would be setting a SQL server up (or any other real DB server, i am no expert) and some php interface. Maybe AMFPHP : http://gotoandlearn.com/search.php?q=amf, or simply use urlloaders ...

Categories : Actionscript

Sharing identifier on iOS Apps
UDID is no longer available after iOS 5: But this is a list of different alternatives for UDID that you can use in your in your iOS app: OpenUDID is meant as a drop-in replacement; so it’s really the closest thing outside the common API. Pros: It mimics the behavior of UDID: same format, same attempt at persistence, etc… in addition, it has a built-in opt-out mechanism that will hopefully educate developers to deal with this case, and at least put user privacy concerns back inside the cycle. Cons: It only works well if it is widely adopted, which appears to be the case today. Risk: That Apple actually meant to clamp down on sharing any sort of unique identifier, in which case, OpenUDID might be questioned https://github.com/ylechelle/OpenUDID/blob/master/README.md UIDevice identif

Categories : IOS

Sharing transaction with AbstractRoutingDataSource
You are violating a unique constraint. I assume you have one defined on the Contact name, so you cannot insert two contacts with the same name. Trying to switch the connection under a DataSource on the fly seems like a very, very, bad idea. Instead you should have two persistence units, one going to one database, and one going to the other. You may also want to investigate EclipseLink's data partitioning, or composite persistence units. http://wiki.eclipse.org/EclipseLink/Examples/JPA/Partitioning http://wiki.eclipse.org/EclipseLink/Examples/JPA/Composite

Categories : Spring

sharedpreferences sharing between two or more activity
try this way public class Results extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.resultmain); SharedPreferences abcPref= this.getSharedPreferences(FILE1,0); int a = Integer.parseInt(abcPref.getString("tA", "")); int b = Integer.parseInt(abcPref.getString("tsB", "")); int c = Integer.parseInt(abcPref.getString("tsC", "")); int d = Integer.parseInt(abcPref.getString("tsD", "")); int e = Integer.parseInt(abcPref.getString("tsE", "")); int f = Integer.parseInt(abcPref.getString("tsF", "")); // Your operations

Categories : Android

Sharing HTML5 app parameters through URL
Like another poster said, $_GET is for serverside PHP code, which doesn't sound like you'd need this. In an app, you could just modify the query string of the URL as the app settings are changed http://host.com/?name=joe&email=joe@joe.com And then you could copy/paste that link to someone, and they load the page, and on load, you can check the query string with url and querystring parsers to reload the parameters you want (like name and email in the example)

Categories : Javascript

using sqllite for sharing data
It could work if you defined your string-array correctly (actually they're not defined correctly). Android using exact conventions how to create resources and you should follow them. Try to define your arrays in the same way like this one: <string-array name="answer1"> <item>Zvonimir</item> <item>Tomislav</item> <item>Branimir</item> <item>Viseslav</item> </string-array> Finally place them to values folder as arrays.xml. And now it should works.

Categories : Android

Sharing authentication between 3 websites
Yes, since the 3 sites are on the same domain, you could share the forms authentication cookie between the 3 applications. This could be achieved by setting the domain property on the 3 applications: <forms domain="www.example.com" ...> Also for this to work you should share the same machine keys between the 3 applications. Please take a look at the following article on MSDN which goes into further details.

Categories : C#

Twitter error while Sharing
You are using a deprecated web service of Twitter, http://api.twitter.com/1/statuses/update.json This represents version 1 of the REST services, but to my knowledge Twitter is updated to 1.1. You should change the twitter 4j library to version 3.0.3

Categories : Java

Android sharing options
I haven't tested this but have you tried something like this: Intent fb = new Intent(Intent.ACTION_SEND); fb.sharingIntent.setClassName("com.facebook.katana", "com.facebook.katana.ShareLinkActivity"); fb.putExtra(Intent.EXTRA_TEXT, "message"); Intent twitter = new Intent(Intent.ACTION_SEND); twitter.setClassName("com.twitter.android","com.twitter.android.PostActivity"); twitter.putExtra(Intent.EXTRA_TEXT, "message"); Intent intent = Intent.createChooser(fb, "Share"); intent.putExtra(Intent.EXTRA_INITIAL_INTENTS, new Intent[] { twitter, ....more here }); startActivity(intent); Base on this answer: How to force Share Intent to open a specific app? Since these activities can change try the url as well or whatever is documented in their website so it fallbacks to their android intent

Categories : Android

Different Dictionaries sharing the same instance
Here's the problem: [{}] * 7 Do this instead: [{}, {}, {}, {}, {}, {}, {}] Explanation: the first line will create one dictionary and copy seven references to it in the list, whereas the second line creates seven different dictionaries - and that's what you want to do. Alternatively, as stated in the comments, this will also work: [{} for _ in range(7)]

Categories : Python

Sharing table data with each other
<a href = "Page.php?View=Invoices">View Invoices</a> <a href = "Page.php?View=Repairs">View Repairs</a> <a href = "Page.php?View=Clients">View Clients</a> <?php if (isset($_GET['View'])){ //query all records from the database $query = "select * from ".$mysqli->real_escape_string($_GET['View']); //execute the query $result = $mysqli->query( $query ); } A method similar to this, would work wonders and allow you to keep the views to one page. Providing your database setups are more or less the same, in individual cases you should validate views per the results of $_GET['View']; If: if ($_GET['View'] === "Test_1"){ echo "Validate as Clients"; }elseif ($_GET['View'] === "Test_2"){ echo "Validate as Repairs"; }elseif ($

Categories : PHP

Using the sharing intent in a "fluid way"
How about this: You put your prepareSharingIntent() code within an AsyncTask and start that task when the app starts up. You can then hold a global reference to the 'chooserIntent' (e.g. in the Application class) and show it once the reference is not null and the user clicks on the share button. Make sure to run it at low priority so you don't slow down your apps startup: private class LongOperation extends AsyncTask<String, Void, String> { @Override protected String doInBackground(String... params) { Thread.currentThread().setPriority(Thread.MIN_PRIORITY); chooserIntent = prepareSharingIntent(); return "Executed"; } @Override protected void onPostExecute(String result) { } @Override protected void onPreExecute() { } @Overr

Categories : Android

Sharing Video to facebook via FB SDK for iOS
You need to create something yourself or search for an existing solution on github (or similar). Something like a custom alert view where you can allow the user to enter text, have a thumbnail of the video which plays when tapped and a couple of buttons.

Categories : IOS



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.