Windows.Foundation.Uri supports Data URI Scheme? - windows-runtime

Does Windows.Foundation.Uri supports data URI Scheme, if yes, can I use that in Windows.UI.StartScreen.SecondaryTile as logoReference parameter? Please help.

Just tested this using the JavaScript Grid app template, and it does not work.
The constructor for Windows.Foundation.Uri will happily accept a data URI, but the constructor for Windows.UI.StartScreen.SecondaryTile throws an exception when attempting to initialize the tile with the data URI.
So you will probably need to find another way of solving this. Perhaps you can dynamically create the tile image and save it to your appdata folder, which can then be accessed via the ms-appdata:// URI scheme?
For more info on Windows Store app development, register for Generation App.

Related

Getting the URL for a bucket or an object using oci-java-sdk

I have already a code to retrieve the objects in the bucket using oci-java-sdk and this is working as expected. I would like to retrieve the URL of the file which was uploaded to the bucket in object storage and when I use this URL, this should redirect to the actual location without asking any credentials.
I saw preauthenticated requests but again i need to create one more request. I dont want to send one more request and want to get URL in the existing GetObjectResponse.
Any suggestions>
Thanks,
js
The URL of an object is not returned from the API but can be built using information you know (See Update Below!). The pattern is:
https://{api_endpoint}/n/{namespace_name}/b/{bucket_name}/o/{object_name}
Accessing that URL will (generally, see below) require authentication. Our authentication mechanism is described at:
https://docs.cloud.oracle.com/en-us/iaas/Content/API/Concepts/signingrequests.htm
Authentication is NOT required if you configure the bucket as a Public Bucket.
https://docs.cloud.oracle.com/en-us/iaas/Content/Object/Tasks/managingbuckets.htm?TocPath=Services%7CObject%20Storage%7C_____2#publicbuckets
As you mentioned, Pre-authenticated Requests (PARs) are an option. They are generally used in this situation, and they work well.
https://docs.cloud.oracle.com/en-us/iaas/Content/Object/Tasks/usingpreauthenticatedrequests.htm
Strictly speaking, it is also possible to use our Amazon S3 Compatible API...
https://docs.cloud.oracle.com/en-us/iaas/Content/Object/Tasks/s3compatibleapi.htm
...and S3's presigned URLs to generate (without involving the API) a URL that will work without additional authentication.
https://docs.aws.amazon.com/AmazonS3/latest/dev/ShareObjectPreSignedURL.html
Update: A teammate pointed out that the OCI SDK for Java now includes a getEndpoint method that can be used to get the hostname needed when querying the Object Storage API. https://docs.cloud.oracle.com/en-us/iaas/tools/java/1.25.3/com/oracle/bmc/objectstorage/ObjectStorage.html#getEndpoint--

How to write an object to gcp object store with x-goog-if-generation-match from a cloud function

I'd like to write an object to gcp object store, while using the x-goog-if-generation-match feature. Using #google-cloud/storage npm library, the file object does not seem to have an option for setting the required object generation.
What are the alternatives?
As you noticed, the #google-cloud/storage npm library doesn't support generation and metageneration preconditions.
As an alternative, you may use either the Storage XML API or the Storage JSON API which do support it. Depending on if you want to use one or the other, you'll be able to use preconditions via HTTP Headers or query string parameters. You'll find the whole list of those here.
Another alternative is to use some kind of optimistic locking:
get the generation id
write object
get the generation id again
repeat until generation after = generation before + 1

How to save ios object or view parameters to server?

What is the best way to save object parameters to DB in ios? => like sending values to server application and server will save the parameters to db? And later that ios-app will get the properties and create the new object again.
What is the best way to do it? For ex, saving CALayer or UIImageView attributes like size, position, color, border width etc..
You have to create a data model which defines what this data looks like.
Once you have it, you will need to define some sort of REST api against your server to get/post/put/delete this data.
To implement this network layer you can look at:
https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/URLLoadingSystem/Articles/UsingNSURLSession.html
AFNetworking and RestKit are other useful libs to consider
To store locally you can look at CoreData - https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/CoreData/cdProgrammingGuide.html

Flex, using navigateToURL to send an AMF object and open the response in a new window

I have an application that connects to an AMF gateway exclusively (in a certain mode) and I have a service that renders some HTML that I want to display in a new window outside of the Flex application.
Is it possible, in Flex, to use navigateToURL to send an AMF object and open the response in a new window?
EDIT: More specifically, does anyone have insight into how an AMF request can be properly constructed in actionscript and sent via the POST data of a URLRequest?
UPDATE: Still looking for a clear spec for AMF that makes it obvious how to construct the service call related headers in AMF and what headers are required. Some guidance in this area would be helpful. I've done more reading and have seen some people talk about some custom solutions they have that work in a similar way to what I've mentioned above, although it seems like those solutions are guarded assets. But this further enforces my belief that this is quite possible.
I'd say no... Even if you could create an AMF packet by hand in AS3, how would you pass it to the URL using navigateToURL? How would the browser know how to handle the AMF values returned from your service call?
I suggest you call the AMF gateway service in your Flash app; do the processing that needs done; and then return a URL to the results. In the result handler method, you can open the URL using navigateToURL.
#Flextras is along the right lines - the AMF gateway in particular with AMFPHP isn't used with a URLRequest, instead you use the RPC remoting - most typically RemoteObject where you specify the receiving gateway (ie: endpoint or more generically the destination channel - but this one needs to be in your services-config which resides on the server), and you typically assign a responder to handle the result/failure events (in which your response is almost always a class marked as a [RemoteAlias]).
See: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/rpc/remoting/mxml/RemoteObject.html#includeExamplesSummary

store preferences in google chrome extentions

Using firefox, I can store extension preferences using Components.classes["#mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefService);
What interface can I use to store preferences in Chrome? And do they get overwritten on an extension update?
Thanks
You can use the localStorage API. See http://code.google.com/chrome/extensions/options.html for an example of building an options page with this, but most simply you can do:
localStorage['foo'] = 'bar'; // Store data
var foo = localStorage['foo']; // Get data
This data won't be wiped out on extension update, either.
The new HTML5 feature to persist data locally (localStorage) should help you here.
In addition to coockies, now there are session and local storage objects, as well as, a simple version of relational database (all storing data on your local harddisk).
One hint when storing/retrieving objects to localStorage ... it is a simple implementation of the Map interface, so the safest way to persist your object is by serializing them via JSON.stringify function and parse retrieved string with JSON.parse.