Convert iPython Notebook to copy-proof format (e.g. png) - ipython

I have a rather long iPython Notebook that I want my students to reproduce in class. I don't just want to give them a pdf or notebook file as they would just copy the text, which defeats the purpose...
Is there a way for me to convert the notebook into a huge png, or copy protected format (e.g. with right click forbidden)?

You can just make a fullsize screenshot of the notebook in the browser.
For Chrome it is possible with extensions or with builtin developer tools. Guide
Newer Firefox versions has it here

Related

Is there any way of scrubbing notebooks pre-save?

I work with sensitive data and need my notebook to scrub the outputs of cells before saving. I know that this is possible in Jupyter notebooks, but is this also possible in VScode Jupyter?
Here's the link to the example in the Jupyter docs, where a scrub_output_pre_save function is written and inserted into the jupyter_notebook_config.py-file.
Thanks!

What is the best way to turn IPython Notebooks on Github to a blog?

I've some IPython notebooks which I maintain at GitHub. I would like to turn them into a blog. I would like to have a discussion area at the end of the notebooks so that readers can comment. I do not want users to be able to execute the codes directly on the site (it is enough if they can see the notebooks), if they want to execute, they can copy the codes and run on their own computers. If possible I do not want a separate copy of the notebooks, I would like to have a single copy for ease of maintenance. What is the best way (preferably a free way) to achieve this?
Thanks
Hamel Husain recently posted to the Jupyter discourse forum a very full-featured Jupyter blogging system hosted on GitHub Pages called fastpages. It seems well documented and state-of-the-art. It allows a comments section, see here.
It seems you want to export a static version of the notebooks? You can use a tool like nbconvert which according to its documentation:
allows you to convert a Jupyter .ipynb notebook document file into another static format including HTML, LaTeX, PDF, Markdown, reStructuredText, and more. nbconvert can also add productivity to your workflow when used to execute notebooks programmatically.
You can export in your desired format and add the remaining markup for commenting or other functionality.

How to create a swift notebook on google colab

I have seen some nice demo on the dev summit on Swift for Tensorflow. So would like to try this out.
I could open this notebook:
https://github.com/tensorflow/swift/blob/master/docs/site/tutorials/custom_differentiation.ipynb
and if you view the nb runtime setting, the runtime type dropdown indicated "Swift".
However, I can't find anywhere in the colab menu how you can create a notebook thats swift from scratch.
Presently, the simplest way is to create a copy of an existing swift notebook. Use the menu item File -> Save a copy in Drive...
For those who want to do hack, or just upload a blank notebook thats configured to run Swift once it gets to Colab, here's maybe useful json snippets:
{"nbformat":4,"nbformat_minor":0,"metadata":{"colab":{"name":"Blank for Swift.ipynb","version":"0.3.2","provenance":[{"file_id":"https://github.com/tensorflow/swift/blob/master/docs/site/tutorials/custom_differentiation.ipynb","timestamp":1552503857805}],"collapsed_sections":[]},"kernelspec":{"name":"swift","display_name":"Swift"},"accelerator":"GPU"},"cells":[{"metadata":{"id":"iROrFnecc1gX","colab_type":"code","colab":{}},"cell_type":"code","source":[""],"execution_count":0,"outputs":[]}]}

How do I copy code from my computer into x3270 emulator?

I'm using x3270 on Ubuntu 16.04. The zOS does not have a good editor and having to write a lot of code and fixing it is a pain.
I want to write code on my computer and copy it into x3270 window.
Is there a way to do this?
x3270 is a blocked based terminal interface and can be used. The approach would be to cut and paste code. Since you mentioned z/OS I assume you are using the TSO and ISPF. ISPF Edit (Option 2 by default) allows for a Text Edit Command (TE) so you can cut and paste larger blocks of text.
When you press enter you will see. You can then position the cursor and paste the text.
Sorry, I just had some assembler source handy but as you can see you can paste a large block of code. Its cumbersome though.
Personally, this is more of a stop gap measure for edits of limited size. There are better solutions.
I personally use VSCode on my local machine. There is a plugin for VSCode from an open source project called Zowe that provides a plugin for VSCode in the VSCode marketplace Visual code Extension for Zowe. This is extension allows for editing code from z/OS on your local system (I use a MacBook Pro) and facilitates the file transfer for you. This is my preferred option. It does require that z/OSMF is installed and configured. You'll need to check that setup on your system.
The final option is to use SFTP to transfer the file. SFTP will allow transfer to MVS and USS file systems and provides an ASCII to EBCDIC conversion as well.
SCP will only transfer files to a USS based filesystem and is an option if that fits your needs.

R-markdown .Rmd or knitr markdown in Jupyter

Is there a way to use .Rmd files directly in Jupyter? In other words, is there a way to get jupyter to render a file like this: https://github.com/yihui/knitr-examples/blob/master/023-engine-python.Rmd?
I love jupyter, but also like the simplicity of the .Rmd syntax.
You could use ipymd, which enables saving notebooks as Markdown documents instead of in Jupyter Notebook format. I don't know enough about knitr to say if there is feature-by-feature compatibility, but it seems like a good start.
Notedown is another possibility.
I created a fork of ipymd which allows to open .Rmd files directly in jupyter notebook.
As opposed to plain markdown, it also supports storing images in a separate .nb.html file.