Stream data into Google earth, view the time-tagged in real-time, and play it back using time slider (Update Security Violation) - google-earth

After a lot of trial-and-error my current approach involves manually loading a kml file into Google Earth. This file contains 2 NetworkLinks to 2 webservers on the same machine as Google Earth.
The web servers are created in Java using undertow, which provides a basic HTTP handler, and the ports used are 8081 and 8082.
The first NetWorkLink HTTP handler (at port 8082) creates a kml file with Document with id=-1. The second NetWorkLink HTTP handler (at port 8081) creates a kml file with a NetworkLinkControl containing an Update to a Document with targetId=-1 with many Creates for various Placemarks, each with a time-tag.
My intention was that the second NetWorkLink would add these time-tagged Placemarks to the previously created document by the first NetworkLink. The problem I am seeing is the Google Earth error:
Error while parsing file http://localhost:8081 at line 2 column 0
Update Security Violation
When I search on this error I see references to the use of Update for local files used in NetworkLInks, but I am using http:localhost, and not a local file. Does anyone know what is causing this Google Earth error message?

Probably it's a Google Earth local access violation issue.
In Tools/Options menu click on the General tab and check "Allow access for local files and personal data" option.

Related

How to handle dynamic list (JSON) of redirects on NextJS + AWS Amplify?

I have a JSON file with 8k+ redirects that I use for my site. This JSON is hosted on a CDN (AWS Cloudfront). And every time one of our products or pages change their path, that JSON is automatically updated with a new redirect, and this happens pretty often (more than once a day).
I want to be able to use that JSON on my NextJS (12.3) project hosted on AWS Amplify.
Ideally I wanted to use the NextJS middleware.js to fetch that JSON and redirect to the proper path.
But right now Amplify doesn't support that middleware. They still have an open issue on github for that:
https://github.com/aws-amplify/amplify-js/issues/9145
So I tried to run that on getServerSideProps. But I'd have to replicate that for every URL segment on my project, which wouldn't look great.
Right now I use the native redirects solution on the next.config.js file (https://nextjs.org/docs/api-reference/next.config.js/redirects).
But this solution isn't great either for two reasons:
This is not dynamic. The JSON file is only fetched when the project is build up, so many times I have to redeploy my project on Amplify to be able to update those redirects.
The latency to find the correct path is affecting the page load perfomance (it takes around 400 to 500ms to run through the 8k+ redirects).
Can anyone help me to find a fast and dynamic solution to fetch and do those redirects on NextJS? Or maybe any idea to do that in a different way.

Cannot find audio file in google bucket with google speech API

With the Google Speech API (using the python sample code), you need to have your audio files on google cloud when longer than 1 minute. According to some sample code, you can use a path like
gs://python-docs-samples-tests/speech/audio.flac.
So I put my audio files in a bucket, and use (I believe) the correct path (i.e. gs://bucket-name/foldername/myaudiofile.wav), yet I get an error .
NotFound: 404 No such object: bucket-name/foldername/myaudiofile.wav
Even if I put the permission on public (which I rather not do), it cannot find the file. I have the feeling I am forgetting something very trivial here... But still haven't found it.
Go to the cloud console > select the project > go to Storage > Browse the buckets and make sure the file is actually there. Best way you can tell, IMO.

How to Connect CloverETL to Google Cloud Storage?

I am using CloverETL Designer for ETL operations and I want to load some csv files from GCS to my Clover graph. I used FlatFileReader and tried to get file using remote File URL but it is not working. Can someone please detail the entire process here??
The path for file in GCS is
https://storage.cloud.google.com/PATH/Write_to_a_file.csv
And I need to get this csv file into the FlatFileReader in CloverETL Designer
You should use the Google Cloud Storage API to GET the file; Clover's HTTPConnector component will allow you to pass in the appropriate parameters to make a GET request (you will presumably have to do an OAuth2 authentication first to get a token), and send the output to a local destination specified in "Output File URL." Then you can use a FlatFileReader to read from that local file.
GCS has several different ways to download files from your buckets. You can use the console and the Cloud Storage browser. Steps: open the storage browser, navigate to the object you want to download, right click, and save to your chosen local folder. If you use Chrome the save appears as “Save Link As…”.
To use the GS Utility, use this command:
`gsutil cp gs://[BucketName]/[ObjectName] [ObjectDestination]`.
Or you can use client libraries or the REST APIs to download files. With these last options you could work with a number of files or create a job to download them. Once they are in a location known to Clover ETL the process is straightforward.
Within Clover designer, under the navigation pane you can right click a folder and choose import. Pick the one in which you placed your GCS file. Once the file is imported then you can use data from it like any other datafile in Clover. Since this is a .csv file, remember to edit your metadata (right click the component, choose extract metadata then edit inside the Metadata Editor -- for data types, labels and such.) Assign metadata to the edges of your components so they know what is coming in/going out of that step. Depending on your file, this process may be repeated many times.
Even with an ETL tool, getting the data and data types correct can be tricky. If you have questions about how to configure data types or your edges in an ETL project, a wiki may help. The web has additional resources may help you get the end analysis you’re looking for.

How to present static file results that are generated at different time to client in play 2?

I am writing a web service using play 2.0 in scala.
After getting client's configuration parameters, then the web service will take a while to generate some files. (Note: some files can be short, some other files can take long).
I figured out how to get client's configurations and trigger my computation,
now I need to present the generated files to client side at the end of the session.
So questions are:
How to present the files to client?
I'm thinking about returning a static folder link to client, so that they can go into the folder to
see further what files are there, and so when clicking on the files, the details of the files can be shown, either jpg or text.
But how?
How to not to block client during the generation of the files?
For example, client can still click on the files that are available at that moment.
Then here comes the third question:
How to let the client side know that the long-time computation file is available and listed in the folder?
I'm pretty new to web application, thanks for any suggestion, advice, or little examples are greatly appreciated too!
I would create a web interface to show the created files to your clients and create a background job to for the long computation process. You can create a wait page where a javascript check if the file is created.

iOS App-to-App Trasnmission of Data using new Document Support API

Problem:
Building Enterprise Applications of a Suite Nature, and need to be able to pass data from one application to another. Example: App1 is a barcode reader that produces and inventory list. App2 needs a "fresh" copy of the same inventory list information that App1 just produced in order to accomplish its goal of producing purchase orders. The two apps and databases are two large to squeeze together in single app, plus the suite will continue to grow with more and more apps.
Understanding:
I fully understand that "Each" application is in it's own sandbox. However, in reading through the documents regarding the new UIDocumentInteractionController API, it appears that an application can dip outside of the sandbox just a little to "Read-In", "View", or "Open-In" a document that was not apart of the bundle or created within the application.
Data Flow:
I'm trying to keep it simple. I have been using the DocInteraction sample application downloaded from Apple, and another application...called App1 to try and work with a simple text file. In App1, I create a simple txt file, and save it to the documents folder. (But this is still inside the app's sandbox?). in the DocInteraction modified sample, I have been trying to figure a way to "View", "Open-In", or better yet "Read-In" the created txt file. If I can pass a simple txt file between the two, I can include a CSV structure to update the databases on each side when ever the applications are opened.
I have tried to utilize the Launch Options Keys with no luck.
In short, I just can't seem to get my head around:
Where App1's data needs to go?
How to find the data in the other App, say App2?
How do you "Open" the file that exist inside another application's sandbox?
End Result:
I have tried to stay away from the
The Document Interaction docs outline:
Previewing a Document or Presenting Options
Registering Your Support of File Types
Opening Files From Other Apps
Displaying and Printing Quick Look Previews
It is the "Opening Files From Other Apps" that I am most interested with. It directs me to utilize the application:didFinishLaunchingWithOptions: method by passing in dictionary values for the keys. This is where I get lost?? How do I set the keys so that it knows "WHERE" and "WHAT" to look for? And I'm still not clear the proper director that App1 should be saving information to in order for the keys to point to the correct place?
Opening email file attachments and opening pdfs in iBooks can't be the only places where you can utilize this API or else Apple wouldn't have went through all the work, they are already allow to talk from App-To-App.
Note: I'm not trying to get App1 to directly transmit data into App2's files. I don't think that would be allowed by Apple at all! I'm trying to get App1 to zip up its data, save it in proper location, so when user decides to use App2, the data can then be available to App2 by "reading-in" the data.
If someone has a sample application, tutorial, or even a solid idea how to get this working I would really appreciate the help.
-Thanks!
P.S. Somebody with 1,500 or higher reputation please create a "UIDocumentInteraction" tag for stackoverflow!
I got it working last month. Here's my mental model:
App1 creates a file anywhere in its sandbox.
App1 calls docinteraction to display the "Open In" GUI for that file
User picks "Open in App2"
The iOS copies the file from one sandbox to the other and launches App2.
App2 implements didfinishlaunchingwithURL and loads the supplied URL (which is the copy in its sandbox)