diff options
author | debashisdeb | 2014-06-21 00:52:25 +0530 |
---|---|---|
committer | debashisdeb | 2014-06-21 00:52:25 +0530 |
commit | 7c756fcc12d21693818e58f6936cab5b7c112868 (patch) | |
tree | 009cb02ec85f4a75ac7b64239751f15361df2bfe /C++_in_Action_-_Industrial-Strength_Programming_Techniques | |
parent | 83c1bfceb1b681b4bb7253b47491be2d8b2014a1 (diff) | |
download | Python-Textbook-Companions-7c756fcc12d21693818e58f6936cab5b7c112868.tar.gz Python-Textbook-Companions-7c756fcc12d21693818e58f6936cab5b7c112868.tar.bz2 Python-Textbook-Companions-7c756fcc12d21693818e58f6936cab5b7c112868.zip |
Removed Problem Statements Completely
Diffstat (limited to 'C++_in_Action_-_Industrial-Strength_Programming_Techniques')
12 files changed, 61 insertions, 66 deletions
diff --git a/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch1.ipynb b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch1.ipynb index 37aa04ae..834bacf2 100644 --- a/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch1.ipynb +++ b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch1.ipynb @@ -1,7 +1,7 @@ { "metadata": { "name": "", - "signature": "sha256:c628e15db0bd7c4697d070eda00c000c028cdbc1d271898882fdd16c63c0f120" + "signature": "sha256:2af50dca95bb8940069ca1eefad39c58f8f97bbf13a194cd9fff16b4f6521b4f" }, "nbformat": 3, "nbformat_minor": 0, @@ -127,7 +127,6 @@ "input": [ "\n", "\n", - "# typename to mark a qualified name as a type name.\n", "def check_assign(a,i,t):\n", " if (i < len(a)):\n", " a[i] = t;" diff --git a/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch10.ipynb b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch10.ipynb index 2951ba7c..52781089 100644 --- a/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch10.ipynb +++ b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch10.ipynb @@ -1,7 +1,7 @@ { "metadata": { "name": "", - "signature": "sha256:605cfaa74a14889610adf1b63bc80cf152287815885aa99d6c7f0c182f62cc6b" + "signature": "sha256:70f9ab632bffbd9fecc3bdcee575cac266cb09d4df74fddec4e595d028f134df" }, "nbformat": 3, "nbformat_minor": 0, @@ -59,7 +59,7 @@ "input": [ "\n", "s = \"Hello\"\n", - "#s[0] = 'h'\n", + "\n", "s = s.lower()\n", "print s" ], @@ -90,7 +90,7 @@ "\n", "\n", "class EmcCollection:\n", - " # insert one element\n", + " \n", " def insert(self,t):\n", " pass\n", " \n", @@ -180,8 +180,7 @@ "cell_type": "code", "collapsed": true, "input": [ - "ting object\n", - "'''\n", + "\n", "class EmcCollection:\n", " def __del__(self):\n", " pass\n", @@ -399,12 +398,8 @@ "collapsed": true, "input": [ "\n", - "\n", - "# insertObject() works for any class with\n", - "# EmcCollection<T> as public base class.\n", "def insertObject(c,element):\n", - " # throw (bad_alloc)\n", - " # return false if insertion fails, true otherwise\n", + " \n", " if (not c.isFull()):\n", " c.insert(element)\n", " return True\n", @@ -448,12 +443,6 @@ "input": [ "\n", "\n", - "# T must be: DefaultConstructible\n", - "# copyConstructible\n", - "# Assignable\n", - "# Destructible\n", - "# EqualityComparable\n", - "\n", "class EmcCollection:\n", " pass" ], @@ -479,11 +468,11 @@ " pass\n", "\n", " def templateRequirements(self):\n", - " # T must be:\n", + " \n", " t1 = T1()\n", - " # DefaultContructible\n", + " \n", " t2 =t1\n", - " # CopyConstructible\n", + "\n", " t2 = t1;\n", " # Assignable\n", " b = (t2 == t1); # EqualityComparable" diff --git a/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch11.ipynb b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch11.ipynb index a7fe619a..9dc6882e 100644 --- a/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch11.ipynb +++ b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch11.ipynb @@ -1,7 +1,7 @@ { "metadata": { "name": "", - "signature": "sha256:8fd9f65c8a3cbb619fe291dbff540345e03b3be12cb5c6908ed137d152dc018d" + "signature": "sha256:2e265a79f479b0afc28156201c75dda9d71f161b6acb07438df53ecda65f24e0" }, "nbformat": 3, "nbformat_minor": 0, @@ -48,7 +48,6 @@ "collapsed": true, "input": [ "\n", - "# Checked version\n", "class EmcString:\n", " def at(self,index):\n", " if (index >= self.lengthM):\n", diff --git a/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch12.ipynb b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch12.ipynb index d96329cd..a4d7907e 100644 --- a/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch12.ipynb +++ b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch12.ipynb @@ -1,7 +1,7 @@ { "metadata": { "name": "", - "signature": "sha256:de2e0bed7b67eb2329c8c600e57f29ce4e5a2c157d6a6ad64246d09e0189ed52" + "signature": "sha256:3fda869111a137bc83ae4b79f3c57ac84f247031c3e08ac7d6dfb9bb168b3105" }, "nbformat": 3, "nbformat_minor": 0, @@ -174,8 +174,7 @@ " ip = 1\n", " g(ip)\n", "\n", - "# Not recommended\n", - "# create int with new\n", + "\n", "def g(i):\n", " raise Exception(i)" ], @@ -201,8 +200,6 @@ " ip = 1\n", " g(ip)\n", "\n", - "# Not recommended\n", - "# create int with new\n", "def g(i):\n", " raise Exception(i)" ], @@ -287,8 +284,7 @@ "class EmcException:\n", " def __init__(self,m):\n", " pass\n", - " # EmcException objects can be printed\n", - "\n", + " \n", " def operator(self,o,EmcException):\n", " pass\n", "\n", diff --git a/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch13.ipynb b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch13.ipynb index 126df2ad..a23bdf0e 100644 --- a/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch13.ipynb +++ b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch13.ipynb @@ -1,7 +1,7 @@ { "metadata": { "name": "", - "signature": "sha256:bbeb97ae5d957eb9274ccf64bc1e7f46b7b45c306736856a8df6cdc589631d7d" + "signature": "sha256:121cbe714f8e854e8d9ce1fe8dcdc370535cc7140b2f83bdae09063602e644f9" }, "nbformat": 3, "nbformat_minor": 0, @@ -125,7 +125,7 @@ "collapsed": false, "input": [ "\n", - "#define SIZE 1024\n", + "\n", "SIZE = 1024;\n", "print SIZE" ], @@ -201,7 +201,6 @@ "collapsed": false, "input": [ "\n", - "# Not recommended to have function-like macro\n", "def SQUARE(x):\n", " return x*x\n", "\n", @@ -329,9 +328,7 @@ "input": [ "\n", "\n", - "# Fruit is a base class\n", "def printFruits(fruits,size):\n", - " # Not recommended to pass arrays to functions\n", " for i in range(size):\n", " print fruits[i] " ], diff --git a/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch15.ipynb b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch15.ipynb index 9ba32dd4..32ad5666 100644 --- a/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch15.ipynb +++ b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch15.ipynb @@ -1,7 +1,7 @@ { "metadata": { "name": "", - "signature": "sha256:7951193995e49370edf3fafb6d685d317214f33d43101f294ebf8961471bb078" + "signature": "sha256:24f5f3b754e3fd6e8afab7bcb99e41e817ec5bce9faae498ba9fb75dd53f93ff" }, "nbformat": 3, "nbformat_minor": 0, @@ -193,8 +193,7 @@ "input": [ "\n", "\n", - "import math\n", - "# import Math # does not work" + "import math\n" ], "language": "python", "metadata": {}, @@ -594,9 +593,7 @@ "i = 0\n", "a[i] = i;\n", "i += 1\n", - "print i \n", - "# NO: i may be incremented before or\n", - "# after its value is used on" + "print i \n" ], "language": "python", "metadata": {}, diff --git a/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch2.ipynb b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch2.ipynb index faabf783..8660012f 100644 --- a/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch2.ipynb +++ b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch2.ipynb @@ -1,7 +1,7 @@ { "metadata": { "name": "", - "signature": "sha256:47670c105df749836e80ebb95394825725c9958056aa9467a60adf31201b90cb" + "signature": "sha256:025b4c65298f5bb6d48b99d717b6d0fce940f5a97ad7eb75ea5897c4c9595891" }, "nbformat": 3, "nbformat_minor": 0, @@ -60,9 +60,7 @@ "cell_type": "code", "collapsed": false, "input": [ - "\n", - "\n", - "#import A \n", + " \n", "\n", "class X :\n", " def __init__(self):\n", diff --git a/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch3.ipynb b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch3.ipynb index dab765f1..ce027b4e 100644 --- a/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch3.ipynb +++ b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch3.ipynb @@ -1,7 +1,7 @@ { "metadata": { "name": "", - "signature": "sha256:ea79adc8d9da30a7f64270d4281f6f246d2c16fc489ed1f94a45b5b3b8be3491" + "signature": "sha256:dbc95d125151940c8402c8ffda427c3e959c7eb724b40434b79a3b03a164fff8" }, "nbformat": 3, "nbformat_minor": 0, @@ -94,13 +94,40 @@ { "metadata": {}, "output_type": "pyout", - "prompt_number": 4, + "prompt_number": 2, "text": [ "' No: this nesting of C-style comments will not work !!!\\nchar* cpM;\\nint lenM;\\n# A pointer to the characters\\n# The length of the character array \\n'" ] } ], - "prompt_number": 4 + "prompt_number": 2 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [], + "language": "python", + "metadata": {}, + "outputs": [], + "prompt_number": 1 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [], + "language": "python", + "metadata": {}, + "outputs": [], + "prompt_number": 1 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [], + "language": "python", + "metadata": {}, + "outputs": [], + "prompt_number": 1 }, { "cell_type": "code", diff --git a/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch5.ipynb b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch5.ipynb index c0f0e5a6..4e630070 100644 --- a/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch5.ipynb +++ b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch5.ipynb @@ -1,7 +1,7 @@ { "metadata": { "name": "", - "signature": "sha256:f452e228ccf497c46b256d665e9e2f574a49ac9ecca7f62127c2ea4d07013e6d" + "signature": "sha256:862ed788d417ee363a92882e2a970648b380a2f974a44d4fd4e62dfc3b0fcdf2" }, "nbformat": 3, "nbformat_minor": 0, @@ -51,8 +51,6 @@ "collapsed": false, "input": [ "\n", - "\n", - "# Not recommended\n", "string1 = \"hello\";\n", "string2 = \"hello\"; \n", "print string1, string2" @@ -142,9 +140,7 @@ "collapsed": false, "input": [ "\n", - "# Literal in definition of const,\n", "charMapSize = 256;\n", - "# but not to specify array size!\n", "for i in range(charMapSize):\n", " pass" ], diff --git a/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch6.ipynb b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch6.ipynb index a35d9ee7..3f83e4d0 100644 --- a/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch6.ipynb +++ b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch6.ipynb @@ -1,7 +1,7 @@ { "metadata": { "name": "", - "signature": "sha256:02be36ad85c7df4dace913f54f3ea199522926d07ecd14544c2024f6326359fd" + "signature": "sha256:7e4ca4515204ca5f28b7ad14f25998ad16f2910d212e32a1071b57e6d0d7e56b" }, "nbformat": 3, "nbformat_minor": 0, @@ -127,16 +127,15 @@ " pass\n", " \n", "def dynamicCast(b):\n", - " # Must use dynamic_cast when base class is virtual.\n", + " \n", " return D(b)\n", "\n", "def constCast(d1):\n", - " # Should use const_cast when casting away const.\n", + " \n", " return D(d1)\n", "\n", "def reinterpretCast(d):\n", - " # Should use reinterpret_cast when casting pointer\n", - " # to pointer of unrelated type.\n", + " \n", " return E(d)" ], "language": "python", @@ -184,12 +183,11 @@ "collapsed": false, "input": [ "\n", - "\n", - "# ci may be in write-protected memory\n", + " \n", "ci = 22;\n", "pi = ci # NO: Const cast away\n", "i = pi; # OK\n", - "# writing into write-protected memory?\n", + " \n", "pi = 7 \n", "print ci, pi, i " ], diff --git a/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch7.ipynb b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch7.ipynb index 753ae756..f8b112a8 100644 --- a/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch7.ipynb +++ b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch7.ipynb @@ -1,7 +1,7 @@ { "metadata": { "name": "", - "signature": "sha256:bef0a5b42b24e0648e81ec34d8c7331f906450b7163d1ed429e0503042ac5057" + "signature": "sha256:fbefe45753ab0203894f5afad5e792e20da756faab0edd14dfdedec2c8be513a" }, "nbformat": 3, "nbformat_minor": 0, @@ -677,8 +677,7 @@ "def f(x,y = 2):\n", " print x\n", " print y\n", - "#void f(int x = 1, int y); // NOT RECOMMENDED\n", - "\n", + " \n", "f(1)\n", "f(2,3)" ], diff --git a/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch8.ipynb b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch8.ipynb index 1449db62..657c42ba 100644 --- a/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch8.ipynb +++ b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch8.ipynb @@ -1,7 +1,7 @@ { "metadata": { "name": "", - "signature": "sha256:90db160243231bb1b3699a6dc0bde758daa5bf22473aeb4fd74b345857a46432" + "signature": "sha256:9aeef576f29f7c783f96768a664cb437cbd4922734a99612921a48bd58c127b5" }, "nbformat": 3, "nbformat_minor": 0, @@ -124,7 +124,7 @@ "\n", "maxSize = 100; # get storage for object\n", "storage = [] # call placement new to create object\n", - "#ap1 = A(); # A() class is not defined here." + " " ], "language": "python", "metadata": {}, |