Ol3-Cesium Example not working when run from local PC - openlayers-3

I can view the OL3-Cesium examples from the website online perfectly.
When I view this example, I get the 3D view when I click on enable/disable button.
Now I have downloaded the release folder. When I try to view the same example from the examples folder, the example does not work the same.
This is the output when I open main.html from my system:
I don't know if I am missing something here

The overall problem is that you are running the example directly from the filesystem. The directory needs to be hosted under a web server, even the most basic server will do. For example, if you have python installed, just run python -m SimpleHTTPServer in the root and browse to http://localhost:8000/.
The exact problem you are seeing is that the default imagery provider is configured to use the same URI protocol as the site being visited, i.e. if you are at an http site, it uses http. If you are at https, it uses https. Since you opened directly from disk, you are using file://, which causes the imagery to try and use file:// as well. Since you have no such imagery on your system nothing shows up in the globe.
It is technically possible to use Cesium and Open Layers completely offline, but care must be taken and it looks like that example was not written with it in mind.

Related

Google Colaboratory URL scheme

I noticed a few changes in Colab URLs recently. Can someone confirm/clarify its correct meaning?
https://colab.research.google.com/notebook#fileId=xxx This is the original one, now not used much.
https://colab.research.google.com/notebooks/xxx.ipynb This is for official notebooks, such as welcome.ipynb and other examples for newcomers.
https://colab.research.google.com/drive/xxxxxx This is the most common scheme. It refers to a specific notebook in Google Drive by fileId.
https://colab.research.google.com/github/tensorflow/path/to/notebook.ipynb The newest one. It can refer to any notebook hosted on github.
https://colab.research.google.com/gist/yourname/xxxxxx/notebook.ipynb A notebook on GitHub Gist. You can save any Colab notebook there with Save a copy as a GitHub Gist... menu.
Am I missing any other URL scheme?
I am also curious about its URL parameters when you “Open in playground”:
forceEdit=true&offline=true&sandboxMode=true This is the default parameter setup. It seems to copy it to a temp file, then you can edit and run it without saving to your drive first.
I can also use just offline=true&sandboxMode=true, and it still works. So why `forceEdit=true’?
What’s the meaning of forceEdit, offline, and sandboxMode anyway?
update
The new sandbox scheme is just https://colab.research.google.com/drive/xxxxxxx#offline=true&sandboxMode=true
This is mostly correct- Colab is migrating away from the hashparam based URLs because they don't allow server-side redirects and the new ones are a bit cleaner.
The #fileId=xxx scheme is still used when opening files from drive.google.com, but this will start using the new scheme soon as well.
All old URLs will continue to work, but because of the server-side redirect we'd encourage using the new scheme.
The playground parameters are crufty and will most likely be changed at some point.
forceEdit allows editing, even if the notebook is not editable (vs the readonly view)
offline disables realtime collaboration.

How to allow other machines in same LAN (PC/Mac/Mobile Devices) to download from our Electron app?

The question is weird but it’s because I don’t even have any knowledge about this concept.
Here is the thing:
I’m working with an Electron app that is a whiteboard application.
A user can draw something onto the board and export it to PDF.
This PDF will be saved into a folder (I assume AppData folder on Windows or something like that on MacOS), so that other machines can access (download) it.
Now I don’t know how to allow other machines to download this file.
Normally we will need to share the folder (on Windows), and other machines can go to Networks/our-machine to find and download the shared files.
But the owner of this app said that we can download it if both machines are on the same LAN, using some kind of URL like 192.168.x.x:6554/mypdfile_somerandomid.pdf
(this URL can then be turned into a QR code so that mobile devices can use camera to access the link quickly)
I don’t know how is this possible. Can you please suggest some solutions?
Thank you very much
Writing URLs
A URL, or uniform resource locator, is a form of address that refers
to a location or file on a network. The address is formatted like
this:
scheme://servername.example.com/folder
The scheme specifies the protocol or type of server. The example.com
portion of the address is called the domain name. If a username is
required, it is inserted before the server name:
scheme://username#servername.example.com/folder
Some schemes require the port number to be specified. Insert it after
the domain name:
scheme://servername.example.com:port/folder
Without public share that windows offers, you will need other third party software to accomplish what you want, which will do the same as windows does.
Better just share the folder your Electron app uses to export PDFs.

open an excel file located on the server instead of download it MVC

I'm building a Reporting web application right now with MVC3 and I've come up to a couple problems.
My goal is to have it able to generate and view Crystal Reports, SSRS reports, and Excel documents.
Right now I'm working on the Excel segment and I'm running into more trouble than I thought I would. First off, when I link directly to the file, it either opens inside the browser or it downloads it from the server and if the user makes changes it doesn't actually save it to the true file on the server.
I've tried both linking to the file directly using Razor and a ViewModel with the path to the document as well as directing it to an action that returned a File.
I've also tried linking it to a shortcut to the actual file thinking that if I could open the shortcut it would open the file the way I wanted it to and unfortunately it didn't really open at all.
The users already have access to the files on the server through a network drive, so as of right now they can go into the server, open the excel document, edit and save it no problem. I want to duplicate this effect through a link. The program already has a file browser built, so I can browse between the files and make links to the reports.
Thanks in advance!
Since they are apparently on a network drive, you can just link to the files directly, relative to the user?
For example: a link to file://///SERVERNAME/folder/
I tested it between two computers on the network, and that seems to work. However, you still get a popup asking that you want to do with the file, open or save. (both in firefox and IE)
Note: Yes, that many slashes seem necessary, lol

Open a file that is on a file server from a webpage?

I am working on an internal application. We have a website that displays all our SSRS reports for a group of work. I have been asked to see if I can link all the files (pdf, word, excel) for the group of work. These files are stored on a file server that users viewing the reports have access to. Each group has its own group of reports and shared files.
Is it possible to open the files (without downloading them) from a webpage? Meaning that they file is opened from the file server? I don't want people to download a copy of the file.
I am pretty sure this can work with IE because sharepoint does it. However, other browsers may have an issue.
EDIT: What I would like is to have a web page with links to the files. When they click on a link (say for a word doc), word will open the file that resides on the file server. Without out a local copy downloaded from the network share.
EDIT2: Please note, I know what I am asking is probably not possible in all browsers. I am more or less just making sure. It seems possible in IE using activeX, but out side of that browsers do a good job at keeping processes inside a sandbox.
3 options. Remember this is for an internal website.
link to the share using file://. This will have the side affect of downloading the file to be viewed. As long as user clicks open every time it should not be a big deal.
Use JavaScript and activeX to open word (excel, reader, ect) passing in the file path as a command line arguments. This works only in IE and in win7 (probably vista) user will get a pop up asking if it is ok for the activeX control to run.
Create a new protocol. openfile://. This would be set up to run an application that is installed on the client machine which would open the file. Since it is internal, the application could be installed on the machines without issues. This also requires a registry change.
I haven't picked one as this change is still being looked into but i figure I would update this in case someone runs into something similar.

How can I make a server log file available via my ASP.NET MVC website?

I have an ASP.NET MVC website that works in tandem with a Windows Service that processes file uploads. For easy maintenance of the site, I'd like the log file for the Windows Service to be accessible (to me, only) via the website, so that I can hit http://myserver/logs/myservice to view the contents of the log file. How can I do that?
At a guess, I could either have the service write its log file in a "Logs" folder at the top level of the site, or I could leave it where it is and set up a virtual directory to point to it. Which of these is better - or is there another, better way?
Wherever the file is stored, I can see that there's going to be another problem. I tried out the first option (Logs folder in my website), but when I try to access the file via HTTP I get an error:
The process cannot access the file 'foo' because it is being used by another process.
Now, I know from experience that my service keeps the file locked for writing while it's running, but that I can still open the file in Notepad to view the current contents. (I'm surprised that IIS insists on write access, if that's what's happening).
How can I get around that? Do I really have to write a handler to read the file and serve it to the browser myself? Or can I fix this with configuration or somesuch?
PS. I'm using IIS7 if that helps.
Unfortunately I'm afraid you'll have to write a handler that will open the file, and return it to the client.
I've written an IIS Manager extension that displays server log files, and what I've noticed that even the simple
System.IO.File.OpenRead("")
can still run in the same problem, and return the same error.. It was kind of confusing.
In the end I used
System.IO.File.Open("", FileMode.Open, FileAccess.Read, FileShare.ReadWrite)
and I could easily open the file while the server was writing logs to it :)
I think the virtual directory is an "okay" solution, if you add the directory (application) with READ ONLY rights + perhaps "BROWSE directory" too (so you can see the folder contents rendered by the IIS).
(But once you do that, you should consider that you also anonymous access to that folder - unless you enable authentication, so watch out for "secret" contents of the logfiles that you might expose? just a thought.)
Another approach, I prefer myself, is to make a MVC/ASP.NET page that does the lookup in the folder by normal code, so that you 100% can filter whatever data is shown in the HTML.
You can open the files as TextStream's and in Read Only mode.
If it's a problem to gain access to the logfolder, I would use the virtual directory with READ ONLY access and then program something that renders the logfiles as HTML on my screen and with my detail levels. Perhaps even add some sort of "login" first. But it all depends on your security levels and contents of logfiles.
is this meaningfull to you? if not, please explain more, as I've been through this thought a few times already for similar situations.

Resources