elm application keeps changing init url - url

I have a project I that was dropped onto my lap written in 0.18, when ran it keeps changing the url from a sub url we currently load it from to the base url of the page, for example the elm application is loaded via http://example.com/dah/dah/elm#welcome. After application renders the url switches to http://example.com/#welcome. I would like to make sure the application stays at the url it was loaded at like http://example.com/dah/dah/elm#welcome and not http://example.com/#welcome. Would appreciate anyones feedback if possible
I thought there would be a simple config that would allow me to just say have the application run from base url http://example.com/dah/dah/, I could not find anything, I also looked at documentation https://dmy.fr/elm-0.18-packages/ specific for 0.18, navigation https://package.elm-lang.org/packages/elm-lang/navigation/2.1.0. Not quite sure if that was the right link. I could not find anything relevant.

Related

First attempt at file download does not work. Need to click link twice and it works

I am having a really weird situation and would appreciate any help that can be provided.
My setup is pretty simple. I have an ember app that communicates with a Rails backend. I hit a certain route and a spreadsheet report is generated and placed in the public folder of the rails app. So far so good.
The rails backend then sends a response with the path to the file to the front-end that I place in a href that people can click on to download the file. This is where the weirdness happens. The first time that the link to download is clicked, I get a 404. What's weird is that if I click the link again or copy and paste the url into the address bar, the download works. No matter how I attempt to download the file, the first attempt always fails and all subsequent attempts succeed. I even set it up so that on one click I try to download the file twice and the first attempt fails and the second one works. This is definitely not ideal though.
edit: Also ... This only happens in production. In development, the download works perfectly fine.
I have no idea what the issue is and would appreciate any help in this.
Thanks

Ol3-Cesium Example not working when run from local PC

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.

Wordpress URL change

I have recently moved my wordpress site from "test.xxxxxx.com" to "xxxxxx.com" They are both identical except I just want to get rid of the "test" portion of my url on my index page and all my links. They are both on the same FTP and server. I transferred my site and have the homepage url working correctly but when I click on any of the links it still says "test" in front of the url. I have tried a couple different search and replace plugins with no luck. Is there a better way to go about this?
Wordpress has a problem that it doesn't update the permalinks easily. So, maybe you will have to change the permalinks manually in the wordpress database.
Use Better Search Replace plugin in order to fix old urls in your database.
After downloading and activating the plugin, you juste have to type old url to find and by which url to replace it, in your case you have to do it twice :
test.xxxxxx.com to xxxxxx.com
and
test.xxxxxx.com/ to xxxxxx.com/
I advice to do it twice because sometimes the plugin make difference between these two (strict string comparison I think) and wil not modifiy everything with only one command

Trying to open an application with parameter via an Application Protocol Handler

I am currently trying to figure out an issue with an Application Protocol Handler I've created. Following the directions listed on MSDN (http://msdn.microsoft.com/en-us/library/aa767914%28v=vs.85%29.aspx), I was able to register my application, PDF Annotator, to open via a URL. The issue I am experiencing is when I try to pass a parameter along with the call. The application will open, but the file parameter that gets passed is not opening within the application.
My registry key is verbatim as dictated by MSDN. My HTML code is as follows:
PDFAnnotator:C:\path\to\file\file.pdf
The way I understood the protocol handler is it takes the URL and tries to launch it via the command line. That being said, I am able to open my pdf file in PDFAnnotator with following command in the prompt:
PDFAnnotator.exe C:\path\to\file\file.pdf
I've tried formatting the file path in the HTML differently thinking that would be the issue too. Has anyone else come across this issue or something similar?
Obligatory Update for future generations (http://xkcd.com/979/):
The reason I was doing this is because half of the PDFs my application handled would be editable while the other half were read-only. I was trying to keep the read-only ones in browser with the Acrobat plugin (I'm targeting chrome only) while the protocol would allow me to set the links of the editable ones to open with Annotator. I tried, on whim, to reverse this (setting the default to Annotator and creating a protocol for Acrobat). I did this, first by trying Acrobat's URI Scheme (acrobat://), which didn't work outside of opening Acrobat. Then, I tried creating a protocol for Acrobat. When that fired off, it gave me an error stating the path was wrong for the file name, path name, or volume. So, progress? I'm giving up on this for now as other priorities have come up, but hopefully this helps somebody down the road.

How to show only the link of an uploaded file, not its location

I have used paperclip to allow me to upload files to a rails application. Everything works and the file is uploaded, but instead of seeing a link to the actual file itself I see the location of it within the systems folder of the rails project.
I'm guessing its either a routing issue or I need to create a link to the file in question. However, I would like to hide the location of the file itself, and only see the link displayed.
I would be very grateful if someone could point me in the right direction here.
You want to hide the actual path of the file in the server, right?
You can achieve that using send_file (http://api.rubyonrails.org/classes/ActionController/DataStreaming.html#method-i-send_file) in a normal controller.
You will still need to do something to protect the download using the real path.

Resources