changeset 6:6455ec6914b3

Update readme
author Brendan Rius <brendan@omixy.com>
date Fri, 25 Mar 2016 14:36:42 +0000
parents c4f5d97f80d0
children aa54c85303b6
files Example of C notebook.ipynb README.md example-notebook.ipynb example-notebook.png
diffstat 4 files changed, 161 insertions(+), 166 deletions(-) [+]
line wrap: on
line diff
--- a/Example of C notebook.ipynb	Fri Mar 25 14:30:05 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,164 +0,0 @@
-{
- "cells": [
-  {
-   "cell_type": "markdown",
-   "metadata": {},
-   "source": [
-    "# Valid code"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": 1,
-   "metadata": {
-    "collapsed": false
-   },
-   "outputs": [
-    {
-     "name": "stderr",
-     "output_type": "stream",
-     "text": []
-    },
-    {
-     "name": "stdout",
-     "output_type": "stream",
-     "text": [
-      "Hello world\n"
-     ]
-    }
-   ],
-   "source": [
-    "#include <stdio.h>\n",
-    "\n",
-    "int main() {\n",
-    "    printf(\"Hello world\\n\");\n",
-    "}"
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "metadata": {},
-   "source": [
-    "But the kernel will also display compilations warnings and errors if we have some. Let's try to remove the `#include <stdio.h>` statement, which if necessary for `printf` to work."
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "metadata": {},
-   "source": [
-    "# Code generating warnings during compilation"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": 2,
-   "metadata": {
-    "collapsed": false
-   },
-   "outputs": [
-    {
-     "name": "stderr",
-     "output_type": "stream",
-     "text": [
-      "/var/folders/31/qct57s856n5f0b2r4tgbmn1c0000gn/T/tmp0Qan0v.c:2:5: warning: implicitly declaring library function 'printf' with type 'int (const char *, ...)' [-Wimplicit-function-declaration]\n",
-      "    printf(\"Hello world\\n\");\n",
-      "    ^\n",
-      "/var/folders/31/qct57s856n5f0b2r4tgbmn1c0000gn/T/tmp0Qan0v.c:2:5: note: include the header <stdio.h> or explicitly provide a declaration for 'printf'\n",
-      "1 warning generated.\n"
-     ]
-    },
-    {
-     "name": "stdout",
-     "output_type": "stream",
-     "text": [
-      "Hello world\n"
-     ]
-    }
-   ],
-   "source": [
-    "int main() {\n",
-    "    printf(\"Hello world\\n\");\n",
-    "}"
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "metadata": {},
-   "source": [
-    "You can see that the warning are displayed, but the code is still executed."
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "metadata": {},
-   "source": [
-    "# Code generating errors during compilation"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": 3,
-   "metadata": {
-    "collapsed": false
-   },
-   "outputs": [
-    {
-     "name": "stderr",
-     "output_type": "stream",
-     "text": [
-      "/var/folders/31/qct57s856n5f0b2r4tgbmn1c0000gn/T/tmpw4Kz3c.c:2:5: warning: implicitly declaring library function 'printf' with type 'int (const char *, ...)' [-Wimplicit-function-declaration]\n",
-      "    printf(\"Hello world\")\n",
-      "    ^\n",
-      "/var/folders/31/qct57s856n5f0b2r4tgbmn1c0000gn/T/tmpw4Kz3c.c:2:5: note: include the header <stdio.h> or explicitly provide a declaration for 'printf'\n",
-      "/var/folders/31/qct57s856n5f0b2r4tgbmn1c0000gn/T/tmpw4Kz3c.c:2:26: error: expected ';' after expression\n",
-      "    printf(\"Hello world\")\n",
-      "                         ^\n",
-      "                         ;\n",
-      "1 warning and 1 error generated.\n",
-      "[C kernel] GCC exited with code 1, the executable will not be executed"
-     ]
-    },
-    {
-     "name": "stdout",
-     "output_type": "stream",
-     "text": []
-    }
-   ],
-   "source": [
-    "int main() {\n",
-    "    printf(\"Hello world\")\n",
-    "}"
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "metadata": {},
-   "source": [
-    "You can see that the errors and warnings are shown, but the code is not executed. The retcode is also added to the end of `stderr`"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {
-    "collapsed": true
-   },
-   "outputs": [],
-   "source": []
-  }
- ],
- "metadata": {
-  "kernelspec": {
-   "display_name": "C",
-   "language": "c",
-   "name": "c_kernel"
-  },
-  "language_info": {
-   "file_extension": "c",
-   "mimetype": "text/plain",
-   "name": "c"
-  }
- },
- "nbformat": 4,
- "nbformat_minor": 0
-}
--- a/README.md	Fri Mar 25 14:30:05 2016 +0000
+++ b/README.md	Fri Mar 25 14:36:42 2016 +0000
@@ -13,6 +13,10 @@
 
 ## Usage
 
- * Create a new Jupyter notebook: `jupyter-notebook`
- * Change the kernel to `C`
+ * Open the example notebook: `jupyter-notebook example-notebook.ipynb`
  * Enjoy!
+
+## Example of notebook
+
+![Example of notebook](example-notebook.png?raw=true "Example of notebook")
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/example-notebook.ipynb	Fri Mar 25 14:36:42 2016 +0000
@@ -0,0 +1,155 @@
+{
+ "cells": [
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "# Valid code"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 1,
+   "metadata": {
+    "collapsed": false
+   },
+   "outputs": [
+    {
+     "name": "stderr",
+     "output_type": "stream",
+     "text": []
+    },
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "Hello world\n"
+     ]
+    }
+   ],
+   "source": [
+    "#include <stdio.h>\n",
+    "\n",
+    "int main() {\n",
+    "    printf(\"Hello world\\n\");\n",
+    "}"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "But the kernel will also display compilations warnings and errors if we have some. Let's try to remove the `#include <stdio.h>` statement, which if necessary for `printf` to work."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "# Code generating warnings during compilation"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 2,
+   "metadata": {
+    "collapsed": false
+   },
+   "outputs": [
+    {
+     "name": "stderr",
+     "output_type": "stream",
+     "text": [
+      "/var/folders/31/qct57s856n5f0b2r4tgbmn1c0000gn/T/tmp0Qan0v.c:2:5: warning: implicitly declaring library function 'printf' with type 'int (const char *, ...)' [-Wimplicit-function-declaration]\n",
+      "    printf(\"Hello world\\n\");\n",
+      "    ^\n",
+      "/var/folders/31/qct57s856n5f0b2r4tgbmn1c0000gn/T/tmp0Qan0v.c:2:5: note: include the header <stdio.h> or explicitly provide a declaration for 'printf'\n",
+      "1 warning generated.\n"
+     ]
+    },
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "Hello world\n"
+     ]
+    }
+   ],
+   "source": [
+    "int main() {\n",
+    "    printf(\"Hello world\\n\");\n",
+    "}"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "You can see that the warning are displayed, but the code is still executed."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "# Code generating errors during compilation"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 3,
+   "metadata": {
+    "collapsed": false
+   },
+   "outputs": [
+    {
+     "name": "stderr",
+     "output_type": "stream",
+     "text": [
+      "/var/folders/31/qct57s856n5f0b2r4tgbmn1c0000gn/T/tmpw4Kz3c.c:2:5: warning: implicitly declaring library function 'printf' with type 'int (const char *, ...)' [-Wimplicit-function-declaration]\n",
+      "    printf(\"Hello world\")\n",
+      "    ^\n",
+      "/var/folders/31/qct57s856n5f0b2r4tgbmn1c0000gn/T/tmpw4Kz3c.c:2:5: note: include the header <stdio.h> or explicitly provide a declaration for 'printf'\n",
+      "/var/folders/31/qct57s856n5f0b2r4tgbmn1c0000gn/T/tmpw4Kz3c.c:2:26: error: expected ';' after expression\n",
+      "    printf(\"Hello world\")\n",
+      "                         ^\n",
+      "                         ;\n",
+      "1 warning and 1 error generated.\n",
+      "[C kernel] GCC exited with code 1, the executable will not be executed"
+     ]
+    },
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": []
+    }
+   ],
+   "source": [
+    "int main() {\n",
+    "    printf(\"Hello world\")\n",
+    "}"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "You can see that the errors and warnings are shown, but the code is not executed. The retcode is also added to the end of `stderr`"
+   ]
+  }
+ ],
+ "metadata": {
+  "kernelspec": {
+   "display_name": "C",
+   "language": "c",
+   "name": "c_kernel"
+  },
+  "language_info": {
+   "file_extension": "c",
+   "mimetype": "text/plain",
+   "name": "c"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
Binary file example-notebook.png has changed