Before you flag this has duplicate, I want to point out that I did read the posts here and all of them tell me to change the code in
~/.jupter/custom/custom.js
However, there is no such directory as custom and no such file as custom.js
Also, if I add the above files and the code, then too it is autosaving.
Any help is greatly appreciated.
Update: jupyter version is : 4.3.0
Operating System: Ubuntu 16.04
Installed via pip
Put that in the custom.js:
define([
'base/js/namespace',
'base/js/events'
],
function(IPython, events) {
events.on("notebook_loaded.Notebook",
function () {
IPython.notebook.set_autosave_interval(0); //in milliseconds
}
);
//may include additional events.on() statements
}
);
Related
RESOLVED:
I built a gulp plugin to solve the problem...
https://www.npmjs.com/package/gulp-mtime-correction
The issue I'm having is that my gulp task using Vinyl-FTP and Gulp-Newer doesn't seem to be noticing changes in my files and therefore is not sending the changes via FTP.
So here are the FTP gulp settings/tasks in gulpfile.js
// FTP settings
const FTP = {
connOpts : {
host : 'ftp.****.co.uk',
user : '****',
password : '*****',
parallel : 10,
log : gutil.log
},
directoryPath : FTPDirectoryPath,
src : dir.build + '**/*',
base : dir.build
};
// ftp deployment to live site
gulp.task( 'deploy', () => {
var conn = ftp.create( FTP.connOpts );
return gulp.src( FTP.src , { base: FTP.base, buffer: false } )
.pipe( conn.newer( FTP.directoryPath ) ) // only upload newer files
.pipe( conn.dest( FTP.directoryPath ) );
} );
Since I'm writing a wordpress theme, FTPDirectoryPath points to the 'etc/wp-content/themes/themename' directory. I'm pretty sure it's set right because it does correctly update brand new files
I don't know if it's an issue with Vinyl-FTP or with Gulp-Newer, but for some reason this FTP task doesn't notice that main.css has been updated.
Please help!!
UPDATE:
So I've worked out that this is a timezone issue. The server is in the UK, but I'm in Panama (6 hours behind), so the files on the server will always appear newer to gulp-newer (which compares the last edit time) unless I haven't updated them for over 6 hours.
Does anyone know of a workaround for this without having to change the clock on my laptop? Can I manually update timestamps on files either locally or on the server, or is there a gulp extension that can deal with this?
Thanks!
I made this npm package as a solution. It was 2 years ago, so let me know if you guys have any issues with it, or feel free to make a PR :)
You can use it to simply adjust a file's mtime (last modification time) before and after whatever 'is file new' check youre using, making it appear that you're in a different timezone.
https://www.npmjs.com/package/gulp-mtime-correction
I am trying Create simple notebook frontend extensions as described here
http://jupyter-notebook.readthedocs.io/en/latest/extending/frontend_extensions.html
This is what I have
~$ cat /home/usr/.local/lib/python2.7/site-packages/my_fancy_module/static/main.js // file my_extension/main.js
define([
'base/js/namespace' ], function(
Jupyter ) {
function load_ipython_extension() {
var handler = function () {
alert('this is an alert from my_extension!');
};
var action = {
icon: 'fa-comment-o', // a font-awesome class used on buttons, etc
help : 'Show an alert',
help_index : 'zz',
handler : handler
};
var prefix = 'my_extension';
var action_name = 'show-alert-usr';
var full_action_name = Jupyter.actions.register(action, action_name, prefix); // returns 'my_extension:show-alert'
Jupyter.toolbar.add_buttons_group([full_action_name]);
}
return {
load_ipython_extension: load_ipython_extension
}; });
When I try to install I get validation errors
$ jupyter nbextension enable /home/usr/.local/lib/python2.7/site-packages/my_fancy_module/static/main.js
--user Enabling notebook extension /home/usr/.local/lib/python2.7/site-packages/my_fancy_module/static/main.js...
- Validating: problems found:
- require? X /home/usr/.local/lib/python2.7/site-packages/my_fancy_module/static/main.js
I am very new to Python notebooks.
Additional information/questions:
When I pip installed my_fance_module it did not copy over the static directory and the .js files inside. I had to manually copy them to ~/usr/.local/ path afterwards.
This is my directory structure
.local/lib/python2.7/site-packages/my_fancy_module
-- __init__.py
|static
--- main.js
Also after installing this main.js and running server and notebook shows only main.js and does not show my notebooks anymore on the browser.
Have you tried?
jupyter nbextension install /home/usr/.local/lib/python2.7/site-packages/my_fancy_module/static/main.js --sys-prefix
before;
jupyter nbextension enable /home/usr/.local/lib/python2.7/site-packages/my_fancy_module/static/main.js
Also what version of Jupyter are you working with? Because the path that you indicated appears to be your systems default Python 2.7 that it ships with. If your developing for Jupyter notebook then I think it would be wise to first install Anaconda then install Jupyter notebook through it conda install notebook then migrate your files to you Anaconda dir. So let me know if that doesn't work out for you.
I am trying to launch R from sublimetext2 via sublimeREPL. Until I installed the new OS everything worked, now not anymore since the directory is not found apparently. I tried all variations but I cannot make it work. Here are my SublimeREPL User settings:
{
"default_extend_env": {"PATH": "{PATH}:/Applications/R"},
"default_extend_env":{"COLUMNS": "500"},
"wrap_width": 200,
"word_wrap": false,
"pep8_ignore":["E251","E501","W191","E303"]
}
Any idea what this might be about?
I solved it: After installing "el capitan", the permissions to access for sublime seemed to be deleted. I reeinstalled R and all worked.
$ wget --quiet http://download.qt-project.org/official_releases/qt/5.2/5.2.1/qt-opensource-windows-x86-msvc2012_64_opengl-5.2.1.exe
$
As seen above, I first downloaded the Qt package for Visual Studio in a Cygwin Bash shell.
A sidenote: The Qt library packaged within Cygwin is not useful for me because I need to use the Visual Studio C++ compiler.
First I set the correct permissions on the file
$ chmod 755 qt-opensource-windows-x86-msvc2012_64_opengl-5.2.1.exe
If I start it like this
$ ./qt-opensource-windows-x86-msvc2012_64_opengl-5.2.1.exe
a graphical window (GUI) is shown but that is not what I want as I would later like to have the installation procedure written into a Bash script that I could run in Cygwin.
If I add the option --help, like this
$ ./qt-opensource-windows-x86-msvc2012_64_opengl-5.2.1.exe --help
a new terminal window is opened with the following text
Usage: SDKMaintenanceTool [OPTIONS]
User:
--help Show commandline usage
--version Show current version
--checkupdates Check for updates and return an XML file describing
the available updates
--updater Start in updater mode.
--manage-packages Start in packagemanager mode.
--proxy Set system proxy on Win and Mac.
This option has no effect on Linux.
--verbose Show debug output on the console
--create-offline-repository Offline installer only: Create a local repository inside the
installation directory based on the offline
installer's content.
Developer:
--runoperation [OPERATION] [arguments...] Perform an operation with a list of arguments
--undooperation [OPERATION] [arguments...] Undo an operation with a list of arguments
--script [scriptName] Execute a script
--no-force-installations Enable deselection of forced components
--addRepository [URI] Add a local or remote repo to the list of user defined repos.
--addTempRepository [URI] Add a local or remote repo to the list of temporary available
repos.
--setTempRepository [URI] Set a local or remote repo as tmp repo, it is the only one
used during fetch.
Note: URI must be prefixed with the protocol, i.e. file:///
http:// or ftp://. It can consist of multiple
addresses separated by comma only.
--show-virtual-components Show virtual components in package manager and updater
--binarydatafile [binary_data_file] Use the binary data of another installer or maintenance tool.
--update-installerbase [new_installerbase] Patch a full installer with a new installer base
--dump-binary-data -i [PATH] -o [PATH] Dumps the binary content into specified output path (offline
installer only).
Input path pointing to binary data file, if omitted
the current application is used as input.
I don't know how to continue from here. Do you know how I could install the Qt 5.2.1 library (for Visual Studio) from the Bash shell in Cygwin?
Update: The advantage of writing the build script for a Cygwin environment is that commands like git, wget, and scp are available. This Stackoverflow answer describes how to invoke the MSVC compiler from a Cygwin bash script. Note, that the Qt application I'm building is not going to have any dependency on Cygwin.
I didn't test with Cygwin but I successfully installed Qt5.5 using a script. To do so, you must use the --script line of the normal installer.
.\qt-opensource-windows-x86-msvc2013_64-5.5.1.exe --script .\qt-installer-noninteractive.qs
Here's an example of qt-installer-noninteractive.qs file I used in the command above
function Controller() {
installer.autoRejectMessageBoxes();
installer.installationFinished.connect(function() {
gui.clickButton(buttons.NextButton);
})
}
Controller.prototype.WelcomePageCallback = function() {
gui.clickButton(buttons.NextButton);
}
Controller.prototype.CredentialsPageCallback = function() {
gui.clickButton(buttons.NextButton);
}
Controller.prototype.IntroductionPageCallback = function() {
gui.clickButton(buttons.NextButton);
}
Controller.prototype.TargetDirectoryPageCallback = function() {
gui.currentPageWidget().TargetDirectoryLineEdit.setText("C:/Qt/Qt5.5.1");
gui.clickButton(buttons.NextButton);
}
Controller.prototype.ComponentSelectionPageCallback = function() {
var widget = gui.currentPageWidget();
widget.deselectAll();
widget.selectComponent("qt.55.win64_msvc2013_64");
// widget.selectComponent("qt.55.qt3d");
// widget.selectComponent("qt.55.qtcanvas3d");
// widget.selectComponent("qt.55.qtquick1");
// widget.selectComponent("qt.55.qtscript");
// widget.selectComponent("qt.55.qtwebengine");
// widget.selectComponent("qt.55.qtquickcontrols");
// widget.selectComponent("qt.55.qtlocation");
gui.clickButton(buttons.NextButton);
}
Controller.prototype.LicenseAgreementPageCallback = function() {
gui.currentPageWidget().AcceptLicenseRadioButton.setChecked(true);
gui.clickButton(buttons.NextButton);
}
Controller.prototype.StartMenuDirectoryPageCallback = function() {
gui.clickButton(buttons.NextButton);
}
Controller.prototype.ReadyForInstallationPageCallback = function()
{
gui.clickButton(buttons.NextButton);
}
Controller.prototype.FinishedPageCallback = function() {
var checkBoxForm = gui.currentPageWidget().LaunchQtCreatorCheckBoxForm
if (checkBoxForm && checkBoxForm.launchQtCreatorCheckBox) {
checkBoxForm.launchQtCreatorCheckBox.checked = false;
}
gui.clickButton(buttons.FinishButton);
}
The tricky part was to found the id of the components! I was able to found the right id qt.55.win64_msvc2013_64 by adding the flag --verbose and installing it normally with the UI and stopping at the last page; all the ids that you selected for installation are there.
There is slightly more information in this answer if you need more details.
EDIT (29-11-2017): For installer 3.0.2-online, the "Next" button in the "Welcome" page is disabled for 1 second so you must add a delay
gui.clickButton(buttons.NextButton, 3000);
EDIT (10-11-2019): See Joshua Wade's answer for more traps and pitfalls, like the "User Data Collection" form and "Archive" and "Latest releases" checkboxes.
My current project is at https://github.com/jimmack1963/localPackages.git.
I am trying to get this code to work:
console.log("You pressed the button, " + MyName);
where MyName comes from a package called simple, that is JUST LOCAL. Per 6.5, am exporting via
Package.on_use(function (api, where) {
api.add_files(['constant.js'], 'client');
//below added per possible suggestion from Nathan, had no effect.
api.use('constant.js', 'client');
if (api.export)
api.export('MyName');
});
Am trying to factor my code out to local packages. This is not about publishing packages, but about using local ones, which is referred to in many places. My package is simply trying to publish a string, MyName. But the project wants none of it. "MyName is not defined."
I copy the technique in 'Discover Meteor,' but it doesn't work for me, and I try other things. Have had a lot of success in Meteor in general.
This spec seems to be changing. I get the 6.5 export requirement, but easily find contradictory advise about the base project's need to add that project in smart.json (not the one in the package). Most references don't list that as a requirement at all.
I've tried
{
"packages": {
"simple" : {
"path": "packages/simple"
}
}
}
and putting it into git and trying from a different project:
{
"packages": {
"simple" : {
"git": "https://github.com/jimmack1963/localPackages.git"
}
}
}
For the latter, pleasingly, the installer was smart enough to burrow down and extract the package itself, ignoring the project wrapping it in the git project. Nice! So, I have the same problem when I install the package directly from git, still not published to the world.
Ubuntu 13.04
Meteorite version 0.6.11
Meteor Release 0.6.5.1
I had the same issue after migrating to 0.6.5 -
You only get 'exported' variables from packages you explicitly "use"; Packages "use" other packages by calling .use inside Package.on_use, projects "use" packages by adding them to .meteor/packages
Additionally, it seems to be quite picky about exporting variables, and wont currently export ones preceded with this.