How can one switch off the checkpoint notification?












0














I'm having the problem that I like my notebooks slimmer than is required to prevent an annoying temporary layout change caused by the display of the automatic checkpoint creation.



In this screenshot:



GUI layout space for checkpoint creation notification



one can see the empty space between the menu entry "Help" and the "Trusted" status icon.
This space is being used by the "Checkpoint created" notification that temporary pops up, with the interval of the automatic checkpoint creation.



Now, whenever the browser window is sufficiently slim, so that the



Checkpoint created <timestamp>


does not fit into this space, the layout manager temporarily creates a new line in the header, and the whole notebook is scrolling down one line, only to scroll up one line a few seconds later. I find this behavior highly annoying, so I would like Jupyter to do its checkpoints withOUT telling me about it. I really don't require this notification.
Is that possible to configure somehow?










share|improve this question






















  • Take a look at my updated answer
    – Kamil Niski
    Nov 17 '18 at 8:15
















0














I'm having the problem that I like my notebooks slimmer than is required to prevent an annoying temporary layout change caused by the display of the automatic checkpoint creation.



In this screenshot:



GUI layout space for checkpoint creation notification



one can see the empty space between the menu entry "Help" and the "Trusted" status icon.
This space is being used by the "Checkpoint created" notification that temporary pops up, with the interval of the automatic checkpoint creation.



Now, whenever the browser window is sufficiently slim, so that the



Checkpoint created <timestamp>


does not fit into this space, the layout manager temporarily creates a new line in the header, and the whole notebook is scrolling down one line, only to scroll up one line a few seconds later. I find this behavior highly annoying, so I would like Jupyter to do its checkpoints withOUT telling me about it. I really don't require this notification.
Is that possible to configure somehow?










share|improve this question






















  • Take a look at my updated answer
    – Kamil Niski
    Nov 17 '18 at 8:15














0












0








0







I'm having the problem that I like my notebooks slimmer than is required to prevent an annoying temporary layout change caused by the display of the automatic checkpoint creation.



In this screenshot:



GUI layout space for checkpoint creation notification



one can see the empty space between the menu entry "Help" and the "Trusted" status icon.
This space is being used by the "Checkpoint created" notification that temporary pops up, with the interval of the automatic checkpoint creation.



Now, whenever the browser window is sufficiently slim, so that the



Checkpoint created <timestamp>


does not fit into this space, the layout manager temporarily creates a new line in the header, and the whole notebook is scrolling down one line, only to scroll up one line a few seconds later. I find this behavior highly annoying, so I would like Jupyter to do its checkpoints withOUT telling me about it. I really don't require this notification.
Is that possible to configure somehow?










share|improve this question













I'm having the problem that I like my notebooks slimmer than is required to prevent an annoying temporary layout change caused by the display of the automatic checkpoint creation.



In this screenshot:



GUI layout space for checkpoint creation notification



one can see the empty space between the menu entry "Help" and the "Trusted" status icon.
This space is being used by the "Checkpoint created" notification that temporary pops up, with the interval of the automatic checkpoint creation.



Now, whenever the browser window is sufficiently slim, so that the



Checkpoint created <timestamp>


does not fit into this space, the layout manager temporarily creates a new line in the header, and the whole notebook is scrolling down one line, only to scroll up one line a few seconds later. I find this behavior highly annoying, so I would like Jupyter to do its checkpoints withOUT telling me about it. I really don't require this notification.
Is that possible to configure somehow?







jupyter-notebook






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 8 '18 at 2:34









K.-Michael Aye

3,10832850




3,10832850












  • Take a look at my updated answer
    – Kamil Niski
    Nov 17 '18 at 8:15


















  • Take a look at my updated answer
    – Kamil Niski
    Nov 17 '18 at 8:15
















Take a look at my updated answer
– Kamil Niski
Nov 17 '18 at 8:15




Take a look at my updated answer
– Kamil Niski
Nov 17 '18 at 8:15












1 Answer
1






active

oldest

votes


















2





+50









It looks like disabling two event handlers should achieve result you need. Just put code below in the first cell of your notebook



%%javascript
IPython.notebook.events.off('checkpoint_created.Notebook');
IPython.notebook.events.off('notebook_saved.Notebook');


I've found these handlers in code of jupyter notebook:




  • checkpoint_created.Notebook

  • notebook_saved.Notebook


Creating a nbextension



If you require the behavior on all your notebook i suggest creating a simple nbextension.



First, create the extension directory under directory path you want:



$ mkdir -p ~/Documents/checkpoint_disable


Create main.js file in above dir



Contents of main.js:



define([
'require',
'jquery',
'base/js/namespace',
], function (
requirejs,
$,
Jupyter,
) {
"use strict";

var initialize = function () {
Jupyter.notebook.events.off('checkpoint_created.Notebook');
Jupyter.notebook.events.off('notebook_saved.Notebook');
Jupyter.notebook.events.on(
'notebook_saved.Notebook',
function() {
console.log('Notebook saved');
})

};

var load_ipython_extension = function () {
return Jupyter.notebook.config.loaded.then(initialize);
};

// return object to export public methods
return {
load_ipython_extension : load_ipython_extension
};
});



NOTE Disabling two mentioned event handlers affects only UI. Under the hood notebook is still being autosaved if there is new content since last save




Installing nbextension



You need to use jupyter-nbextension command provided already with jupyter.



First install the extension



$ jupyter-nbextension install --user ~/Documents/checkpoint_disable


Next enable the extension



$ jupyter-nbextension enable checkpoint_disable/main


You can check that extension is installed by invoiking



$ jupyter-nbextension list


And you're done. The extension should load automatically.
You can verify that it is true if you see in browser javascript console log similar to one below:




load_extensions 
Arguments { 0: "jupyter-js-widgets/extension", 1: "checkpoint_disable/main", … }
utils.js:60
Loading extension: checkpoint_disable/main



Resources




  • Installing and enabling extensions

  • Custom front-end extensions

  • Enabling/Disabling extensions






share|improve this answer























  • Well, to change ALL my notebooks I wouldn't call "just" ;) Isn't there a way to put this into jupyter_notebook_config.py ? I guess in the worst case, I could put it into the ipython_kernel config.
    – K.-Michael Aye
    Nov 17 '18 at 2:13










  • thanks so much, looks awesome. While trying to follow your instructions, I noticed that you say "extension directory under jupyter" but your mkdir is working inside the .ipython folder? Which one should it be?
    – K.-Michael Aye
    Nov 18 '18 at 6:14










  • ~/.jupyter/nbextensions/ for some reason did not work where .ipython did. I recommend that you check which one will load the extension on your installation. I would be happy to put more detailed info but the i had difficulties finding good nbextension resources.
    – Kamil Niski
    Nov 18 '18 at 6:50






  • 1




    @K.-MichaelAye I've found the docs on installing extension. It should be more straightforwad and relaible now.
    – Kamil Niski
    Nov 18 '18 at 7:07










  • your install commends returns this: "Please supply at least one subcommand: disable, enable, install, list, uninstall"
    – K.-Michael Aye
    Nov 19 '18 at 18:29











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53200747%2fhow-can-one-switch-off-the-checkpoint-notification%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









2





+50









It looks like disabling two event handlers should achieve result you need. Just put code below in the first cell of your notebook



%%javascript
IPython.notebook.events.off('checkpoint_created.Notebook');
IPython.notebook.events.off('notebook_saved.Notebook');


I've found these handlers in code of jupyter notebook:




  • checkpoint_created.Notebook

  • notebook_saved.Notebook


Creating a nbextension



If you require the behavior on all your notebook i suggest creating a simple nbextension.



First, create the extension directory under directory path you want:



$ mkdir -p ~/Documents/checkpoint_disable


Create main.js file in above dir



Contents of main.js:



define([
'require',
'jquery',
'base/js/namespace',
], function (
requirejs,
$,
Jupyter,
) {
"use strict";

var initialize = function () {
Jupyter.notebook.events.off('checkpoint_created.Notebook');
Jupyter.notebook.events.off('notebook_saved.Notebook');
Jupyter.notebook.events.on(
'notebook_saved.Notebook',
function() {
console.log('Notebook saved');
})

};

var load_ipython_extension = function () {
return Jupyter.notebook.config.loaded.then(initialize);
};

// return object to export public methods
return {
load_ipython_extension : load_ipython_extension
};
});



NOTE Disabling two mentioned event handlers affects only UI. Under the hood notebook is still being autosaved if there is new content since last save




Installing nbextension



You need to use jupyter-nbextension command provided already with jupyter.



First install the extension



$ jupyter-nbextension install --user ~/Documents/checkpoint_disable


Next enable the extension



$ jupyter-nbextension enable checkpoint_disable/main


You can check that extension is installed by invoiking



$ jupyter-nbextension list


And you're done. The extension should load automatically.
You can verify that it is true if you see in browser javascript console log similar to one below:




load_extensions 
Arguments { 0: "jupyter-js-widgets/extension", 1: "checkpoint_disable/main", … }
utils.js:60
Loading extension: checkpoint_disable/main



Resources




  • Installing and enabling extensions

  • Custom front-end extensions

  • Enabling/Disabling extensions






share|improve this answer























  • Well, to change ALL my notebooks I wouldn't call "just" ;) Isn't there a way to put this into jupyter_notebook_config.py ? I guess in the worst case, I could put it into the ipython_kernel config.
    – K.-Michael Aye
    Nov 17 '18 at 2:13










  • thanks so much, looks awesome. While trying to follow your instructions, I noticed that you say "extension directory under jupyter" but your mkdir is working inside the .ipython folder? Which one should it be?
    – K.-Michael Aye
    Nov 18 '18 at 6:14










  • ~/.jupyter/nbextensions/ for some reason did not work where .ipython did. I recommend that you check which one will load the extension on your installation. I would be happy to put more detailed info but the i had difficulties finding good nbextension resources.
    – Kamil Niski
    Nov 18 '18 at 6:50






  • 1




    @K.-MichaelAye I've found the docs on installing extension. It should be more straightforwad and relaible now.
    – Kamil Niski
    Nov 18 '18 at 7:07










  • your install commends returns this: "Please supply at least one subcommand: disable, enable, install, list, uninstall"
    – K.-Michael Aye
    Nov 19 '18 at 18:29
















2





+50









It looks like disabling two event handlers should achieve result you need. Just put code below in the first cell of your notebook



%%javascript
IPython.notebook.events.off('checkpoint_created.Notebook');
IPython.notebook.events.off('notebook_saved.Notebook');


I've found these handlers in code of jupyter notebook:




  • checkpoint_created.Notebook

  • notebook_saved.Notebook


Creating a nbextension



If you require the behavior on all your notebook i suggest creating a simple nbextension.



First, create the extension directory under directory path you want:



$ mkdir -p ~/Documents/checkpoint_disable


Create main.js file in above dir



Contents of main.js:



define([
'require',
'jquery',
'base/js/namespace',
], function (
requirejs,
$,
Jupyter,
) {
"use strict";

var initialize = function () {
Jupyter.notebook.events.off('checkpoint_created.Notebook');
Jupyter.notebook.events.off('notebook_saved.Notebook');
Jupyter.notebook.events.on(
'notebook_saved.Notebook',
function() {
console.log('Notebook saved');
})

};

var load_ipython_extension = function () {
return Jupyter.notebook.config.loaded.then(initialize);
};

// return object to export public methods
return {
load_ipython_extension : load_ipython_extension
};
});



NOTE Disabling two mentioned event handlers affects only UI. Under the hood notebook is still being autosaved if there is new content since last save




Installing nbextension



You need to use jupyter-nbextension command provided already with jupyter.



First install the extension



$ jupyter-nbextension install --user ~/Documents/checkpoint_disable


Next enable the extension



$ jupyter-nbextension enable checkpoint_disable/main


You can check that extension is installed by invoiking



$ jupyter-nbextension list


And you're done. The extension should load automatically.
You can verify that it is true if you see in browser javascript console log similar to one below:




load_extensions 
Arguments { 0: "jupyter-js-widgets/extension", 1: "checkpoint_disable/main", … }
utils.js:60
Loading extension: checkpoint_disable/main



Resources




  • Installing and enabling extensions

  • Custom front-end extensions

  • Enabling/Disabling extensions






share|improve this answer























  • Well, to change ALL my notebooks I wouldn't call "just" ;) Isn't there a way to put this into jupyter_notebook_config.py ? I guess in the worst case, I could put it into the ipython_kernel config.
    – K.-Michael Aye
    Nov 17 '18 at 2:13










  • thanks so much, looks awesome. While trying to follow your instructions, I noticed that you say "extension directory under jupyter" but your mkdir is working inside the .ipython folder? Which one should it be?
    – K.-Michael Aye
    Nov 18 '18 at 6:14










  • ~/.jupyter/nbextensions/ for some reason did not work where .ipython did. I recommend that you check which one will load the extension on your installation. I would be happy to put more detailed info but the i had difficulties finding good nbextension resources.
    – Kamil Niski
    Nov 18 '18 at 6:50






  • 1




    @K.-MichaelAye I've found the docs on installing extension. It should be more straightforwad and relaible now.
    – Kamil Niski
    Nov 18 '18 at 7:07










  • your install commends returns this: "Please supply at least one subcommand: disable, enable, install, list, uninstall"
    – K.-Michael Aye
    Nov 19 '18 at 18:29














2





+50







2





+50



2




+50




It looks like disabling two event handlers should achieve result you need. Just put code below in the first cell of your notebook



%%javascript
IPython.notebook.events.off('checkpoint_created.Notebook');
IPython.notebook.events.off('notebook_saved.Notebook');


I've found these handlers in code of jupyter notebook:




  • checkpoint_created.Notebook

  • notebook_saved.Notebook


Creating a nbextension



If you require the behavior on all your notebook i suggest creating a simple nbextension.



First, create the extension directory under directory path you want:



$ mkdir -p ~/Documents/checkpoint_disable


Create main.js file in above dir



Contents of main.js:



define([
'require',
'jquery',
'base/js/namespace',
], function (
requirejs,
$,
Jupyter,
) {
"use strict";

var initialize = function () {
Jupyter.notebook.events.off('checkpoint_created.Notebook');
Jupyter.notebook.events.off('notebook_saved.Notebook');
Jupyter.notebook.events.on(
'notebook_saved.Notebook',
function() {
console.log('Notebook saved');
})

};

var load_ipython_extension = function () {
return Jupyter.notebook.config.loaded.then(initialize);
};

// return object to export public methods
return {
load_ipython_extension : load_ipython_extension
};
});



NOTE Disabling two mentioned event handlers affects only UI. Under the hood notebook is still being autosaved if there is new content since last save




Installing nbextension



You need to use jupyter-nbextension command provided already with jupyter.



First install the extension



$ jupyter-nbextension install --user ~/Documents/checkpoint_disable


Next enable the extension



$ jupyter-nbextension enable checkpoint_disable/main


You can check that extension is installed by invoiking



$ jupyter-nbextension list


And you're done. The extension should load automatically.
You can verify that it is true if you see in browser javascript console log similar to one below:




load_extensions 
Arguments { 0: "jupyter-js-widgets/extension", 1: "checkpoint_disable/main", … }
utils.js:60
Loading extension: checkpoint_disable/main



Resources




  • Installing and enabling extensions

  • Custom front-end extensions

  • Enabling/Disabling extensions






share|improve this answer














It looks like disabling two event handlers should achieve result you need. Just put code below in the first cell of your notebook



%%javascript
IPython.notebook.events.off('checkpoint_created.Notebook');
IPython.notebook.events.off('notebook_saved.Notebook');


I've found these handlers in code of jupyter notebook:




  • checkpoint_created.Notebook

  • notebook_saved.Notebook


Creating a nbextension



If you require the behavior on all your notebook i suggest creating a simple nbextension.



First, create the extension directory under directory path you want:



$ mkdir -p ~/Documents/checkpoint_disable


Create main.js file in above dir



Contents of main.js:



define([
'require',
'jquery',
'base/js/namespace',
], function (
requirejs,
$,
Jupyter,
) {
"use strict";

var initialize = function () {
Jupyter.notebook.events.off('checkpoint_created.Notebook');
Jupyter.notebook.events.off('notebook_saved.Notebook');
Jupyter.notebook.events.on(
'notebook_saved.Notebook',
function() {
console.log('Notebook saved');
})

};

var load_ipython_extension = function () {
return Jupyter.notebook.config.loaded.then(initialize);
};

// return object to export public methods
return {
load_ipython_extension : load_ipython_extension
};
});



NOTE Disabling two mentioned event handlers affects only UI. Under the hood notebook is still being autosaved if there is new content since last save




Installing nbextension



You need to use jupyter-nbextension command provided already with jupyter.



First install the extension



$ jupyter-nbextension install --user ~/Documents/checkpoint_disable


Next enable the extension



$ jupyter-nbextension enable checkpoint_disable/main


You can check that extension is installed by invoiking



$ jupyter-nbextension list


And you're done. The extension should load automatically.
You can verify that it is true if you see in browser javascript console log similar to one below:




load_extensions 
Arguments { 0: "jupyter-js-widgets/extension", 1: "checkpoint_disable/main", … }
utils.js:60
Loading extension: checkpoint_disable/main



Resources




  • Installing and enabling extensions

  • Custom front-end extensions

  • Enabling/Disabling extensions







share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 21 '18 at 21:03









K.-Michael Aye

3,10832850




3,10832850










answered Nov 16 '18 at 22:06









Kamil Niski

2,5541214




2,5541214












  • Well, to change ALL my notebooks I wouldn't call "just" ;) Isn't there a way to put this into jupyter_notebook_config.py ? I guess in the worst case, I could put it into the ipython_kernel config.
    – K.-Michael Aye
    Nov 17 '18 at 2:13










  • thanks so much, looks awesome. While trying to follow your instructions, I noticed that you say "extension directory under jupyter" but your mkdir is working inside the .ipython folder? Which one should it be?
    – K.-Michael Aye
    Nov 18 '18 at 6:14










  • ~/.jupyter/nbextensions/ for some reason did not work where .ipython did. I recommend that you check which one will load the extension on your installation. I would be happy to put more detailed info but the i had difficulties finding good nbextension resources.
    – Kamil Niski
    Nov 18 '18 at 6:50






  • 1




    @K.-MichaelAye I've found the docs on installing extension. It should be more straightforwad and relaible now.
    – Kamil Niski
    Nov 18 '18 at 7:07










  • your install commends returns this: "Please supply at least one subcommand: disable, enable, install, list, uninstall"
    – K.-Michael Aye
    Nov 19 '18 at 18:29


















  • Well, to change ALL my notebooks I wouldn't call "just" ;) Isn't there a way to put this into jupyter_notebook_config.py ? I guess in the worst case, I could put it into the ipython_kernel config.
    – K.-Michael Aye
    Nov 17 '18 at 2:13










  • thanks so much, looks awesome. While trying to follow your instructions, I noticed that you say "extension directory under jupyter" but your mkdir is working inside the .ipython folder? Which one should it be?
    – K.-Michael Aye
    Nov 18 '18 at 6:14










  • ~/.jupyter/nbextensions/ for some reason did not work where .ipython did. I recommend that you check which one will load the extension on your installation. I would be happy to put more detailed info but the i had difficulties finding good nbextension resources.
    – Kamil Niski
    Nov 18 '18 at 6:50






  • 1




    @K.-MichaelAye I've found the docs on installing extension. It should be more straightforwad and relaible now.
    – Kamil Niski
    Nov 18 '18 at 7:07










  • your install commends returns this: "Please supply at least one subcommand: disable, enable, install, list, uninstall"
    – K.-Michael Aye
    Nov 19 '18 at 18:29
















Well, to change ALL my notebooks I wouldn't call "just" ;) Isn't there a way to put this into jupyter_notebook_config.py ? I guess in the worst case, I could put it into the ipython_kernel config.
– K.-Michael Aye
Nov 17 '18 at 2:13




Well, to change ALL my notebooks I wouldn't call "just" ;) Isn't there a way to put this into jupyter_notebook_config.py ? I guess in the worst case, I could put it into the ipython_kernel config.
– K.-Michael Aye
Nov 17 '18 at 2:13












thanks so much, looks awesome. While trying to follow your instructions, I noticed that you say "extension directory under jupyter" but your mkdir is working inside the .ipython folder? Which one should it be?
– K.-Michael Aye
Nov 18 '18 at 6:14




thanks so much, looks awesome. While trying to follow your instructions, I noticed that you say "extension directory under jupyter" but your mkdir is working inside the .ipython folder? Which one should it be?
– K.-Michael Aye
Nov 18 '18 at 6:14












~/.jupyter/nbextensions/ for some reason did not work where .ipython did. I recommend that you check which one will load the extension on your installation. I would be happy to put more detailed info but the i had difficulties finding good nbextension resources.
– Kamil Niski
Nov 18 '18 at 6:50




~/.jupyter/nbextensions/ for some reason did not work where .ipython did. I recommend that you check which one will load the extension on your installation. I would be happy to put more detailed info but the i had difficulties finding good nbextension resources.
– Kamil Niski
Nov 18 '18 at 6:50




1




1




@K.-MichaelAye I've found the docs on installing extension. It should be more straightforwad and relaible now.
– Kamil Niski
Nov 18 '18 at 7:07




@K.-MichaelAye I've found the docs on installing extension. It should be more straightforwad and relaible now.
– Kamil Niski
Nov 18 '18 at 7:07












your install commends returns this: "Please supply at least one subcommand: disable, enable, install, list, uninstall"
– K.-Michael Aye
Nov 19 '18 at 18:29




your install commends returns this: "Please supply at least one subcommand: disable, enable, install, list, uninstall"
– K.-Michael Aye
Nov 19 '18 at 18:29


















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53200747%2fhow-can-one-switch-off-the-checkpoint-notification%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

If I really need a card on my start hand, how many mulligans make sense? [duplicate]

Alcedinidae

Can an atomic nucleus contain both particles and antiparticles? [duplicate]