google maps custom marker not displaying as my custom icon - python

I'm using motionless in python (3.5) to build static map images.
I was having a hard time to create custom markers. But it seems like it's not so much the framework or my code, but the google maps API itself.
I can't figure out what's wrong with my URL,while this URL, works.
I use this icon:
https://raw.githubusercontent.com/havnar/sprites/master/ico/1.ico
While the stack overflow favicon just works:
http://cdn.sstatic.net/Sites/stackoverflow/img/favicon.ico

There was an issue with your icon file. I have re-saved the file out and uploaded to my own Github and it loads fine now:
https://maps.googleapis.com/maps/api/staticmap?zoom=17&size=512x512&maptype=hybrid&markers=icon:https://raw.githubusercontent.com/zensign/ico-test/master/favicon3.ico%7C34.052230%2C-118.243680
You can grab the working .ico file here: https://raw.githubusercontent.com/zensign/ico-test/master/favicon3.ico

Related

How do I post Python generated GFS plots on my website?

I have a Python script that ingests GFS model data and plots it using matplotlib. How do I get those exact plots to display on a website? I am currently using PythonAnywhere to build my webpage.
It looks like Python Anywhere has a variety of options for how you can host your website/web application--so the details of how to do this will depend on how you are hosting your site.
One option is Flask, and I'll just point you to Matplotlib's example on embedding Matplotlib within Flask.
Another option is to generate the plots statically somewhere, and then upload them into your static website content. I'm not sure how exactly one one would go about that with Python Anywhere.

Image in Jupyter Notebook ipynb doesn't show up in GitHub private repo but the same code works with public repo

I have a Jupyter Notebook .ipynb file in my GitHub repository. It is supposed to show an image via the following markdown code:
![image](image.png)
The image does show up when the repository is public. However, when the repository is set to private, only the alternative caption "image" is visible and the image doesn't load. If I right-click on it and select "View Image", the image loads fine.
The issue also doesn't exist for .md Markdown files: the same line above works for public and private repos.
There is this answer which describes how to embed images into the .ipynb file, but that's not what I'm looking for. I want to display the .png file dynamically.
As of 2015, Jupyter notebooks are rendered on GitHub using nbviewer. From this blog post they state:
Second, because of security concerns, some features available on nbviewer will not be available on GitHub. For example, GitHub will not render any dynamic output display that uses JavaScript, custom CSS, and most custom HTML embedded in Markdown or in outputs. When this is the case, and GitHub cannot fully render your notebooks, you will see an icon that allows you to view the full notebook on nbviewer.
An issue thread has some users saying that logging out/logging in will resolve the issue. Others say it is resolved over time. But there seems to be no recognized solution.
I struggled a lot, than at last was able to fix it.
Use "/" instead of "\" in image path
If you are using width field for png image file than .png should be small, width="200" number should be in quotes, img should be closed like this ->img src="Image/neuron-1.png" width="300" />
I have tested most of the comments; however, only the following works for me:
Build the folder in the same repository with the image name.
Create a file .gitkeep in the Image folder.
Upload your images in this folder.
Add address like: <img src='Image/name.PNG' />
Note: building Image folder is necessary.
When I made my repo public, Github required me to confirm my credentials, but as soon as it was public, the images rendered. It could have been either so I'd suggest either logging out / in or making your repo public (then taking immediately private again if need be).

Django doesn't show the CSS of my template

The problem is described in title. I have this template for a blog that I'm creating using Django.
When I open it normally, using double click over the HTML file, it looks like this:
But when I open it via url from the Django project, it looks like this
It only shows a green square (part of the css) but obviously can't open the css correctly.
Any idea to solve this?
In Django you don't open the HTML with double click on the file, you need to run the server first and open your site using the localhost (like you did in the second picture).
Judging by those images, are you sure you put the image in the static folder? In Django, the HTML files stays in the "templates" folder of your app and the css, javascript and images in the "static" folder.
If this answer doesn't help you, then you should post your code here, otherwise I can't find the problem.

How to serve static files using a webkit view in a python gtk application?

I am building a gtk desktop application. The main part of my views are HTML. So I make use of the Python implementation of Webkit. The problem is, that I cant include images, as Webkit does not allow to load images from local file system:
<img src="file://{{media_url}}_theme/media/img/eft.png"/>
=> This will cause a "Not allowed to load local resource".
Is there a way to load static files like images or css-files locally?
You can use base64 to encode your images as texts that can be included in your html pages.
#Skami 18's answer seems like a good direction. Maybe then use a data URI to actually set the src attribute?

CDN options for image resizing

Background:
I working on an application on Google App Engine. Its been going really well until I hit one of their limitations in file size -- 1MB. One of the components of my application resizes images, which have been uploaded by users. The files are directly uploaded to S3 (http://developer.amazonwebservices.com/connect/entry.jspa?externalID=1434) via POST. I was planning on using a CDN to delivered the resized images.
Question:
I was wondering if there was CDN that provided an API for resizing images through HTTP call. I found out that SimpleCDN once provided the service, but has sense removed it. I would like to tell the CDN to resize the image I am requesting from the URL.
For example,
original URL:
http://cdn.example.com/images/large_picture.jpg
resized image to 125x100:
http://cdn.example.com/images/large_picture.jpg/125/100
Does anyone know of CDN that provides a functionality like this? Or have a suggestion to get around the 1MB limit on Google App Engine (not a hack, but alternative method of code).
Looks like I have found a service that provides what I am indeed looking for. Nirvanix provides an image resize API and even has a nice library for Google App Engine to use with their API. Just thought I would share my findings.
SteadyOffload does it as well.

Categories