Add custom title text to jupyter notebook interface - config

I frequently run jupyter notebook on multiple servers/computers, and it would be great if the interface could be customised so I can see at a glance which server/computer is behind the notebook GUI I'm looking at.
Is there a setting for adding a short piece of text to the title bar in the web interface? Can someone suggest a snippet of code to put in jupyter_notebook_config.py?

most flexible would be:
import socket
print(socket.gethostname())
answered in :
How can I use Python to get the system hostname?

Related

I need some help on creating an automation script using Github as my "playground"

I've been doing a lot of selenium practices lately. However, I haven't been able to create an automation script that would allow me to create a new gist on github. To those of you who are familiar with gist on github, on https://gist.github.com/, there is a big Text Area that would allow the user to type in the code. I've tried using xpath to no avail. I've also made sure that I use the latest version of geckodriver and .jar. Using cssselector also didn't work. From what I've discovered, there are tons of divs on that Text Area. To make things short and simple, how do I create an automation script for that big text area?
screenshot of https://gist.github.com/
it use CodeMirror text editor, try executeScript with the code below
document.querySelector('.CodeMirror').CodeMirror.setValue('Hello World!')

Generating matplotlib graph which is refreshed real-time on web browser using mpld3

I have realized the dynamic graph drawing with matplotlib, and it can refresh graph real-time. Now, I want to generate matplot figure on Web Browers using mpld3. It can export to webpage, but can only run one time and graph won't be refreshed continuously. Wondering what this may be caused by? My script frame is as follow:
import mpld3[enter image description here][1]
from mpld3._server import serve
.
.
.
html1=mpld3.fig_to_html(fig1)
html2=mpld3.fig_to_html(fig2)
serve(html1+html2)
plt.pause(0.5)
enter image description here
There is no way to do that.
However, you can still export your figure as a html file – as you already do with the mpld3.fig_to_html() command – but always in the same html file, and run a auto-reload soft in the web browser on this page (see for example this plugin for Firefox: https://addons.mozilla.org/en-US/firefox/addon/tab-auto-reload/).
But for mpld3 figures, the loading time can be quite large depending on the amount of data you are showing. This solution is definitely not appropriate for real-time applications!

Viewing graphs in Jupyter or IPython

I am trying to use both bokeh and matplotlib in my IPython notebook... Neither work perfectly.
Attached is a screen shot of Bokeh. Matplotlib explanation is below.
Here are my system specs:
-Windows 7 with Vagrant
-Jupyter/IPython
BOKEH -- buttons are static images; there is no resizing, yet the graph is interactive
Should look like from this website: http://docs.bokeh.org/en/latest/docs/quickstart.html
MATPLOTLIB -- only static shots appear when it should be zoomable, etc (like bokeh)
1) read the documentation.
you would only change output_file() to a call to output_notebook() instead.
Which you did not seem to do above.
2) Why should it ? What di you do to make it zoomable ?
3) try not to post 2 unrelated question at the same time.
You appear to be using an older version of Bokeh. The issue with the CSS problems (button appearance) has been fixed for some time. As mentioned above, you will need to execute output_notebook() to load Bokeh for IPython notebook usage. For future reference, questions like this greatly benefit from providing as much information as possible (e.g., Bokeh and browser versions, platform information, etc.) Without that information it is impossible to diagnose problems with any certainty.

Editing Video Effects panel on VLC for Mac

Ok so this question is actually in two parts.
I coded a video filter for VLC and I would like to add a control to the Video Effects panel on the OS X UI. So far I've been able to link my plugin the the UI by hijacking one of the existing controls, but this isn't ideal.
Now, if I open up the Xcode project (I'm running Xcode 6.3.1) and try to open the VideoEffect.xib file, I get the following error:
I tried to google this but it sounds like the only alternative would be to play archaeologist and dig up an old copy of Xcode 3. Is there any other way to be able to open this file and edit it somehow? I tried to look at the XML code but if I started to change that I'd do more damage than good.
The second thing I'd like to do is sending back values from the effect module to the UI. At the moment (by hijacking one of the existing sliders), all I can do is read a value from the panel with
config_ChainParse(p_filter, FILTER_PREFIX, ppsz_filter_options, p_filter->p_cfg);
p_filter->p_sys->i_factor = var_CreateGetIntegerCommand(p_filter, FILTER_PREFIX "factor");
and then, inside the callback function:
p_sys->i_factor = VLC_CLIP( newval.i_int, 0, 255 );
However, I haven't been able to write back the value. I'd like the filter to set p_sys->i_factor to a random value at start. This works (using var_SetInteger()), but it isn't reflected in the position of the slider in the Video Effect panel. I suspect I need to hack a bit deeper for that. Any ideas?
Regarding your first question with the xib-file. Consider downloading and using our forthcoming 3.0 code from git://git.videolan.org/vlc.git - it allows editing of said file without Xcode 3.
Regarding your second question, why would you want your video filter to interfere with the UI? This is not how the architecture of VLC works and there is no correct way to do it at this point. You would need to edit the core to do another global variable callback to ask the UI to reload the presented filter configuration.
Perhaps, if you give details about what your filter does and what you want to achieve, we find a more supported way :)

3D animation programatically rendered in Blender

I have a project in which I would like to programatically create and render a 3d animation based upon input. I originally asked here on stackoverflow if Blender was right for the job, and the response was yes, but upon looking at the API, it says this:
Python was embedded in Blender, so to access BPython modules you need to run scripts from the program itself: you can't import the Blender module into an external Python interpreter.
I want to be able to create and render this scene without having to ever open another program like Blender. Is this possible, and is Blender still the right choice?
Thanks in advance!
At work me and colleague worked on a project that rendered 3d scenes altered externally. We used Python to modify/create scenes, and did the rending on server through the command line interface (no GUI).
You can pass a python script as an argument to Blender in the command line options to
generate your scene objects and do the rendering.
I don't see how you can render in Blender without using Blender.
You can use Blender if you want, obviously this is not your only option.
If you need to
create and render a 3d animation based upon input.
You can go as simple or as you complex as you'd like.
You can use OpenGL in your language of choice (C++, Java, Python, etc.)
and display the animation (with or without fancy renderings).
It's up to what 'render' means to your context.
If you need some nice shading(light, soft shadows, reflections, etc. - ray tracers basically), you can still show an interactive preview to your users and generate the scene
for a 3rd party renderer(like Yafaray, Sunflow, LuxRender, etc. - I've put together a short list of free renders), and show the progress to the users after they've chosen the external render option.
On a similar note, have a look at joons.
HTH
Cart by Suomi - Yafaray Gallery image
Julia quaternion fractal - Sunflow Gallery image
Klein Bottle - LuxRender Gallery image