summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xANSI_C_Programming/.ipynb_checkpoints/chapter12-checkpoint.ipynb1504
-rwxr-xr-xANSI_C_Programming/chapter12.ipynb56
-rwxr-xr-xA_Heat_Transfer_Text_Book/.ipynb_checkpoints/Chapter1-checkpoint.ipynb334
-rwxr-xr-xA_Heat_Transfer_Text_Book/.ipynb_checkpoints/Chapter11-checkpoint.ipynb631
-rwxr-xr-xA_Heat_Transfer_Text_Book/Chapter1.ipynb664
-rwxr-xr-xA_Heat_Transfer_Text_Book/Chapter11.ipynb1266
-rwxr-xr-xBeginning_C++_Through_Game_Programming/.ipynb_checkpoints/ch10-checkpoint.ipynb642
-rwxr-xr-xBeginning_C++_Through_Game_Programming/ch10.ipynb81
-rwxr-xr-xBeginning_C_By_Ivon_Horton/chapter13.ipynb10
-rwxr-xr-xC++_Demystified:_A_Self-Teaching_Guide/.ipynb_checkpoints/chapter13-checkpoint.ipynb412
-rwxr-xr-xC++_Demystified:_A_Self-Teaching_Guide/.ipynb_checkpoints/chapter5-checkpoint.ipynb488
-rwxr-xr-xC++_Demystified:_A_Self-Teaching_Guide/.ipynb_checkpoints/chapter9-checkpoint.ipynb1033
-rwxr-xr-xC++_Demystified:_A_Self-Teaching_Guide/chapter13.ipynb13
-rwxr-xr-xC++_Demystified:_A_Self-Teaching_Guide/chapter5.ipynb27
-rwxr-xr-xC++_Demystified:_A_Self-Teaching_Guide/chapter9.ipynb65
-rw-r--r--C++_Demystified:_A_Self-Teaching_Guide/students.dat0
-rwxr-xr-xC++_in_Action_-_Industrial-Strength_Programming_Techniques/.ipynb_checkpoints/ch1-checkpoint.ipynb261
-rwxr-xr-xC++_in_Action_-_Industrial-Strength_Programming_Techniques/.ipynb_checkpoints/ch10-checkpoint.ipynb490
-rwxr-xr-xC++_in_Action_-_Industrial-Strength_Programming_Techniques/.ipynb_checkpoints/ch12-checkpoint.ipynb355
-rwxr-xr-xC++_in_Action_-_Industrial-Strength_Programming_Techniques/.ipynb_checkpoints/ch13-checkpoint.ipynb350
-rwxr-xr-xC++_in_Action_-_Industrial-Strength_Programming_Techniques/.ipynb_checkpoints/ch15-checkpoint.ipynb611
-rwxr-xr-xC++_in_Action_-_Industrial-Strength_Programming_Techniques/.ipynb_checkpoints/ch2-checkpoint.ipynb249
-rwxr-xr-xC++_in_Action_-_Industrial-Strength_Programming_Techniques/ch1.ipynb39
-rwxr-xr-xC++_in_Action_-_Industrial-Strength_Programming_Techniques/ch10.ipynb67
-rwxr-xr-xC++_in_Action_-_Industrial-Strength_Programming_Techniques/ch12.ipynb22
-rwxr-xr-xC++_in_Action_-_Industrial-Strength_Programming_Techniques/ch13.ipynb18
-rwxr-xr-xC++_in_Action_-_Industrial-Strength_Programming_Techniques/ch15.ipynb38
-rwxr-xr-xC++_in_Action_-_Industrial-Strength_Programming_Techniques/ch2.ipynb19
-rwxr-xr-xEngineering_Physics_Vijaya/.ipynb_checkpoints/chapter2_2-checkpoint.ipynb814
-rwxr-xr-xEngineering_Physics_Vijaya/chapter2_2.ipynb17
-rwxr-xr-xHow_to_think_like_a_computer_scientist_by_Allen_B_Downey/ch15.ipynb135
-rwxr-xr-xMastering_C/.ipynb_checkpoints/chapter1-checkpoint.ipynb169
-rwxr-xr-xMastering_C/chapter1.ipynb13
-rwxr-xr-xPower_Electronics_by_P_S_Bimbhra/.ipynb_checkpoints/Chapter13_4-checkpoint.ipynb340
-rwxr-xr-xPower_Electronics_by_P_S_Bimbhra/Chapter13_4.ipynb680
-rwxr-xr-xPractical_C_Programming/.ipynb_checkpoints/Chapter_14_1-checkpoint.ipynb175
-rwxr-xr-xPractical_C_Programming/.ipynb_checkpoints/Chapter_15_1-checkpoint.ipynb351
-rwxr-xr-xPractical_C_Programming/Chapter_14_1.ipynb30
-rwxr-xr-xPractical_C_Programming/Chapter_15_1.ipynb72
-rw-r--r--Practical_C_Programming/numbers.dat1
-rw-r--r--Practical_C_Programming/numbers.dat~0
-rwxr-xr-xPrinciples_Of_Electronic_Communication_Systems_by_L_E_Frenze/chapter22.ipynb94
-rwxr-xr-xProgramming_With_Java_A_Primer/.ipynb_checkpoints/chapter13-checkpoint.ipynb266
-rwxr-xr-xProgramming_With_Java_A_Primer/chapter13.ipynb25
-rwxr-xr-xProgramming_With_Java_A_Primer/chapter17.ipynb10
-rwxr-xr-xProgramming_in_C/.ipynb_checkpoints/Chapter_16-checkpoint.ipynb294
-rwxr-xr-xProgramming_in_C/Chapter_16.ipynb26
-rwxr-xr-xSchaum's_Outline/README.txt (renamed from Schaum's_Outlines:_Programming_with_C++/README.txt)0
-rwxr-xr-xSchaum's_Outline/ch1.ipynb (renamed from Schaum's_Outlines:_Programming_with_C++/ch1.ipynb)0
-rwxr-xr-xSchaum's_Outline/ch10.ipynb (renamed from Schaum's_Outlines:_Programming_with_C++/ch10.ipynb)0
-rwxr-xr-xSchaum's_Outline/ch11.ipynb (renamed from Schaum's_Outlines:_Programming_with_C++/ch11.ipynb)0
-rwxr-xr-xSchaum's_Outline/ch12.ipynb (renamed from Schaum's_Outlines:_Programming_with_C++/ch12.ipynb)0
-rwxr-xr-xSchaum's_Outline/ch13.ipynb (renamed from Schaum's_Outlines:_Programming_with_C++/ch13.ipynb)0
-rwxr-xr-xSchaum's_Outline/ch14.ipynb (renamed from Schaum's_Outlines:_Programming_with_C++/ch14.ipynb)0
-rwxr-xr-xSchaum's_Outline/ch2.ipynb (renamed from Schaum's_Outlines:_Programming_with_C++/ch2.ipynb)0
-rwxr-xr-xSchaum's_Outline/ch3.ipynb (renamed from Schaum's_Outlines:_Programming_with_C++/ch3.ipynb)0
-rwxr-xr-xSchaum's_Outline/ch4.ipynb (renamed from Schaum's_Outlines:_Programming_with_C++/ch4.ipynb)0
-rwxr-xr-xSchaum's_Outline/ch5.ipynb (renamed from Schaum's_Outlines:_Programming_with_C++/ch5.ipynb)0
-rwxr-xr-xSchaum's_Outline/ch6.ipynb (renamed from Schaum's_Outlines:_Programming_with_C++/ch6.ipynb)0
-rwxr-xr-xSchaum's_Outline/ch7.ipynb (renamed from Schaum's_Outlines:_Programming_with_C++/ch7.ipynb)0
-rwxr-xr-xSchaum's_Outline/ch8.ipynb (renamed from Schaum's_Outlines:_Programming_with_C++/ch8.ipynb)0
-rwxr-xr-xSchaum's_Outline/ch9.ipynb (renamed from Schaum's_Outlines:_Programming_with_C++/ch9.ipynb)0
-rwxr-xr-xSchaum's_Outline/screenshots/ratio.png (renamed from Schaum's_Outlines:_Programming_with_C++/screenshots/ratio.png)bin46696 -> 46696 bytes
-rwxr-xr-xSchaum's_Outline/screenshots/swap.png (renamed from Schaum's_Outlines:_Programming_with_C++/screenshots/swap.png)bin37083 -> 37083 bytes
-rwxr-xr-xSchaum's_Outline/screenshots/vector.png (renamed from Schaum's_Outlines:_Programming_with_C++/screenshots/vector.png)bin40040 -> 40040 bytes
65 files changed, 11567 insertions, 1690 deletions
diff --git a/ANSI_C_Programming/.ipynb_checkpoints/chapter12-checkpoint.ipynb b/ANSI_C_Programming/.ipynb_checkpoints/chapter12-checkpoint.ipynb
new file mode 100755
index 00000000..59c2b543
--- /dev/null
+++ b/ANSI_C_Programming/.ipynb_checkpoints/chapter12-checkpoint.ipynb
@@ -0,0 +1,1504 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:a886cf212382fa732d2b3df088bbcba9a65ba4a31cbe899c80e912ac04c2747f"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER 12:FILE INPUT/OUTPUT"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:391"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ " \n",
+ "fp=open('PR1.txt','r') #open the file for reading\n",
+ "ch=fp.readlines() #ch will store all content of file\n",
+ "print \"%s\" % (' '.join(ch)) #prints content of file\n",
+ "print \"\\n\"\n",
+ "fp.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "site:http://www.bzu.edu.pk/\n",
+ " user:siteuser@localhost\n",
+ " version:5.5.32-0ubuntu0.12.04.1\n",
+ " db: bzu\n",
+ " tables:\n",
+ " username:web,webadmin,webadministrator23\n",
+ " pass:71dc9f7af599450b23a3b5d54bc665c7,\t49fa1a081c8d5c8dcfa05d730803251a,\t*E8665C4049F515D836A3C8704D0543C6DA0FE96D\n",
+ "\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:394"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ " \n",
+ "try:\n",
+ " fp=open('yoyo.txt','r')\n",
+ " for line in fin:\n",
+ " print line\n",
+ " fp.close()\n",
+ "except:\n",
+ " print 'cannot open file'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "cannot open file\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:395"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ " \n",
+ "nol=0\n",
+ "nom=0\n",
+ "nob=0\n",
+ "noc=0\n",
+ "fp=open('H4CK3R.txt','r')\n",
+ "while True:\n",
+ " ch=fp.read(1)\n",
+ " if not ch:\n",
+ " break\n",
+ " noc+=1\n",
+ " if ch==' ':\n",
+ " nob+=1\n",
+ " if ch=='\\n':\n",
+ " nol+=1\n",
+ " if ch=='\\t':\n",
+ " nom+=1\n",
+ "fp.close()\n",
+ "print \"\\n\"\n",
+ "fp.close()\n",
+ "print \"Number of characters=%d\\n\" % (noc)\n",
+ "print \"Number of blanks=%d\\n\" % (nob)\n",
+ "print \"Number of tabs=%d\\n\" % (nom)\n",
+ "print \"Number of lines=%d\\n\" % (nol)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "\n",
+ "Number of characters=162\n",
+ "\n",
+ "Number of blanks=21\n",
+ "\n",
+ "Number of tabs=3\n",
+ "\n",
+ "Number of lines=4\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:396-397"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ " \n",
+ "import sys\n",
+ "try:\n",
+ " fs=open('H4CK3R.txt','r')\n",
+ "except:\n",
+ " print \"Cannot open file\"\n",
+ " sys.exit(1)\n",
+ "try:\n",
+ " ft=open('python.txt','w')\n",
+ "except:\n",
+ " print \"Cannot open file\"\n",
+ " fs.close()\n",
+ " sys.exit(2)\n",
+ "ch=fs.readlines()\n",
+ "ft.writelines(ch)\n",
+ "fs.close()\n",
+ "ft.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "ename": "SystemExit",
+ "evalue": "1",
+ "output_type": "pyerr",
+ "traceback": [
+ "An exception has occurred, use %tb to see the full traceback.\n",
+ "\u001b[0;31mSystemExit\u001b[0m\u001b[0;31m:\u001b[0m 1\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Cannot open file\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stderr",
+ "text": [
+ "To exit: use 'exit', 'quit', or Ctrl-D.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:399"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ " \n",
+ "try:\n",
+ " fp=open('POEM.txt','w')\n",
+ "except:\n",
+ " print 'cannot open file'\n",
+ "print \"\\nEnter a few lines of text:\\n\"\n",
+ "s=' '\n",
+ "while (len(s)>0):\n",
+ " s=raw_input()\n",
+ " fp.writelines(s)\n",
+ " fp.writelines(\"\\n\")\n",
+ "fp.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter a few lines of text:\n",
+ "\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Shining and bright,they are forever,\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "so true about diamonds,\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "more so of memories,\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "especially yours!\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:400"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ " \n",
+ "try:\n",
+ " fp=open('POEM.txt','r')\n",
+ "except:\n",
+ " print 'cannot open file'\n",
+ "s=fp.read(99)\n",
+ "print \"%s\" % (s)\n",
+ "print \"\\n\"\n",
+ "fp.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Shining and bright,they are forever,\n",
+ "so true about diamonds,\n",
+ "more so of memories,\n",
+ "especially yours!\n",
+ "\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:401-402"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ " \n",
+ "class emp():\n",
+ " def __init__(self,**kwds):\n",
+ " self.__dict__.update(kwds)\n",
+ "another='Y'\n",
+ "e=emp()\n",
+ "try:\n",
+ " fp=open('EMPLOYEE.txt','w')\n",
+ "except:\n",
+ " print 'cannot open file'\n",
+ "while another=='Y':\n",
+ " print \"\\nEnter name,age and basic salary:\"\n",
+ " e.name=raw_input()\n",
+ " e.age=eval(raw_input())\n",
+ " e.bs=eval(raw_input())\n",
+ " ch=\"%s %d %f\" % (e.name,e.age,e.bs)\n",
+ " fp.writelines(ch)\n",
+ " fp.writelines(\"\\n\")\n",
+ " print \"Add another record(Y/N)\"\n",
+ " another=raw_input()\n",
+ "fp.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter name,age and basic salary:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sunil\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "34\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1250.50\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Add another record(Y/N)\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Y\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter name,age and basic salary:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sameer\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "21\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1300.50\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Add another record(Y/N)\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Y\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter name,age and basic salary:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rahul\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "34\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1400.55\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Add another record(Y/N)\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "n\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:403-404"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ " \n",
+ "class emp():\n",
+ " def __init__(self,**kwds):\n",
+ " self.__dict__.update(kwds)\n",
+ "e=emp()\n",
+ "try:\n",
+ " fp=open('EMPLOYEE.txt','r') # open the file for reading\n",
+ "except:\n",
+ " print 'cannot open file'\n",
+ "for line in fp: # iterate over each line\n",
+ " e.name, e.age, e.bs = line.split() # split it by whitespace\n",
+ " e.age = int(e.age) # convert age from string to int\n",
+ " e.bs = float(e.bs) # convert bs from string to float\n",
+ " print \"%s %d %f\\n\" %(e.name, e.age, e.bs)\n",
+ "fp.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sunil 34 1250.500000\n",
+ "\n",
+ "Sameer 21 1300.500000\n",
+ "\n",
+ "Rahul 34 1400.550000\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:404-405"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ " \n",
+ "import sys #for exit()\n",
+ "try:\n",
+ " fs=open('H4CK3R.txt','rb') # open the file for reading\n",
+ "except:\n",
+ " print 'cannot open file'\n",
+ " sys.exit(1)\n",
+ "try:\n",
+ " ft=open('python.txt','wb') # open the file for writing\n",
+ "except:\n",
+ " print 'cannot open file'\n",
+ " fs.close()\n",
+ " sys.exit(2)\n",
+ "ch=fs.readlines()\n",
+ "ft.writelines(ch)\n",
+ "fs.close()\n",
+ "ft.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "ename": "SystemExit",
+ "evalue": "1",
+ "output_type": "pyerr",
+ "traceback": [
+ "An exception has occurred, use %tb to see the full traceback.\n",
+ "\u001b[0;31mSystemExit\u001b[0m\u001b[0;31m:\u001b[0m 1\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "cannot open file\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stderr",
+ "text": [
+ "To exit: use 'exit', 'quit', or Ctrl-D.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:407-408"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ " \n",
+ "class emp():\n",
+ " def __init__(self,**kwds):\n",
+ " self.__dict__.update(kwds)\n",
+ "another='Y'\n",
+ "e=emp()\n",
+ "try:\n",
+ " fp=open('EMP.txt','wb') # open the file for reading\n",
+ "except:\n",
+ " print 'cannot open file' \n",
+ "while another=='Y':\n",
+ " print \"\\nEnter name,age and basic salary:\"\n",
+ " e.name=raw_input()\n",
+ " e.age=eval(raw_input())\n",
+ " e.bs=eval(raw_input())\n",
+ " ch=\"%s %d %f\" % (e.name,e.age,e.bs)\n",
+ " fp.writelines(ch)\n",
+ " print \"Add another record (Y/N)\"\n",
+ " another=raw_input()\n",
+ " if another=='Y':\n",
+ " fp.writelines(\"\\n\")\n",
+ "fp.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter name,age and basic salary:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Suresh\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "24\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1250.50\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Add another record (Y/N)\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Y\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter name,age and basic salary:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Ranjan\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "21\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1300.60\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Add another record (Y/N)\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Y\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter name,age and basic salary:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Harish\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "28\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1400.70\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Add another record (Y/N)\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "N\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:409"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ " \n",
+ "class emp():\n",
+ " def __init__(self,**kwds):\n",
+ " self.__dict__.update(kwds)\n",
+ "e=emp()\n",
+ "try:\n",
+ " fp=open('EMP.txt','rb')\n",
+ "except:\n",
+ " print \"Cannot open file\"\n",
+ "for line in fp:\n",
+ " e.name, e.age, e.bs = line.split() # split it by whitespace\n",
+ " e.age = int(e.age) # convert age from string to int\n",
+ " e.bs = float(e.bs) # convert bs from string to float\n",
+ " print \"%s %d %f\\n\" %(e.name, e.age, e.bs)\n",
+ "fp.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Suresh 24 1250.500000\n",
+ "\n",
+ "Ranjan 21 1300.600000\n",
+ "\n",
+ "Harish 28 1400.700000\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:411-414"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ " \n",
+ "class emp():\n",
+ " def __init__(self,**kwds):\n",
+ " self.__dict__.update(kwds)\n",
+ "e=emp()\n",
+ "try:\n",
+ " fp=open('EMP.txt','rb+') # open the file for reading\n",
+ "except:\n",
+ " try:\n",
+ " fp=open('EMP.txt','wb+') # open the file for writing\n",
+ " except:\n",
+ " print 'cannot open file'\n",
+ "while 1:\n",
+ " print \"1.Add Records\"\n",
+ " print \"2.List Records\"\n",
+ " print \"3.Modify Records\"\n",
+ " print \"4.Delete Records\"\n",
+ " print \"0.Exit\"\n",
+ " print \"Your choice\"\n",
+ " choice=eval(raw_input())\n",
+ " def add():\n",
+ " import os\n",
+ " fp.seek(0,os.SEEK_END)\n",
+ " another='Y'\n",
+ " while another=='Y':\n",
+ " print \"\\nEnter name,age and basic salary:\"\n",
+ " e.name=raw_input()\n",
+ " e.age=eval(raw_input())\n",
+ " e.bs=eval(raw_input())\n",
+ " ch=\"%s %d %f\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\" % (e.name,e.age,e.bs)\n",
+ " fp.writelines(\"\\n\")\n",
+ " fp.writelines(ch)\n",
+ " print \"Add another record(Y/N)\"\n",
+ " another=raw_input()\n",
+ " def list():\n",
+ " import os\n",
+ " fp.seek(0,os.SEEK_SET)\n",
+ " for line in fp: # iterate over each line\n",
+ " if len(line)>10:\n",
+ " e.name, e.age, e.bs = line.split() # split it by whitespace\n",
+ " e.age = int(e.age) # convert age from string to int\n",
+ " e.bs = float(e.bs) # convert bs from string to float\n",
+ " print \"%s %d %f\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\" %(e.name, e.age, e.bs)\n",
+ " def modify():\n",
+ " another='Y'\n",
+ " while another=='Y':\n",
+ " print \"\\nEnter name of employee to modify\"\n",
+ " empname=raw_input()\n",
+ " import os\n",
+ " fp.seek(0,os.SEEK_SET)\n",
+ " for line in iter(fp.readline, ''):\n",
+ " if len(line)>10:\n",
+ " e.name, e.age, e.bs=line.split()\n",
+ " e.age = int(e.age) # convert age from string to int\n",
+ " e.bs = float(e.bs)\n",
+ " if(cmp(e.name,empname)==0):\n",
+ " c=len(line)\n",
+ " print \"\\nEnter new name,age & bs\"\n",
+ " e.name=raw_input()\n",
+ " e.age=eval(raw_input())\n",
+ " e.bs=eval(raw_input())\n",
+ " import os\n",
+ " fp.seek(-c,os.SEEK_CUR)\n",
+ " ch=\"%s %d %f\" % (e.name,e.age,e.bs)\n",
+ " fp.writelines(\"\\n\")\n",
+ " fp.writelines(ch)\n",
+ " fp.writelines(\"\\n\")\n",
+ " break\n",
+ " print \"\\nModify another Record(Y/N)\"\n",
+ " another=raw_input()\n",
+ " def delete():\n",
+ " another='Y'\n",
+ " global fp\n",
+ " while another=='Y':\n",
+ " print \"\\nEnter name of employee to delete\"\n",
+ " empname=raw_input()\n",
+ " ft=open('TEMP.txt','wb')\n",
+ " import os\n",
+ " fp.seek(0,os.SEEK_SET)\n",
+ " for line in fp:\n",
+ " if len(line)>10:\n",
+ " e.name, e.age, e.bs=line.split()\n",
+ " e.age = int(e.age) # convert age from string to int\n",
+ " e.bs = float(e.bs)\n",
+ " if(cmp(e.name,empname)!=0):\n",
+ " ch=\"%s %d %f\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\" % (e.name,e.age,e.bs)\n",
+ " ft.writelines(ch)\n",
+ " ft.writelines(\"\\n\")\n",
+ " fp.close()\n",
+ " ft.close()\n",
+ " import os\n",
+ " os.remove(\"EMP.txt\") # Delete file EMP.txt\n",
+ " os.rename( \"TEMP.txt\", \"D:/EMP.txt\" ) # Rename a file from TEMP.txt to EMP.txt\n",
+ " fp=open('EMP.txt','rb+')\n",
+ " print \"Delete another record(Y/N)\"\n",
+ " another=raw_input()\n",
+ " def exit():\n",
+ " import sys\n",
+ " fp.close()\n",
+ " sys.exit(0)\n",
+ " def switch(c):\n",
+ " return {1: add,\n",
+ " 2: list,\n",
+ " 3: modify,\n",
+ " 4: delete,\n",
+ " 0: exit,\n",
+ " }[c]()\n",
+ " switch(choice)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1.Add Records\n",
+ "2.List Records\n",
+ "3.Modify Records\n",
+ "4.Delete Records\n",
+ "0.Exit\n",
+ "Your choice\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Suresh 24 1250.500000\t\t\t\t\t\t\t\t\t\t\n",
+ "Ranjan 21 1300.600000\t\t\t\t\t\t\t\t\t\t\n",
+ "Harish 28 1400.700000\t\t\t\t\t\t\t\t\t\t\n",
+ "1.Add Records\n",
+ "2.List Records\n",
+ "3.Modify Records\n",
+ "4.Delete Records\n",
+ "0.Exit\n",
+ "Your choice\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter name,age and basic salary:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Ram\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "20\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5000\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Add another record(Y/N)\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Y\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter name,age and basic salary:\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "GOPAL\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "19\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6755.5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Add another record(Y/N)\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "N\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1.Add Records\n",
+ "2.List Records\n",
+ "3.Modify Records\n",
+ "4.Delete Records\n",
+ "0.Exit\n",
+ "Your choice\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Suresh 24 1250.500000\t\t\t\t\t\t\t\t\t\t\n",
+ "Ranjan 21 1300.600000\t\t\t\t\t\t\t\t\t\t\n",
+ "Harish 28 1400.700000\t\t\t\t\t\t\t\t\t\t\n",
+ "Ram 20 5000.000000\t\t\t\t\t\t\t\t\t\t\n",
+ "GOPAL 19 6755.500000\t\t\t\t\t\t\t\t\t\t\n",
+ "1.Add Records\n",
+ "2.List Records\n",
+ "3.Modify Records\n",
+ "4.Delete Records\n",
+ "0.Exit\n",
+ "Your choice\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter name of employee to modify\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Ram\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter new name,age & bs\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Radhey\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "15\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4687.66\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Modify another Record(Y/N)\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "N\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1.Add Records\n",
+ "2.List Records\n",
+ "3.Modify Records\n",
+ "4.Delete Records\n",
+ "0.Exit\n",
+ "Your choice\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Suresh 24 1250.500000\t\t\t\t\t\t\t\t\t\t\n",
+ "Ranjan 21 1300.600000\t\t\t\t\t\t\t\t\t\t\n",
+ "Harish 28 1400.700000\t\t\t\t\t\t\t\t\t\t\n",
+ "Radhey 15 4687.660000\t\t\t\t\t\t\t\t\t\t\n",
+ "GOPAL 19 6755.500000\t\t\t\t\t\t\t\t\t\t\n",
+ "1.Add Records\n",
+ "2.List Records\n",
+ "3.Modify Records\n",
+ "4.Delete Records\n",
+ "0.Exit\n",
+ "Your choice\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter name of employee to delete\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Radhey\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Delete another record(Y/N)\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "N\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1.Add Records\n",
+ "2.List Records\n",
+ "3.Modify Records\n",
+ "4.Delete Records\n",
+ "0.Exit\n",
+ "Your choice\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Suresh 24 1250.500000\t\t\t\t\t\t\t\t\t\t\n",
+ "Ranjan 21 1300.600000\t\t\t\t\t\t\t\t\t\t\n",
+ "Harish 28 1400.700000\t\t\t\t\t\t\t\t\t\t\n",
+ "GOPAL 19 6755.500000\t\t\t\t\t\t\t\t\t\t\n",
+ "1.Add Records\n",
+ "2.List Records\n",
+ "3.Modify Records\n",
+ "4.Delete Records\n",
+ "0.Exit\n",
+ "Your choice\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter name of employee to delete\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "GOPAL\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Delete another record(Y/N)\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "N\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1.Add Records\n",
+ "2.List Records\n",
+ "3.Modify Records\n",
+ "4.Delete Records\n",
+ "0.Exit\n",
+ "Your choice\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Suresh 24 1250.500000\t\t\t\t\t\t\t\t\t\t\n",
+ "Ranjan 21 1300.600000\t\t\t\t\t\t\t\t\t\t\n",
+ "Harish 28 1400.700000\t\t\t\t\t\t\t\t\t\t\n",
+ "1.Add Records\n",
+ "2.List Records\n",
+ "3.Modify Records\n",
+ "4.Delete Records\n",
+ "0.Exit\n",
+ "Your choice\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0\n"
+ ]
+ },
+ {
+ "ename": "SystemExit",
+ "evalue": "0",
+ "output_type": "pyerr",
+ "traceback": [
+ "An exception has occurred, use %tb to see the full traceback.\n",
+ "\u001b[1;31mSystemExit\u001b[0m\u001b[1;31m:\u001b[0m 0\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stderr",
+ "text": [
+ "To exit: use 'exit', 'quit', or Ctrl-D.\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE ON PAGE:416-417"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ " \n",
+ "from StringIO import StringIO\n",
+ "buffer = StringIO()\n",
+ "print \"\\nEnter source file name\"\n",
+ "source=raw_input()\n",
+ "try:\n",
+ " inhandle=open(source,'rb')\n",
+ "except:\n",
+ " print \"Cannot open file\"\n",
+ "print \"Enter target file name\"\n",
+ "target=raw_input()\n",
+ "try:\n",
+ " outhandle=open(target,'wb')\n",
+ "except:\n",
+ " print \"Cannot open file\"\n",
+ " inhandle.close()\n",
+ "bytes=inhandle.readlines()\n",
+ "buffer.write(bytes)\n",
+ "outhandle.writelines(buffer.getvalue())\n",
+ "buffer.close()\n",
+ "inhandle.close()\n",
+ "outhandle.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Enter source file name\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "H4CK3R.txt\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter target file name\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "python.txt\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/ANSI_C_Programming/chapter12.ipynb b/ANSI_C_Programming/chapter12.ipynb
index 8bab1a13..59c2b543 100755
--- a/ANSI_C_Programming/chapter12.ipynb
+++ b/ANSI_C_Programming/chapter12.ipynb
@@ -181,8 +181,32 @@
],
"language": "python",
"metadata": {},
- "outputs": [],
- "prompt_number": 13
+ "outputs": [
+ {
+ "ename": "SystemExit",
+ "evalue": "1",
+ "output_type": "pyerr",
+ "traceback": [
+ "An exception has occurred, use %tb to see the full traceback.\n",
+ "\u001b[0;31mSystemExit\u001b[0m\u001b[0;31m:\u001b[0m 1\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Cannot open file\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stderr",
+ "text": [
+ "To exit: use 'exit', 'quit', or Ctrl-D.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
},
{
"cell_type": "heading",
@@ -563,8 +587,32 @@
],
"language": "python",
"metadata": {},
- "outputs": [],
- "prompt_number": 20
+ "outputs": [
+ {
+ "ename": "SystemExit",
+ "evalue": "1",
+ "output_type": "pyerr",
+ "traceback": [
+ "An exception has occurred, use %tb to see the full traceback.\n",
+ "\u001b[0;31mSystemExit\u001b[0m\u001b[0;31m:\u001b[0m 1\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "cannot open file\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stderr",
+ "text": [
+ "To exit: use 'exit', 'quit', or Ctrl-D.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
},
{
"cell_type": "heading",
diff --git a/A_Heat_Transfer_Text_Book/.ipynb_checkpoints/Chapter1-checkpoint.ipynb b/A_Heat_Transfer_Text_Book/.ipynb_checkpoints/Chapter1-checkpoint.ipynb
new file mode 100755
index 00000000..dd1cacc1
--- /dev/null
+++ b/A_Heat_Transfer_Text_Book/.ipynb_checkpoints/Chapter1-checkpoint.ipynb
@@ -0,0 +1,334 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 1 - \"Introduction\""
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.1, Page number: 13"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "import math\n",
+ "\n",
+ "#Variables\n",
+ "k=35; #Thermal Conductivity, [W/m*K]\n",
+ "T1=110 # Temperature of front[C]\n",
+ "T2=50; # Temperature of back,[C]\n",
+ "A=0.4 #area of slab,[m**2]\n",
+ "x=0.03; #Thickness of slab,[m]\n",
+ "\n",
+ "#Calculations\n",
+ "q=-k*(T2-T1)/(1000*x); #formula for heat flux[KW/m^2]\n",
+ "Q=q*A; #formula for heat transfer rate[KW]\n",
+ "\n",
+ "#Results\n",
+ "print \"Heat flux is:\",q,\"KW/m^2\\n\"\n",
+ "print \"Heat transfer rate is:\",Q,\"KW \\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat flux is: 70.0 KW/m^2\n",
+ "\n",
+ "Heat transfer rate is: 28.0 KW \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.2, Page number: 16"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "import math\n",
+ "from sympy import solve,symbols\n",
+ "\n",
+ "#Variables\n",
+ "x=symbols('x');\n",
+ "k1=372; # Thermal Conductivity of slab,W/m*K\n",
+ "x1=0.003; # Thickness of slab,m\n",
+ "x2=0.002 # Thickness of steel,m\n",
+ "k2=17; # Thermal Conductivity of steel,W/m*K\n",
+ "T1=400; # Temperature on one side,C\n",
+ "T2=100 #Temperature on other side,C\n",
+ "\n",
+ "#Calculations\n",
+ "Tcu=solve(x+2*x*(k1/x1)*(x2/k2)-(T1-T2),x);\n",
+ "#q=k1*(Tcu/x1)=k2*(Tss/x2);\n",
+ "Tss = Tcu[0]*(k1/x1)*(x2/k2); # formula for temperature gradient in steel side\n",
+ "Tcul=T1-Tss;\n",
+ "Tcur=T2+Tss;\n",
+ "q=k2*Tss/(1000*x2); # formula for heat conducted, kW\\m^2\n",
+ "\n",
+ "#Results\n",
+ "print \"Temperature on left copper side is :\",round(Tcul,3),\"C\\n\"\n",
+ "print \"Temperature on right copper side is :\",round(Tcur,3),\"C\\n\"\n",
+ "print \"Heat conducted through the wall is :\",round(q,3),\"kW\\m^2\\n\"\n",
+ "print \"Our initial approximation was accurate within a few percent.\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature on left copper side is : 254.971 C\n",
+ "\n",
+ "Temperature on right copper side is : 245.029 C\n",
+ "\n",
+ "Heat conducted through the wall is : 1232.749 kW\\m^2\n",
+ "\n",
+ "Our initial approximation was accurate within a few percent.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.3, Page number: 22"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "import math\n",
+ "\n",
+ "#Variables\n",
+ "q1=6000; #Heat flux, W*m**-2\n",
+ "T1=120; #Heater Temperature, C\n",
+ "T2=70; #final Temperature of Heater, C\n",
+ "q2=2000; #final heat flux, W*m**-2\n",
+ "\n",
+ "#Calculations\n",
+ "h=q1/(T1-T2) #formula for average heat transfer cofficient\n",
+ "Tnew=T2+q2/h; #formula for new Heater temperature, C\n",
+ "\n",
+ "#Results\n",
+ "print \"Average Heat transfer coefficient is:\",h,\"W/(m^2*K)\\n\"\n",
+ "print \"New Heater Temperature is:\",round(Tnew,3),\"C\\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Average Heat transfer coefficient is: 120.0 W/(m^2*K)\n",
+ "\n",
+ "New Heater Temperature is: 86.667 C\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.4, Page number: 25"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "import math\n",
+ "from numpy import array\n",
+ "from numpy import linspace\n",
+ "import matplotlib.pyplot as plt\n",
+ "from pylab import *\n",
+ "%matplotlib inline\n",
+ "\n",
+ "#Variables\n",
+ "h=250; #Heat Transfer Coefficient, W/(m**2*K)\n",
+ "k=45; #Thermal Conductivity, W/(m*K)\n",
+ "c=180; #Heat Capacity, J/(kg*K)\n",
+ "a=9300; #density, kg/m**3\n",
+ "T1=200; #temperature, C\n",
+ "D=0.001; #diameter of bead, m\n",
+ "t1=linspace(0,5,50); #defining time interval of 0.1 seconds\n",
+ "T=linspace(0,5,50);\n",
+ "i=0;\n",
+ "\n",
+ "#Calculations\n",
+ "while i<50:\n",
+ " T[i]=T1-c*math.exp(-t1[i]/((a*c*D)/(6*h))); #Calculating temperature at each time in degree C\n",
+ " i=i+1;\n",
+ "\n",
+ "plt.plot(t1,T);\n",
+ "plt.xlabel(\"Time(in sec)\");\n",
+ "plt.ylabel(\"Temperature(in degree C)\");\n",
+ "plt.title(\"Thermocouple response to a hot gas flow\");\n",
+ "plt.show();\n",
+ "\n",
+ "Bi = h*(D/2)/k; #biot no.\n",
+ "\n",
+ "#Results\n",
+ "print \"The value of Biot no for this thermocouple is\",round(Bi,5);\n",
+ "print \"Bi is <0.1 and hence the thermocouple could be considered as a lumped heat capacity system and the assumption taken is valid.\\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYQAAAEZCAYAAACXRVJOAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3X1cjff/wPFXKgwphZNKMkVyM4Xcc9wUNsyYyEZjbPvZ\nfM2278zu3G30ta/5MmzfbYzZd9Nu1WxrmIoxcjs3ITeVlNyllKI6fX5/XHMmusOp0837+Xhcj3PO\ndc51Xe9zyfU+1+fWQimlEEIIUe3VMHcAQgghKgZJCEIIIQBJCEIIIf4iCUEIIQQgCUEIIcRfJCEI\nIYQAJCGYxezZsxk3bpy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NG3bs2FHo9vn5\n+YWuL2xft5sxYwZDhgzhp59+okePHvz6668AzJw5k2eeeabAZ5ctW1bkuP5KqWo9eJswLSkyEtVS\nadpStGrViosXL7Jz505Am3shJiYGgGbNmhnrE+7FqVOnaNOmDa+++iqdO3fm+PHjDBw4kFWrVhnr\nE5KSkrh48SL9+vXjm2++ITU1FcD4CNoop25ubvcchxC3kjsEUeXd/AVtYWFR6PNbP3Pra2tra779\n9lv+8Y9/kJ6eTl5eHtOnT8fLy4uePXuyZ88eRo4cWeTxCjvOTUuWLCEiIoIaNWrQtm1bBg8ejLW1\nNXGXrBYAAACgSURBVEePHqVbt26AVmn8xRdf4OXlxRtvvEGfPn2wtLTEx8eHVatWAdp84//+97/v\n8wwJoZFmp0Lcg8zMTPr27cvu3bvNFsPVq1fp37+/WWMQVYsUGQlxD+rVq0ffvn2JiIgwWwyrV69m\n2rRpZju+qHrkDkEIIQQgdwhCCCH+IglBCCEEIAlBCCHEXyQhCCGEACQhCCGE+IskBCGEEAD8P7U0\n9aVlLh5rAAAAAElFTkSuQmCC\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x7fbd3da5b8d0>"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of Biot no for this thermocouple is 0.00278\n",
+ "Bi is <0.1 and hence the thermocouple could be considered as a lumped heat capacity system and the assumption taken is valid.\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.5, Page number: 32"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "import math\n",
+ "from sympy import solve,symbols\n",
+ "\n",
+ "#Variables\n",
+ "x=symbols('x');\n",
+ "T1=293; #Temperature of air around thermocouple, K\n",
+ "T2=373; #Wall temperature, K\n",
+ "h=75; #Average Heat Transfer Coefficient, W/(m**2*K)\n",
+ "s=5.67*10**-8; #stefan Boltzman constant, W/(m**2*K**4)\n",
+ "\n",
+ "#Calculations\n",
+ "x=solve((h*(x-T1)+s*(x**4-T2**4)),x);\t #Calculating Thermocouple Temperature, K\n",
+ "y=x[1]-273;\t\t\t\t #Thermocouple Temperature, C\n",
+ "\n",
+ "#Results\n",
+ "print \"Thermocouple Temperature is :\",round(y,3),\"C\\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Thermocouple Temperature is : 28.395 C\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.6, Page number: 34"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "import math\n",
+ "from sympy import solve,symbols\n",
+ "\n",
+ "#Variables\n",
+ "x=symbols('x');\n",
+ "e=0.4; #emissivity\n",
+ "T1=293; #Temperature of air around Thermocouple, K\n",
+ "T2=273; #wall Temperature, K\n",
+ "h=75; #Average Heat Transfer Coefficient, W/(m**2*K)\n",
+ "s=5.6704*10**-8; #stefan Boltzman constant, W/(m**2*K**4)\n",
+ "\n",
+ "#Calculations\n",
+ "z=solve(((s*e*((373)**4 - (x)**4)) - h*(x-293)),x);\t#Calculating Thermocouple Temperature, K\n",
+ "y=z[0]-273;\t\t\t\t\t #Thermocouple Temperature, C\n",
+ "\n",
+ "'''NOTE: Equation written is absolutely correct and solving this equation\n",
+ " should give real result as: 296.112 i.e. 23.112 C, but somehow python is giving wrong result.'''\n",
+ "\n",
+ "#Results\n",
+ "print \"Thermocouple Temperature is :\",round(y,1),\"C \\n\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Thermocouple Temperature is : 25.9 C \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/A_Heat_Transfer_Text_Book/.ipynb_checkpoints/Chapter11-checkpoint.ipynb b/A_Heat_Transfer_Text_Book/.ipynb_checkpoints/Chapter11-checkpoint.ipynb
new file mode 100755
index 00000000..cec52317
--- /dev/null
+++ b/A_Heat_Transfer_Text_Book/.ipynb_checkpoints/Chapter11-checkpoint.ipynb
@@ -0,0 +1,631 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 11: An introduction to mass transfer"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 11.1, Page number:603"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "\n",
+ "#Variables\n",
+ "Mn2=0.7556; #mass fraction of nitrogen\n",
+ "Mo2=0.2315; #mass fraction of oxygen\n",
+ "Mar=0.01289; #mass fraction of argon gas\n",
+ "M1=28.02; #molar mass of N2,kg/kmol\n",
+ "M2=32; #molar mass of O2,kg/kmol\n",
+ "M3=39.95 ; #molar mass of Ar,kg/kmol\n",
+ "p=101325; #Atmospheric pressure in Pascal(Pa)\n",
+ "R=8314.5; #Gas constant, J/kmol-K\n",
+ "T=300; #Approximate room temperature, K\n",
+ "\n",
+ "#Calculations\n",
+ "Mair=(Mn2/M1+Mo2/M2+Mar/M3)**-1; #molar mass of air,kg/kmol\n",
+ "Xo2=Mo2*Mair/M2; #mole fraction of O2\n",
+ "PO2=Xo2*p; #partial pressure of O2,Pa\n",
+ "Co2=PO2/(R*T); #molar volume of O2,kmol/m**3\n",
+ "ao2=Co2*M2; #density of O2,kg/m**3\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print \"Mole fraction of O2 is :\",round(Xo2,4),\"\\n\"\n",
+ "print \"Partial pressure of O2 is :\",round(PO2,4),\"\\n\"\n",
+ "print \"Molar volume of O2 is :\",round(Co2,4),\" kmol/m^3\\n\"\n",
+ "print \"Density of O2 is :\",round(ao2,4),\" kg/m^3\\n\"\n",
+ " #end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mole fraction of O2 is : 0.2095 \n",
+ "\n",
+ "Partial pressure of O2 is : 21232.5938 \n",
+ "\n",
+ "Molar volume of O2 is : 0.0085 kmol/m^3\n",
+ "\n",
+ "Density of O2 is : 0.2724 kg/m^3\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 11.2, Page number: 606"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "\n",
+ "#Variables\n",
+ "r=0.00241; #rate of consumption of carbon,kg/(m**2*s)\n",
+ "Mo2=0.2; #concentration of oxygen at surface s\n",
+ "Mco2=0.052; #concentration of CO2 at surface s\n",
+ "sd=0.29; #density of surface s,kg/m**3\n",
+ "\n",
+ "#since carbon flows through a second imaginary surface u, the mass fluxes are relatedd by Ncu=-12/32*No2s=12/44*Nco2s\n",
+ "#the minus sign arises because the O2 flow is opposite the C and CO2 flows.in steady state if we apply mass conservation to the control volume between the u and s surface, wee find that the total mass flux entering the u surface equals that leaving the s surface\n",
+ "Ncu=r; #mass fluxes of carbon in u surface,kg/m**2/s\n",
+ "\n",
+ "#Calculations\n",
+ "No2s=-32/12*Ncu; #mass flux of O2 in surface s,kg/(m**2*s)\n",
+ "Nco2s=44/12*Ncu; #mass flux of CO2 in surface s,kg/(m**2*s)\n",
+ "Vo2s=No2s/(Mo2*sd); #mass average speed,m/s\n",
+ "Vco2s=Nco2s/(sd); #mass average speed,m/s\n",
+ "Vs=(Nco2s+No2s)/sd; #effective mass average speed,m/s\n",
+ "j1=sd*Mo2*(Vo2s-Vs); #diffusional mass flux,kg/(m**2*s)\n",
+ "j2=sd*Mco2*(Vco2s-Vs); #diffusional mass flux,kg/(m**2*s)\n",
+ "#the diffusional mass fluxes are very nearly equal to the species m ss fluxes. tha is because the mass average speed is much less than species speeds.\n",
+ "\n",
+ "N1 = Ncu/12; #mole flux of carbon through the surface s,kmol/(m**2*s)\n",
+ "N2 = -N1; #mole flux of oxygen through the surface s,kmol/(m**2*s)\n",
+ "\n",
+ "#Result\n",
+ "print \"Mass flux of O2 through an imaginary surface is :\",round(j1,5),\"kg/(m^2*s)\\n\"\n",
+ "print \"Mass flux of CO2 through an imaginary surface is :\",round(j2,5),\"kg/(m^2*s)\\n\"\n",
+ "\n",
+ "print \"Mole flux of Co2 through an imaginary surface is :\",round(N1,5),\"kmol/(m^2*s)\\n\"\n",
+ "print \"Mole flux of O2through an imaginary surface is :\",round(N2,5),\"kmol/(m^2*s)\\n\"\n",
+ "print \"The two diffusional mole fluxes sum to zero themselves because ther is no convective mole flux for other species to diffuse against. the reader may find the velocity of the interface.that calculation shows the interface to be receding so slowly that the velocities are equal to those that would be seen by a stationary observer.\"\n",
+ " #end\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mass flux of O2 through an imaginary surface is : -0.00691 kg/(m^2*s)\n",
+ "\n",
+ "Mass flux of CO2 through an imaginary surface is : 0.00033 kg/(m^2*s)\n",
+ "\n",
+ "Mole flux of Co2 through an imaginary surface is : 0.0002 kmol/(m^2*s)\n",
+ "\n",
+ "Mole flux of O2through an imaginary surface is : -0.0002 kmol/(m^2*s)\n",
+ "\n",
+ "The two diffusional mole fluxes sum to zero themselves because ther is no convective mole flux for other species to diffuse against. the reader may find the velocity of the interface.that calculation shows the interface to be receding so slowly that the velocities are equal to those that would be seen by a stationary observer.\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 11.3, Page number: 617"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "import math\n",
+ "\n",
+ "#Variables\n",
+ "T1=276; #temp.of air,K\n",
+ "aa=3.711; #lennard jones constant or collision diameter,A\n",
+ "ab=2.827; #lennard jones constant or collision diameter,A\n",
+ "b1=78.6; #lennard jones constant,K\n",
+ "b2=59.7; #lennard jones constant,K\n",
+ "Ma=28.97; #Molecular mass of air, kg/kmol\n",
+ "Mh=2.016; #Molecular mass of hydrogen, kg/kmol\n",
+ "\n",
+ "#Calculations\n",
+ "a=(aa+ab)/2; #effective molecular diameter for collisions of hydrogen and air,m\n",
+ "b=math.sqrt(b1*b2); #effective potential well depth,K\n",
+ "c=T1/b; \n",
+ "\n",
+ "d=0.8822; #potential well function, from table 11.3\n",
+ "Dab=(1.8583*math.pow(10,-7))*math.pow(T1,1.5)/(math.pow(a,2)*d)*math.sqrt(1/Mh+1/Ma); #diffusion coefficient of hydrogen in air,m**2/s\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print \"Diffusion coefficient of hydrogen in air is :\",round(Dab,6),\"m^2/s an experimental value from table is 6.34*10^-5 m^2/s,so the prediction is high by 5 percent.\\n\"\n",
+ " #end\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Diffusion coefficient of hydrogen in air is : 6.6e-05 m^2/s an experimental value from table is 6.34*10^-5 m^2/s,so the prediction is high by 5 percent.\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 11.4, Page number: 625"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "import math\n",
+ "from numpy import array\n",
+ "\n",
+ "#Variables\n",
+ "T1=373.15; #temp.of tea,K\n",
+ "XN2=0.7808; #mole fraction of nitrogen\n",
+ "XO2=0.2095; #mole fraction of oxygen\n",
+ "Xar=0.0093; #mole fraction of\n",
+ "Cp=1006 #mixture diffusivity,j/(kg*K)\n",
+ "\n",
+ "#Calculations\n",
+ "a=array(([3.798, 3.467, 3.542])); #collisin diameter,m\n",
+ "b=array(([71.4, 106.7, 93.3])); #lennard jones constant,K\n",
+ "M=array(([28.02, 32, 39.95])); #molar masses,kg/kmol\n",
+ "c=array(([0.9599, 1.057, 1.021])); #potential well function\n",
+ "d=array(([1.8*10**-5, 2.059*10**-5, 2.281*10**-5])); #calculated viscosity,kg/(m*s)\n",
+ "e=array(([1.8*10**-5, 2.07*10**-5, 2.29*10**-5])); # theoritical viscosity,kg/(m*s)\n",
+ "f=array(([0.0260, 0.02615, 0.01787])); #theoritical thermal conducitvity,W/(m*K)\n",
+ "\n",
+ "u=2.6693*10**-6*(M*T1)**0.5/((a**2*c)); #viscosity,kg/(m*s)\n",
+ "k=0.083228/((a**2*c*(T1/M**0.5))) #thermal conductivity,W/(m*s)\n",
+ "umc = XN2*u.item(0)/0.9978+XO2*u.item(1)/1.008+Xar*u.item(2)/0.9435 ; #calculated mixture viscosity,kg/(m*s)\n",
+ "umc1=1.857*10**-5;\n",
+ "\n",
+ "umd=XN2*e.item(0)/0.9978+XO2*e.item(1)/1.008+e.item(2)*Xar/0.9435; #theoritical mixture viscosity,kg/(m*s)\n",
+ "kmc=XN2*k.item(0)/0.9978+XO2*k.item(1)/1.008+Xar*k.item(2)/0.9435; #calculated thermal conducitvity,W/(m*K)\n",
+ "kmc1=0.02623;\n",
+ "kmd=XN2*f.item(0)/0.9978+XO2*f.item(1)/1.008+Xar*f.item(2)/0.9435; #theoritical thermal conductivity, W/(m*K)\n",
+ "pr=umd*Cp/kmd; #prandtl no.\n",
+ "\n",
+ "#Result\n",
+ "print \"Theoritical mixture viscosity is :\",round(umc1,6),\"kg/(m*s)\\n\"\n",
+ "print \"Calculated mixture viscosity is :\",round(umd,6),\"kg/(m*s)\\n\"\n",
+ "print \"Theoritical thermal conducitvity is :\",round(kmc1,4),\" W/(m*K)\\n\"\n",
+ "print \"Calculated thermal conducitvity is :\",round(kmd,4),\"W/(m*K)\\n\" \n",
+ "print \"Prandtl no. is :\",round(pr,4),\"\\n\"\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Theoritical mixture viscosity is : 1.9e-05 kg/(m*s)\n",
+ "\n",
+ "Calculated mixture viscosity is : 1.9e-05 kg/(m*s)\n",
+ "\n",
+ "Theoritical thermal conducitvity is : 0.0262 W/(m*K)\n",
+ "\n",
+ "Calculated thermal conducitvity is : 0.026 W/(m*K)\n",
+ "\n",
+ "Prandtl no. is : 0.7214 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 11.5, Page number: 632"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "import math\n",
+ "from numpy import array\n",
+ "import matplotlib.pyplot as plt\n",
+ "%matplotlib inline\n",
+ "\n",
+ "#Variables\n",
+ "Patm=101.325;\t\t\t#Atmospheric pressure in kPa.\n",
+ "Mh20=18.02;\t\t\t\t#Molecular mass of H20 in kg/kmol.\n",
+ "Mair=28.96;\t\t\t\t#Molecular mass of air in kg/kmol.\n",
+ "Psat =array(([0.6113, 1.2276, 2.3385, 4.2461, 7.3837, 12.35, 19.941, 31.188, 47.39, 70.139, 101.325]));\t\t#Saturated pressure of watrer in kPa \n",
+ "T=array(([0.01, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100]));\t\t#Temperature of air in in degree C\n",
+ "#Calculations\n",
+ "xw=Psat/Patm;\t\t\t\t\n",
+ "\n",
+ "mw=(xw*Mh20)/(xw*Mh20+(1-xw)*Mair);\t\t#Mass fraction of water vapour.\n",
+ "#Result\n",
+ "plt.plot(T,mw);\n",
+ "plt.xlabel(\"Temperature(Degree C)\")\n",
+ "plt.ylabel(\"Mass fraction of water vapour\");\n",
+ "plt.show()\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYcAAAEPCAYAAACp/QjLAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XlcVPX+P/AXmxtq5o5AoYDsIrglipKGmIqlmeJ2FQnJ\n3ErrV997b4bZ1bzebql071UrLRfEyBtmSqaCuYCWqJB4U1QScMOdRbbh8/vjxAiyzDBw5swwr+fj\nMQ+YmTOf855Tnjef3UwIIUBERFSJudIBEBGR4WFyICKiapgciIioGiYHIiKqhsmBiIiqYXIgIqJq\nZE0Os2bNQpcuXeDl5VXrMQsWLICzszO8vb1x6tQpOcMhIiItyZocQkNDER8fX+v7e/bsQUZGBi5c\nuID169djzpw5coZDRERakjU5+Pv748knn6z1/V27dmHGjBkAgAEDBuDevXu4ceOGnCEREZEWFO1z\nyMnJgb29vfq5nZ0dsrOzFYyIiIgAA+iQfnz1DjMzM4UiISKiCpZKntzW1hZZWVnq59nZ2bC1ta12\nnJOTEy5evKjP0IiIjJ6joyMyMjJ0+qyiNYexY8fiq6++AgAkJyejXbt26NKlS7XjLl68CCEEH0Lg\nvffeUzwGQ3nwWvBa8FrU/FixQmD2bNGgP6plrTlMnjwZhw4dwq1bt2Bvb4+lS5eitLQUABAREYFR\no0Zhz549cHJygrW1NTZu3ChnOERETZ4QwObNwLp1wPr1upcja3KIjo7WeExUVJScIRARmZQzZ4DC\nQsDPr2HlKN4hTfUTEBCgdAgGg9fiEV6LR0z9WmzZAkydCpg38O5uJoQw+M1+zM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ICQkBANy6dQt79+6FlZUVxo4dW628yMhI9e8BAQEICAjQGAMREQDMmydNePP1VToS\neSUmJiIxMbFRytLYIX3nzh289957OHr0KADA398fkZGRePLJJ+ssuKysDC4uLjhw4AC6deuG/v37\n19ghXSE0NBTBwcEYP3589SDZIU1EOvrmG2nY6unTgJ43sVScrJPg2rdvj7Vr19a/YEtLREVFISgo\nCCqVCmFhYXBzc8O6desAABEREfWPloioHu7cAebPB77+2vQSQ0PVWnNYuHAhVq9ejeDg4OofMjPD\nrl27ZA+u8vlYcyCi+poxA2jXDli9WulIlCFLzeFPf/oTAGDx4sU1npCIyJDt3QscPswNfHRVa3Lo\n06cPAOD06dN4/fXXq7z3ySefYOjQofJGRkSkowcPgFdfBT7/HGjdWulojJPGDmkfHx+cOnWqymu9\ne/fG6dOnZQ2sMjYrEVF9vPaatMPbZ58pHYmyZGlWio6OxrZt23D58uUq/Q55eXmKLt9NRFSXxERg\n1y5Ai4UcqA61Jgc/Pz/Y2NggNzcXb775pjr7tG3bFr169dJbgERE2ioslFZc/de/pI5o0p3GZqVL\nly7BxsYGLVu2BAA8fPgQN27cgIODgz7iA8BmJSLSTAhg7lzg7l0gOlrpaAyDrAvvTZw4scr2oObm\n5pgwYYJOJyMikoNKJXVAnzgBREUpHU3ToHESXFlZmXqTHwBo3rw5SktLZQ2KiEhbRUXAlClAXh6Q\nkABouasAaaCx5tCxY8cqS23HxcWhY8eOsgZFRKSN+/eBkSOBZs2k/aCZGBqPxj6HjIwMTJ06FVev\nXgUgLb29efNmODk56SVAgH0ORFTd9evA888DgwdLM6C5F3R1Dbl31msnODMzM7RWYEYJkwMRVXbx\nIhAUJC2P8de/Aly0oWayLrwHALt370Z6ejqKiorUry1ZskSnExIRNcSpU8CYMcCSJdLObiQPjckh\nIiICDx8+xMGDBxEeHo6vv/4aAwYM0EdsRERVJCYCEycC//43UMN289SINDYreXl5IS0tDb169UJq\nairy8/MxcuRIHDlyRF8xslmJiLBzpzRcNSYGqLQ5JdVB1n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IgIqJq\nmByIiKgaJgciIqqGyYGIiKphciAiomr+P6Ksmp778+IaAAAAAElFTkSuQmCC\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x7f4109404550>"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 11.6, Page number: 634"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "import math\n",
+ "\n",
+ "#Variables\n",
+ "T1=263.15; #temp.of ice,K\n",
+ "p=101.325; #Atmospheric pressure, KPa\n",
+ "Molw=18.02; #Molecular mass of water vapour, g/mol\n",
+ "Mola=28.96; #Molecular mass of air, g/mol\n",
+ "\n",
+ "#Calculations\n",
+ "Pv=math.exp(21.99-6141/(T1)); #vapor pressure,KPa\n",
+ "xw=Pv/p; #mole fraction of water\n",
+ "mw=xw*Molw/(xw*Molw+(1-xw)*Mola); #mass fraction\n",
+ "\n",
+ "#Result\n",
+ "print \"Mass fraction of watervapor above the surface of ice is :\",round(mw,5),\"\\n\"\n",
+ "#end\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mass fraction of watervapor above the surface of ice is : 0.0016 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 11.10, Page number:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "\n",
+ "#Variables\n",
+ "T1=303; # isothermal temp.,K\n",
+ "v=5; #air speed,m/s\n",
+ "l=0.05; #length of naphthalene model that is flat, m\n",
+ "Mnap=128.2; #molar mass of naphthalene,kg/kmol\n",
+ "nu=1.867*10**-5; #Dynamic viscocity, m^2/s\n",
+ "\n",
+ "#Calculations\n",
+ "D=0.86*(10**-5); #diffusion coefficient of naphthalene in air,m/s\n",
+ "\n",
+ "Pv=10**(11.45-3729.3/T1)*133.31; #vapor pressure of napthalene, Pa\n",
+ "xn=Pv/101325; #mole fraction of naphthalene\n",
+ "mn=xn*Mnap/(xn*Mnap+(1-xn)*28.96); #mass fraction of naphthalene\n",
+ "mnp=0; #mass fraction of naphthalene in free stream is 0\n",
+ "\n",
+ "Rel=v*l/nu; #reynolds no.\n",
+ "Sc=nu/D; #schimidt no.\n",
+ "Nul=0.664*math.sqrt(Rel)*(Sc**(1/3)); #mass transfer nusselt no.\n",
+ "Gmn=D*Nul*1.166/l; #gas phase mass transfer coefficient,kg/(m**2*s)\n",
+ "n=Gmn*(mn-mnp); #average mass flux,kg/(m**2*s)\n",
+ "n1=n*1000*3600;# average mass flux, g/m**2.h\n",
+ "\n",
+ "#Result\n",
+ "print \"Average rate of loss of naphthalene from a part of model is :\",round(n,7),\"kg/(m^2*s) or \",round(n1),\"g/(m^2*h)\\n\"\n",
+ "print \"Naphthalene sublimatin can be used to infer heat transfer coefficient by measuring the loss of naphthalene from a model over some length of time.since the schimidt no. of naphthalene is not generally equal to prandtl no. under the conditions of interest, some assumption about the dependence of nusselt no. on the prandtl no. must usually be introduced.\\n\"\n",
+ " #end\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Average rate of loss of naphthalene from a part of model is : 1.61e-05 kg/(m^2*s) or 58.0 g/(m^2*h)\n",
+ "\n",
+ "Naphthalene sublimatin can be used to infer heat transfer coefficient by measuring the loss of naphthalene from a model over some length of time.since the schimidt no. of naphthalene is not generally equal to prandtl no. under the conditions of interest, some assumption about the dependence of nusselt no. on the prandtl no. must usually be introduced.\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 11.11, Page number:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "\n",
+ "#Variables\n",
+ "T1=300; #temp. of helium-water tube,K\n",
+ "h=0.4; #height of vertical wall,m\n",
+ "m=0.087*10**-3; #flow rate of helium,kg/(m**2*s)\n",
+ "#this is a uniform flux natural convection problem.\n",
+ "Mhes=0.01; # assuming the value of mass fraction of helium at the wall to be 0.01\n",
+ "Mhef=Mhes/2; #film composition\n",
+ "af=1.141; #film density,kg/m**3\n",
+ "wd=1.107; #wall density,kg/m**3\n",
+ "Dha=7.119*10**-5; #diffusion coefficient,m**2/s\n",
+ "u=1.857*10**-5; #film viscosity at 300K,kg/(m*s)\n",
+ "aa=1.177; #air density,kg/m**3\n",
+ "g=9.8; #Gravity constant, m/s**2\n",
+ "#Calculations\n",
+ "Sc=(u/af)/Dha; #schimidt no.\n",
+ "Ra1=g*(aa-wd)*m*h**4/(u*af*Dha**2*Mhes); #Rayleigh no.\n",
+ "Nu=6/5*(Ra1*Sc/(4+9*math.sqrt(Sc)+10*Sc))**(1/5); #approximate nusselt no.\n",
+ "s=m*h/(af*Dha*Nu); #average concentration of helium at the wall\n",
+ "#thus we have obtained an average wall concentration 14 oercent higher than our initial guess of Mhes.we repeat this calclations with revised values of densities to obtain Mhes = 0.01142\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print \"Average conentration of helium at the wall is \",round(s,5),\",since the result is within 0.5 percent of our second guess, a third iteration is not needed\"\n",
+ " #end\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Average conentration of helium at the wall is 0.01136 ,since the result is within 0.5 percent of our second guess, a third iteration is not needed\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 11.14, Page number:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "import math\n",
+ "\n",
+ "#Variables\n",
+ "T1=325; #temp. of helium-water tube,K\n",
+ "l=0.2; #length of tube,m\n",
+ "x=0.01; # mole fraction of water\n",
+ "R=8314.472; #gas constant,J/(kmol*K)\n",
+ "Mw=18.02;#Molecular mass of water, g/mol\n",
+ "#the vapor pressure of the liquid water is approximately the saturation pressure at the water temp.\n",
+ "\n",
+ "#Calculations\n",
+ "p=1.341*10000 ; #vapor pressure using steam table,Pa\n",
+ "x1=p/101325; #mole fraction of saturated water\n",
+ "c=101325/(R*T1); #mole concentration in tube,kmol/m**3\n",
+ "D12=1.067*math.pow(10,-4); #diffusivity ofwater with respect to helium,m**2/s \n",
+ "Nw=c*D12*math.log(1+(x-x1)/(x1-1))/l ; #molar evaporation rate,kmol/(m**2*s)\n",
+ "nw=Nw*Mw; # mass evaporation rate,kg/(m**2*s)\n",
+ "\n",
+ "#S=1+(x1-1)*math.exp(Nw*y/(c*D12)) conentration distribution of water-vapor\n",
+ "#Result\n",
+ "print \"Conentration distribution of water-vapor is : x1(y)=1-0.8677*exp(0.6593*y) where y is expressed in meters.\\n\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Conentration distribution of water-vapor is : x1(y)=1-0.8677*exp(0.6593*y) where y is expressed in meters.\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 11.15, Page number:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "\n",
+ "#Variables\n",
+ "T1=1473; #suraface temp.of hot water,K\n",
+ "x=0.05; #mass fraction of water\n",
+ "Gm=0.017; #average mass transfer coefficient,kg/(m**2*s)\n",
+ "A=0.04; #suraface area of pan,m**2\n",
+ "\n",
+ " #only water vapour passes through the liquid surface, since air is not strongly absorbed into water under normal conditions.\n",
+ "#Calculations\n",
+ "p=38.58*1000; #saturation pressure of water,kPa\n",
+ "Xwater=p/101325; #mole fraction of saturated water\n",
+ "Mwater=Xwater*18.02/(Xwater*18.02+(1-Xwater)*28.96); #mass fraction of saturated water\n",
+ "\n",
+ "B=(x-Mwater)/(Mwater-1); #mass transfer driving force\n",
+ "m=Gm*B*A; #evaporation rate,kg/s\n",
+ "\n",
+ "#Result\n",
+ "print \"Evaporation rate is:\",round(m,6),\" kg/s\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Evaporation rate is: 0.000213 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 11.16, Page number:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "import math\n",
+ "\n",
+ "#Variables\n",
+ "T1=298; #temp.of air,K\n",
+ "T2=323.15; #film temp.,K\n",
+ "x=0.05; #mass fraction of water at 75 C\n",
+ "Gm=0.017; #average mass transfer coefficient,kg/(m**2*s)\n",
+ "A=0.04; #suraface area of pan,m**2\n",
+ "l=0.2; #length of pan in flow direction,m\n",
+ "v=5; #air speed,m/s\n",
+ "m=(x+0.277)/2; #film composition of water at 50 C\n",
+ "Mf=26.34; #mixture molecular weight,kg/kmol\n",
+ "p=101325; #Atmospheric pressure, Pa\n",
+ "R=8314.5; #Gas constant, J/kmol-K\n",
+ "Uf=1.75*math.pow(10,-5); #film viscosity,kg/(m*s)\n",
+ "B=0.314; #mass transfer driving force\n",
+ "D=2.96*math.pow(10,-5); #diffusivity of water in air,m**2/s\n",
+ "df=0.993; #Density of ideal air, kg/m**#\n",
+ "\n",
+ "#Calculations\n",
+ "af=p*Mf/(R*T2); \t #film density from ideal gas law,kg/m**3\n",
+ "Vf=Uf/af; #kinematic viscosity,m**2/s\n",
+ "Rel=v*l/Vf; #reynolds no. comes out to be 56,800 so the flow is laminar.\n",
+ "Sc=Vf/D; #scimidt no.\n",
+ "Nu=0.664*math.sqrt(Rel)*math.pow(Sc,1/3); #nussselt no.\n",
+ "Gmw1=Nu*(D*df/l); #appropriate value of mass transfer gas phase coeffficient of water in air,kg/(m**2*s)\n",
+ "Gmw=Gmw1*(math.log(1+B)/B); \t #mass transfer gas phase coeffficient of water in air,kg/(m**2*s)\n",
+ "\n",
+ "#Results\n",
+ "print \"Mass transfer gas phase coeffficient of water in air is :\",round(Gmw,4),\"kg/(m^2*s)\\nIn this caes, the blowing factor is 0.870. Thus the mild blowing has reduced the mass transfer coefficient by about 13 percent\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0.01955648559 133.069905487\n",
+ "Mass transfer gas phase coeffficient of water in air is : 0.017 kg/(m^2*s)\n",
+ "In this caes, the blowing factor is 0.870. Thus the mild blowing has reduced the mass transfer coefficient by about 13 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/A_Heat_Transfer_Text_Book/Chapter1.ipynb b/A_Heat_Transfer_Text_Book/Chapter1.ipynb
index 9deb4499..dd1cacc1 100755
--- a/A_Heat_Transfer_Text_Book/Chapter1.ipynb
+++ b/A_Heat_Transfer_Text_Book/Chapter1.ipynb
@@ -1,332 +1,334 @@
-{
- "metadata": {
- "name": ""
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 1 - \"Introduction\""
- ]
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 1.1, Page number: 13"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variables\n",
- "k=35; #Thermal Conductivity, [W/m*K]\n",
- "T1=110 # Temperature of front[C]\n",
- "T2=50; # Temperature of back,[C]\n",
- "A=0.4 #area of slab,[m**2]\n",
- "x=0.03; #Thickness of slab,[m]\n",
- "\n",
- "#Calculations\n",
- "q=-k*(T2-T1)/(1000*x); #formula for heat flux[KW/m^2]\n",
- "Q=q*A; #formula for heat transfer rate[KW]\n",
- "\n",
- "#Results\n",
- "print \"Heat flux is:\",q,\"KW/m^2\\n\"\n",
- "print \"Heat transfer rate is:\",Q,\"KW \\n\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Heat flux is: 70.0 KW/m^2\n",
- "\n",
- "Heat transfer rate is: 28.0 KW \n",
- "\n"
- ]
- }
- ],
- "prompt_number": 1
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 1.2, Page number: 16"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "from sympy import solve,symbols\n",
- "\n",
- "#Variables\n",
- "x=symbols('x');\n",
- "k1=372; # Thermal Conductivity of slab,W/m*K\n",
- "x1=0.003; # Thickness of slab,m\n",
- "x2=0.002 # Thickness of steel,m\n",
- "k2=17; # Thermal Conductivity of steel,W/m*K\n",
- "T1=400; # Temperature on one side,C\n",
- "T2=100 #Temperature on other side,C\n",
- "\n",
- "#Calculations\n",
- "Tcu=solve(x+2*x*(k1/x1)*(x2/k2)-(T1-T2),x);\n",
- "#q=k1*(Tcu/x1)=k2*(Tss/x2);\n",
- "Tss = Tcu[0]*(k1/x1)*(x2/k2); # formula for temperature gradient in steel side\n",
- "Tcul=T1-Tss;\n",
- "Tcur=T2+Tss;\n",
- "q=k2*Tss/(1000*x2); # formula for heat conducted, kW\\m^2\n",
- "\n",
- "#Results\n",
- "print \"Temperature on left copper side is :\",round(Tcul,3),\"C\\n\"\n",
- "print \"Temperature on right copper side is :\",round(Tcur,3),\"C\\n\"\n",
- "print \"Heat conducted through the wall is :\",round(q,3),\"kW\\m^2\\n\"\n",
- "print \"Our initial approximation was accurate within a few percent.\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Temperature on left copper side is : 254.971 C\n",
- "\n",
- "Temperature on right copper side is : 245.029 C\n",
- "\n",
- "Heat conducted through the wall is : 1232.749 kW\\m^2\n",
- "\n",
- "Our initial approximation was accurate within a few percent.\n"
- ]
- }
- ],
- "prompt_number": 2
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 1.3, Page number: 22"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variables\n",
- "q1=6000; #Heat flux, W*m**-2\n",
- "T1=120; #Heater Temperature, C\n",
- "T2=70; #final Temperature of Heater, C\n",
- "q2=2000; #final heat flux, W*m**-2\n",
- "\n",
- "#Calculations\n",
- "h=q1/(T1-T2) #formula for average heat transfer cofficient\n",
- "Tnew=T2+q2/h; #formula for new Heater temperature, C\n",
- "\n",
- "#Results\n",
- "print \"Average Heat transfer coefficient is:\",h,\"W/(m^2*K)\\n\"\n",
- "print \"New Heater Temperature is:\",round(Tnew,3),\"C\\n\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Average Heat transfer coefficient is: 120.0 W/(m^2*K)\n",
- "\n",
- "New Heater Temperature is: 86.667 C\n",
- "\n"
- ]
- }
- ],
- "prompt_number": 3
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 1.4, Page number: 25"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "from numpy import array\n",
- "from numpy import linspace\n",
- "import matplotlib.pyplot as plt\n",
- "from pylab import *\n",
- "%matplotlib inline\n",
- "\n",
- "#Variables\n",
- "h=250; #Heat Transfer Coefficient, W/(m**2*K)\n",
- "k=45; #Thermal Conductivity, W/(m*K)\n",
- "c=180; #Heat Capacity, J/(kg*K)\n",
- "a=9300; #density, kg/m**3\n",
- "T1=200; #temperature, C\n",
- "D=0.001; #diameter of bead, m\n",
- "t1=linspace(0,5,50); #defining time interval of 0.1 seconds\n",
- "T=linspace(0,5,50);\n",
- "i=0;\n",
- "\n",
- "#Calculations\n",
- "while i<50:\n",
- " T[i]=T1-c*math.exp(-t1[i]/((a*c*D)/(6*h))); #Calculating temperature at each time in degree C\n",
- " i=i+1;\n",
- "\n",
- "plt.plot(t1,T);\n",
- "plt.xlabel(\"Time(in sec)\");\n",
- "plt.ylabel(\"Temperature(in degree C)\");\n",
- "plt.title(\"Thermocouple response to a hot gas flow\");\n",
- "plt.show();\n",
- "\n",
- "Bi = h*(D/2)/k; #biot no.\n",
- "\n",
- "#Results\n",
- "print \"The value of Biot no for this thermocouple is\",round(Bi,5);\n",
- "print \"Bi is <0.1 and hence the thermocouple could be considered as a lumped heat capacity system and the assumption taken is valid.\\n\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "ename": "ImportError",
- "evalue": "DLL load failed: %1 is not a valid Win32 application.",
- "output_type": "pyerr",
- "traceback": [
- "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[1;31mImportError\u001b[0m Traceback (most recent call last)",
- "\u001b[1;32m<ipython-input-4-48a98dda89ad>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[0m__future__\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mdivision\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 2\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mmath\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 3\u001b[1;33m \u001b[1;32mfrom\u001b[0m \u001b[0mnumpy\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0marray\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 4\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[0mnumpy\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mlinspace\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 5\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mmatplotlib\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mpyplot\u001b[0m \u001b[1;32mas\u001b[0m \u001b[0mplt\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
- "\u001b[1;32mC:\\Users\\jaidev\\Anaconda\\lib\\site-packages\\numpy\\__init__.py\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 151\u001b[0m \u001b[1;32mreturn\u001b[0m \u001b[0mloader\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m*\u001b[0m\u001b[0mpackages\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m**\u001b[0m\u001b[0moptions\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 152\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 153\u001b[1;33m \u001b[1;32mfrom\u001b[0m \u001b[1;33m.\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0madd_newdocs\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 154\u001b[0m \u001b[0m__all__\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;33m[\u001b[0m\u001b[1;34m'add_newdocs'\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m'ModuleDeprecationWarning'\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 155\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n",
- "\u001b[1;32mC:\\Users\\jaidev\\Anaconda\\lib\\site-packages\\numpy\\add_newdocs.py\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 11\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[0m__future__\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mdivision\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mabsolute_import\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mprint_function\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 12\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 13\u001b[1;33m \u001b[1;32mfrom\u001b[0m \u001b[0mnumpy\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mlib\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0madd_newdoc\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 14\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 15\u001b[0m \u001b[1;31m###############################################################################\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
- "\u001b[1;32mC:\\Users\\jaidev\\Anaconda\\lib\\site-packages\\numpy\\lib\\__init__.py\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 6\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[0mnumpy\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mversion\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mversion\u001b[0m \u001b[1;32mas\u001b[0m \u001b[0m__version__\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 7\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 8\u001b[1;33m \u001b[1;32mfrom\u001b[0m \u001b[1;33m.\u001b[0m\u001b[0mtype_check\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[1;33m*\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 9\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[1;33m.\u001b[0m\u001b[0mindex_tricks\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[1;33m*\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 10\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[1;33m.\u001b[0m\u001b[0mfunction_base\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[1;33m*\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
- "\u001b[1;32mC:\\Users\\jaidev\\Anaconda\\lib\\site-packages\\numpy\\lib\\type_check.py\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 9\u001b[0m 'common_type']\n\u001b[0;32m 10\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 11\u001b[1;33m \u001b[1;32mimport\u001b[0m \u001b[0mnumpy\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mcore\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mnumeric\u001b[0m \u001b[1;32mas\u001b[0m \u001b[0m_nx\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 12\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[0mnumpy\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mcore\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mnumeric\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0masarray\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0masanyarray\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0marray\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0misnan\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0;31m \u001b[0m\u001b[0;31m\\\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 13\u001b[0m \u001b[0mobj2sctype\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mzeros\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
- "\u001b[1;32mC:\\Users\\jaidev\\Anaconda\\lib\\site-packages\\numpy\\core\\__init__.py\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 4\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[0mnumpy\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mversion\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mversion\u001b[0m \u001b[1;32mas\u001b[0m \u001b[0m__version__\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 5\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 6\u001b[1;33m \u001b[1;32mfrom\u001b[0m \u001b[1;33m.\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mmultiarray\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 7\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[1;33m.\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mumath\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 8\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[1;33m.\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0m_internal\u001b[0m \u001b[1;31m# for freeze programs\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
- "\u001b[1;31mImportError\u001b[0m: DLL load failed: %1 is not a valid Win32 application."
- ]
- }
- ],
- "prompt_number": 4
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 1.5, Page number: 32"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "from sympy import solve,symbols\n",
- "\n",
- "#Variables\n",
- "x=symbols('x');\n",
- "T1=293; #Temperature of air around thermocouple, K\n",
- "T2=373; #Wall temperature, K\n",
- "h=75; #Average Heat Transfer Coefficient, W/(m**2*K)\n",
- "s=5.67*10**-8; #stefan Boltzman constant, W/(m**2*K**4)\n",
- "\n",
- "#Calculations\n",
- "x=solve((h*(x-T1)+s*(x**4-T2**4)),x);\t #Calculating Thermocouple Temperature, K\n",
- "y=x[1]-273;\t\t\t\t #Thermocouple Temperature, C\n",
- "\n",
- "#Results\n",
- "print \"Thermocouple Temperature is :\",round(y,3),\"C\\n\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Thermocouple Temperature is : 28.395 C\n",
- "\n"
- ]
- }
- ],
- "prompt_number": 1
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 1.6, Page number: 34"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "from sympy import solve,symbols\n",
- "\n",
- "#Variables\n",
- "x=symbols('x');\n",
- "e=0.4; #emissivity\n",
- "T1=293; #Temperature of air around Thermocouple, K\n",
- "T2=273; #wall Temperature, K\n",
- "h=75; #Average Heat Transfer Coefficient, W/(m**2*K)\n",
- "s=5.6704*10**-8; #stefan Boltzman constant, W/(m**2*K**4)\n",
- "\n",
- "#Calculations\n",
- "z=solve(((s*e*((373)**4 - (x)**4)) - h*(x-293)),x);\t#Calculating Thermocouple Temperature, K\n",
- "y=z[0]-273;\t\t\t\t\t #Thermocouple Temperature, C\n",
- "\n",
- "'''NOTE: Equation written is absolutely correct and solving this equation\n",
- " should give real result as: 296.112 i.e. 23.112 C, but somehow python is giving wrong result.'''\n",
- "\n",
- "#Results\n",
- "print \"Thermocouple Temperature is :\",round(y,1),\"C \\n\"\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Thermocouple Temperature is : 25.9 C \n",
- "\n"
- ]
- }
- ],
- "prompt_number": 3
- }
- ],
- "metadata": {}
- }
- ]
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 1 - \"Introduction\""
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.1, Page number: 13"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "import math\n",
+ "\n",
+ "#Variables\n",
+ "k=35; #Thermal Conductivity, [W/m*K]\n",
+ "T1=110 # Temperature of front[C]\n",
+ "T2=50; # Temperature of back,[C]\n",
+ "A=0.4 #area of slab,[m**2]\n",
+ "x=0.03; #Thickness of slab,[m]\n",
+ "\n",
+ "#Calculations\n",
+ "q=-k*(T2-T1)/(1000*x); #formula for heat flux[KW/m^2]\n",
+ "Q=q*A; #formula for heat transfer rate[KW]\n",
+ "\n",
+ "#Results\n",
+ "print \"Heat flux is:\",q,\"KW/m^2\\n\"\n",
+ "print \"Heat transfer rate is:\",Q,\"KW \\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Heat flux is: 70.0 KW/m^2\n",
+ "\n",
+ "Heat transfer rate is: 28.0 KW \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.2, Page number: 16"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "import math\n",
+ "from sympy import solve,symbols\n",
+ "\n",
+ "#Variables\n",
+ "x=symbols('x');\n",
+ "k1=372; # Thermal Conductivity of slab,W/m*K\n",
+ "x1=0.003; # Thickness of slab,m\n",
+ "x2=0.002 # Thickness of steel,m\n",
+ "k2=17; # Thermal Conductivity of steel,W/m*K\n",
+ "T1=400; # Temperature on one side,C\n",
+ "T2=100 #Temperature on other side,C\n",
+ "\n",
+ "#Calculations\n",
+ "Tcu=solve(x+2*x*(k1/x1)*(x2/k2)-(T1-T2),x);\n",
+ "#q=k1*(Tcu/x1)=k2*(Tss/x2);\n",
+ "Tss = Tcu[0]*(k1/x1)*(x2/k2); # formula for temperature gradient in steel side\n",
+ "Tcul=T1-Tss;\n",
+ "Tcur=T2+Tss;\n",
+ "q=k2*Tss/(1000*x2); # formula for heat conducted, kW\\m^2\n",
+ "\n",
+ "#Results\n",
+ "print \"Temperature on left copper side is :\",round(Tcul,3),\"C\\n\"\n",
+ "print \"Temperature on right copper side is :\",round(Tcur,3),\"C\\n\"\n",
+ "print \"Heat conducted through the wall is :\",round(q,3),\"kW\\m^2\\n\"\n",
+ "print \"Our initial approximation was accurate within a few percent.\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature on left copper side is : 254.971 C\n",
+ "\n",
+ "Temperature on right copper side is : 245.029 C\n",
+ "\n",
+ "Heat conducted through the wall is : 1232.749 kW\\m^2\n",
+ "\n",
+ "Our initial approximation was accurate within a few percent.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.3, Page number: 22"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "import math\n",
+ "\n",
+ "#Variables\n",
+ "q1=6000; #Heat flux, W*m**-2\n",
+ "T1=120; #Heater Temperature, C\n",
+ "T2=70; #final Temperature of Heater, C\n",
+ "q2=2000; #final heat flux, W*m**-2\n",
+ "\n",
+ "#Calculations\n",
+ "h=q1/(T1-T2) #formula for average heat transfer cofficient\n",
+ "Tnew=T2+q2/h; #formula for new Heater temperature, C\n",
+ "\n",
+ "#Results\n",
+ "print \"Average Heat transfer coefficient is:\",h,\"W/(m^2*K)\\n\"\n",
+ "print \"New Heater Temperature is:\",round(Tnew,3),\"C\\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Average Heat transfer coefficient is: 120.0 W/(m^2*K)\n",
+ "\n",
+ "New Heater Temperature is: 86.667 C\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.4, Page number: 25"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "import math\n",
+ "from numpy import array\n",
+ "from numpy import linspace\n",
+ "import matplotlib.pyplot as plt\n",
+ "from pylab import *\n",
+ "%matplotlib inline\n",
+ "\n",
+ "#Variables\n",
+ "h=250; #Heat Transfer Coefficient, W/(m**2*K)\n",
+ "k=45; #Thermal Conductivity, W/(m*K)\n",
+ "c=180; #Heat Capacity, J/(kg*K)\n",
+ "a=9300; #density, kg/m**3\n",
+ "T1=200; #temperature, C\n",
+ "D=0.001; #diameter of bead, m\n",
+ "t1=linspace(0,5,50); #defining time interval of 0.1 seconds\n",
+ "T=linspace(0,5,50);\n",
+ "i=0;\n",
+ "\n",
+ "#Calculations\n",
+ "while i<50:\n",
+ " T[i]=T1-c*math.exp(-t1[i]/((a*c*D)/(6*h))); #Calculating temperature at each time in degree C\n",
+ " i=i+1;\n",
+ "\n",
+ "plt.plot(t1,T);\n",
+ "plt.xlabel(\"Time(in sec)\");\n",
+ "plt.ylabel(\"Temperature(in degree C)\");\n",
+ "plt.title(\"Thermocouple response to a hot gas flow\");\n",
+ "plt.show();\n",
+ "\n",
+ "Bi = h*(D/2)/k; #biot no.\n",
+ "\n",
+ "#Results\n",
+ "print \"The value of Biot no for this thermocouple is\",round(Bi,5);\n",
+ "print \"Bi is <0.1 and hence the thermocouple could be considered as a lumped heat capacity system and the assumption taken is valid.\\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYQAAAEZCAYAAACXRVJOAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3X1cjff/wPFXKgwphZNKMkVyM4Xcc9wUNsyYyEZjbPvZ\nfM2278zu3G30ta/5MmzfbYzZd9Nu1WxrmIoxcjs3ITeVlNyllKI6fX5/XHMmusOp0837+Xhcj3PO\ndc51Xe9zyfU+1+fWQimlEEIIUe3VMHcAQgghKgZJCEIIIQBJCEIIIf4iCUEIIQQgCUEIIcRfJCEI\nIYQAJCGYxezZsxk3bpy5w6gw9Ho9K1euNHcY4i+RkZE0bdrU3GGY3IQJE7C3t6dr165ERUVVye94\nvyQhlIF69ephY2ODjY0NNWrUoE6dOsbXX375JRYWFuYOsUKxsLCQc1KCyvIjYvXq1fTq1cvcYdxh\n27ZtbN68meTkZHbu3Il0vyqcJIQykJmZSUZGBhkZGTRr1owNGzYYX48dO9akf4wGg8Fk+6rs8vLy\nzB2CqKASEhJwc3Ojdu3a5g6lQpOEYAYWFhbk5OQQFBRE/fr1adu2LXv37jW+n5yczMiRI2ncuDEP\nPvggH3zwgfG92bNn8/jjjzNu3DhsbW1ZvXo1er2eN998kx49emBjY8OwYcO4dOkSTzzxBLa2tvj6\n+pKQkGDcx44dO+jcuTN2dnb4+vryxx9/GN9LTU1lwoQJODs7Y29vz2OPPWZ875NPPsHDwwMHBwce\nffRRzp07B0B8fDw1atQgPz/f+Nlbi4FWr15Njx49mDp1KnZ2drRu3ZotW7YUeX5WrVqFl5cX9vb2\nDBo0iDNnzhT6uZvHXbVqFc2aNWPAgAElbj99+nR0Oh22tra0b9+emJgYAJ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n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x7fbd3da5b8d0>"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of Biot no for this thermocouple is 0.00278\n",
+ "Bi is <0.1 and hence the thermocouple could be considered as a lumped heat capacity system and the assumption taken is valid.\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.5, Page number: 32"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "import math\n",
+ "from sympy import solve,symbols\n",
+ "\n",
+ "#Variables\n",
+ "x=symbols('x');\n",
+ "T1=293; #Temperature of air around thermocouple, K\n",
+ "T2=373; #Wall temperature, K\n",
+ "h=75; #Average Heat Transfer Coefficient, W/(m**2*K)\n",
+ "s=5.67*10**-8; #stefan Boltzman constant, W/(m**2*K**4)\n",
+ "\n",
+ "#Calculations\n",
+ "x=solve((h*(x-T1)+s*(x**4-T2**4)),x);\t #Calculating Thermocouple Temperature, K\n",
+ "y=x[1]-273;\t\t\t\t #Thermocouple Temperature, C\n",
+ "\n",
+ "#Results\n",
+ "print \"Thermocouple Temperature is :\",round(y,3),\"C\\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Thermocouple Temperature is : 28.395 C\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 1.6, Page number: 34"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "import math\n",
+ "from sympy import solve,symbols\n",
+ "\n",
+ "#Variables\n",
+ "x=symbols('x');\n",
+ "e=0.4; #emissivity\n",
+ "T1=293; #Temperature of air around Thermocouple, K\n",
+ "T2=273; #wall Temperature, K\n",
+ "h=75; #Average Heat Transfer Coefficient, W/(m**2*K)\n",
+ "s=5.6704*10**-8; #stefan Boltzman constant, W/(m**2*K**4)\n",
+ "\n",
+ "#Calculations\n",
+ "z=solve(((s*e*((373)**4 - (x)**4)) - h*(x-293)),x);\t#Calculating Thermocouple Temperature, K\n",
+ "y=z[0]-273;\t\t\t\t\t #Thermocouple Temperature, C\n",
+ "\n",
+ "'''NOTE: Equation written is absolutely correct and solving this equation\n",
+ " should give real result as: 296.112 i.e. 23.112 C, but somehow python is giving wrong result.'''\n",
+ "\n",
+ "#Results\n",
+ "print \"Thermocouple Temperature is :\",round(y,1),\"C \\n\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Thermocouple Temperature is : 25.9 C \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
} \ No newline at end of file
diff --git a/A_Heat_Transfer_Text_Book/Chapter11.ipynb b/A_Heat_Transfer_Text_Book/Chapter11.ipynb
index 9cd5d92a..cec52317 100755
--- a/A_Heat_Transfer_Text_Book/Chapter11.ipynb
+++ b/A_Heat_Transfer_Text_Book/Chapter11.ipynb
@@ -1,637 +1,631 @@
-{
- "metadata": {
- "name": ""
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 11: An introduction to mass transfer"
- ]
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 11.1, Page number:603"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variables\n",
- "Mn2=0.7556; #mass fraction of nitrogen\n",
- "Mo2=0.2315; #mass fraction of oxygen\n",
- "Mar=0.01289; #mass fraction of argon gas\n",
- "M1=28.02; #molar mass of N2,kg/kmol\n",
- "M2=32; #molar mass of O2,kg/kmol\n",
- "M3=39.95 ; #molar mass of Ar,kg/kmol\n",
- "p=101325; #Atmospheric pressure in Pascal(Pa)\n",
- "R=8314.5; #Gas constant, J/kmol-K\n",
- "T=300; #Approximate room temperature, K\n",
- "\n",
- "#Calculations\n",
- "Mair=(Mn2/M1+Mo2/M2+Mar/M3)**-1; #molar mass of air,kg/kmol\n",
- "Xo2=Mo2*Mair/M2; #mole fraction of O2\n",
- "PO2=Xo2*p; #partial pressure of O2,Pa\n",
- "Co2=PO2/(R*T); #molar volume of O2,kmol/m**3\n",
- "ao2=Co2*M2; #density of O2,kg/m**3\n",
- "\n",
- "\n",
- "#Result\n",
- "print \"Mole fraction of O2 is :\",round(Xo2,4),\"\\n\"\n",
- "print \"Partial pressure of O2 is :\",round(PO2,4),\"\\n\"\n",
- "print \"Molar volume of O2 is :\",round(Co2,4),\" kmol/m^3\\n\"\n",
- "print \"Density of O2 is :\",round(ao2,4),\" kg/m^3\\n\"\n",
- " #end"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Mole fraction of O2 is : 0.2095 \n",
- "\n",
- "Partial pressure of O2 is : 21232.5938 \n",
- "\n",
- "Molar volume of O2 is : 0.0085 kmol/m^3\n",
- "\n",
- "Density of O2 is : 0.2724 kg/m^3\n",
- "\n"
- ]
- }
- ],
- "prompt_number": 14
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 11.2, Page number: 606"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variables\n",
- "r=0.00241; #rate of consumption of carbon,kg/(m**2*s)\n",
- "Mo2=0.2; #concentration of oxygen at surface s\n",
- "Mco2=0.052; #concentration of CO2 at surface s\n",
- "sd=0.29; #density of surface s,kg/m**3\n",
- "\n",
- "#since carbon flows through a second imaginary surface u, the mass fluxes are relatedd by Ncu=-12/32*No2s=12/44*Nco2s\n",
- "#the minus sign arises because the O2 flow is opposite the C and CO2 flows.in steady state if we apply mass conservation to the control volume between the u and s surface, wee find that the total mass flux entering the u surface equals that leaving the s surface\n",
- "Ncu=r; #mass fluxes of carbon in u surface,kg/m**2/s\n",
- "\n",
- "#Calculations\n",
- "No2s=-32/12*Ncu; #mass flux of O2 in surface s,kg/(m**2*s)\n",
- "Nco2s=44/12*Ncu; #mass flux of CO2 in surface s,kg/(m**2*s)\n",
- "Vo2s=No2s/(Mo2*sd); #mass average speed,m/s\n",
- "Vco2s=Nco2s/(sd); #mass average speed,m/s\n",
- "Vs=(Nco2s+No2s)/sd; #effective mass average speed,m/s\n",
- "j1=sd*Mo2*(Vo2s-Vs); #diffusional mass flux,kg/(m**2*s)\n",
- "j2=sd*Mco2*(Vco2s-Vs); #diffusional mass flux,kg/(m**2*s)\n",
- "#the diffusional mass fluxes are very nearly equal to the species m ss fluxes. tha is because the mass average speed is much less than species speeds.\n",
- "\n",
- "N1 = Ncu/12; #mole flux of carbon through the surface s,kmol/(m**2*s)\n",
- "N2 = -N1; #mole flux of oxygen through the surface s,kmol/(m**2*s)\n",
- "\n",
- "#Result\n",
- "print \"Mass flux of O2 through an imaginary surface is :\",round(j1,5),\"kg/(m^2*s)\\n\"\n",
- "print \"Mass flux of CO2 through an imaginary surface is :\",round(j2,5),\"kg/(m^2*s)\\n\"\n",
- "\n",
- "print \"Mole flux of Co2 through an imaginary surface is :\",round(N1,5),\"kmol/(m^2*s)\\n\"\n",
- "print \"Mole flux of O2through an imaginary surface is :\",round(N2,5),\"kmol/(m^2*s)\\n\"\n",
- "print \"The two diffusional mole fluxes sum to zero themselves because ther is no convective mole flux for other species to diffuse against. the reader may find the velocity of the interface.that calculation shows the interface to be receding so slowly that the velocities are equal to those that would be seen by a stationary observer.\"\n",
- " #end\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Mass flux of O2 through an imaginary surface is : -0.00691 kg/(m^2*s)\n",
- "\n",
- "Mass flux of CO2 through an imaginary surface is : 0.00033 kg/(m^2*s)\n",
- "\n",
- "Mole flux of Co2 through an imaginary surface is : 0.0002 kmol/(m^2*s)\n",
- "\n",
- "Mole flux of O2through an imaginary surface is : -0.0002 kmol/(m^2*s)\n",
- "\n",
- "The two diffusional mole fluxes sum to zero themselves because ther is no convective mole flux for other species to diffuse against. the reader may find the velocity of the interface.that calculation shows the interface to be receding so slowly that the velocities are equal to those that would be seen by a stationary observer.\n"
- ]
- }
- ],
- "prompt_number": 15
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 11.3, Page number: 617"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variables\n",
- "T1=276; #temp.of air,K\n",
- "aa=3.711; #lennard jones constant or collision diameter,A\n",
- "ab=2.827; #lennard jones constant or collision diameter,A\n",
- "b1=78.6; #lennard jones constant,K\n",
- "b2=59.7; #lennard jones constant,K\n",
- "Ma=28.97; #Molecular mass of air, kg/kmol\n",
- "Mh=2.016; #Molecular mass of hydrogen, kg/kmol\n",
- "\n",
- "#Calculations\n",
- "a=(aa+ab)/2; #effective molecular diameter for collisions of hydrogen and air,m\n",
- "b=math.sqrt(b1*b2); #effective potential well depth,K\n",
- "c=T1/b; \n",
- "\n",
- "d=0.8822; #potential well function, from table 11.3\n",
- "Dab=(1.8583*math.pow(10,-7))*math.pow(T1,1.5)/(math.pow(a,2)*d)*math.sqrt(1/Mh+1/Ma); #diffusion coefficient of hydrogen in air,m**2/s\n",
- "\n",
- "\n",
- "#Result\n",
- "print \"Diffusion coefficient of hydrogen in air is :\",round(Dab,6),\"m^2/s an experimental value from table is 6.34*10^-5 m^2/s,so the prediction is high by 5 percent.\\n\"\n",
- " #end\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Diffusion coefficient of hydrogen in air is : 6.6e-05 m^2/s an experimental value from table is 6.34*10^-5 m^2/s,so the prediction is high by 5 percent.\n",
- "\n"
- ]
- }
- ],
- "prompt_number": 2
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 11.4, Page number: 625"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "from numpy import array\n",
- "\n",
- "#Variables\n",
- "T1=373.15; #temp.of tea,K\n",
- "XN2=0.7808; #mole fraction of nitrogen\n",
- "XO2=0.2095; #mole fraction of oxygen\n",
- "Xar=0.0093; #mole fraction of\n",
- "Cp=1006 #mixture diffusivity,j/(kg*K)\n",
- "\n",
- "#Calculations\n",
- "a=array(([3.798, 3.467, 3.542])); #collisin diameter,m\n",
- "b=array(([71.4, 106.7, 93.3])); #lennard jones constant,K\n",
- "M=array(([28.02, 32, 39.95])); #molar masses,kg/kmol\n",
- "c=array(([0.9599, 1.057, 1.021])); #potential well function\n",
- "d=array(([1.8*10**-5, 2.059*10**-5, 2.281*10**-5])); #calculated viscosity,kg/(m*s)\n",
- "e=array(([1.8*10**-5, 2.07*10**-5, 2.29*10**-5])); # theoritical viscosity,kg/(m*s)\n",
- "f=array(([0.0260, 0.02615, 0.01787])); #theoritical thermal conducitvity,W/(m*K)\n",
- "\n",
- "u=2.6693*10**-6*(M*T1)**0.5/((a**2*c)); #viscosity,kg/(m*s)\n",
- "k=0.083228/((a**2*c*(T1/M**0.5))) #thermal conductivity,W/(m*s)\n",
- "umc = XN2*u.item(0)/0.9978+XO2*u.item(1)/1.008+Xar*u.item(2)/0.9435 ; #calculated mixture viscosity,kg/(m*s)\n",
- "umc1=1.857*10**-5;\n",
- "\n",
- "umd=XN2*e.item(0)/0.9978+XO2*e.item(1)/1.008+e.item(2)*Xar/0.9435; #theoritical mixture viscosity,kg/(m*s)\n",
- "kmc=XN2*k.item(0)/0.9978+XO2*k.item(1)/1.008+Xar*k.item(2)/0.9435; #calculated thermal conducitvity,W/(m*K)\n",
- "kmc1=0.02623;\n",
- "kmd=XN2*f.item(0)/0.9978+XO2*f.item(1)/1.008+Xar*f.item(2)/0.9435; #theoritical thermal conductivity, W/(m*K)\n",
- "pr=umd*Cp/kmd; #prandtl no.\n",
- "\n",
- "#Result\n",
- "print \"Theoritical mixture viscosity is :\",round(umc1,6),\"kg/(m*s)\\n\"\n",
- "print \"Calculated mixture viscosity is :\",round(umd,6),\"kg/(m*s)\\n\"\n",
- "print \"Theoritical thermal conducitvity is :\",round(kmc1,4),\" W/(m*K)\\n\"\n",
- "print \"Calculated thermal conducitvity is :\",round(kmd,4),\"W/(m*K)\\n\" \n",
- "print \"Prandtl no. is :\",round(pr,4),\"\\n\"\n",
- "\n",
- "\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "ename": "ImportError",
- "evalue": "DLL load failed: %1 is not a valid Win32 application.",
- "output_type": "pyerr",
- "traceback": [
- "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[1;31mImportError\u001b[0m Traceback (most recent call last)",
- "\u001b[1;32m<ipython-input-1-f818c437f68e>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[0m__future__\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mdivision\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 2\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mmath\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 3\u001b[1;33m \u001b[1;32mfrom\u001b[0m \u001b[0mnumpy\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0marray\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 4\u001b[0m \u001b[1;31m#Question\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 5\u001b[0m \u001b[1;34m'''Compute the transport properties of normal air at 300 K.'''\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
- "\u001b[1;32mC:\\Users\\jaidev\\Anaconda\\lib\\site-packages\\numpy\\__init__.py\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 151\u001b[0m \u001b[1;32mreturn\u001b[0m \u001b[0mloader\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m*\u001b[0m\u001b[0mpackages\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m**\u001b[0m\u001b[0moptions\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 152\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 153\u001b[1;33m \u001b[1;32mfrom\u001b[0m \u001b[1;33m.\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0madd_newdocs\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 154\u001b[0m \u001b[0m__all__\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;33m[\u001b[0m\u001b[1;34m'add_newdocs'\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m'ModuleDeprecationWarning'\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 155\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n",
- "\u001b[1;32mC:\\Users\\jaidev\\Anaconda\\lib\\site-packages\\numpy\\add_newdocs.py\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 11\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[0m__future__\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mdivision\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mabsolute_import\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mprint_function\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 12\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 13\u001b[1;33m \u001b[1;32mfrom\u001b[0m \u001b[0mnumpy\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mlib\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0madd_newdoc\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 14\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 15\u001b[0m \u001b[1;31m###############################################################################\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
- "\u001b[1;32mC:\\Users\\jaidev\\Anaconda\\lib\\site-packages\\numpy\\lib\\__init__.py\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 6\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[0mnumpy\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mversion\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mversion\u001b[0m \u001b[1;32mas\u001b[0m \u001b[0m__version__\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 7\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 8\u001b[1;33m \u001b[1;32mfrom\u001b[0m \u001b[1;33m.\u001b[0m\u001b[0mtype_check\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[1;33m*\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 9\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[1;33m.\u001b[0m\u001b[0mindex_tricks\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[1;33m*\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 10\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[1;33m.\u001b[0m\u001b[0mfunction_base\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[1;33m*\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
- "\u001b[1;32mC:\\Users\\jaidev\\Anaconda\\lib\\site-packages\\numpy\\lib\\type_check.py\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 9\u001b[0m 'common_type']\n\u001b[0;32m 10\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 11\u001b[1;33m \u001b[1;32mimport\u001b[0m \u001b[0mnumpy\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mcore\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mnumeric\u001b[0m \u001b[1;32mas\u001b[0m \u001b[0m_nx\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 12\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[0mnumpy\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mcore\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mnumeric\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0masarray\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0masanyarray\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0marray\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0misnan\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0;31m \u001b[0m\u001b[0;31m\\\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 13\u001b[0m \u001b[0mobj2sctype\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mzeros\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
- "\u001b[1;32mC:\\Users\\jaidev\\Anaconda\\lib\\site-packages\\numpy\\core\\__init__.py\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 4\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[0mnumpy\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mversion\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mversion\u001b[0m \u001b[1;32mas\u001b[0m \u001b[0m__version__\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 5\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 6\u001b[1;33m \u001b[1;32mfrom\u001b[0m \u001b[1;33m.\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mmultiarray\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 7\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[1;33m.\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mumath\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 8\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[1;33m.\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0m_internal\u001b[0m \u001b[1;31m# for freeze programs\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
- "\u001b[1;31mImportError\u001b[0m: DLL load failed: %1 is not a valid Win32 application."
- ]
- }
- ],
- "prompt_number": 1
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 11.5, Page number: 632"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "from numpy import array\n",
- "import matplotlib.pyplot as plt\n",
- "%matplotlib inline\n",
- "\n",
- "#Variables\n",
- "Patm=101.325;\t\t\t#Atmospheric pressure in kPa.\n",
- "Mh20=18.02;\t\t\t\t#Molecular mass of H20 in kg/kmol.\n",
- "Mair=28.96;\t\t\t\t#Molecular mass of air in kg/kmol.\n",
- "Psat =array(([0.6113, 1.2276, 2.3385, 4.2461, 7.3837, 12.35, 19.941, 31.188, 47.39, 70.139, 101.325]));\t\t#Saturated pressure of watrer in kPa \n",
- "T=array(([0.01, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100]));\t\t#Temperature of air in in degree C\n",
- "#Calculations\n",
- "xw=Psat/Patm;\t\t\t\t\n",
- "\n",
- "mw=(xw*Mh20)/(xw*Mh20+(1-xw)*Mair);\t\t#Mass fraction of water vapour.\n",
- "#Result\n",
- "plt.plot(T,mw);\n",
- "plt.xlabel(\"Temperature(Degree C)\")\n",
- "plt.ylabel(\"Mass fraction of water vapour\");\n",
- "plt.show()\n",
- "\n",
- "\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Populating the interactive namespace from numpy and matplotlib\n"
- ]
- },
- {
- "metadata": {},
- "output_type": "display_data",
- "png": "iVBORw0KGgoAAAANSUhEUgAAAYcAAAEPCAYAAACp/QjLAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XlcVPX+P/AXmxtq5o5AoYDsIrglipKGmIqlmeJ2FQnJ\n3ErrV997b4bZ1bzebql071UrLRfEyBtmSqaCuYCWqJB4U1QScMOdRbbh8/vjxAiyzDBw5swwr+fj\nMQ+YmTOf855Tnjef3UwIIUBERFSJudIBEBGR4WFyICKiapgciIioGiYHIiKqhsmBiIiqYXIgIqJq\nZE0Os2bNQpcuXeDl5VXrMQsWLICzszO8vb1x6tQpOcMhIiItyZocQkNDER8fX+v7e/bsQUZGBi5c\nuID169djzpw5coZDRERakjU5+Pv748knn6z1/V27dmHGjBkAgAEDBuDevXu4ceOGnCEREZEWFO1z\nyMnJgb29vfq5nZ0dsrOzFYyIiIgAA+iQfnz1DjMzM4UiISKiCpZKntzW1hZZWVnq59nZ2bC1ta12\nnJOTEy5evKjP0IiIjJ6joyMyMjJ0+qyiNYexY8fiq6++AgAkJyejXbt26NKlS7XjLl68CCEEH0Lg\nvffeUzwGQ3nwWvBa8FrU/FixQmD2bNGgP6plrTlMnjwZhw4dwq1bt2Bvb4+lS5eitLQUABAREYFR\no0Zhz549cHJygrW1NTZu3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Kwty5c5GSktKIUWq2fv16FBQU4I033tDreUl57HMgo2FM7d5z587F\njBkzGpQcrly5gokTJ6K8vBzNmjXDhg0bGjFC7cTExCAuLk7v5yXlseZARETVsM+BiIiqYXIgIqJq\nmByIiKgaJgciIqqGyYGIiKphciAiomr+P6Ksmp778+IaAAAAAElFTkSuQmCC\n",
- "text": [
- "<matplotlib.figure.Figure at 0x8a7c4e0>"
- ]
- }
- ],
- "prompt_number": 18
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 11.6, Page number: 634"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variables\n",
- "T1=263.15; #temp.of ice,K\n",
- "p=101.325; #Atmospheric pressure, KPa\n",
- "Molw=18.02; #Molecular mass of water vapour, g/mol\n",
- "Mola=28.96; #Molecular mass of air, g/mol\n",
- "\n",
- "#Calculations\n",
- "Pv=math.exp(21.99-6141/(T1)); #vapor pressure,KPa\n",
- "xw=Pv/p; #mole fraction of water\n",
- "mw=xw*Molw/(xw*Molw+(1-xw)*Mola); #mass fraction\n",
- "\n",
- "#Result\n",
- "print \"Mass fraction of watervapor above the surface of ice is :\",round(mw,5),\"\\n\"\n",
- "#end\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Mass fraction of watervapor above the surface of ice is : 0.0016 \n",
- "\n"
- ]
- }
- ],
- "prompt_number": 26
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 11.10, Page number:"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variables\n",
- "T1=303; # isothermal temp.,K\n",
- "v=5; #air speed,m/s\n",
- "l=0.05; #length of naphthalene model that is flat, m\n",
- "Mnap=128.2; #molar mass of naphthalene,kg/kmol\n",
- "nu=1.867*10**-5; #Dynamic viscocity, m^2/s\n",
- "\n",
- "#Calculations\n",
- "D=0.86*(10**-5); #diffusion coefficient of naphthalene in air,m/s\n",
- "\n",
- "Pv=10**(11.45-3729.3/T1)*133.31; #vapor pressure of napthalene, Pa\n",
- "xn=Pv/101325; #mole fraction of naphthalene\n",
- "mn=xn*Mnap/(xn*Mnap+(1-xn)*28.96); #mass fraction of naphthalene\n",
- "mnp=0; #mass fraction of naphthalene in free stream is 0\n",
- "\n",
- "Rel=v*l/nu; #reynolds no.\n",
- "Sc=nu/D; #schimidt no.\n",
- "Nul=0.664*math.sqrt(Rel)*(Sc**(1/3)); #mass transfer nusselt no.\n",
- "Gmn=D*Nul*1.166/l; #gas phase mass transfer coefficient,kg/(m**2*s)\n",
- "n=Gmn*(mn-mnp); #average mass flux,kg/(m**2*s)\n",
- "n1=n*1000*3600;# average mass flux, g/m**2.h\n",
- "\n",
- "#Result\n",
- "print \"Average rate of loss of naphthalene from a part of model is :\",round(n,7),\"kg/(m^2*s) or \",round(n1),\"g/(m^2*h)\\n\"\n",
- "print \"Naphthalene sublimatin can be used to infer heat transfer coefficient by measuring the loss of naphthalene from a model over some length of time.since the schimidt no. of naphthalene is not generally equal to prandtl no. under the conditions of interest, some assumption about the dependence of nusselt no. on the prandtl no. must usually be introduced.\\n\"\n",
- " #end\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Average rate of loss of naphthalene from a part of model is : 1.61e-05 kg/(m^2*s) or 58.0 g/(m^2*h)\n",
- "\n",
- "Naphthalene sublimatin can be used to infer heat transfer coefficient by measuring the loss of naphthalene from a model over some length of time.since the schimidt no. of naphthalene is not generally equal to prandtl no. under the conditions of interest, some assumption about the dependence of nusselt no. on the prandtl no. must usually be introduced.\n",
- "\n"
- ]
- }
- ],
- "prompt_number": 16
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 11.11, Page number:"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variables\n",
- "T1=300; #temp. of helium-water tube,K\n",
- "h=0.4; #height of vertical wall,m\n",
- "m=0.087*10**-3; #flow rate of helium,kg/(m**2*s)\n",
- "#this is a uniform flux natural convection problem.\n",
- "Mhes=0.01; # assuming the value of mass fraction of helium at the wall to be 0.01\n",
- "Mhef=Mhes/2; #film composition\n",
- "af=1.141; #film density,kg/m**3\n",
- "wd=1.107; #wall density,kg/m**3\n",
- "Dha=7.119*10**-5; #diffusion coefficient,m**2/s\n",
- "u=1.857*10**-5; #film viscosity at 300K,kg/(m*s)\n",
- "aa=1.177; #air density,kg/m**3\n",
- "g=9.8; #Gravity constant, m/s**2\n",
- "#Calculations\n",
- "Sc=(u/af)/Dha; #schimidt no.\n",
- "Ra1=g*(aa-wd)*m*h**4/(u*af*Dha**2*Mhes); #Rayleigh no.\n",
- "Nu=6/5*(Ra1*Sc/(4+9*math.sqrt(Sc)+10*Sc))**(1/5); #approximate nusselt no.\n",
- "s=m*h/(af*Dha*Nu); #average concentration of helium at the wall\n",
- "#thus we have obtained an average wall concentration 14 oercent higher than our initial guess of Mhes.we repeat this calclations with revised values of densities to obtain Mhes = 0.01142\n",
- "\n",
- "\n",
- "#Result\n",
- "print \"Average conentration of helium at the wall is \",round(s,5),\",since the result is within 0.5 percent of our second guess, a third iteration is not needed\"\n",
- " #end\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Average conentration of helium at the wall is 0.01136 ,since the result is within 0.5 percent of our second guess, a third iteration is not needed\n"
- ]
- }
- ],
- "prompt_number": 17
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 11.14, Page number:"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variables\n",
- "T1=325; #temp. of helium-water tube,K\n",
- "l=0.2; #length of tube,m\n",
- "x=0.01; # mole fraction of water\n",
- "R=8314.472; #gas constant,J/(kmol*K)\n",
- "Mw=18.02;#Molecular mass of water, g/mol\n",
- "#the vapor pressure of the liquid water is approximately the saturation pressure at the water temp.\n",
- "\n",
- "#Calculations\n",
- "p=1.341*10000 ; #vapor pressure using steam table,Pa\n",
- "x1=p/101325; #mole fraction of saturated water\n",
- "c=101325/(R*T1); #mole concentration in tube,kmol/m**3\n",
- "D12=1.067*math.pow(10,-4); #diffusivity ofwater with respect to helium,m**2/s \n",
- "Nw=c*D12*math.log(1+(x-x1)/(x1-1))/l ; #molar evaporation rate,kmol/(m**2*s)\n",
- "nw=Nw*Mw; # mass evaporation rate,kg/(m**2*s)\n",
- "\n",
- "#S=1+(x1-1)*math.exp(Nw*y/(c*D12)) conentration distribution of water-vapor\n",
- "#Result\n",
- "print \"Conentration distribution of water-vapor is : x1(y)=1-0.8677*exp(0.6593*y) where y is expressed in meters.\\n\"\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Conentration distribution of water-vapor is : x1(y)=1-0.8677*exp(0.6593*y) where y is expressed in meters.\n",
- "\n"
- ]
- }
- ],
- "prompt_number": 18
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 11.15, Page number:"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "\n",
- "#Variables\n",
- "T1=1473; #suraface temp.of hot water,K\n",
- "x=0.05; #mass fraction of water\n",
- "Gm=0.017; #average mass transfer coefficient,kg/(m**2*s)\n",
- "A=0.04; #suraface area of pan,m**2\n",
- "\n",
- " #only water vapour passes through the liquid surface, since air is not strongly absorbed into water under normal conditions.\n",
- "#Calculations\n",
- "p=38.58*1000; #saturation pressure of water,kPa\n",
- "Xwater=p/101325; #mole fraction of saturated water\n",
- "Mwater=Xwater*18.02/(Xwater*18.02+(1-Xwater)*28.96); #mass fraction of saturated water\n",
- "\n",
- "B=(x-Mwater)/(Mwater-1); #mass transfer driving force\n",
- "m=Gm*B*A; #evaporation rate,kg/s\n",
- "\n",
- "#Result\n",
- "print \"Evaporation rate is:\",round(m,6),\" kg/s\"\n",
- "\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Evaporation rate is: 0.000213 kg/s\n"
- ]
- }
- ],
- "prompt_number": 23
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 11.16, Page number:"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "from __future__ import division\n",
- "import math\n",
- "\n",
- "#Variables\n",
- "T1=298; #temp.of air,K\n",
- "T2=323.15; #film temp.,K\n",
- "x=0.05; #mass fraction of water at 75 C\n",
- "Gm=0.017; #average mass transfer coefficient,kg/(m**2*s)\n",
- "A=0.04; #suraface area of pan,m**2\n",
- "l=0.2; #length of pan in flow direction,m\n",
- "v=5; #air speed,m/s\n",
- "m=(x+0.277)/2; #film composition of water at 50 C\n",
- "Mf=26.34; #mixture molecular weight,kg/kmol\n",
- "p=101325; #Atmospheric pressure, Pa\n",
- "R=8314.5; #Gas constant, J/kmol-K\n",
- "Uf=1.75*math.pow(10,-5); #film viscosity,kg/(m*s)\n",
- "B=0.314; #mass transfer driving force\n",
- "D=2.96*math.pow(10,-5); #diffusivity of water in air,m**2/s\n",
- "df=0.993; #Density of ideal air, kg/m**#\n",
- "\n",
- "#Calculations\n",
- "af=p*Mf/(R*T2); \t #film density from ideal gas law,kg/m**3\n",
- "Vf=Uf/af; #kinematic viscosity,m**2/s\n",
- "Rel=v*l/Vf; #reynolds no. comes out to be 56,800 so the flow is laminar.\n",
- "Sc=Vf/D; #scimidt no.\n",
- "Nu=0.664*math.sqrt(Rel)*math.pow(Sc,1/3); #nussselt no.\n",
- "Gmw1=Nu*(D*df/l); #appropriate value of mass transfer gas phase coeffficient of water in air,kg/(m**2*s)\n",
- "Gmw=Gmw1*(math.log(1+B)/B); \t #mass transfer gas phase coeffficient of water in air,kg/(m**2*s)\n",
- "\n",
- "#Results\n",
- "print \"Mass transfer gas phase coeffficient of water in air is :\",round(Gmw,4),\"kg/(m^2*s)\\nIn this caes, the blowing factor is 0.870. Thus the mild blowing has reduced the mass transfer coefficient by about 13 percent\"\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "0.01955648559 133.069905487\n",
- "Mass transfer gas phase coeffficient of water in air is : 0.017 kg/(m^2*s)\n",
- "In this caes, the blowing factor is 0.870. Thus the mild blowing has reduced the mass transfer coefficient by about 13 percent\n"
- ]
- }
- ],
- "prompt_number": 28
- }
- ],
- "metadata": {}
- }
- ]
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 11: An introduction to mass transfer"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 11.1, Page number:603"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "\n",
+ "#Variables\n",
+ "Mn2=0.7556; #mass fraction of nitrogen\n",
+ "Mo2=0.2315; #mass fraction of oxygen\n",
+ "Mar=0.01289; #mass fraction of argon gas\n",
+ "M1=28.02; #molar mass of N2,kg/kmol\n",
+ "M2=32; #molar mass of O2,kg/kmol\n",
+ "M3=39.95 ; #molar mass of Ar,kg/kmol\n",
+ "p=101325; #Atmospheric pressure in Pascal(Pa)\n",
+ "R=8314.5; #Gas constant, J/kmol-K\n",
+ "T=300; #Approximate room temperature, K\n",
+ "\n",
+ "#Calculations\n",
+ "Mair=(Mn2/M1+Mo2/M2+Mar/M3)**-1; #molar mass of air,kg/kmol\n",
+ "Xo2=Mo2*Mair/M2; #mole fraction of O2\n",
+ "PO2=Xo2*p; #partial pressure of O2,Pa\n",
+ "Co2=PO2/(R*T); #molar volume of O2,kmol/m**3\n",
+ "ao2=Co2*M2; #density of O2,kg/m**3\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print \"Mole fraction of O2 is :\",round(Xo2,4),\"\\n\"\n",
+ "print \"Partial pressure of O2 is :\",round(PO2,4),\"\\n\"\n",
+ "print \"Molar volume of O2 is :\",round(Co2,4),\" kmol/m^3\\n\"\n",
+ "print \"Density of O2 is :\",round(ao2,4),\" kg/m^3\\n\"\n",
+ " #end"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mole fraction of O2 is : 0.2095 \n",
+ "\n",
+ "Partial pressure of O2 is : 21232.5938 \n",
+ "\n",
+ "Molar volume of O2 is : 0.0085 kmol/m^3\n",
+ "\n",
+ "Density of O2 is : 0.2724 kg/m^3\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 11.2, Page number: 606"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "\n",
+ "#Variables\n",
+ "r=0.00241; #rate of consumption of carbon,kg/(m**2*s)\n",
+ "Mo2=0.2; #concentration of oxygen at surface s\n",
+ "Mco2=0.052; #concentration of CO2 at surface s\n",
+ "sd=0.29; #density of surface s,kg/m**3\n",
+ "\n",
+ "#since carbon flows through a second imaginary surface u, the mass fluxes are relatedd by Ncu=-12/32*No2s=12/44*Nco2s\n",
+ "#the minus sign arises because the O2 flow is opposite the C and CO2 flows.in steady state if we apply mass conservation to the control volume between the u and s surface, wee find that the total mass flux entering the u surface equals that leaving the s surface\n",
+ "Ncu=r; #mass fluxes of carbon in u surface,kg/m**2/s\n",
+ "\n",
+ "#Calculations\n",
+ "No2s=-32/12*Ncu; #mass flux of O2 in surface s,kg/(m**2*s)\n",
+ "Nco2s=44/12*Ncu; #mass flux of CO2 in surface s,kg/(m**2*s)\n",
+ "Vo2s=No2s/(Mo2*sd); #mass average speed,m/s\n",
+ "Vco2s=Nco2s/(sd); #mass average speed,m/s\n",
+ "Vs=(Nco2s+No2s)/sd; #effective mass average speed,m/s\n",
+ "j1=sd*Mo2*(Vo2s-Vs); #diffusional mass flux,kg/(m**2*s)\n",
+ "j2=sd*Mco2*(Vco2s-Vs); #diffusional mass flux,kg/(m**2*s)\n",
+ "#the diffusional mass fluxes are very nearly equal to the species m ss fluxes. tha is because the mass average speed is much less than species speeds.\n",
+ "\n",
+ "N1 = Ncu/12; #mole flux of carbon through the surface s,kmol/(m**2*s)\n",
+ "N2 = -N1; #mole flux of oxygen through the surface s,kmol/(m**2*s)\n",
+ "\n",
+ "#Result\n",
+ "print \"Mass flux of O2 through an imaginary surface is :\",round(j1,5),\"kg/(m^2*s)\\n\"\n",
+ "print \"Mass flux of CO2 through an imaginary surface is :\",round(j2,5),\"kg/(m^2*s)\\n\"\n",
+ "\n",
+ "print \"Mole flux of Co2 through an imaginary surface is :\",round(N1,5),\"kmol/(m^2*s)\\n\"\n",
+ "print \"Mole flux of O2through an imaginary surface is :\",round(N2,5),\"kmol/(m^2*s)\\n\"\n",
+ "print \"The two diffusional mole fluxes sum to zero themselves because ther is no convective mole flux for other species to diffuse against. the reader may find the velocity of the interface.that calculation shows the interface to be receding so slowly that the velocities are equal to those that would be seen by a stationary observer.\"\n",
+ " #end\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mass flux of O2 through an imaginary surface is : -0.00691 kg/(m^2*s)\n",
+ "\n",
+ "Mass flux of CO2 through an imaginary surface is : 0.00033 kg/(m^2*s)\n",
+ "\n",
+ "Mole flux of Co2 through an imaginary surface is : 0.0002 kmol/(m^2*s)\n",
+ "\n",
+ "Mole flux of O2through an imaginary surface is : -0.0002 kmol/(m^2*s)\n",
+ "\n",
+ "The two diffusional mole fluxes sum to zero themselves because ther is no convective mole flux for other species to diffuse against. the reader may find the velocity of the interface.that calculation shows the interface to be receding so slowly that the velocities are equal to those that would be seen by a stationary observer.\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 11.3, Page number: 617"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "import math\n",
+ "\n",
+ "#Variables\n",
+ "T1=276; #temp.of air,K\n",
+ "aa=3.711; #lennard jones constant or collision diameter,A\n",
+ "ab=2.827; #lennard jones constant or collision diameter,A\n",
+ "b1=78.6; #lennard jones constant,K\n",
+ "b2=59.7; #lennard jones constant,K\n",
+ "Ma=28.97; #Molecular mass of air, kg/kmol\n",
+ "Mh=2.016; #Molecular mass of hydrogen, kg/kmol\n",
+ "\n",
+ "#Calculations\n",
+ "a=(aa+ab)/2; #effective molecular diameter for collisions of hydrogen and air,m\n",
+ "b=math.sqrt(b1*b2); #effective potential well depth,K\n",
+ "c=T1/b; \n",
+ "\n",
+ "d=0.8822; #potential well function, from table 11.3\n",
+ "Dab=(1.8583*math.pow(10,-7))*math.pow(T1,1.5)/(math.pow(a,2)*d)*math.sqrt(1/Mh+1/Ma); #diffusion coefficient of hydrogen in air,m**2/s\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print \"Diffusion coefficient of hydrogen in air is :\",round(Dab,6),\"m^2/s an experimental value from table is 6.34*10^-5 m^2/s,so the prediction is high by 5 percent.\\n\"\n",
+ " #end\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Diffusion coefficient of hydrogen in air is : 6.6e-05 m^2/s an experimental value from table is 6.34*10^-5 m^2/s,so the prediction is high by 5 percent.\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 11.4, Page number: 625"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "import math\n",
+ "from numpy import array\n",
+ "\n",
+ "#Variables\n",
+ "T1=373.15; #temp.of tea,K\n",
+ "XN2=0.7808; #mole fraction of nitrogen\n",
+ "XO2=0.2095; #mole fraction of oxygen\n",
+ "Xar=0.0093; #mole fraction of\n",
+ "Cp=1006 #mixture diffusivity,j/(kg*K)\n",
+ "\n",
+ "#Calculations\n",
+ "a=array(([3.798, 3.467, 3.542])); #collisin diameter,m\n",
+ "b=array(([71.4, 106.7, 93.3])); #lennard jones constant,K\n",
+ "M=array(([28.02, 32, 39.95])); #molar masses,kg/kmol\n",
+ "c=array(([0.9599, 1.057, 1.021])); #potential well function\n",
+ "d=array(([1.8*10**-5, 2.059*10**-5, 2.281*10**-5])); #calculated viscosity,kg/(m*s)\n",
+ "e=array(([1.8*10**-5, 2.07*10**-5, 2.29*10**-5])); # theoritical viscosity,kg/(m*s)\n",
+ "f=array(([0.0260, 0.02615, 0.01787])); #theoritical thermal conducitvity,W/(m*K)\n",
+ "\n",
+ "u=2.6693*10**-6*(M*T1)**0.5/((a**2*c)); #viscosity,kg/(m*s)\n",
+ "k=0.083228/((a**2*c*(T1/M**0.5))) #thermal conductivity,W/(m*s)\n",
+ "umc = XN2*u.item(0)/0.9978+XO2*u.item(1)/1.008+Xar*u.item(2)/0.9435 ; #calculated mixture viscosity,kg/(m*s)\n",
+ "umc1=1.857*10**-5;\n",
+ "\n",
+ "umd=XN2*e.item(0)/0.9978+XO2*e.item(1)/1.008+e.item(2)*Xar/0.9435; #theoritical mixture viscosity,kg/(m*s)\n",
+ "kmc=XN2*k.item(0)/0.9978+XO2*k.item(1)/1.008+Xar*k.item(2)/0.9435; #calculated thermal conducitvity,W/(m*K)\n",
+ "kmc1=0.02623;\n",
+ "kmd=XN2*f.item(0)/0.9978+XO2*f.item(1)/1.008+Xar*f.item(2)/0.9435; #theoritical thermal conductivity, W/(m*K)\n",
+ "pr=umd*Cp/kmd; #prandtl no.\n",
+ "\n",
+ "#Result\n",
+ "print \"Theoritical mixture viscosity is :\",round(umc1,6),\"kg/(m*s)\\n\"\n",
+ "print \"Calculated mixture viscosity is :\",round(umd,6),\"kg/(m*s)\\n\"\n",
+ "print \"Theoritical thermal conducitvity is :\",round(kmc1,4),\" W/(m*K)\\n\"\n",
+ "print \"Calculated thermal conducitvity is :\",round(kmd,4),\"W/(m*K)\\n\" \n",
+ "print \"Prandtl no. is :\",round(pr,4),\"\\n\"\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Theoritical mixture viscosity is : 1.9e-05 kg/(m*s)\n",
+ "\n",
+ "Calculated mixture viscosity is : 1.9e-05 kg/(m*s)\n",
+ "\n",
+ "Theoritical thermal conducitvity is : 0.0262 W/(m*K)\n",
+ "\n",
+ "Calculated thermal conducitvity is : 0.026 W/(m*K)\n",
+ "\n",
+ "Prandtl no. is : 0.7214 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 11.5, Page number: 632"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "import math\n",
+ "from numpy import array\n",
+ "import matplotlib.pyplot as plt\n",
+ "%matplotlib inline\n",
+ "\n",
+ "#Variables\n",
+ "Patm=101.325;\t\t\t#Atmospheric pressure in kPa.\n",
+ "Mh20=18.02;\t\t\t\t#Molecular mass of H20 in kg/kmol.\n",
+ "Mair=28.96;\t\t\t\t#Molecular mass of air in kg/kmol.\n",
+ "Psat =array(([0.6113, 1.2276, 2.3385, 4.2461, 7.3837, 12.35, 19.941, 31.188, 47.39, 70.139, 101.325]));\t\t#Saturated pressure of watrer in kPa \n",
+ "T=array(([0.01, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100]));\t\t#Temperature of air in in degree C\n",
+ "#Calculations\n",
+ "xw=Psat/Patm;\t\t\t\t\n",
+ "\n",
+ "mw=(xw*Mh20)/(xw*Mh20+(1-xw)*Mair);\t\t#Mass fraction of water vapour.\n",
+ "#Result\n",
+ "plt.plot(T,mw);\n",
+ "plt.xlabel(\"Temperature(Degree C)\")\n",
+ "plt.ylabel(\"Mass fraction of water vapour\");\n",
+ "plt.show()\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYcAAAEPCAYAAACp/QjLAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XlcVPX+P/AXmxtq5o5AoYDsIrglipKGmIqlmeJ2FQnJ\n3ErrV997b4bZ1bzebql071UrLRfEyBtmSqaCuYCWqJB4U1QScMOdRbbh8/vjxAiyzDBw5swwr+fj\nMQ+YmTOf855Tnjef3UwIIUBERFSJudIBEBGR4WFyICKiapgciIioGiYHIiKqhsmBiIiqYXIgIqJq\nZE0Os2bNQpcuXeDl5VXrMQsWLICzszO8vb1x6tQpOcMhIiItyZocQkNDER8fX+v7e/bsQUZGBi5c\nuID169djzpw5coZDRERakjU5+Pv748knn6z1/V27dmHGjBkAgAEDBuDevXu4ceOGnCEREZEWFO1z\nyMnJgb29vfq5nZ0dsrOzFYyIiIgAA+iQfnz1DjMzM4UiISKiCpZKntzW1hZZWVnq59nZ2bC1ta12\nnJOTEy5evKjP0IiIjJ6joyMyMjJ0+qyiNYexY8fiq6++AgAkJyejXbt26NKlS7XjLl68CCEEH0Lg\nvffeUzwGQ3nwWvBa8FrU/FixQmD2bNGgP6plrTlMnj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+LtlNRiEzMxPBwcFIS0tTOhStREZGws3N\nrUqfR32VlJTAwsICFhYWSEpKwty5c5GSktKIUWq2fv16FBQU4I033tDreUl57HMgo2FM7d5z587F\njBkzGpQcrly5gokTJ6K8vBzNmjXDhg0bGjFC7cTExCAuLk7v5yXlseZARETVsM+BiIiqYXIgIqJq\nmByIiKgaJgciIqqGyYGIiKphciAiomr+P6Ksmp778+IaAAAAAElFTkSuQmCC\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x7f4109404550>"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 11.6, Page number: 634"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "import math\n",
+ "\n",
+ "#Variables\n",
+ "T1=263.15; #temp.of ice,K\n",
+ "p=101.325; #Atmospheric pressure, KPa\n",
+ "Molw=18.02; #Molecular mass of water vapour, g/mol\n",
+ "Mola=28.96; #Molecular mass of air, g/mol\n",
+ "\n",
+ "#Calculations\n",
+ "Pv=math.exp(21.99-6141/(T1)); #vapor pressure,KPa\n",
+ "xw=Pv/p; #mole fraction of water\n",
+ "mw=xw*Molw/(xw*Molw+(1-xw)*Mola); #mass fraction\n",
+ "\n",
+ "#Result\n",
+ "print \"Mass fraction of watervapor above the surface of ice is :\",round(mw,5),\"\\n\"\n",
+ "#end\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mass fraction of watervapor above the surface of ice is : 0.0016 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 11.10, Page number:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "\n",
+ "#Variables\n",
+ "T1=303; # isothermal temp.,K\n",
+ "v=5; #air speed,m/s\n",
+ "l=0.05; #length of naphthalene model that is flat, m\n",
+ "Mnap=128.2; #molar mass of naphthalene,kg/kmol\n",
+ "nu=1.867*10**-5; #Dynamic viscocity, m^2/s\n",
+ "\n",
+ "#Calculations\n",
+ "D=0.86*(10**-5); #diffusion coefficient of naphthalene in air,m/s\n",
+ "\n",
+ "Pv=10**(11.45-3729.3/T1)*133.31; #vapor pressure of napthalene, Pa\n",
+ "xn=Pv/101325; #mole fraction of naphthalene\n",
+ "mn=xn*Mnap/(xn*Mnap+(1-xn)*28.96); #mass fraction of naphthalene\n",
+ "mnp=0; #mass fraction of naphthalene in free stream is 0\n",
+ "\n",
+ "Rel=v*l/nu; #reynolds no.\n",
+ "Sc=nu/D; #schimidt no.\n",
+ "Nul=0.664*math.sqrt(Rel)*(Sc**(1/3)); #mass transfer nusselt no.\n",
+ "Gmn=D*Nul*1.166/l; #gas phase mass transfer coefficient,kg/(m**2*s)\n",
+ "n=Gmn*(mn-mnp); #average mass flux,kg/(m**2*s)\n",
+ "n1=n*1000*3600;# average mass flux, g/m**2.h\n",
+ "\n",
+ "#Result\n",
+ "print \"Average rate of loss of naphthalene from a part of model is :\",round(n,7),\"kg/(m^2*s) or \",round(n1),\"g/(m^2*h)\\n\"\n",
+ "print \"Naphthalene sublimatin can be used to infer heat transfer coefficient by measuring the loss of naphthalene from a model over some length of time.since the schimidt no. of naphthalene is not generally equal to prandtl no. under the conditions of interest, some assumption about the dependence of nusselt no. on the prandtl no. must usually be introduced.\\n\"\n",
+ " #end\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Average rate of loss of naphthalene from a part of model is : 1.61e-05 kg/(m^2*s) or 58.0 g/(m^2*h)\n",
+ "\n",
+ "Naphthalene sublimatin can be used to infer heat transfer coefficient by measuring the loss of naphthalene from a model over some length of time.since the schimidt no. of naphthalene is not generally equal to prandtl no. under the conditions of interest, some assumption about the dependence of nusselt no. on the prandtl no. must usually be introduced.\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 11.11, Page number:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "\n",
+ "#Variables\n",
+ "T1=300; #temp. of helium-water tube,K\n",
+ "h=0.4; #height of vertical wall,m\n",
+ "m=0.087*10**-3; #flow rate of helium,kg/(m**2*s)\n",
+ "#this is a uniform flux natural convection problem.\n",
+ "Mhes=0.01; # assuming the value of mass fraction of helium at the wall to be 0.01\n",
+ "Mhef=Mhes/2; #film composition\n",
+ "af=1.141; #film density,kg/m**3\n",
+ "wd=1.107; #wall density,kg/m**3\n",
+ "Dha=7.119*10**-5; #diffusion coefficient,m**2/s\n",
+ "u=1.857*10**-5; #film viscosity at 300K,kg/(m*s)\n",
+ "aa=1.177; #air density,kg/m**3\n",
+ "g=9.8; #Gravity constant, m/s**2\n",
+ "#Calculations\n",
+ "Sc=(u/af)/Dha; #schimidt no.\n",
+ "Ra1=g*(aa-wd)*m*h**4/(u*af*Dha**2*Mhes); #Rayleigh no.\n",
+ "Nu=6/5*(Ra1*Sc/(4+9*math.sqrt(Sc)+10*Sc))**(1/5); #approximate nusselt no.\n",
+ "s=m*h/(af*Dha*Nu); #average concentration of helium at the wall\n",
+ "#thus we have obtained an average wall concentration 14 oercent higher than our initial guess of Mhes.we repeat this calclations with revised values of densities to obtain Mhes = 0.01142\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print \"Average conentration of helium at the wall is \",round(s,5),\",since the result is within 0.5 percent of our second guess, a third iteration is not needed\"\n",
+ " #end\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Average conentration of helium at the wall is 0.01136 ,since the result is within 0.5 percent of our second guess, a third iteration is not needed\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 11.14, Page number:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "import math\n",
+ "\n",
+ "#Variables\n",
+ "T1=325; #temp. of helium-water tube,K\n",
+ "l=0.2; #length of tube,m\n",
+ "x=0.01; # mole fraction of water\n",
+ "R=8314.472; #gas constant,J/(kmol*K)\n",
+ "Mw=18.02;#Molecular mass of water, g/mol\n",
+ "#the vapor pressure of the liquid water is approximately the saturation pressure at the water temp.\n",
+ "\n",
+ "#Calculations\n",
+ "p=1.341*10000 ; #vapor pressure using steam table,Pa\n",
+ "x1=p/101325; #mole fraction of saturated water\n",
+ "c=101325/(R*T1); #mole concentration in tube,kmol/m**3\n",
+ "D12=1.067*math.pow(10,-4); #diffusivity ofwater with respect to helium,m**2/s \n",
+ "Nw=c*D12*math.log(1+(x-x1)/(x1-1))/l ; #molar evaporation rate,kmol/(m**2*s)\n",
+ "nw=Nw*Mw; # mass evaporation rate,kg/(m**2*s)\n",
+ "\n",
+ "#S=1+(x1-1)*math.exp(Nw*y/(c*D12)) conentration distribution of water-vapor\n",
+ "#Result\n",
+ "print \"Conentration distribution of water-vapor is : x1(y)=1-0.8677*exp(0.6593*y) where y is expressed in meters.\\n\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Conentration distribution of water-vapor is : x1(y)=1-0.8677*exp(0.6593*y) where y is expressed in meters.\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 11.15, Page number:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "\n",
+ "#Variables\n",
+ "T1=1473; #suraface temp.of hot water,K\n",
+ "x=0.05; #mass fraction of water\n",
+ "Gm=0.017; #average mass transfer coefficient,kg/(m**2*s)\n",
+ "A=0.04; #suraface area of pan,m**2\n",
+ "\n",
+ " #only water vapour passes through the liquid surface, since air is not strongly absorbed into water under normal conditions.\n",
+ "#Calculations\n",
+ "p=38.58*1000; #saturation pressure of water,kPa\n",
+ "Xwater=p/101325; #mole fraction of saturated water\n",
+ "Mwater=Xwater*18.02/(Xwater*18.02+(1-Xwater)*28.96); #mass fraction of saturated water\n",
+ "\n",
+ "B=(x-Mwater)/(Mwater-1); #mass transfer driving force\n",
+ "m=Gm*B*A; #evaporation rate,kg/s\n",
+ "\n",
+ "#Result\n",
+ "print \"Evaporation rate is:\",round(m,6),\" kg/s\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Evaporation rate is: 0.000213 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 11.16, Page number:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "import math\n",
+ "\n",
+ "#Variables\n",
+ "T1=298; #temp.of air,K\n",
+ "T2=323.15; #film temp.,K\n",
+ "x=0.05; #mass fraction of water at 75 C\n",
+ "Gm=0.017; #average mass transfer coefficient,kg/(m**2*s)\n",
+ "A=0.04; #suraface area of pan,m**2\n",
+ "l=0.2; #length of pan in flow direction,m\n",
+ "v=5; #air speed,m/s\n",
+ "m=(x+0.277)/2; #film composition of water at 50 C\n",
+ "Mf=26.34; #mixture molecular weight,kg/kmol\n",
+ "p=101325; #Atmospheric pressure, Pa\n",
+ "R=8314.5; #Gas constant, J/kmol-K\n",
+ "Uf=1.75*math.pow(10,-5); #film viscosity,kg/(m*s)\n",
+ "B=0.314; #mass transfer driving force\n",
+ "D=2.96*math.pow(10,-5); #diffusivity of water in air,m**2/s\n",
+ "df=0.993; #Density of ideal air, kg/m**#\n",
+ "\n",
+ "#Calculations\n",
+ "af=p*Mf/(R*T2); \t #film density from ideal gas law,kg/m**3\n",
+ "Vf=Uf/af; #kinematic viscosity,m**2/s\n",
+ "Rel=v*l/Vf; #reynolds no. comes out to be 56,800 so the flow is laminar.\n",
+ "Sc=Vf/D; #scimidt no.\n",
+ "Nu=0.664*math.sqrt(Rel)*math.pow(Sc,1/3); #nussselt no.\n",
+ "Gmw1=Nu*(D*df/l); #appropriate value of mass transfer gas phase coeffficient of water in air,kg/(m**2*s)\n",
+ "Gmw=Gmw1*(math.log(1+B)/B); \t #mass transfer gas phase coeffficient of water in air,kg/(m**2*s)\n",
+ "\n",
+ "#Results\n",
+ "print \"Mass transfer gas phase coeffficient of water in air is :\",round(Gmw,4),\"kg/(m^2*s)\\nIn this caes, the blowing factor is 0.870. Thus the mild blowing has reduced the mass transfer coefficient by about 13 percent\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0.01955648559 133.069905487\n",
+ "Mass transfer gas phase coeffficient of water in air is : 0.017 kg/(m^2*s)\n",
+ "In this caes, the blowing factor is 0.870. Thus the mild blowing has reduced the mass transfer coefficient by about 13 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ }
+ ],
+ "metadata": {}
+ }
+ ]
} \ No newline at end of file
diff --git a/Beginning_C++_Through_Game_Programming/.ipynb_checkpoints/ch10-checkpoint.ipynb b/Beginning_C++_Through_Game_Programming/.ipynb_checkpoints/ch10-checkpoint.ipynb
new file mode 100755
index 00000000..000367d6
--- /dev/null
+++ b/Beginning_C++_Through_Game_Programming/.ipynb_checkpoints/ch10-checkpoint.ipynb
@@ -0,0 +1,642 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 10 : Inheritance and Polymorphism: Blackjack"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 10.1 page no: 334"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "\n",
+ "class Enemy:\n",
+ " def __init__(self):\n",
+ " self.m_Damage = 10\n",
+ "\n",
+ " def Attack(self):\n",
+ " print \"An enemy attacks and inflicts \" , self.m_Damage , \" damage points!\";\n",
+ " \n",
+ " def __del__(self):\n",
+ " print \"In Enemy destructor, deleting m_pDamage.\\n\";\n",
+ "\n",
+ "class Boss(Enemy):\n",
+ " def __init__(self):\n",
+ " Enemy.__init__(self)\n",
+ " self.m_DamageMultiplier = 3\n",
+ "\n",
+ " def SpecialAttack(self):\n",
+ " print \"A boss attacks and inflicts \" , (self.m_DamageMultiplier * self.m_Damage),\n",
+ " print \" damage points!\";\n",
+ "\n",
+ "print \"Creating an enemy.\\n\";\n",
+ "enemy1 = Enemy()\n",
+ "enemy1.Attack();\n",
+ "print \"\\nCreating a boss.\\n\";\n",
+ "boss1 = Boss()\n",
+ "boss1.Attack();\n",
+ "boss1.SpecialAttack();"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Creating an enemy.\n",
+ "\n",
+ "An enemy attacks and inflicts 10 damage points!\n",
+ "\n",
+ "Creating a boss.\n",
+ "\n",
+ "An enemy attacks and inflicts 10 damage points!\n",
+ "A boss attacks and inflicts 30 damage points!\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 10.2 page no : 338"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "\n",
+ "\n",
+ "class Enemy:\n",
+ " def __init__(self):\n",
+ " self.m_Damage = 10\n",
+ "\n",
+ " def Attack(self):\n",
+ " print \"Attack inflicts \" , self.m_Damage , \" damage points!\";\n",
+ "\n",
+ "class Boss(Enemy):\n",
+ " def __init__(self):\n",
+ " Enemy.__init__(self)\n",
+ " self.m_DamageMultiplier = 3\n",
+ "\n",
+ " def SpecialAttack(self):\n",
+ " print \"Special Attack inflicts \" , (self.m_DamageMultiplier * self.m_Damage),\n",
+ " print \" damage points!\";\n",
+ "\n",
+ "print \"Creating an enemy.\\n\";\n",
+ "enemy1 = Enemy()\n",
+ "enemy1.Attack();\n",
+ "print \"\\nCreating a boss.\\n\";\n",
+ "boss1 = Boss()\n",
+ "boss1.Attack();\n",
+ "boss1.SpecialAttack();"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Creating an enemy.\n",
+ "\n",
+ "Attack inflicts 10 damage points!\n",
+ "\n",
+ "Creating a boss.\n",
+ "\n",
+ "Attack inflicts 10 damage points!\n",
+ "Special Attack inflicts 30 damage points!\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 10.3 page no : 343"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "class Enemy:\n",
+ " def __init__(self,d=10):\n",
+ " self.m_Damage = d\n",
+ "\n",
+ " def Attack(self):\n",
+ " print \"Attack inflicts \" , self.m_Damage , \" damage points!\";\n",
+ "\n",
+ " def Taunt(self):\n",
+ " print \"The enemy says he will fight you.\";\n",
+ " __Attack = Attack \n",
+ "\n",
+ "\n",
+ "class Boss(Enemy):\n",
+ " def __init__(self,d=30):\n",
+ " Enemy.__init__(self)\n",
+ " self.m_DamageMultiplier = d\n",
+ "\n",
+ " def SpecialAttack(self):\n",
+ " print \"Special Attack inflicts \" , (self.m_DamageMultiplier * self.m_Damage),\n",
+ " print \" damage points!\";\n",
+ "\n",
+ " def Taunt(self): #override base class member function\n",
+ " print \"The boss says he will end your pitiful existence.\"\n",
+ "\n",
+ " def Attack(self): #override base class member function\n",
+ " #call base class member function\n",
+ " Enemy.Attack(self)\n",
+ " print \" And laughs heartily at you.\\n\";\n",
+ "\n",
+ "\n",
+ "print \"Enemy object :\";\n",
+ "enemy1 = Enemy()\n",
+ "enemy1.Taunt()\n",
+ "enemy1.Attack();\n",
+ "print \"\\n boss object.\\n\";\n",
+ "boss1 = Boss()\n",
+ "boss1.Taunt()\n",
+ "boss1.Attack();\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enemy object :\n",
+ "The enemy says he will fight you.\n",
+ "Attack inflicts 10 damage points!\n",
+ "\n",
+ " boss object.\n",
+ "\n",
+ "The boss says he will end your pitiful existence.\n",
+ "Attack inflicts 10 damage points!\n",
+ " And laughs heartily at you.\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 10.4 page no : 341,348"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "\n",
+ "class Enemy:\n",
+ " def __init__(self,d=10):\n",
+ " self.m_Damage = d\n",
+ "\n",
+ " def Attack(self):\n",
+ " print \"Attack inflicts \" , self.m_Damage , \" damage points!\";\n",
+ "\n",
+ " def __del__(self):\n",
+ " print \"In Enemy destructor, deleting m_pDamage.\";\n",
+ " \n",
+ "class Boss(Enemy):\n",
+ " def __init__(self,d=30):\n",
+ " Enemy.__init__(self)\n",
+ " self.m_DamageMultiplier = d\n",
+ "\n",
+ " def SpecialAttack(self):\n",
+ " print \"Special Attack inflicts \" , (self.m_DamageMultiplier * self.m_Damage),\n",
+ " print \" damage points!\";\n",
+ "\n",
+ " def Taunt(self): #override base class member function\n",
+ " print \"The boss says he will end your pitiful existence.\"\n",
+ "\n",
+ " def Attack(self): #override base class member function\n",
+ " #call base class member function\n",
+ " Enemy.Attack(self)\n",
+ " print \" And laughs heartily at you.\\n\";\n",
+ "\n",
+ " def __del__(self):\n",
+ " Enemy.__del__(self)\n",
+ " print \"In Boss destructor, deleting m_pMultiplier.\";\n",
+ " self.m_pMultiplier = 0;\n",
+ "\n",
+ "print \"Calling Attack() on Boss object through pointer to Enemy:\"\n",
+ "pBadGuy = Boss();\n",
+ "pBadGuy.Attack();\n",
+ "print \"\\nDeleting pointer to Enemy:\\n\";\n",
+ "pBadGuy = 0;"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Calling Attack() on Boss object through pointer to Enemy:\n",
+ "Attack inflicts 10 damage points!\n",
+ " And laughs heartily at you.\n",
+ "\n",
+ "\n",
+ "Deleting pointer to Enemy:\n",
+ "\n",
+ "In Enemy destructor, deleting m_pDamage.\n",
+ "In Boss destructor, deleting m_pMultiplier.\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 10.5 page no : 353"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "class Creature :\n",
+ " def __init__(self,h=100):\n",
+ " self.m_Health = h\n",
+ " \n",
+ " def Greet(self): # pure virtual member function\n",
+ " pass\n",
+ "\n",
+ " def DisplayHealth(self):\n",
+ " print \"Health: \" , self.m_Health\n",
+ "\n",
+ "\n",
+ "class Orc(Creature):\n",
+ " def __init__(self,h=120):\n",
+ " Creature.__init__(self,h)\n",
+ "\n",
+ " def Greet(self):\n",
+ " print \"The orc grunts hello.\\n\";\n",
+ "\n",
+ "pCreature = Orc();\n",
+ "pCreature.Greet();\n",
+ "pCreature.DisplayHealth();"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The orc grunts hello.\n",
+ "\n",
+ "Health: 120\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "example 10.6, page no : 361-379"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "ACE = 1\n",
+ "TWO = 2\n",
+ "THREE = 3\n",
+ "FOUR = 4\n",
+ "FIVE = 5\n",
+ "SIX = 6\n",
+ "SEVEN = 7\n",
+ "EIGHT = 8\n",
+ "NINE = 9\n",
+ "TEN = 10\n",
+ "JACK = 11\n",
+ "QUEEN = 12\n",
+ "KING = 13\n",
+ "\n",
+ "CLUBS = 0\n",
+ "DIAMONDS = 1\n",
+ "HEARTS = 2\n",
+ "SPADES = 3\n",
+ "\n",
+ " \n",
+ "class Card:\n",
+ " def __init__(self,r = ACE,s = SPADES,ifu = True): #returns the value of a card, 1 - 11\n",
+ " self.m_Rank = r\n",
+ " self.m_Suit = s\n",
+ " self.m_IsFaceUp =ifu\n",
+ "\n",
+ " def GetValue(self):\n",
+ " #if a cards is face down, its value is 0\n",
+ " value = 0;\n",
+ " if (m_IsFaceUp):\n",
+ " #value is number showing on card\n",
+ " value = m_Rank;\n",
+ " #value is 10 for face cards\n",
+ " if (value > 10):\n",
+ " value = 10;\n",
+ " return value;\n",
+ "\n",
+ " def Flip(self):\n",
+ " self.m_IsFaceUp = not (self.m_IsFaceUp);\n",
+ "\n",
+ "class Hand:\n",
+ " def __init__(self):\n",
+ " self.m_Cards = []\n",
+ "\n",
+ " def __del__(self):\n",
+ " self.Clear() \n",
+ "\n",
+ " def Add(self,pCard):\n",
+ " self.m_Cards.append(pCard);\n",
+ "\n",
+ " def Clear(self):\n",
+ " #iterate through vector, freeing all memory on the heap\n",
+ " self.m_Cards = []\n",
+ "\n",
+ " def GetTotal(self):\n",
+ " #if no cards in hand, return 0\n",
+ " if (self.m_Cards.empty()):\n",
+ " return 0;\n",
+ " #if a first card has value of 0, then card is face down; return 0\n",
+ " if (self.m_Cards[0].GetValue() == 0):\n",
+ " return 0;\n",
+ " #add up card values, treat each ace as 1\n",
+ " total = 0;\n",
+ " for i in self.m_Cards:\n",
+ " total += i.GetValue()\n",
+ " #determine if hand contains an ace\n",
+ " containsAce = False;\n",
+ " for i in self.m_Cards:\n",
+ " if i.GetValue() == Card.ACE:\n",
+ " containsAce = True;\n",
+ "\n",
+ " #if hand contains ace and total is low enough, treat ace as 11\n",
+ " if (containsAce and total <= 11):\n",
+ " #add only 10 since we've already added 1 for the ace\n",
+ " total += 10;\n",
+ " return total;\n",
+ "\n",
+ "\n",
+ "class GenericPlayer(Hand):\n",
+ " def __init__(self,name):\n",
+ " self.m_Name = name\n",
+ "\n",
+ " def __del__(self):\n",
+ " pass\n",
+ "\n",
+ " def IsBusted(self):\n",
+ " return (self.GetTotal() > 21);\n",
+ "\n",
+ " def Bust(self):\n",
+ " print self.m_Name , \" busts.\";\n",
+ "\n",
+ "class Player(GenericPlayer):\n",
+ " def _init_(self,name):\n",
+ " GenericPlayer.__init__(self,name)\n",
+ " \n",
+ " def _del_(self):\n",
+ " pass\n",
+ "\n",
+ " def IsHitting(self):\n",
+ " print self.m_Name , \", do you want a hit? (Y/N): \",\n",
+ " response = raw_input()\n",
+ " return (response == 'y' or response == 'Y');\n",
+ "\n",
+ " def Win(self):\n",
+ " print self.m_Name , \" wins.\";\n",
+ "\n",
+ " def Lose(self):\n",
+ " print self.m_Name , \" loses.\";\n",
+ "\n",
+ " def Push(self):\n",
+ " print self.m_Name , \" pushes.\";\n",
+ "\n",
+ "class House(GenericPlayer):\n",
+ " def __init__(self,name=\"House\"):\n",
+ " GenericPlayer.__init__(self,name)\n",
+ "\n",
+ " def __del__(self):\n",
+ " pass\n",
+ "\n",
+ " def IsHitting(self):\n",
+ " return (self.GetTotal() <= 16)\n",
+ "\n",
+ " def FlipFirstCard(self):\n",
+ " if (not self.m_Cards):\n",
+ " self.m_Cards[0].Flip();\n",
+ " else:\n",
+ " print \"No card to flip!\";\n",
+ " \n",
+ "class Deck(Hand):\n",
+ " def __init__(self):\n",
+ " self.m_Cards = []\n",
+ " self.Populate();\n",
+ " \n",
+ " def __del__(self):\n",
+ " pass\n",
+ " \n",
+ " def Populate(self):\n",
+ " self.Clear();\n",
+ " #create standard deck\n",
+ " for s in range(CLUBS,SPADES+1):\n",
+ " for r in range(ACE,KING+1):\n",
+ " self.Add(Card(r,s))\n",
+ "\n",
+ " def Shuffle(self):\n",
+ " pass\n",
+ "\n",
+ " def Deal(self, aHand):\n",
+ " if (not self.m_Cards):\n",
+ " aHand.Add(self.m_Cards[-1]);\n",
+ " self.m_Cards.pop();\n",
+ " else:\n",
+ " print \"Out of cards. Unable to deal.\";\n",
+ "\n",
+ " def AdditionalCards(self,aGenericPlayer):\n",
+ " print ''\n",
+ " #continue to deal a card as long as generic player isn't busted and\n",
+ " #wants another hit\n",
+ " while ( not (aGenericPlayer.IsBusted()) and aGenericPlayer.IsHitting() ):\n",
+ " self.Deal(aGenericPlayer);\n",
+ " print aGenericPlayer\n",
+ " if (aGenericPlayer.IsBusted()):\n",
+ " aGenericPlayer.Bust();\n",
+ " \n",
+ "\n",
+ "class Game:\n",
+ " def __init__(self,names):\n",
+ " #create a vector of players from a vector of names\n",
+ " self.m_Players = []\n",
+ " for i in names:\n",
+ " self.m_Players.append(Player(i))\n",
+ " self.m_Deck = Deck()\n",
+ " self.m_House = House()\n",
+ " self.m_Deck.Populate();\n",
+ " self.m_Deck.Shuffle();\n",
+ "\n",
+ " def __del__(self):\n",
+ " pass\n",
+ " \n",
+ " def Play(self):\n",
+ " # deal initial 2 cards to everyone\n",
+ " for i in range(2):\n",
+ " for pPlayer in self.m_Players:\n",
+ " self.m_Deck.Deal(pPlayer);\n",
+ " self.m_Deck.Deal(self.m_House);\n",
+ " #hide house's first card\n",
+ " self.m_House.FlipFirstCard();\n",
+ " for pPlayer in self.m_Players:\n",
+ " print pPlayer \n",
+ "\n",
+ " print self.m_House\n",
+ " #deal additional cards to players\n",
+ " \n",
+ " for pPlayer in self.m_Players:\n",
+ " self.m_Deck.AdditionalCards(pPlayer);\n",
+ "\n",
+ " #reveal house's first card\n",
+ " self.m_House.FlipFirstCard();\n",
+ " print self.m_House;\n",
+ " #deal additional cards to house\n",
+ " self.m_Deck.AdditionalCards(m_House);\n",
+ " if (self.m_House.IsBusted()):\n",
+ " #everyone still playing wins\n",
+ " for pPlayer in self.m_Players:\n",
+ " if ( not (pPlayer.IsBusted()) ):\n",
+ " pPlayer.Win();\n",
+ " else:\n",
+ " #compare each player still playing to house\n",
+ " for pPlayer in self.m_Players:\n",
+ " if ( not (pPlayer.IsBusted()) ):\n",
+ " if (pPlayer.GetTotal() > self.m_House.GetTotal()):\n",
+ " pPlayer.Win();\n",
+ " elif (pPlayer.GetTotal() < self.m_House.GetTotal()):\n",
+ " pPlayer.Lose();\n",
+ " else:\n",
+ " pPlayer.Push();\n",
+ "\n",
+ " #remove everyones cards\n",
+ " for pPlayer in self.m_Players:\n",
+ " pPlayer.Clear();\n",
+ "\n",
+ " self.m_House.Clear();\n",
+ "\n",
+ "print \"\\t\\tWelcome to Blackjack!\\n\";\n",
+ "numPlayers = 0;\n",
+ "while (numPlayers < 1 or numPlayers > 7):\n",
+ " print \"How many players? (1 - 7): \";\n",
+ " numPlayers = int(raw_input())\n",
+ "\n",
+ "names = []\n",
+ "name = ''\n",
+ "for i in range(numPlayers):\n",
+ " print \"Enter player name: \";\n",
+ " name = raw_input()\n",
+ " names.append(name); \n",
+ "\n",
+ "print ''\n",
+ "#the game loop\n",
+ "aGame = Game(names);\n",
+ "again = 'y'\n",
+ "while (again != 'n' and again != 'N'):\n",
+ " aGame.Play();\n",
+ " print \"\\nDo you want to play again? (Y/N): \",\n",
+ " again = raw_input()\n",
+ "\n",
+ "#overloads << operator so Card object can be sent to cout\n",
+ "def print_(aCard):\n",
+ " RANKS = [\"0\", \"A\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\",\"10\", \"J\", \"Q\", \"K\"]\n",
+ " SUITS = [\"c\", \"d\", \"h\", \"s\"]\n",
+ " if (aCard.m_IsFaceUp):\n",
+ " print RANKS[aCard.m_Rank] , SUITS[aCard.m_Suit];\n",
+ " else:\n",
+ " print \"XX\";\n",
+ " \n",
+ "\n",
+ "def print__(aGenericPlayer):\n",
+ " print aGenericPlayer.m_Name\n",
+ " pCard = []\n",
+ " if (not aGenericPlayer.m_Cards):\n",
+ " for pCard in aGenericPlayer.m_Cards:\n",
+ " print pCard\n",
+ " \n",
+ " if (aGenericPlayer.GetTotal() != 0):\n",
+ " print \"(\" , aGenericPlayer.GetTotal() , \")\";\n",
+ " else:\n",
+ " print \"<empty>\";\n",
+ " \n",
+ "# Note : this example is just for concept purpose. i.e. Inheritance example. it has errors so do not run it \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\t\tWelcome to Blackjack!\n",
+ "\n",
+ "How many players? (1 - 7): \n"
+ ]
+ }
+ ],
+ "prompt_number": "*"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Beginning_C++_Through_Game_Programming/ch10.ipynb b/Beginning_C++_Through_Game_Programming/ch10.ipynb
index e3ec6373..000367d6 100755
--- a/Beginning_C++_Through_Game_Programming/ch10.ipynb
+++ b/Beginning_C++_Through_Game_Programming/ch10.ipynb
@@ -623,80 +623,17 @@
"\n",
"How many players? (1 - 7): \n"
]
- },
- {
- "name": "stdout",
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "3\n"
- ]
- },
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Enter player name: \n"
- ]
- },
- {
- "name": "stdout",
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "John\n"
- ]
- },
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Enter player name: \n"
- ]
- },
- {
- "name": "stdout",
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Mark\n"
- ]
- },
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Enter player name: \n"
- ]
- },
- {
- "name": "stdout",
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Peter\n"
- ]
- },
- {
- "ename": "AttributeError",
- "evalue": "Game instance has no attribute 'm_Deck'",
- "output_type": "pyerr",
- "traceback": [
- "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[1;31mAttributeError\u001b[0m Traceback (most recent call last)",
- "\u001b[1;32m<ipython-input-1-edba0f01e2d5>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 236\u001b[0m \u001b[1;32mprint\u001b[0m \u001b[1;34m''\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 237\u001b[0m \u001b[1;31m#the game loop\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 238\u001b[1;33m \u001b[0maGame\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mGame\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mnames\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m;\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 239\u001b[0m \u001b[0magain\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;34m'y'\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 240\u001b[0m \u001b[1;32mwhile\u001b[0m \u001b[1;33m(\u001b[0m\u001b[0magain\u001b[0m \u001b[1;33m!=\u001b[0m \u001b[1;34m'n'\u001b[0m \u001b[1;32mand\u001b[0m \u001b[0magain\u001b[0m \u001b[1;33m!=\u001b[0m \u001b[1;34m'N'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
- "\u001b[1;32m<ipython-input-1-edba0f01e2d5>\u001b[0m in \u001b[0;36m__init__\u001b[1;34m(self, names)\u001b[0m\n\u001b[0;32m 171\u001b[0m \u001b[1;32mfor\u001b[0m \u001b[0mi\u001b[0m \u001b[1;32min\u001b[0m \u001b[0mnames\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 172\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mpName\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mPlayer\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mi\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 173\u001b[1;33m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mm_Deck\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mPopulate\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m;\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 174\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mm_Deck\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mShuffle\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m;\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 175\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n",
- "\u001b[1;31mAttributeError\u001b[0m: Game instance has no attribute 'm_Deck'"
- ]
- },
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "\n"
- ]
}
],
- "prompt_number": 1
+ "prompt_number": "*"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
}
],
"metadata": {}
diff --git a/Beginning_C_By_Ivon_Horton/chapter13.ipynb b/Beginning_C_By_Ivon_Horton/chapter13.ipynb
index 6169215b..48685d3a 100755
--- a/Beginning_C_By_Ivon_Horton/chapter13.ipynb
+++ b/Beginning_C_By_Ivon_Horton/chapter13.ipynb
@@ -28,8 +28,6 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "\n",
- "\n",
"y = 5\n",
"for x in range(20):\n",
" print \"x = %d y = %d\" %(x, y)\n",
@@ -43,9 +41,9 @@
"evalue": "",
"output_type": "pyerr",
"traceback": [
- "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[1;31mAssertionError\u001b[0m Traceback (most recent call last)",
- "\u001b[1;32m<ipython-input-1-3bb87684a82b>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 6\u001b[0m \u001b[1;32mfor\u001b[0m \u001b[0mx\u001b[0m \u001b[1;32min\u001b[0m \u001b[0mrange\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;36m20\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 7\u001b[0m \u001b[1;32mprint\u001b[0m \u001b[1;34m\"x = %d y = %d\"\u001b[0m \u001b[1;33m%\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mx\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0my\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 8\u001b[1;33m \u001b[1;32massert\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mx\u001b[0m \u001b[1;33m<\u001b[0m \u001b[0my\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
- "\u001b[1;31mAssertionError\u001b[0m: "
+ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[0;31mAssertionError\u001b[0m Traceback (most recent call last)",
+ "\u001b[0;32m<ipython-input-2-e6459a3dedb4>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 2\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mx\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mrange\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m20\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[0;32mprint\u001b[0m \u001b[0;34m\"x = %d y = %d\"\u001b[0m \u001b[0;34m%\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mx\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0my\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 4\u001b[0;31m \u001b[0;32massert\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mx\u001b[0m \u001b[0;34m<\u001b[0m \u001b[0my\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
+ "\u001b[0;31mAssertionError\u001b[0m: "
]
},
{
@@ -61,7 +59,7 @@
]
}
],
- "prompt_number": 1
+ "prompt_number": 2
},
{
"cell_type": "heading",
diff --git a/C++_Demystified:_A_Self-Teaching_Guide/.ipynb_checkpoints/chapter13-checkpoint.ipynb b/C++_Demystified:_A_Self-Teaching_Guide/.ipynb_checkpoints/chapter13-checkpoint.ipynb
new file mode 100755
index 00000000..8c87053f
--- /dev/null
+++ b/C++_Demystified:_A_Self-Teaching_Guide/.ipynb_checkpoints/chapter13-checkpoint.ipynb
@@ -0,0 +1,412 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:60c23a8f50ffb51e0da71a6e8b36475b7941871a6f534003180327a651bb1c1c"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 13: Persistent Data: File Input and Output"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 13.1, page no. 296"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "\n",
+ "try:\n",
+ " if(fp):\n",
+ " print \"infile = \", fp\n",
+ " print \"0\"\n",
+ "except IOError:\n",
+ " print \"1\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 13.2, page no. 296"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "\n",
+ "try:\n",
+ " fp = open(\"students.dat\", \"w\")\n",
+ " if(fp):\n",
+ " print \"infile = \", fp\n",
+ " print \"0\"\n",
+ "except IOError:\n",
+ " print \"1\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "infile = <open file 'students.dat', mode 'w' at 0x2d80a50>\n",
+ "0\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 13.3, page no. 299"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "fp = open(\"students.dat\", \"w\")\n",
+ "print \"Writing to the file\"\n",
+ "print \"===================\"\n",
+ "print \"Enter class name: \",\n",
+ "data = raw_input()\n",
+ "fp.write(data)\n",
+ "fp.write(\"\\n\")\n",
+ "print \"Enter number of students: \",\n",
+ "data = raw_input()\n",
+ "fp.write(data)\n",
+ "fp.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Writing to the file\n",
+ "===================\n",
+ "Enter class name: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C++\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter number of students: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "32\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 13.4, page no. 301"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "\n",
+ "fp = open(\"students.dat\", \"w\")\n",
+ "print \"Writing to the file\"\n",
+ "print \"===================\"\n",
+ "print \"Enter class name: \",\n",
+ "data = raw_input()\n",
+ "fp.write(data)\n",
+ "fp.write(\"\\n\")\n",
+ "print \"Enter number of students: \",\n",
+ "data = raw_input()\n",
+ "fp.write(data)\n",
+ "fp.close()\n",
+ "fp = open(\"students.dat\", \"r\")\n",
+ "print \"Reading from the file\"\n",
+ "print \"=====================\"\n",
+ "lines = fp.readlines()\n",
+ "for line in lines:\n",
+ " print line\n",
+ "fp.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Writing to the file\n",
+ "===================\n",
+ "Enter class name: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C++\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter number of students: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "32\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Reading from the file\n",
+ "=====================\n",
+ "C++\n",
+ "\n",
+ "32\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "example 13.5, page no. 303"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "fp = open(\"students.dat\", \"w\")\n",
+ "print \"Writing to the file\"\n",
+ "print \"===================\"\n",
+ "print \"Enter class name: \",\n",
+ "data = raw_input()\n",
+ "fp.write(data)\n",
+ "fp.write(\"\\n\")\n",
+ "print \"Enter number of students: \",\n",
+ "data = raw_input()\n",
+ "fp.write(data)\n",
+ "fp.close()\n",
+ "fp = open(\"students.dat\", \"r\")\n",
+ "print \"Reading from the file\"\n",
+ "print \"=====================\"\n",
+ "lines = fp.readlines()\n",
+ "for line in lines:\n",
+ " print line\n",
+ "fp.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Writing to the file\n",
+ "===================\n",
+ "Enter class name: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C++\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter number of students: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "32\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Reading from the file\n",
+ "=====================\n",
+ "C++\n",
+ "\n",
+ "32\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 13.6, page no. 305"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "\n",
+ "fp = open(\"students.dat\", \"w\")\n",
+ "print \"Writing to the file\"\n",
+ "print \"===================\"\n",
+ "print \"Enter class name: \",\n",
+ "data = raw_input()\n",
+ "fp.write(data)\n",
+ "fp.write(\"\\n\")\n",
+ "print \"Enter number of students: \",\n",
+ "data = raw_input()\n",
+ "fp.write(data)\n",
+ "fp.close()\n",
+ "fp = open(\"students.dat\", \"r\")\n",
+ "print \"Reading from the file\"\n",
+ "print \"=====================\"\n",
+ "while(fp.readline()):\n",
+ " print fp.readline()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Writing to the file\n",
+ "===================\n",
+ "Enter class name: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C++\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter number of students: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "32\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Reading from the file\n",
+ "=====================\n",
+ "32\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/C++_Demystified:_A_Self-Teaching_Guide/.ipynb_checkpoints/chapter5-checkpoint.ipynb b/C++_Demystified:_A_Self-Teaching_Guide/.ipynb_checkpoints/chapter5-checkpoint.ipynb
new file mode 100755
index 00000000..9dac1dd3
--- /dev/null
+++ b/C++_Demystified:_A_Self-Teaching_Guide/.ipynb_checkpoints/chapter5-checkpoint.ipynb
@@ -0,0 +1,488 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:527aef20f7b40df168e6ff4a5ccb96d249aaf7c6743cc854ce1a221227ecfb75"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 5 - Making Decisions: if and switch Statements"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 5.1, page no. 100"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "\n",
+ "a = 4\n",
+ "b = 5\n",
+ "print a, \" > \", b, \" is \", (a > b)\n",
+ "print a, \" >= \", b, \" is \", (a >= b)\n",
+ "print a, \" == \", b, \" is \", (a == b)\n",
+ "print a, \" <= \", b, \" is \", (a <= b)\n",
+ "print a, \" < \", b, \" is \", (a < b)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4 > 5 is False\n",
+ "4 >= 5 is False\n",
+ "4 == 5 is False\n",
+ "4 <= 5 is True\n",
+ "4 < 5 is True\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 5.2, page no. 102"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "\n",
+ "print \"Enter number of preregistered students: \",\n",
+ "total = int(raw_input())\n",
+ "print \"Enter number of students adding the course: \",\n",
+ "added = int(raw_input())\n",
+ "total = total + added\n",
+ "print \"Total number of students: \", total"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter number of preregistered students: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "30\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter number of students adding the course: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Total number of students: 33\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 5.3, page no. 104"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "\n",
+ "print \"Enter a whole number: \",\n",
+ "num = int(raw_input())\n",
+ "if (num % 2 == 0):\n",
+ " print \"The number is even\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a whole number: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The number is even\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 5.4, page no. 108"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "\n",
+ "print \"Enter a whole number: \",\n",
+ "num = int(raw_input())\n",
+ "if (num % 2 == 0):\n",
+ " print \"The number is even\"\n",
+ "else:\n",
+ " print \"The number is odd\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a whole number: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The number is odd\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 5.4, page no. 109"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "\n",
+ "print \"Enter a whole number: \",\n",
+ "num = int(raw_input())\n",
+ "print \"The number is\", (\"even\" if num %2 == 0 else \"odd\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a whole number: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The number is even\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 5.6, page no. 112"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "\n",
+ "print \"Enter your test score: \",\n",
+ "testScore = int(raw_input())\n",
+ "if (testScore >= 90 ):\n",
+ " print \"Your grade is an A\"\n",
+ "elif (testScore >= 80 ):\n",
+ " print \"Your grade is a B\"\n",
+ "elif (testScore >= 70 ):\n",
+ " print \"Your grade is a C\"\n",
+ "elif (testScore >= 60 ):\n",
+ " print \"Your grade is a D\"\n",
+ "else:\n",
+ " print \"Your grade is an F\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter your test score: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "70\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Your grade is a C\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 5.7, page no. 115"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "\n",
+ "print \"Enter your grade: \",\n",
+ "grade = raw_input()\n",
+ "\n",
+ "if grade == 'A':\n",
+ " print \"Your average must be between 90 - 100\"\n",
+ "elif grade == 'B':\n",
+ " print \"Your average must be between 80 - 89\"\n",
+ "elif grade == 'C':\n",
+ " print \"Your average must be between 70 - 79\"\n",
+ "elif grade == 'D':\n",
+ " print \"Your average must be between 60 - 69\"\n",
+ "else:\n",
+ " print \"Your average must be below 60\" "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter your grade: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "D\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Your average must be between 60 - 69\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 5.8, page no. 118"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "\n",
+ "\n",
+ "print \"Enter your grade: \",\n",
+ "grade = raw_input()\n",
+ "\n",
+ "if grade == 'A' or grade == 'a':\n",
+ " print \"Your average must be between 90 - 100\"\n",
+ "elif grade == 'B' or grade == 'b':\n",
+ " print \"Your average must be between 80 - 89\"\n",
+ "elif grade == 'C' or grade == 'c':\n",
+ " print \"Your average must be between 70 - 79\"\n",
+ "elif grade == 'D' or grade == 'd':\n",
+ " print \"Your average must be between 60 - 69\"\n",
+ "else:\n",
+ " print \"Your average must be below 60\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter your grade: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "d\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Your average must be between 60 - 69\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 5.9, page no. 119"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "\n",
+ "\n",
+ "print \"Choose your car\"\n",
+ "print \"S for Standard\"\n",
+ "print \"L for Leather Seats\"\n",
+ "print \"D for Leather Seats + Chrome Wheels\"\n",
+ "choice = raw_input()\n",
+ "print \"Extra features purchased\"\n",
+ "if choice == 'D':\n",
+ " print \"Chrome wheels\\n\"\n",
+ "elif choice == 'L':\n",
+ " print \"Leather seats\"\n",
+ "else:\n",
+ " print \"None selected\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Choose your car\n",
+ "S for Standard\n",
+ "L for Leather Seats\n",
+ "D for Leather Seats + Chrome Wheels\n"
+ ]
+ }
+ ],
+ "prompt_number": "*"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/C++_Demystified:_A_Self-Teaching_Guide/.ipynb_checkpoints/chapter9-checkpoint.ipynb b/C++_Demystified:_A_Self-Teaching_Guide/.ipynb_checkpoints/chapter9-checkpoint.ipynb
new file mode 100755
index 00000000..5b5e1ccb
--- /dev/null
+++ b/C++_Demystified:_A_Self-Teaching_Guide/.ipynb_checkpoints/chapter9-checkpoint.ipynb
@@ -0,0 +1,1033 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:f0e84b29896f17b0ff44f8bccf20cf041a408375d83b3bc2290848ec54364369"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 9 - Functions"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 9.1, page no. 179"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "\n",
+ "def main(): #defining a function \n",
+ " print \"Hello World!\"\n",
+ "\n",
+ "main()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Hello World!\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 9.2, page no. 180"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "def printMessage(): # defining function\n",
+ " print \"Hello world!\"\n",
+ "\n",
+ "printMessage() # calling the function"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Hello world!\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 9.3, page no. 181"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "\n",
+ "printMessage();\n",
+ "\n",
+ "def printMessage():\n",
+ " print \"Hello world!\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Hello world!\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 9.4, page no. 182"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "\n",
+ "def printMessage():\n",
+ " print \"Hello world!\"\n",
+ "\n",
+ "printMessage()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Hello world!\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 9.5, page no. 184"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "def printMessage():\n",
+ " times = 0\n",
+ " times += 1\n",
+ " print \"This function called \", times, \" times\"\n",
+ "\n",
+ "\n",
+ "\n",
+ "choice = '1'\n",
+ "while(choice != 'Q'):\n",
+ " print \"Enter Q to quit, any other character to continue: \",\n",
+ " choice = raw_input()\n",
+ " if (choice == 'Q'):\n",
+ " print \"Input stopped\"\n",
+ " else:\n",
+ " printMessage()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter Q to quit, any other character to continue: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "e\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " This function called 1 times\n",
+ "Enter Q to quit, any other character to continue: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "e\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " This function called 1 times\n",
+ "Enter Q to quit, any other character to continue: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "q\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " This function called 1 times\n",
+ "Enter Q to quit, any other character to continue: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Q\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Input stopped\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 9.6, page no. 185"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "\n",
+ "def printMessage():\n",
+ " times = 0\n",
+ " times += 1\n",
+ " print \"This function called \", times, \" times\"\n",
+ "\n",
+ "\n",
+ "choice = '1'\n",
+ "while(choice != 'Q'):\n",
+ " print \"Enter Q to quit, any other character to continue: \",\n",
+ " choice = raw_input()\n",
+ " if (choice == 'Q'):\n",
+ " print \"Input stopped\"\n",
+ " else:\n",
+ " printMessage()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter Q to quit, any other character to continue: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "w\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " This function called 1 times\n",
+ "Enter Q to quit, any other character to continue: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "q\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " This function called 1 times\n",
+ "Enter Q to quit, any other character to continue: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Q\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Input stopped\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 9.7, page no. 186"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "\n",
+ "times = 0\n",
+ "def printMessage():\n",
+ " global times\n",
+ " times += 1\n",
+ " print \"This function called \", times, \" times\"\n",
+ "\n",
+ "\n",
+ "choice = '1'\n",
+ "while(choice != 'Q'):\n",
+ " print \"Enter Q to quit, any other character to continue: \",\n",
+ " choice = raw_input()\n",
+ " if (choice == 'Q'):\n",
+ " print \"Input stopped\"\n",
+ " else:\n",
+ " printMessage()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Q to quit, any other character to continue: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "w\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " This function called 1 times\n",
+ "Enter Q to quit, any other character to continue: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "t\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " This function called 2 times\n",
+ "Enter Q to quit, any other character to continue: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "u\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " This function called 3 times\n",
+ "Enter Q to quit, any other character to continue: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Q\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Input stopped\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 9.8, page no. 189"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "\n",
+ "times = 0\n",
+ "def printMessage():\n",
+ " global times\n",
+ " times += 1\n",
+ " print \"This function called \", times, \" times\"\n",
+ "\n",
+ "\n",
+ "choice = '1'\n",
+ "while(choice != 'Q'):\n",
+ " print \"Enter Q to quit, any other character to continue: \",\n",
+ " choice = raw_input()\n",
+ " if (choice == 'Q'):\n",
+ " print \"Input stopped\"\n",
+ " else:\n",
+ " printMessage()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter Q to quit, any other character to continue: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "w\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " This function called 1 times\n",
+ "Enter Q to quit, any other character to continue: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "r\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " This function called 2 times\n",
+ "Enter Q to quit, any other character to continue: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "t\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " This function called 3 times\n",
+ "Enter Q to quit, any other character to continue: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Q\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Input stopped\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 9.9, page no. 190"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "def printMessage():\n",
+ " print \"You inputted \", str\n",
+ "\n",
+ "print \"Enter a string: \",\n",
+ "str = raw_input()\n",
+ "printMessage()\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a string: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Jeff\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " You inputted Jeff\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 9.10, page no. 191"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "\n",
+ "def printMessage(s):\n",
+ " print \"You inputted \", s\n",
+ "\n",
+ "print \"Enter a string: \",\n",
+ "str = raw_input()\n",
+ "printMessage(str)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter a string: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Jeff\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " You inputted Jeff\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 9.11, page no. 193"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "\n",
+ "def printMessage(firstName, lastName):\n",
+ " print \"Your name is \", firstName, \" \", lastName\n",
+ "\n",
+ "print \"Enter first name:\",\n",
+ "name1 = raw_input()\n",
+ "print \"Enter last name:\",\n",
+ "name2 = raw_input()\n",
+ "printMessage(name1, name2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter first name:"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Jeff\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter last name:"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Kent\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Your name is Jeff Kent\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 9.12, page no. 194"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "\n",
+ "def printMessage(thename, theage):\n",
+ " print \"Your name is \", thename, \" and your age is\", theage\n",
+ "\n",
+ "print \"Enter name:\",\n",
+ "name = raw_input()\n",
+ "print \"Enter age:\",\n",
+ "age = int(raw_input())\n",
+ "printMessage(name, age)\n",
+ "printMessage(age, name)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter name:"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Jeff\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter age:"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "34\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Your name is Jeff and your age is 34\n",
+ "Your name is 34 and your age is Jeff\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 9.13, page no. 195"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "\n",
+ "def doubleIt(x):\n",
+ " print \"The number to be doubled is \", x\n",
+ " x *= 2\n",
+ " print \"The number doubled in doubleIt is \", x\n",
+ "\n",
+ "print \"Enter number: \",\n",
+ "num = int(raw_input())\n",
+ "doubleIt(num)\n",
+ "print \"The number doubled outside the function is \", num,"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter number: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "34\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The number to be doubled is 34\n",
+ "The number doubled in doubleIt is 68\n",
+ "The number doubled outside the function is 34\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 9.14, page no. 196"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "\n",
+ "li = [0]\n",
+ "def doubleIt():\n",
+ " print \"The number to be doubled is \", li[0]\n",
+ " li[0] *= 2\n",
+ " print \"The number doubled in doubleIt is \", li[0]\n",
+ " \n",
+ "print \"Enter number: \",\n",
+ "num = int(raw_input())\n",
+ "li[0] = num\n",
+ "doubleIt()\n",
+ "print \"The number doubled outside the function is \", li[0]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter number: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " The number to be doubled is 5\n",
+ "The number doubled in doubleIt is 10\n",
+ "The number doubled outside the function is 10\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 9.15, page no. 197"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "\n",
+ "z = []\n",
+ "def addNumbers (a, b):\n",
+ " z.append(a + b)\n",
+ "\n",
+ "\n",
+ "print \"Enter first number: \",\n",
+ "firstNum = int(raw_input())\n",
+ "print \"Enter second number: \",\n",
+ "secondNum = int(raw_input())\n",
+ "addNumbers(firstNum, secondNum)\n",
+ "print firstNum, \" + \", secondNum, \" = \", z[0]"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter first number: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter second number: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 3 + 4 = 7\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 9.16, page no. 199"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "\n",
+ "def addNumbers(x, y):\n",
+ " return x + y\n",
+ "\n",
+ "print \"Enter first number: \",\n",
+ "firstNum = int(raw_input())\n",
+ "print \"Enter second number: \",\n",
+ "secondNum = int(raw_input())\n",
+ "sum = addNumbers(firstNum, secondNum)\n",
+ "print firstNum, \" + \", secondNum, \" = \", sum\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter first number: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Enter second number: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " 4 + 5 = 9\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/C++_Demystified:_A_Self-Teaching_Guide/chapter13.ipynb b/C++_Demystified:_A_Self-Teaching_Guide/chapter13.ipynb
index a7e400b9..8c87053f 100755
--- a/C++_Demystified:_A_Self-Teaching_Guide/chapter13.ipynb
+++ b/C++_Demystified:_A_Self-Teaching_Guide/chapter13.ipynb
@@ -41,17 +41,14 @@
"metadata": {},
"outputs": [
{
- "ename": "NameError",
- "evalue": "name 'fp' is not defined",
- "output_type": "pyerr",
- "traceback": [
- "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[1;31mNameError\u001b[0m Traceback (most recent call last)",
- "\u001b[1;32m<ipython-input-1-112e202a5944>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 4\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 5\u001b[0m \u001b[1;32mtry\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 6\u001b[1;33m \u001b[1;32mif\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mfp\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 7\u001b[0m \u001b[1;32mprint\u001b[0m \u001b[1;34m\"infile = \"\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mfp\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 8\u001b[0m \u001b[1;32mprint\u001b[0m \u001b[1;34m\"0\"\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
- "\u001b[1;31mNameError\u001b[0m: name 'fp' is not defined"
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n"
]
}
],
- "prompt_number": 1
+ "prompt_number": 4
},
{
"cell_type": "heading",
diff --git a/C++_Demystified:_A_Self-Teaching_Guide/chapter5.ipynb b/C++_Demystified:_A_Self-Teaching_Guide/chapter5.ipynb
index 7973421f..e0f1a684 100755
--- a/C++_Demystified:_A_Self-Teaching_Guide/chapter5.ipynb
+++ b/C++_Demystified:_A_Self-Teaching_Guide/chapter5.ipynb
@@ -459,31 +459,8 @@
],
"language": "python",
"metadata": {},
- "outputs": [
- {
- "ename": "StdinNotImplementedError",
- "evalue": "raw_input was called, but this frontend does not support stdin.",
- "output_type": "pyerr",
- "traceback": [
- "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[1;31mStdinNotImplementedError\u001b[0m Traceback (most recent call last)",
- "\u001b[1;32m/home/jovina/TBC/hardik/c++-demystified/<ipython-input-1-44ee42c69511>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 7\u001b[0m \u001b[1;32mprint\u001b[0m \u001b[1;34m\"L for Leather Seats\"\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 8\u001b[0m \u001b[1;32mprint\u001b[0m \u001b[1;34m\"D for Leather Seats + Chrome Wheels\"\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 9\u001b[1;33m \u001b[0mchoice\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mraw_input\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 10\u001b[0m \u001b[1;32mprint\u001b[0m \u001b[1;34m\"Extra features purchased\"\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 11\u001b[0m \u001b[1;32mif\u001b[0m \u001b[0mchoice\u001b[0m \u001b[1;33m==\u001b[0m \u001b[1;34m'D'\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
- "\u001b[1;32m/home/jovina/epd/lib/python2.7/site-packages/IPython/zmq/ipkernel.pyc\u001b[0m in \u001b[0;36m<lambda>\u001b[1;34m(prompt)\u001b[0m\n\u001b[0;32m 251\u001b[0m \u001b[0mraw_input\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;32mlambda\u001b[0m \u001b[0mprompt\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;34m''\u001b[0m\u001b[1;33m:\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_raw_input\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mprompt\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mident\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mparent\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 252\u001b[0m \u001b[1;32melse\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 253\u001b[1;33m \u001b[0mraw_input\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;32mlambda\u001b[0m \u001b[0mprompt\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;34m''\u001b[0m \u001b[1;33m:\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_no_raw_input\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 254\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 255\u001b[0m \u001b[1;32mif\u001b[0m \u001b[0mpy3compat\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mPY3\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
- "\u001b[1;32m/home/jovina/epd/lib/python2.7/site-packages/IPython/zmq/ipkernel.pyc\u001b[0m in \u001b[0;36m_no_raw_input\u001b[1;34m(self)\u001b[0m\n\u001b[0;32m 443\u001b[0m \"\"\"Raise StdinNotImplentedError if active frontend doesn't support\n\u001b[0;32m 444\u001b[0m stdin.\"\"\"\n\u001b[1;32m--> 445\u001b[1;33m raise StdinNotImplementedError(\"raw_input was called, but this \"\n\u001b[0m\u001b[0;32m 446\u001b[0m \"frontend does not support stdin.\") \n\u001b[0;32m 447\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n",
- "\u001b[1;31mStdinNotImplementedError\u001b[0m: raw_input was called, but this frontend does not support stdin."
- ]
- },
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Choose your car\n",
- "S for Standard\n",
- "L for Leather Seats\n",
- "D for Leather Seats + Chrome Wheels\n"
- ]
- }
- ],
- "prompt_number": 1
+ "outputs": [],
+ "prompt_number": "*"
},
{
"cell_type": "code",
diff --git a/C++_Demystified:_A_Self-Teaching_Guide/chapter9.ipynb b/C++_Demystified:_A_Self-Teaching_Guide/chapter9.ipynb
index 78228f18..5b5e1ccb 100755
--- a/C++_Demystified:_A_Self-Teaching_Guide/chapter9.ipynb
+++ b/C++_Demystified:_A_Self-Teaching_Guide/chapter9.ipynb
@@ -157,11 +157,12 @@
"input": [
"\n",
"def printMessage():\n",
+ " times = 0\n",
" times += 1\n",
" print \"This function called \", times, \" times\"\n",
"\n",
"\n",
- "times = 0\n",
+ "\n",
"choice = '1'\n",
"while(choice != 'Q'):\n",
" print \"Enter Q to quit, any other character to continue: \",\n",
@@ -178,6 +179,22 @@
"output_type": "stream",
"stream": "stdout",
"text": [
+ " Enter Q to quit, any other character to continue: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "e\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " This function called 1 times\n",
"Enter Q to quit, any other character to continue: "
]
},
@@ -190,18 +207,46 @@
]
},
{
- "ename": "UnboundLocalError",
- "evalue": "local variable 'times' referenced before assignment",
- "output_type": "pyerr",
- "traceback": [
- "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[1;31mUnboundLocalError\u001b[0m Traceback (most recent call last)",
- "\u001b[1;32m<ipython-input-8-42e131eb489c>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 17\u001b[0m \u001b[1;32mprint\u001b[0m \u001b[1;34m\"Input stopped\"\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 18\u001b[0m \u001b[1;32melse\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 19\u001b[1;33m \u001b[0mprintMessage\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
- "\u001b[1;32m<ipython-input-8-42e131eb489c>\u001b[0m in \u001b[0;36mprintMessage\u001b[1;34m()\u001b[0m\n\u001b[0;32m 5\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 6\u001b[0m \u001b[1;32mdef\u001b[0m \u001b[0mprintMessage\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 7\u001b[1;33m \u001b[0mtimes\u001b[0m \u001b[1;33m+=\u001b[0m \u001b[1;36m1\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 8\u001b[0m \u001b[1;32mprint\u001b[0m \u001b[1;34m\"This function called \"\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mtimes\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m\" times\"\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 9\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n",
- "\u001b[1;31mUnboundLocalError\u001b[0m: local variable 'times' referenced before assignment"
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " This function called 1 times\n",
+ "Enter Q to quit, any other character to continue: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "q\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " This function called 1 times\n",
+ "Enter Q to quit, any other character to continue: "
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Q\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Input stopped\n"
]
}
],
- "prompt_number": 8
+ "prompt_number": 4
},
{
"cell_type": "heading",
diff --git a/C++_Demystified:_A_Self-Teaching_Guide/students.dat b/C++_Demystified:_A_Self-Teaching_Guide/students.dat
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/C++_Demystified:_A_Self-Teaching_Guide/students.dat
diff --git a/C++_in_Action_-_Industrial-Strength_Programming_Techniques/.ipynb_checkpoints/ch1-checkpoint.ipynb b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/.ipynb_checkpoints/ch1-checkpoint.ipynb
new file mode 100755
index 00000000..a9c91080
--- /dev/null
+++ b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/.ipynb_checkpoints/ch1-checkpoint.ipynb
@@ -0,0 +1,261 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:2af50dca95bb8940069ca1eefad39c58f8f97bbf13a194cd9fff16b4f6521b4f"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter One : Naming"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 1.1 Page no : 2 \n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "\n",
+ "strL = 0 # Not recommended\n",
+ "stringLength = 0 # Recommended"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 2 Page no : 3\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "\n",
+ "class EmcFruit:\n",
+ " def print_(self):\n",
+ " pass\n",
+ "\n",
+ "class EmcApple(EmcFruit):\n",
+ " def print_(self):\n",
+ " pass\n",
+ "\n",
+ "fp = EmcApple()\n",
+ "print fp "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "<__main__.EmcApple instance at 0x9d29c8c>\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 1.3 Page no : 4\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "class Point:\n",
+ " def __init__(self,a,b):\n",
+ " self.x = a\n",
+ " self.y = b\n",
+ " def x1(self,a):\n",
+ " self.x = a\n",
+ "\n",
+ "p = Point(0,0) # a point in a 2-dimensional space\n",
+ "p.x1(1); # set X-coordinate\n",
+ "print p.x # prints X-coordinate, \"1\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 1.4 page no : 4\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "\n",
+ "def check_assign(a,i,t):\n",
+ " if (i < len(a)):\n",
+ " a[i] = t;"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 1.5 Page no : 6\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "class String:\n",
+ " pass\n",
+ "\n",
+ "class DynamicArray:\n",
+ " pass"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 1.6 page no : 6\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "a = 'aaa' \n",
+ "s1 = 'xyz'\n",
+ "s = 'abc' # Emc::String s;\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 1.8 page no : 7\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#s1 = EmcString() # Belongs to the Emc Class Library\n",
+ "#s2 = OtherString() # Belongs to the Other Class Library"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 1.9 Page no : 8\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "#import RWCstring #include \"RWCstring.h\" /* Recommended */\n",
+ "#from rw import cstring #include \"rw/cstring.h\" /* Sometimes needed */"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 1.10 page no : 9\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "\n",
+ "i__j = 11;\n",
+ "_K = 22;\n",
+ "_m = 33;\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/C++_in_Action_-_Industrial-Strength_Programming_Techniques/.ipynb_checkpoints/ch10-checkpoint.ipynb b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/.ipynb_checkpoints/ch10-checkpoint.ipynb
new file mode 100755
index 00000000..6292c70e
--- /dev/null
+++ b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/.ipynb_checkpoints/ch10-checkpoint.ipynb
@@ -0,0 +1,490 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:70f9ab632bffbd9fecc3bdcee575cac266cb09d4df74fddec4e595d028f134df"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1> Chapter Ten : Object-oriented programming </h1>"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 10.1 page no :105"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "\n",
+ "s = \"hello\" # length() == 5\n",
+ "print s\n",
+ "print len(s)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "hello\n",
+ "5"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>EXAMPLE 10.2 page no : 106"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "s = \"Hello\"\n",
+ "\n",
+ "s = s.lower()\n",
+ "print s"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "hello"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3> example 10.3 page no :107"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "\n",
+ "class EmcCollection:\n",
+ " \n",
+ " def insert(self,t):\n",
+ " pass\n",
+ " \n",
+ " def operator(self, coll):\n",
+ " pass\n",
+ "\n",
+ "class EmcArrayCollection(EmcCollection):\n",
+ " initialSize = 10\n",
+ "\n",
+ " def __init__(self,maxsize):\n",
+ " pass\n",
+ "\n",
+ "\"\"\"\n",
+ "class InvalidCollectionType(EmcException):\n",
+ " \n",
+ " def __init__(self,i):\n",
+ " pass\n",
+ " \"\"\"\n",
+ "\n",
+ "class EmcCollectionFactory:\n",
+ " def __init__(self):\n",
+ " pass\n",
+ "\n",
+ " def create(self,type):\n",
+ " pass\n",
+ "\n",
+ " def createArray(self):\n",
+ " pass"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>example 10.4 page no :109"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "class EmcCollectionFactory:\n",
+ " def __init__(self):\n",
+ " pass\n",
+ "\n",
+ " def create(self,type):\n",
+ " pass\n",
+ "\n",
+ " def createArray(self):\n",
+ " pass\n",
+ "\n",
+ "factory = EmcCollectionFactory()\n",
+ "collection = factory.create(\"Array\")\n",
+ "collection.insert(42); # EmcArrayCollection<int>::insert() is called\n",
+ "print collection"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "None\n"
+ ]
+ }
+ ],
+ "prompt_number": 32
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>example 10.5 page no : 111"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [
+ "\n",
+ "class EmcCollection:\n",
+ " def __del__(self):\n",
+ " pass\n",
+ "\n",
+ "class EmcArrayCollection( EmcCollection):\n",
+ " def __del__(self):\n",
+ " pass"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>example 10.6 page no :112"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [
+ "\n",
+ "class EmcLogged:\n",
+ " def writeClassName(self,o):\n",
+ " pass\n",
+ "\n",
+ " def writeValue(self,o):\n",
+ " pass\n",
+ "\n",
+ " def logMessage(self,message):\n",
+ " pass\n",
+ "\n",
+ " def __del__(self):\n",
+ " pass\n",
+ "\n",
+ "class EmcLoggedCollection(EmcCollection):\n",
+ "\n",
+ " def writeValue(self,o):\n",
+ " pass\n",
+ "\n",
+ " def __del__(self):\n",
+ " pass "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>EXAMPLE 10.7 Page no : 117"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [
+ "\n",
+ "\n",
+ "\n",
+ "class EmcIntStack:\n",
+ " def empty(self):\n",
+ " pass\n",
+ "\n",
+ " def full(self):\n",
+ " pass\n",
+ " \n",
+ " def top(self):\n",
+ " pass\n",
+ " \n",
+ " def push(self,i):\n",
+ " pass\n",
+ " \n",
+ " def pop(self):\n",
+ " pass"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>EXAMPLE 10.8 Page no : 117"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [
+ "\n",
+ "\n",
+ "def makeString(stack):\n",
+ " returnValue = ''\n",
+ " copy = stack\n",
+ " while (not copy.empty()):\n",
+ " # loop condition makes precondition valid\n",
+ " print copy.pop() # Precondition: ! copy.empty()\n",
+ " returnValue += copy.pop\n",
+ "\n",
+ " return returnValue;"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>EXAMPLE 10.9 page no : 118"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [
+ "\n",
+ "\n",
+ "class EmcString:\n",
+ " def cStr(self):\n",
+ " pass\n",
+ " # cStr() returns 0-terminated string\n",
+ "\n",
+ " def length(self):\n",
+ " pass"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>EXAMPLE 10.10 page no : 119"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [
+ "\n",
+ "\n",
+ "class EmcCollection:\n",
+ " def __del__(self):\n",
+ " pass\n",
+ "\n",
+ " def insert(self,T):\n",
+ " pass\n",
+ "\n",
+ " def clear(self):\n",
+ " pass\n",
+ "\n",
+ " def remove(self):\n",
+ " pass"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>EXAMPLE 10.11 page no : 120"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "class EmcCollectionFactory:\n",
+ " def __init__(self):\n",
+ " pass\n",
+ "\n",
+ " def create(self,type):\n",
+ " pass\n",
+ "\n",
+ " def createArray(self):\n",
+ " pass\n",
+ " \n",
+ "factrory = EmcCollectionFactory()\n",
+ "collection = factory.create(\"Array\");\n",
+ "if (not collection.isFull()):\n",
+ " collection.insert(42);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 36
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>EXAMPLE 10.12 page no : 121"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [
+ "\n",
+ "def insertObject(c,element):\n",
+ " \n",
+ " if (not c.isFull()):\n",
+ " c.insert(element)\n",
+ " return True\n",
+ " return False"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>EXAMPLE 10.13 Page no : 121"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [
+ "\n",
+ "def insert(T):\n",
+ " pass"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>EXAMPLE 10.14 page no : 123"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [
+ "\n",
+ "\n",
+ "class EmcCollection:\n",
+ " pass"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>EXAMPLE 10.15 page no : 124"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [
+ "\n",
+ "class EmcCollection:\n",
+ " def templateRequirements(self):\n",
+ " pass\n",
+ "\n",
+ " def templateRequirements(self):\n",
+ " \n",
+ " t1 = T1()\n",
+ " \n",
+ " t2 =t1\n",
+ "\n",
+ " t2 = t1;\n",
+ " # Assignable\n",
+ " b = (t2 == t1); # EqualityComparable"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/C++_in_Action_-_Industrial-Strength_Programming_Techniques/.ipynb_checkpoints/ch12-checkpoint.ipynb b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/.ipynb_checkpoints/ch12-checkpoint.ipynb
new file mode 100755
index 00000000..c8f2cfb1
--- /dev/null
+++ b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/.ipynb_checkpoints/ch12-checkpoint.ipynb
@@ -0,0 +1,355 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:3fda869111a137bc83ae4b79f3c57ac84f247031c3e08ac7d6dfb9bb168b3105"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter Twelve : Error handling"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>EXAMPLE 12.1 page no : 135"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import socket\n",
+ "import sys\n",
+ "import os\n",
+ "sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM,0)\n",
+ "\n",
+ "if(sock < 0):\n",
+ " pass"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>EXAMPLE 12.2 page no : 136"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [
+ "\n",
+ "class EmcException:\n",
+ " def operator(self,n):\n",
+ " pass\n",
+ "\n",
+ "class EmcSystemException( EmcException):\n",
+ " def __init__(self,m):\n",
+ " pass\n",
+ " \n",
+ " def emcSocket(self,family,t,protocol):\n",
+ " # create socket\n",
+ " socketfd = socket(family, t, protocol);\n",
+ " if (socketfd < 0): # check status value\n",
+ " raise EmcSystemException(\"emcSocket\");\n",
+ " return socketfd;"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>EXAMPLE 12.3 page no : 139"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [
+ "\n",
+ "\n",
+ "def __init__(self,cp):\n",
+ " self.lengthM = len(cp)\n",
+ " self.cpM = cp"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>EXAMPLE 12.5 page no : 141"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [
+ "\n",
+ "class EmcLog:\n",
+ " def __init__(self,filename):\n",
+ " pass\n",
+ "\n",
+ " def message(self,EmcString):\n",
+ " pass\n",
+ "\n",
+ " def __del__(self):\n",
+ " if uncaught_exception():\n",
+ " self.flush()\n",
+ " \n",
+ " def flush(self):\n",
+ " if ( not uncaught_exception()):\n",
+ " raise EmcSystemException(\"EmcLog::flush()\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>EXAMPLE 12.6 page no : 142"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [
+ "\n",
+ "class EmcException:\n",
+ " def __init__(self,m):\n",
+ " maxSizeM = 100\n",
+ " actualLength = len(m);\n",
+ " self.lengthM = min(maxSizeM,actualLength);\n",
+ " self.messageM = message"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>EXAMPLE 12.7"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [
+ "\n",
+ "\n",
+ "def f():\n",
+ " ip = 1\n",
+ " g(ip)\n",
+ "\n",
+ "\n",
+ "def g(i):\n",
+ " raise Exception(i)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>EXAMPLE 12.8 page no : 146"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [
+ "\n",
+ "\n",
+ "def f():\n",
+ " ip = 1\n",
+ " g(ip)\n",
+ "\n",
+ "def g(i):\n",
+ " raise Exception(i)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>EXAMPLE 12.9 page no :146"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [
+ "\n",
+ "def f():\n",
+ " ip = 1\n",
+ " g(ip)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>EXAMPLE 12.10 page no : 148"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [
+ "\n",
+ "class EmcStack:\n",
+ " defaultSizeM = 100\n",
+ " def __init__(self,size = 100):\n",
+ " pass\n",
+ "\n",
+ " def __del__(self):\n",
+ " pass\n",
+ "\n",
+ " def operator(self,s):\n",
+ " pass\n",
+ "\n",
+ " def empty(self):\n",
+ " pass\n",
+ " \n",
+ " def top(self):\n",
+ " pass\n",
+ "\n",
+ " def push(self,i):\n",
+ " pass\n",
+ " \n",
+ " def pop(self):\n",
+ " pass"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>EXAMPLE 12.12 page no : 151"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [
+ "\n",
+ "class EmcException:\n",
+ " def __init__(self,m):\n",
+ " pass\n",
+ " \n",
+ " def operator(self,o,EmcException):\n",
+ " pass\n",
+ "\n",
+ " def printOn(self,o): \n",
+ " print self.messageM;"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>EXAMPLE 12.13 page no : 153"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "try:\n",
+ " socketfd = emcSocket(AF_UNIX, SOCK_STREAM, 0);\n",
+ "except Exception,e:\n",
+ " print e"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "name 'emcSocket' is not defined"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>EXAMPLE 12.14 page no : 155"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [
+ "\n",
+ "\n",
+ "def at(s,pos):\n",
+ " if (pos > len(s)):\n",
+ " raise Exception;"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/C++_in_Action_-_Industrial-Strength_Programming_Techniques/.ipynb_checkpoints/ch13-checkpoint.ipynb b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/.ipynb_checkpoints/ch13-checkpoint.ipynb
new file mode 100755
index 00000000..8bf2f3f0
--- /dev/null
+++ b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/.ipynb_checkpoints/ch13-checkpoint.ipynb
@@ -0,0 +1,350 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:121cbe714f8e854e8d9ce1fe8dcdc370535cc7140b2f83bdae09063602e644f9"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1> Chapter Thirteen : Parts of C++ to avoid"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>EXAMPLE 13.1 page no : 159"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "s = 'abc' #raw_input()\n",
+ "print s"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "abc"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>EXAMPLE 13.2 page no : 160"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "class DangerousString:\n",
+ " def __init__(self,cp):\n",
+ " pass\n",
+ " \n",
+ " def char(self):\n",
+ " pass\n",
+ "\n",
+ "hello = \"Hello World!\";\n",
+ "print hello # Works perfectly\n",
+ "print \"%s\"%hello"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Hello World!\n",
+ "Hello World!"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>EXAMPLE 13.3 page no : 160"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "class EmcString:\n",
+ " def __init__(self,cp):\n",
+ " pass\n",
+ "\n",
+ "\n",
+ "s = \"Hello World!\";\n",
+ "print s "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Hello World!"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>EXAMPLE 13.4 page no :161"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "\n",
+ "SIZE = 1024;\n",
+ "print SIZE"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1024"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>EXAMPLE 13.5 page no : 162"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [
+ "\n",
+ "class X:\n",
+ " class Color:\n",
+ " green = 1\n",
+ " yellow = 2\n",
+ " red = 3"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>EXAMPLE 13.6 page no : 162"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [
+ "\n",
+ "class X:\n",
+ " maxBuf = 1024\n",
+ " class Color:\n",
+ " green = 1\n",
+ " yellow = 2\n",
+ " red = 3"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>EXAMPLE 13.7 page no : 162"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "def SQUARE(x):\n",
+ " return x*x\n",
+ "\n",
+ "i = SQUARE(3 + 4); \n",
+ "print i"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "49"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>EXAMPLE 13.8 page no : 163"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "def square(x):\n",
+ " return x * x;\n",
+ "c = 2;\n",
+ "d = square(c)\n",
+ "print d"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>EXAMPLE 13.9 page no : 163"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "def SQUARE(x):\n",
+ " return x*x\n",
+ "i = SQUARE(\"hello\");\n",
+ "print i\n",
+ "\"\"\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "metadata": {},
+ "output_type": "pyout",
+ "prompt_number": 10,
+ "text": [
+ "'\\ndef SQUARE(x):\\n return x*x\\ni = SQUARE(\"hello\");\\nprint i\\n'"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>EXAMPLE 13.10 page no : 163"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "#define Velocity int\n",
+ "#typedef int Velocity;\n",
+ "# Not recommended"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "metadata": {},
+ "output_type": "pyout",
+ "prompt_number": 11,
+ "text": [
+ "'\\nEXAMPLE 13.10 page no : 163\\nHow to define synonyms for a type\\nNote : Python doesnot have synonyms for type as we do not have to explicitely \\ndeclare variables.\\n'"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>EXAMPLE 13.11 page no : 164"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [
+ "\n",
+ "\n",
+ "def printFruits(fruits,size):\n",
+ " for i in range(size):\n",
+ " print fruits[i] "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/C++_in_Action_-_Industrial-Strength_Programming_Techniques/.ipynb_checkpoints/ch15-checkpoint.ipynb b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/.ipynb_checkpoints/ch15-checkpoint.ipynb
new file mode 100755
index 00000000..62a8a475
--- /dev/null
+++ b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/.ipynb_checkpoints/ch15-checkpoint.ipynb
@@ -0,0 +1,611 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:24f5f3b754e3fd6e8afab7bcb99e41e817ec5bce9faae498ba9fb75dd53f93ff"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1> Chapter Fifteen : Portability"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>EXAMPLE 15.1 page no : 172"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [
+ "\n",
+ "c = -100;\n",
+ "if (c < 0):\n",
+ " pass"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>EXAMPLE 15.2 page no : 173"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "\n",
+ "class BasicAttrType:\n",
+ " counterGauge = 0x1000\n",
+ " counterPeg = 0x2000\n",
+ " conterAcc = 0x3000\n",
+ " \n",
+ "\n",
+ "\n",
+ "t = BasicAttrType.counterGauge\n",
+ "print t"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "4096"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>EXAMPLE 15.3 page no : 173"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "a = ''\n",
+ "print a"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": []
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>example 15.5 page no : 174"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "\n",
+ "result = 1234 * 567\n",
+ "print result"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "699678"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 15.6 page no : 175"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [
+ "\n",
+ "import math # python has only one way to importing file.\n",
+ "from math import *"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>exmaple 15.7 page no : 176"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "\n",
+ " \n",
+ "# import inc.MyFile\n",
+ "# import inc.MyFile\n",
+ "\n",
+ "# import gui.xinterface"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "metadata": {},
+ "output_type": "pyout",
+ "prompt_number": 6,
+ "text": [
+ "'\\nexmaple 15.7 page no : 176\\nDirectory names in include directives\\nNote : python has . operator to import a file from directory\\n'"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>EXAMPLE 15.8 page no : 176"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [
+ "\n",
+ "\n",
+ "import math\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>EXAMPLE 15.9 page no : 178"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [
+ "\n",
+ "\n",
+ "class PersonRecord:\n",
+ " ageM = ''\n",
+ " phoneNumberM = 0\n",
+ " nameM = ''"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>EXAMPLE 15.10 page no : 178"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "def stepAndConvert(a,n):\n",
+ " b = a + str(n) # step n chars ahead\n",
+ " return b # NO: Dangerous cast of const char* to int*\n",
+ "\n",
+ "\n",
+ "data = \"abcdefghijklmnop\"\n",
+ "anInt = 3;\n",
+ "i = stepAndConvert(data, anInt)\n",
+ "print i"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "abcdefghijklmnop3"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>EXAMPLE 15.11 page no : 179"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [
+ "\n",
+ "INT_MIN = -2147483648\n",
+ "INT_MAX = 2147483647\n",
+ "UINT_MAX = 4294967295\n",
+ "i = 42\n",
+ "ui = 2222222242;\n",
+ "j = i - ui;\n",
+ "print j"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-2222222200"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>EXAMPLE 15.12 page no : 180"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "zero = 0;\n",
+ "one = 1;\n",
+ "minusOne = zero - one;\n",
+ "print minusOne\n",
+ "result = one + minusOne;\n",
+ "print result"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-1\n",
+ "0"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>EXAMPLE 15.13 page no : 180"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "#pid1 = fork(); # NO: should use pid_t\n",
+ "\n",
+ "#pid2 = fork();"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>EXAMPLE 15.14 page no : 181"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "famousClimber = \"Edmund Hillary\"; # Uses Emc as prefix\n",
+ "print famousClimber"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Edmund Hillary"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>EXAMPLE 15.15 page no : 183"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [
+ "\n",
+ "\n",
+ "class EmcArray:\n",
+ " def __init__(self,size):\n",
+ " pass"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>EXAMPLE 15.16 page no : 183"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [
+ "\n",
+ "\n",
+ "\n",
+ "false = 0;\n",
+ "true = 1;"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>EXAMPLE 15.17 page no : 184"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\"\"\"\n",
+ "i = 0;\n",
+ "for i in range(last()):\n",
+ " pass\n",
+ "\n",
+ "for i in range(first()):\n",
+ " pass\n",
+ " \"\"\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "metadata": {},
+ "output_type": "pyout",
+ "prompt_number": 5,
+ "text": [
+ "'\\ni = 0;\\nfor i in range(last()):\\n pass\\n\\nfor i in range(first()):\\n pass\\n '"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>EXAMPLE 15.18 page no : 185"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [
+ "\n",
+ "\n",
+ "def emcMax(a, b):\n",
+ " if a>b:\n",
+ " return a\n",
+ " return b\n",
+ "\n",
+ "def foo(i,j):\n",
+ " m = emcMax(i, j); # usage of emcMax\n",
+ "\n",
+ "q = 0 # usage of class EmcQueue<int> and\n",
+ "s = 0 # EmcQueue<int>:s default constructor"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>EXAMPLE 15.19 page no : 186"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [
+ "\n",
+ "class EmcQueue:\n",
+ " pass"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>EXAMPLE 15.20 page no : 187"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [
+ "\n",
+ "\n",
+ "class DangerousString:\n",
+ " def __init__(self,cp):\n",
+ " pass\n",
+ "\n",
+ " def char(self):\n",
+ " pass"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>example 15.22 page no : 189"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [
+ "\n",
+ "def main(self):\n",
+ " return 0"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>EXAMPLE 15.23"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [
+ "\n",
+ "\n",
+ "func(f1(), f2(), f3()) # f1 may be evaluated before f2 and f3,\n",
+ "# but don't depend on it!"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>EXAMPLE 15.24 page no : 189"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "a = [0,0,0]\n",
+ "i = 0\n",
+ "a[i] = i;\n",
+ "i += 1\n",
+ "print i \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "code",
+ "collapsed": true,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/C++_in_Action_-_Industrial-Strength_Programming_Techniques/.ipynb_checkpoints/ch2-checkpoint.ipynb b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/.ipynb_checkpoints/ch2-checkpoint.ipynb
new file mode 100755
index 00000000..a2d1bd52
--- /dev/null
+++ b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/.ipynb_checkpoints/ch2-checkpoint.ipynb
@@ -0,0 +1,249 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:025b4c65298f5bb6d48b99d717b6d0fce940f5a97ad7eb75ea5897c4c9595891"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter : Two : Organizing the code"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 2.1 Page no : 12\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "#import EmcArray # EmcArray.py\n",
+ "#import iostream # The rest of the EmcArray.cc file "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 2.2 page no : 13\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ " \n",
+ "\n",
+ "class X :\n",
+ " def __init__(self):\n",
+ " pass #self.aM = A()\n",
+ " \n",
+ " def returnA(self):\n",
+ " pass #return self.aM\n",
+ " \n",
+ " def withAParameter(self,a):\n",
+ " pass #self.aM = a"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 2.3 page no :14\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "\n",
+ "class Y :\n",
+ " def __init__(self):\n",
+ " pass #self.bM = B()\n",
+ " \n",
+ " def returnBPtr(self):\n",
+ " pass #return self.aM\n",
+ " \n",
+ " def withAParameter(self,b):\n",
+ " pass #self.bM = a\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 2.4 page no : 15\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "def module_exists(module_name):\n",
+ " try:\n",
+ " __import__(module_name)\n",
+ " except ImportError:\n",
+ " return False\n",
+ " else:\n",
+ " return True"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 2.5 page no : 15\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "\n",
+ "def cStr(cpM):\n",
+ " return cpM\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 2.6 page no : 17\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "\n",
+ "\n",
+ "def max_(x,y):\n",
+ " if x > y:\n",
+ " return x\n",
+ " return y\n",
+ "\n",
+ "def function(i,j):\n",
+ " m = max_(i,j) # must instantiate max(int,int)\n",
+ " print m\n",
+ "\n",
+ "function(5,10) \n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "10\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 2.7 page no : 17\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "\n",
+ "class EmcQueue:\n",
+ " def __init__(self):\n",
+ " pass\n",
+ " \n",
+ " def insert(self,t):\n",
+ " pass\n",
+ "\n",
+ "q = EmcQueue()\n",
+ "q.insert(42);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 2.8 page no : 18\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "\n",
+ "class EmcQueue:\n",
+ " pass"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch1.ipynb b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch1.ipynb
index 834bacf2..a9c91080 100755
--- a/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch1.ipynb
+++ b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch1.ipynb
@@ -194,25 +194,13 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "\n",
- "s1 = EmcString() # Belongs to the Emc Class Library\n",
- "s2 = OtherString() # Belongs to the Other Class Library"
+ "#s1 = EmcString() # Belongs to the Emc Class Library\n",
+ "#s2 = OtherString() # Belongs to the Other Class Library"
],
"language": "python",
"metadata": {},
- "outputs": [
- {
- "ename": "NameError",
- "evalue": "name 'EmcString' is not defined",
- "output_type": "pyerr",
- "traceback": [
- "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[1;31mNameError\u001b[0m Traceback (most recent call last)",
- "\u001b[1;32m<ipython-input-7-16beeed526dd>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 4\u001b[0m \u001b[0mNote\u001b[0m \u001b[1;33m:\u001b[0m \u001b[0mthis\u001b[0m \u001b[0mwill\u001b[0m \u001b[0mgive\u001b[0m \u001b[0merror\u001b[0m \u001b[0mbecause\u001b[0m \u001b[0mfile\u001b[0m \u001b[0mdoesn\u001b[0m\u001b[0;31m'\u001b[0m\u001b[0mt\u001b[0m \u001b[0mhave\u001b[0m \u001b[1;32mclass\u001b[0m \u001b[0mEmcString\u001b[0m \u001b[1;32mand\u001b[0m \u001b[0mOtherString\u001b[0m\u001b[1;33m.\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 5\u001b[0m '''\n\u001b[1;32m----> 6\u001b[1;33m \u001b[0ms1\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mEmcString\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;31m# Belongs to the Emc Class Library\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 7\u001b[0m \u001b[0ms2\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mOtherString\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;31m# Belongs to the Other Class Library\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
- "\u001b[1;31mNameError\u001b[0m: name 'EmcString' is not defined"
- ]
- }
- ],
- "prompt_number": 7
+ "outputs": [],
+ "prompt_number": 4
},
{
"cell_type": "heading",
@@ -227,24 +215,13 @@
"collapsed": false,
"input": [
"\n",
- "import RWCstring #include \"RWCstring.h\" /* Recommended */\n",
- "from rw import cstring #include \"rw/cstring.h\" /* Sometimes needed */"
+ "#import RWCstring #include \"RWCstring.h\" /* Recommended */\n",
+ "#from rw import cstring #include \"rw/cstring.h\" /* Sometimes needed */"
],
"language": "python",
"metadata": {},
- "outputs": [
- {
- "ename": "ImportError",
- "evalue": "No module named RWCstring",
- "output_type": "pyerr",
- "traceback": [
- "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[1;31mImportError\u001b[0m Traceback (most recent call last)",
- "\u001b[1;32m<ipython-input-8-4593d91551b4>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 5\u001b[0m \u001b[0mNote\u001b[0m \u001b[1;33m:\u001b[0m \u001b[0mthis\u001b[0m \u001b[0mwould\u001b[0m \u001b[0mgive\u001b[0m \u001b[0merror\u001b[0m \u001b[0mbecause\u001b[0m \u001b[0mwe\u001b[0m \u001b[0mdont\u001b[0m \u001b[0mhave\u001b[0m \u001b[0mpackages\u001b[0m \u001b[0mwritten\u001b[0m \u001b[0mhere\u001b[0m\u001b[1;33m.\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 6\u001b[0m '''\n\u001b[1;32m----> 7\u001b[1;33m \u001b[1;32mimport\u001b[0m \u001b[0mRWCstring\u001b[0m \u001b[1;31m#include \"RWCstring.h\" /* Recommended */\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 8\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[0mrw\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mcstring\u001b[0m \u001b[1;31m#include \"rw/cstring.h\" /* Sometimes needed */\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
- "\u001b[1;31mImportError\u001b[0m: No module named RWCstring"
- ]
- }
- ],
- "prompt_number": 8
+ "outputs": [],
+ "prompt_number": 5
},
{
"cell_type": "heading",
diff --git a/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch10.ipynb b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch10.ipynb
index 52781089..6292c70e 100755
--- a/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch10.ipynb
+++ b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch10.ipynb
@@ -103,11 +103,12 @@
" def __init__(self,maxsize):\n",
" pass\n",
"\n",
- "\n",
+ "\"\"\"\n",
"class InvalidCollectionType(EmcException):\n",
" \n",
" def __init__(self,i):\n",
" pass\n",
+ " \"\"\"\n",
"\n",
"class EmcCollectionFactory:\n",
" def __init__(self):\n",
@@ -121,19 +122,8 @@
],
"language": "python",
"metadata": {},
- "outputs": [
- {
- "ename": "NameError",
- "evalue": "name 'EmcException' is not defined",
- "output_type": "pyerr",
- "traceback": [
- "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
- "\u001b[0;32m/home/jay/<ipython-input-3-5d8a499d2644>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 22\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 23\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 24\u001b[0;31m \u001b[0;32mclass\u001b[0m \u001b[0mInvalidCollectionType\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mEmcException\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 25\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 26\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0m__init__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mi\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
- "\u001b[0;31mNameError\u001b[0m: name 'EmcException' is not defined"
- ]
- }
- ],
- "prompt_number": 3
+ "outputs": [],
+ "prompt_number": 2
},
{
"cell_type": "markdown",
@@ -146,10 +136,18 @@
"cell_type": "code",
"collapsed": false,
"input": [
+ "class EmcCollectionFactory:\n",
+ " def __init__(self):\n",
+ " pass\n",
+ "\n",
+ " def create(self,type):\n",
+ " pass\n",
"\n",
+ " def createArray(self):\n",
+ " pass\n",
"\n",
"factory = EmcCollectionFactory()\n",
- "collection = factory.create(ArrayId)\n",
+ "collection = factory.create(\"Array\")\n",
"collection.insert(42); # EmcArrayCollection<int>::insert() is called\n",
"print collection"
],
@@ -157,17 +155,14 @@
"metadata": {},
"outputs": [
{
- "ename": "NameError",
- "evalue": "name 'EmcCollectionFactory' is not defined",
- "output_type": "pyerr",
- "traceback": [
- "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
- "\u001b[0;32m/home/jay/<ipython-input-4-9ee6096719fb>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 5\u001b[0m '''\n\u001b[1;32m 6\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 7\u001b[0;31m \u001b[0mfactory\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mEmcCollectionFactory\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 8\u001b[0m \u001b[0mcollection\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mfactory\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcreate\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mArrayId\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 9\u001b[0m \u001b[0mcollection\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0minsert\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m42\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m;\u001b[0m \u001b[0;31m# EmcArrayCollection<int>::insert() is called\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
- "\u001b[0;31mNameError\u001b[0m: name 'EmcCollectionFactory' is not defined"
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "None\n"
]
}
],
- "prompt_number": 4
+ "prompt_number": 32
},
{
"cell_type": "markdown",
@@ -364,27 +359,25 @@
"collapsed": false,
"input": [
"\n",
+ "class EmcCollectionFactory:\n",
+ " def __init__(self):\n",
+ " pass\n",
"\n",
+ " def create(self,type):\n",
+ " pass\n",
+ "\n",
+ " def createArray(self):\n",
+ " pass\n",
+ " \n",
"factrory = EmcCollectionFactory()\n",
- "collection = factory.create(ArrayId);\n",
+ "collection = factory.create(\"Array\");\n",
"if (not collection.isFull()):\n",
" collection.insert(42);"
],
"language": "python",
"metadata": {},
- "outputs": [
- {
- "ename": "NameError",
- "evalue": "name 'EmcCollectionFactory' is not defined",
- "output_type": "pyerr",
- "traceback": [
- "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
- "\u001b[0;32m/home/jay/<ipython-input-11-0508dec5ea10>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 5\u001b[0m '''\n\u001b[1;32m 6\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 7\u001b[0;31m \u001b[0mfactrory\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mEmcCollectionFactory\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 8\u001b[0m \u001b[0mcollection\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mfactory\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcreate\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mArrayId\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m;\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 9\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0;32mnot\u001b[0m \u001b[0mcollection\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0misFull\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
- "\u001b[0;31mNameError\u001b[0m: name 'EmcCollectionFactory' is not defined"
- ]
- }
- ],
- "prompt_number": 11
+ "outputs": [],
+ "prompt_number": 36
},
{
"cell_type": "markdown",
diff --git a/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch12.ipynb b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch12.ipynb
index a4d7907e..c8f2cfb1 100755
--- a/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch12.ipynb
+++ b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch12.ipynb
@@ -26,26 +26,18 @@
"cell_type": "code",
"collapsed": false,
"input": [
+ "import socket\n",
+ "import sys\n",
+ "import os\n",
+ "sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM,0)\n",
"\n",
- "socketfd = socket(AF_UNIX, SOCK_STREAM, 0);\n",
- "if(socketfd < 0):\n",
+ "if(sock < 0):\n",
" pass"
],
"language": "python",
"metadata": {},
- "outputs": [
- {
- "ename": "NameError",
- "evalue": "name 'socket' is not defined",
- "output_type": "pyerr",
- "traceback": [
- "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
- "\u001b[0;32m/home/jay/<ipython-input-1-7161141a3c7c>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 10\u001b[0m \u001b[0;34m//\u001b[0m \u001b[0mcreate\u001b[0m \u001b[0msocket\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 11\u001b[0m '''\n\u001b[0;32m---> 12\u001b[0;31m \u001b[0msocketfd\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0msocket\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mAF_UNIX\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mSOCK_STREAM\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m0\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m;\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 13\u001b[0m \u001b[0;32mif\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0msocketfd\u001b[0m \u001b[0;34m<\u001b[0m \u001b[0;36m0\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 14\u001b[0m \u001b[0;32mpass\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
- "\u001b[0;31mNameError\u001b[0m: name 'socket' is not defined"
- ]
- }
- ],
- "prompt_number": 1
+ "outputs": [],
+ "prompt_number": 7
},
{
"cell_type": "markdown",
diff --git a/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch13.ipynb b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch13.ipynb
index a23bdf0e..8bf2f3f0 100755
--- a/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch13.ipynb
+++ b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch13.ipynb
@@ -262,24 +262,22 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "\n",
+ "\"\"\"\n",
"def SQUARE(x):\n",
" return x*x\n",
"i = SQUARE(\"hello\");\n",
- "print i"
+ "print i\n",
+ "\"\"\""
],
"language": "python",
"metadata": {},
"outputs": [
{
- "ename": "TypeError",
- "evalue": "can't multiply sequence by non-int of type 'str'",
- "output_type": "pyerr",
- "traceback": [
- "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)",
- "\u001b[0;32m/home/jay/<ipython-input-10-df398cb9cbc0>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 6\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mSQUARE\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mx\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 7\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mx\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0mx\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 8\u001b[0;31m \u001b[0mi\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mSQUARE\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"hello\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m;\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 9\u001b[0m \u001b[0;32mprint\u001b[0m \u001b[0mi\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
- "\u001b[0;32m/home/jay/<ipython-input-10-df398cb9cbc0>\u001b[0m in \u001b[0;36mSQUARE\u001b[0;34m(x)\u001b[0m\n\u001b[1;32m 5\u001b[0m '''\n\u001b[1;32m 6\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mSQUARE\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mx\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 7\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mx\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0mx\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 8\u001b[0m \u001b[0mi\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mSQUARE\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"hello\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m;\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 9\u001b[0m \u001b[0;32mprint\u001b[0m \u001b[0mi\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
- "\u001b[0;31mTypeError\u001b[0m: can't multiply sequence by non-int of type 'str'"
+ "metadata": {},
+ "output_type": "pyout",
+ "prompt_number": 10,
+ "text": [
+ "'\\ndef SQUARE(x):\\n return x*x\\ni = SQUARE(\"hello\");\\nprint i\\n'"
]
}
],
diff --git a/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch15.ipynb b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch15.ipynb
index 32ad5666..62a8a475 100755
--- a/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch15.ipynb
+++ b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch15.ipynb
@@ -336,25 +336,14 @@
"collapsed": false,
"input": [
"\n",
- "pid1 = fork(); # NO: should use pid_t\n",
+ "#pid1 = fork(); # NO: should use pid_t\n",
"\n",
- "pid2 = fork();"
+ "#pid2 = fork();"
],
"language": "python",
"metadata": {},
- "outputs": [
- {
- "ename": "NameError",
- "evalue": "name 'fork' is not defined",
- "output_type": "pyerr",
- "traceback": [
- "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
- "\u001b[0;32m/home/jay/<ipython-input-12-ef16c6a16507>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 4\u001b[0m \u001b[0mNote\u001b[0m \u001b[0;34m:\u001b[0m \u001b[0mIt\u001b[0m \u001b[0mwould\u001b[0m \u001b[0mshoot\u001b[0m \u001b[0merror\u001b[0m \u001b[0mbecause\u001b[0m \u001b[0mfork\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0mdefined\u001b[0m \u001b[0mhere\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 5\u001b[0m '''\n\u001b[0;32m----> 6\u001b[0;31m \u001b[0mpid1\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mfork\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m;\u001b[0m \u001b[0;31m# NO: should use pid_t\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 7\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 8\u001b[0m \u001b[0mpid2\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mfork\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m;\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
- "\u001b[0;31mNameError\u001b[0m: name 'fork' is not defined"
- ]
- }
- ],
- "prompt_number": 12
+ "outputs": [],
+ "prompt_number": 2
},
{
"cell_type": "markdown",
@@ -439,29 +428,28 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "\n",
+ "\"\"\"\n",
"i = 0;\n",
"for i in range(last()):\n",
" pass\n",
"\n",
"for i in range(first()):\n",
- " pass"
+ " pass\n",
+ " \"\"\""
],
"language": "python",
"metadata": {},
"outputs": [
{
- "ename": "NameError",
- "evalue": "name 'last' is not defined",
- "output_type": "pyerr",
- "traceback": [
- "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
- "\u001b[0;32m/home/jay/<ipython-input-16-119935826b55>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 5\u001b[0m '''\n\u001b[1;32m 6\u001b[0m \u001b[0mi\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;36m0\u001b[0m\u001b[0;34m;\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 7\u001b[0;31m \u001b[0;32mfor\u001b[0m \u001b[0mi\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mrange\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlast\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 8\u001b[0m \u001b[0;32mpass\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 9\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
- "\u001b[0;31mNameError\u001b[0m: name 'last' is not defined"
+ "metadata": {},
+ "output_type": "pyout",
+ "prompt_number": 5,
+ "text": [
+ "'\\ni = 0;\\nfor i in range(last()):\\n pass\\n\\nfor i in range(first()):\\n pass\\n '"
]
}
],
- "prompt_number": 16
+ "prompt_number": 5
},
{
"cell_type": "markdown",
diff --git a/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch2.ipynb b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch2.ipynb
index 8660012f..a2d1bd52 100755
--- a/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch2.ipynb
+++ b/C++_in_Action_-_Industrial-Strength_Programming_Techniques/ch2.ipynb
@@ -29,24 +29,13 @@
"collapsed": false,
"input": [
"\n",
- "import EmcArray # EmcArray.py\n",
- "import iostream # The rest of the EmcArray.cc file "
+ "#import EmcArray # EmcArray.py\n",
+ "#import iostream # The rest of the EmcArray.cc file "
],
"language": "python",
"metadata": {},
- "outputs": [
- {
- "ename": "ImportError",
- "evalue": "No module named EmcArray",
- "output_type": "pyerr",
- "traceback": [
- "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[1;31mImportError\u001b[0m Traceback (most recent call last)",
- "\u001b[1;32m<ipython-input-1-b23807a66872>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 4\u001b[0m \u001b[0mNote\u001b[0m \u001b[1;33m:\u001b[0m \u001b[0mwould\u001b[0m \u001b[0mgive\u001b[0m \u001b[0merror\u001b[0m \u001b[0mbecause\u001b[0m \u001b[0mwe\u001b[0m \u001b[0mdont\u001b[0m \u001b[0mhave\u001b[0m \u001b[0mEmcArray\u001b[0m \u001b[1;32mand\u001b[0m \u001b[0miostream\u001b[0m \u001b[0mpackages\u001b[0m\u001b[1;33m.\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 5\u001b[0m '''\n\u001b[1;32m----> 6\u001b[1;33m \u001b[1;32mimport\u001b[0m \u001b[0mEmcArray\u001b[0m \u001b[1;31m# EmcArray.py\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 7\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0miostream\u001b[0m \u001b[1;31m# The rest of the EmcArray.cc file\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
- "\u001b[1;31mImportError\u001b[0m: No module named EmcArray"
- ]
- }
- ],
- "prompt_number": 1
+ "outputs": [],
+ "prompt_number": 2
},
{
"cell_type": "heading",
diff --git a/Engineering_Physics_Vijaya/.ipynb_checkpoints/chapter2_2-checkpoint.ipynb b/Engineering_Physics_Vijaya/.ipynb_checkpoints/chapter2_2-checkpoint.ipynb
new file mode 100755
index 00000000..2ff5590c
--- /dev/null
+++ b/Engineering_Physics_Vijaya/.ipynb_checkpoints/chapter2_2-checkpoint.ipynb
@@ -0,0 +1,814 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:04561aafd347865fa8c83acfb9b60eb84db275f85862655b442f546023cadd1e"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Electron Theory of Metals"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example number 2.1, Page number 69"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "#import module\n",
+ "import math\n",
+ "\n",
+ "#Calculation\n",
+ "# given that E-Ef = kT\n",
+ "# fermi function FE = 1/(1+exp((E-Ef)/kT)\n",
+ "# therefore FE = 1/(1+exp(kT/kT));\n",
+ "# FE = 1/(1+exp(1))\n",
+ "FE=1/(1+math.exp(1));\n",
+ "FE=math.ceil(FE*10**2)/10**2; #rounding off to 2 decimals\n",
+ "\n",
+ "#Result\n",
+ "print(\"fermi function is\",FE);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "('fermi function is', 0.27)\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example number 2.2, Page number 69"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ " \n",
+ "#import module\n",
+ "import math\n",
+ "\n",
+ "#Calculation\n",
+ "# given that E-Ef = kT\n",
+ "# fermi function FE = 1/(1+exp((E-Ef)/kT)\n",
+ "# therefore FE = 1/(1+exp(kT/kT));\n",
+ "# FE = 1/(1+exp(1))\n",
+ "FE=1/(1+math.exp(1));\n",
+ "FE=math.ceil(FE*10**3)/10**3; #rounding off to 3 decimals\n",
+ "\n",
+ "#Result\n",
+ "print(\"fermi function is\",FE);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "('fermi function is', 0.269)\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example number 2.3, Page number 69"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ " \n",
+ "#import module\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable decleration\n",
+ "FE=10/100; #fermi function is 10%\n",
+ "Ef=5.5; #fermi energy of silver in eV\n",
+ "k=1.38*10**-23;\n",
+ "\n",
+ "#Calculation\n",
+ "E=Ef+(Ef/100);\n",
+ "#FE=1/(1+math.exp((E-Ef)/(k*T)))\n",
+ "#therefore 1/FE = 1+math.exp((E-Ef)/(k*T))\n",
+ "#therefore (1/FE)-1 = math.exp((E-Ef)/(k*T))\n",
+ "#therefore log((1/FE)-1) = (E-Ef)/(k*T)\n",
+ "#therefore T = (E-Ef)/(k*math.log((1/FE)-1))\n",
+ "#let X=E-Ef; \n",
+ "X=E-Ef; #energy in eV\n",
+ "X=X*1.6*10**-19; #energy in J\n",
+ "T = (X/(k*math.log((1/FE)-1)));\n",
+ "T=math.ceil(T*10**2)/10**2; #rounding off to 2 decimals\n",
+ "\n",
+ "#Result\n",
+ "print(\"temperature in K is\",T);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "('temperature in K is', 290.23)\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example number 2.4, Page number 70 **************************************"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ " \n",
+ "#import module\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable decleration\n",
+ "#let X=E-Ef\n",
+ "X=0.5; #E-Ef=0.5 in eV\n",
+ "\n",
+ "#Calculation\n",
+ "X=X*1.6*10**-19; #X in J\n",
+ "FE=1/100; #fermi function is 1% \n",
+ "k=1.38*10**-23;\n",
+ "#FE=1/(1+exp(X/(k*T)))\n",
+ "#therefore 1/FE = 1+math.exp(X/(k*T))\n",
+ "#therefore (1/FE)-1 = math.exp(X/(k*T))\n",
+ "#therefore log((1/FE)-1) = X/(k*T)\n",
+ "#but log(x) = 2.303*math.log10(x)\n",
+ "#therefore T = X/(k*math.log((1/FE)-1))\n",
+ "#but log(x)=2.303*math.log10(x)\n",
+ "#therefore T = X/(k*2.303*math.log10((1/FE)-1))\n",
+ "T = X/(k*2.303*math.log10((1/FE)-1));\n",
+ "\n",
+ "#Result\n",
+ "print(\"temperature in K is\",T);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "('temperature in K is', 1261.3505710887953)\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example number 2.5, Page number 71 *******"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ " \n",
+ "#import module\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable decleration\n",
+ "rho_s=10.5*10**3; #density in kg/m^3\n",
+ "NA=6.02*10**26; #avagadro number per kmol\n",
+ "MA=107.9; \n",
+ "\n",
+ "#Calculation\n",
+ "n=(rho_s*NA)/MA;\n",
+ "sigma=6.8*10**7;\n",
+ "e=1.6*10**-19; #charge in coulomb\n",
+ "mew=sigma/(n*e);\n",
+ "mew=math.ceil(mew*10**6)/10**6; #rounding off to 6 decimals\n",
+ "\n",
+ "#Result\n",
+ "print(\"density of electrons is\",n);\n",
+ "print(\"mobility of electrons in silver in m^2/Vs is\",mew);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "('density of electrons is', 5.85820203892493e+28)\n",
+ "('mobility of electrons in silver in m^2/Vs is', 0.007255)\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example number 2.6, Page number 71 ***"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ " \n",
+ "#import module\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable decleration\n",
+ "d=8.92*10**3; #density in kg/m^3\n",
+ "rho=1.73*10**-8; #resistivity in ohm-m\n",
+ "m=9.1*10**-31; #mass in kg\n",
+ "w=63.5; #atomic weight\n",
+ "e=1.6*10**-19; #charge in coulomb\n",
+ "A=6.02*10**26; #avagadro number\n",
+ "\n",
+ "#Calculation\n",
+ "n=(d*A)/w;\n",
+ "mew=1/(rho*n*e);\n",
+ "tow=m/(n*(e**2)*rho);\n",
+ "mew=math.ceil(mew*10**6)/10**6; #rounding off to 6 decimals\n",
+ "\n",
+ "#Result\n",
+ "print(\"mobility of electrons in Copper in m/Vs is\",mew);\n",
+ "print(\"average time of collision of electrons in copper in sec is\",tow);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "('mobility of electrons in Copper in m/Vs is', 0.004273)\n",
+ "('average time of collision of electrons in copper in sec is', 2.4297841992299697e-14)\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example number 2.7, Page number 72"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ " \n",
+ "#import module\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable decleration\n",
+ "rho=1.54*10**-8; #resistivity in ohm-m\n",
+ "n=5.8*10**28; #electron/m^3\n",
+ "m=9.108*10**-31; #mass in kg\n",
+ "e=1.602*10**-19; #charge in coulomb\n",
+ "\n",
+ "#Calculation\n",
+ "tow=m/(n*(e**2)*rho);\n",
+ "\n",
+ "#Result\n",
+ "print(\"relaxation time of conduction electrons in sec is\",tow);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "('relaxation time of conduction electrons in sec is', 3.973281032516849e-14)\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example number 2.8, Page number 73"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ " \n",
+ "#import module\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable decleration\n",
+ "FE=10/100; #fermi function is 10%\n",
+ "Ef=5.5; #fermi energy of silver in eV\n",
+ "k=1.38*10**-23;\n",
+ "\n",
+ "#Calculation\n",
+ "E=Ef+(Ef/100);\n",
+ "#FE=1/(1+math.exp((E-Ef)/(k*T)))\n",
+ "#therefore 1/FE = 1+math.exp((E-Ef)/(k*T))\n",
+ "#therefore (1/FE)-1 = math.exp((E-Ef)/(k*T))\n",
+ "#therefore log((1/FE)-1) = (E-Ef)/(k*T)\n",
+ "#therefore T = (E-Ef)/(k*math.log((1/FE)-1))\n",
+ "#let X=E-Ef; \n",
+ "X=E-Ef; #energy in eV\n",
+ "X=X*1.6*10**-19; #energy in J\n",
+ "T = (X/(k*math.log((1/FE)-1)));\n",
+ "T=math.ceil(T*10**2)/10**2; #rounding off to 2 decimals\n",
+ "\n",
+ "#Result\n",
+ "print(\"temperature in K is\",T);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "('temperature in K is', 290.23)\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example number 2.9, Page number 73"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ " \n",
+ "#import module\n",
+ "import math\n",
+ "\n",
+ "#Calculation\n",
+ "# given that E-Ef = kT\n",
+ "# fermi function FpE = 1/(1+exp((E-Ef)/kT)\n",
+ "# therefore FpE = 1/(1+exp(kT/kT));\n",
+ "# FpE = 1/(1+exp(1))\n",
+ "FpE=1/(1+math.exp(1));\n",
+ "FpE=math.ceil(FpE*10**2)/10**2; #rounding off to 2 decimals\n",
+ "\n",
+ "#Result\n",
+ "print(\"fermi function is\",FpE);\n",
+ "#the presence of electron at that energy level is not certain"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "('fermi function is', 0.27)\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example number 2.10, Page number 74 ****************************"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ " \n",
+ "#import module\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable decleration\n",
+ "m=9.1*10**-31; #mass in kg\n",
+ "h=6.626*10**-34;\n",
+ "A=(8*m)**(3/2);\n",
+ "\n",
+ "#Calculation\n",
+ "B=math.pi/(2*h**3);\n",
+ "EfeV=3.10; #fermi energy in eV\n",
+ "Ef=EfeV*1.6*10**-19; #fermi energy in J\n",
+ "EFeV=EfeV+0.02; #energy after interval in eV\n",
+ "EF=EFeV*1.6*10**-19; #energy after interval in J\n",
+ "def f(E):\n",
+ " Q=A*B*math.sqrt(E)\n",
+ " \n",
+ "I=(Ef,EF,f)\n",
+ "\n",
+ "#Result\n",
+ "print(\"number of energy states per unit volume is\",I);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "('number of energy states per unit volume is', (4.960000000000001e-19, 4.992000000000001e-19, <function f at 0x7f1495202848>))\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example number 2.11, Page number 74"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ " \n",
+ "#import module\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable decleration\n",
+ "T=300; #temperature in K\n",
+ "n=8.5*10**28; #density per m^3\n",
+ "rho=1.69*10**-8; #resistivity in ohm/m^3\n",
+ "me=9.11*10**-31; #mass of electron in kg\n",
+ "e=1.6*10**-19; #charge in coulomb\n",
+ "KB=1.38*10**-23; #boltzmann constant in J/k\n",
+ "\n",
+ "#Calculation\n",
+ "lamda=math.sqrt(3*KB*me*T)/(n*(e**2)*rho);\n",
+ "\n",
+ "#Result\n",
+ "print(\"mean free path of electron in m is\",lamda);\n",
+ "\n",
+ "#answer given in the book is wrong"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "('mean free path of electron in m is', 2.892506814374228e-09)\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example number 2.12, Page number 75"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ " \n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable decleration\n",
+ "rho=1.43*10**-8; #resistivity in ohm-m\n",
+ "n=6.5*10**28; #electron/m^3\n",
+ "m=9.11*10**-34; #mass in kg\n",
+ "e=1.6*10**-19; #charge in coulomb\n",
+ "\n",
+ "#Calculation\n",
+ "tow=m/(n*(e**2)*rho);\n",
+ "\n",
+ "#Result\n",
+ "print(\"relaxation time of conduction electrons in sec is\",tow);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "('relaxation time of conduction electrons in sec is', 3.8285032275416887e-17)\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example number 2.13, Page number 75 ******"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ " \n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable decleration\n",
+ "d=8.92*10**3; #density in kg/m^3\n",
+ "rho=1.73*10**-8; #resistivity in ohm-m\n",
+ "m=9.1*10**-31; #mass in kg\n",
+ "M=63.5; #atomic weight\n",
+ "e=1.6*10**-19; #charge in coulomb\n",
+ "A=6.02*10**26; #avagadro number\n",
+ "\n",
+ "#Calculation\n",
+ "n=(d*A)/M;\n",
+ "mew=1/(rho*n*e);\n",
+ "tow=m/(n*(e**2)*rho);\n",
+ "mew=math.ceil(mew*10**6)/10**6; #rounding off to 6 decimals\n",
+ "\n",
+ "#Result\n",
+ "print(\"mobility of electrons in Copper in m/Vs is\",mew);\n",
+ "print(\"average time of collision of electrons in copper in sec is\",tow);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "('mobility of electrons in Copper in m/Vs is', 0.004273)\n",
+ "('average time of collision of electrons in copper in sec is', 2.4297841992299697e-14)\n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example number 2.14, Page number 76"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ " \n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable decleration\n",
+ "MH=1.008*2*1.67*10**-27; #mass in kg\n",
+ "T=30; #temperature in C\n",
+ "\n",
+ "#Calculation\n",
+ "T=T+273; #temperature in K\n",
+ "KB=1.38*10**-23; #boltzmann constant in J/k\n",
+ "KE=(3/2)*KB*T; #kinetic energy in J\n",
+ "KEeV=KE*6.24*10**18; #kinetic energy in eV\n",
+ "cbar=math.sqrt((3*KB*T)/MH);\n",
+ "\n",
+ "#Result\n",
+ "print(\"average kinetic energy in J is\",KE);\n",
+ "print(\"average kinetic energy in eV is\",KEeV);\n",
+ "print(\"velocity of molecules in m/s is\",cbar);\n",
+ "\n",
+ "#answers for average kinetic energy in eV and velocity of electrons given in the book are wrong"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "('average kinetic energy in J is', 6.2720999999999986e-21)\n",
+ "('average kinetic energy in eV is', 0.039137903999999994)\n",
+ "('velocity of molecules in m/s is', 1930.269663853336)\n"
+ ]
+ }
+ ],
+ "prompt_number": 33
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example number 2.15, Page number 77 ****"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ " \n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable decleration\n",
+ "Ee=10; #electron kinetic energy in eV\n",
+ "Ep=10; #proton kinetic energy in eV\n",
+ "me=9.1*10**-31; #mass of electron in kg\n",
+ "mp=1.67*10**-27; #mass of proton in kg\n",
+ "\n",
+ "#Calculation\n",
+ "EeeV=Ee*1.6*10**-19; #electron kinetic energy in J\n",
+ "EpeV=Ep*1.6*10**-19; #proton kinetic energy in J\n",
+ "cebar=math.sqrt((2*EeeV)/me);\n",
+ "cpbar=math.sqrt((2*EpeV)/mp);\n",
+ "\n",
+ "#Result\n",
+ "print(\"velocity of electron in m/s is\",cebar);\n",
+ "print(\"velocity of proton in m/s is\",cpbar);\n",
+ "\n",
+ "#answers given in the book are wrong"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "('velocity of electron in m/s is', 1875228.9237539817)\n",
+ "('velocity of proton in m/s is', 43774.05241316662)\n"
+ ]
+ }
+ ],
+ "prompt_number": 35
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example number 2.16, Page number 77"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ " \n",
+ "#import module\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable decleration\n",
+ "A=10; #area of cross section in mm^2\n",
+ "A=A*10**-6; #area of cross section in m^2\n",
+ "i=100; #current in amp\n",
+ "n=8.5*10**28; #number of electrons per mm^3\n",
+ "e=1.6*10**-19; #electron charge in coulumb\n",
+ "\n",
+ "#Calculation\n",
+ "vd=1/(n*A*e);\n",
+ "\n",
+ "#Result\n",
+ "print(\"drift velocity in m/s is\",vd);\n",
+ "\n",
+ "#answer given in the book is wrong"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "('drift velocity in m/s is', 7.3529411764705884e-06)\n"
+ ]
+ }
+ ],
+ "prompt_number": 36
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example number 2.17, Page number 78"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ " \n",
+ "#import module\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable decleration\n",
+ "tow=3*10**-14; #relaxation time in sec\n",
+ "n=8*10**28; #density of electrons per m^3\n",
+ "KB=1.38*10**-23; #boltzmann constant in J/k\n",
+ "T=0; #temperature in C\n",
+ "\n",
+ "#Calculation\n",
+ "T=T+273; #temperature in K\n",
+ "m=9.1*10**-31; #mass of electron in kg\n",
+ "sigma_T=((3*n*tow*(KB**2)*T)/(2*m));\n",
+ "sigma_T=math.ceil(sigma_T*10**2)/10**2; #rounding off to 2 decimals\n",
+ "\n",
+ "#Result\n",
+ "print(\"thermal conductivity of copper in ohm-1 is\",sigma_T);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "('thermal conductivity of copper in ohm-1 is', 205.68)\n"
+ ]
+ }
+ ],
+ "prompt_number": 38
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Engineering_Physics_Vijaya/chapter2_2.ipynb b/Engineering_Physics_Vijaya/chapter2_2.ipynb
index a118db3c..2ff5590c 100755
--- a/Engineering_Physics_Vijaya/chapter2_2.ipynb
+++ b/Engineering_Physics_Vijaya/chapter2_2.ipynb
@@ -456,8 +456,10 @@
"Ef=EfeV*1.6*10**-19; #fermi energy in J\n",
"EFeV=EfeV+0.02; #energy after interval in eV\n",
"EF=EFeV*1.6*10**-19; #energy after interval in J\n",
- "function Q=f(E),Q=A*B*math.sqrt(E),endfunction\n",
- "I=intg(Ef,EF,f)\n",
+ "def f(E):\n",
+ " Q=A*B*math.sqrt(E)\n",
+ " \n",
+ "I=(Ef,EF,f)\n",
"\n",
"#Result\n",
"print(\"number of energy states per unit volume is\",I);"
@@ -466,15 +468,14 @@
"metadata": {},
"outputs": [
{
- "ename": "SyntaxError",
- "evalue": "invalid syntax (<ipython-input-25-15d658985351>, line 18)",
- "output_type": "pyerr",
- "traceback": [
- "\u001b[1;36m File \u001b[1;32m\"<ipython-input-25-15d658985351>\"\u001b[1;36m, line \u001b[1;32m18\u001b[0m\n\u001b[1;33m function Q=f(E),Q=A*B*math.sqrt(E),endfunction\u001b[0m\n\u001b[1;37m ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m invalid syntax\n"
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "('number of energy states per unit volume is', (4.960000000000001e-19, 4.992000000000001e-19, <function f at 0x7f1495202848>))\n"
]
}
],
- "prompt_number": 25
+ "prompt_number": 22
},
{
"cell_type": "heading",
diff --git a/How_to_think_like_a_computer_scientist_by_Allen_B_Downey/ch15.ipynb b/How_to_think_like_a_computer_scientist_by_Allen_B_Downey/ch15.ipynb
index cc4b221f..8919462b 100755
--- a/How_to_think_like_a_computer_scientist_by_Allen_B_Downey/ch15.ipynb
+++ b/How_to_think_like_a_computer_scientist_by_Allen_B_Downey/ch15.ipynb
@@ -1,6 +1,6 @@
{
"metadata": {
- "name": "ch15"
+ "name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
@@ -11,18 +11,40 @@
"cell_type": "heading",
"level": 1,
"metadata": {},
- "source": "Chapter 15 : File Input/Output and apmatrixes"
+ "source": [
+ "Chapter 15 : File Input/Output and apmatrixes"
+ ]
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
- "source": "example 15.1 page no : 162\n"
+ "source": [
+ "example 15.1 page no : 162\n"
+ ]
},
{
"cell_type": "code",
"collapsed": false,
- "input": "'''\nexample 15.1 page no : 162\n'''\ntry:\n fileName = \"a.txt\"\n f = open(fileName,\"r\")\nexcept:\n print \"Unable to open the file named \" , fileName;\n import sys\n sys.exit(0)\n\n# reading file line by line\n \nfor i in f.readlines():\n print i\n\nf.close() ",
+ "input": [
+ "'''\n",
+ "example 15.1 page no : 162\n",
+ "'''\n",
+ "try:\n",
+ " fileName = \"a.txt\"\n",
+ " f = open(fileName,\"r\")\n",
+ "except:\n",
+ " print \"Unable to open the file named \" , fileName;\n",
+ " import sys\n",
+ " sys.exit(0)\n",
+ "\n",
+ "# reading file line by line\n",
+ " \n",
+ "for i in f.readlines():\n",
+ " print i\n",
+ "\n",
+ "f.close() "
+ ],
"language": "python",
"metadata": {},
"outputs": [
@@ -32,18 +54,22 @@
"output_type": "pyerr",
"traceback": [
"An exception has occurred, use %tb to see the full traceback.\n",
- "\u001b[1;31mSystemExit\u001b[0m\u001b[1;31m:\u001b[0m 0\n"
+ "\u001b[0;31mSystemExit\u001b[0m\u001b[0;31m:\u001b[0m 0\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
- "text": "Unable to open the file named a.txt\n"
+ "text": [
+ "Unable to open the file named a.txt\n"
+ ]
},
{
"output_type": "stream",
"stream": "stderr",
- "text": "To exit: use 'exit', 'quit', or Ctrl-D.\n"
+ "text": [
+ "To exit: use 'exit', 'quit', or Ctrl-D.\n"
+ ]
}
],
"prompt_number": 1
@@ -52,12 +78,37 @@
"cell_type": "heading",
"level": 3,
"metadata": {},
- "source": "example 15.2 page no : 163\n"
+ "source": [
+ "example 15.2 page no : 163\n"
+ ]
},
{
"cell_type": "code",
"collapsed": false,
- "input": "'''\nexample 15.2 page no : 163\n'''\n\ntry:\n fileName = \"a.txt\"\n outputFile = \"b.txt\"\n f = open(fileName,\"r\")\n w = open(outputFile,\"w\")\nexcept:\n print \"Unable to open the file named \" , fileName;\n import sys\n sys.exit(0)\n\n# reading file line by line\n \nfor i in f.readlines():\n w.write(i)\n print i\n \nf.close()\nw.close() ",
+ "input": [
+ "'''\n",
+ "example 15.2 page no : 163\n",
+ "'''\n",
+ "\n",
+ "try:\n",
+ " fileName = \"a.txt\"\n",
+ " outputFile = \"b.txt\"\n",
+ " f = open(fileName,\"r\")\n",
+ " w = open(outputFile,\"w\")\n",
+ "except:\n",
+ " print \"Unable to open the file named \" , fileName;\n",
+ " import sys\n",
+ " sys.exit(0)\n",
+ "\n",
+ "# reading file line by line\n",
+ " \n",
+ "for i in f.readlines():\n",
+ " w.write(i)\n",
+ " print i\n",
+ " \n",
+ "f.close()\n",
+ "w.close() "
+ ],
"language": "python",
"metadata": {},
"outputs": [
@@ -73,12 +124,16 @@
{
"output_type": "stream",
"stream": "stdout",
- "text": "Unable to open the file named a.txt\n"
+ "text": [
+ "Unable to open the file named a.txt\n"
+ ]
},
{
"output_type": "stream",
"stream": "stderr",
- "text": "To exit: use 'exit', 'quit', or Ctrl-D.\n"
+ "text": [
+ "To exit: use 'exit', 'quit', or Ctrl-D.\n"
+ ]
}
],
"prompt_number": 2
@@ -87,19 +142,67 @@
"cell_type": "heading",
"level": 3,
"metadata": {},
- "source": "example 15.3 page no : 167\n"
+ "source": [
+ "example 15.3 page no : 167\n"
+ ]
},
{
"cell_type": "code",
"collapsed": false,
- "input": "'''\nexample 15.3 page no : 167\n'''\n\nclass Set:\n def __init__(self,n):\n self.elements = []\n self.numElements = 0\n\n def getNumElements(self):\n return self.numElements\n\n def getElement(self,i):\n if (i < self.numElements):\n return slef.elements[i];\n else:\n print \"Set index out of range.\" \n import sys\n sys.exit(0)\n\n def find(self,s):\n for i in range(self.numElements):\n if (self.elements[i] == s): \n return i;\n return -1;\n\n def add(self,s):\n # if the element is already in the set, return its index\n index = self.find(s);\n if (index != -1):\n return index;\n # if the apvector is full, double its size\n # add the new elements and return its index\n self.elements.append(s)\n self.numElements += 1\n return self.numElements - 1;\n\ncities= Set (2);\ncity1 = 'ahmedabad'\ncity2 = 'rajkot'\nindex1 = cities.add(city1);\nindex2 = cities.add(city2)\nprint index1, index2",
+ "input": [
+ "'''\n",
+ "example 15.3 page no : 167\n",
+ "'''\n",
+ "\n",
+ "class Set:\n",
+ " def __init__(self,n):\n",
+ " self.elements = []\n",
+ " self.numElements = 0\n",
+ "\n",
+ " def getNumElements(self):\n",
+ " return self.numElements\n",
+ "\n",
+ " def getElement(self,i):\n",
+ " if (i < self.numElements):\n",
+ " return slef.elements[i];\n",
+ " else:\n",
+ " print \"Set index out of range.\" \n",
+ " import sys\n",
+ " sys.exit(0)\n",
+ "\n",
+ " def find(self,s):\n",
+ " for i in range(self.numElements):\n",
+ " if (self.elements[i] == s): \n",
+ " return i;\n",
+ " return -1;\n",
+ "\n",
+ " def add(self,s):\n",
+ " # if the element is already in the set, return its index\n",
+ " index = self.find(s);\n",
+ " if (index != -1):\n",
+ " return index;\n",
+ " # if the apvector is full, double its size\n",
+ " # add the new elements and return its index\n",
+ " self.elements.append(s)\n",
+ " self.numElements += 1\n",
+ " return self.numElements - 1;\n",
+ "\n",
+ "cities= Set (2);\n",
+ "city1 = 'ahmedabad'\n",
+ "city2 = 'rajkot'\n",
+ "index1 = cities.add(city1);\n",
+ "index2 = cities.add(city2)\n",
+ "print index1, index2"
+ ],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
- "text": "0 1\n"
+ "text": [
+ "0 1\n"
+ ]
}
],
"prompt_number": 3
@@ -107,7 +210,7 @@
{
"cell_type": "code",
"collapsed": false,
- "input": "",
+ "input": [],
"language": "python",
"metadata": {},
"outputs": []
@@ -115,7 +218,7 @@
{
"cell_type": "code",
"collapsed": false,
- "input": "",
+ "input": [],
"language": "python",
"metadata": {},
"outputs": []
diff --git a/Mastering_C/.ipynb_checkpoints/chapter1-checkpoint.ipynb b/Mastering_C/.ipynb_checkpoints/chapter1-checkpoint.ipynb
new file mode 100755
index 00000000..271dc0b9
--- /dev/null
+++ b/Mastering_C/.ipynb_checkpoints/chapter1-checkpoint.ipynb
@@ -0,0 +1,169 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:f3ff9d889b7b7951c347d942d053d9fde4d57e52c21d53b779e2930b738a9f69"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 1: Introduction"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1, page no. 18"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Hello World\"\n",
+ "print \"Bye.\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Hello World\n",
+ "Bye\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2, page no. 24"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Hello World\"\n",
+ "#This program will give error"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Hello World\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3, page no. 24"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Hello World\"\n",
+ "print \"Bye.\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Hello World\n",
+ "Bye.\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4, page no. 24"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"Hello World\";print \"Bye.\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Hello World\n",
+ "Bye.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5, page no. 25"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print \"\\\n",
+ " Hello World\"\n",
+ "\n",
+ "print \"\\\n",
+ " Bye.\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Hello World\n",
+ " Bye.\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Mastering_C/chapter1.ipynb b/Mastering_C/chapter1.ipynb
index b1a0ed0e..271dc0b9 100755
--- a/Mastering_C/chapter1.ipynb
+++ b/Mastering_C/chapter1.ipynb
@@ -57,22 +57,21 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "Print \"Hello World\"\n",
+ "print \"Hello World\"\n",
"#This program will give error"
],
"language": "python",
"metadata": {},
"outputs": [
{
- "ename": "SyntaxError",
- "evalue": "invalid syntax (<ipython-input-2-9028d474ee90>, line 1)",
- "output_type": "pyerr",
- "traceback": [
- "\u001b[1;36m File \u001b[1;32m\"<ipython-input-2-9028d474ee90>\"\u001b[1;36m, line \u001b[1;32m1\u001b[0m\n\u001b[1;33m Print \"Hello World\"\u001b[0m\n\u001b[1;37m ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m invalid syntax\n"
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Hello World\n"
]
}
],
- "prompt_number": 2
+ "prompt_number": 1
},
{
"cell_type": "heading",
diff --git a/Power_Electronics_by_P_S_Bimbhra/.ipynb_checkpoints/Chapter13_4-checkpoint.ipynb b/Power_Electronics_by_P_S_Bimbhra/.ipynb_checkpoints/Chapter13_4-checkpoint.ipynb
new file mode 100755
index 00000000..a5664090
--- /dev/null
+++ b/Power_Electronics_by_P_S_Bimbhra/.ipynb_checkpoints/Chapter13_4-checkpoint.ipynb
@@ -0,0 +1,340 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 13 : Power Factor Improvement"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.1, Page No 754"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "V_s=250.0\n",
+ "R_l=5.0\n",
+ "I_l=20.0\n",
+ "V_l1=math.sqrt(V_s**2-(R_l*I_l)**2)\n",
+ "reg1=(V_s-V_l1)/V_s*100 \n",
+ "pf1=1.0\n",
+ "\n",
+ "#Calculations\n",
+ "P_l1=V_l1*I_l*pf1 #load power\n",
+ "P_r1=V_s*I_l*pf1 #max powwible system rating\n",
+ "utf1=P_l1*100/P_r1 \n",
+ "pf2=0.5\n",
+ " #(.5*V_l)**2+(.866*V_l+R_l*I_l)**2=V_s**2\n",
+ " #after solving\n",
+ "V_l2=158.35 \n",
+ "reg2=(V_s-V_l2)/V_s*100 \n",
+ "P_l2=V_l2*I_l*pf2 #load power\n",
+ "P_r2=V_s*I_l #max powwible system rating\n",
+ "utf2=P_l2*100/P_r2 \n",
+ "\n",
+ "\n",
+ "#Results\n",
+ "print(\"for pf=1\")\n",
+ "print(\"load voltage=%.2f V\" %V_l1)\n",
+ "print(\"voltage regulation=%.2f\" %reg1)\n",
+ "print(\"system utilisation factor=%.3f\" %utf1)\n",
+ "print(\"energy consumed(in units)=%.1f\" %(P_l1/1000))\n",
+ "print(\"for pf=.5\")\n",
+ "print(\"load voltage=%.2f V\" %V_l2)\n",
+ "print(\"voltage regulation=%.2f\" %reg2)\n",
+ "print(\"system utilisation factor=%.3f\" %utf2)\n",
+ "print(\"energy consumed(in units)=%.2f\" %(P_l2/1000))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "for pf=1\n",
+ "load voltage=229.13 V\n",
+ "voltage regulation=8.35\n",
+ "system utilisation factor=91.652\n",
+ "energy consumed(in units)=4.6\n",
+ "for pf=.5\n",
+ "load voltage=158.35 V\n",
+ "voltage regulation=36.66\n",
+ "system utilisation factor=31.670\n",
+ "energy consumed(in units)=1.58\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.2, Page No 756"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "f=50.0\n",
+ "V_s=230.0\n",
+ "I_m1=2\n",
+ "pf1=.3\n",
+ "\n",
+ "#Calculations\n",
+ "I_c1=I_m1*math.sin(math.radians(math.degrees(math.acos(pf1))))\n",
+ "C1=I_c1/(2*math.pi*f*V_s) \n",
+ "I_m2=5\n",
+ "pf2=.5\n",
+ "I_c2=I_m2*math.sin(math.radians(math.degrees(math.acos(pf2))))\n",
+ "C2=I_c2/(2*math.pi*f*V_s) \n",
+ "I_m3=10\n",
+ "pf3=.7\n",
+ "I_c3=I_m3*math.sin(math.radians(math.degrees(math.acos(pf3))))\n",
+ "C3=I_c3/(2*math.pi*f*V_s) \n",
+ "\n",
+ "#Results\n",
+ "print(\"at no load\")\n",
+ "print(\"value of capacitance=%.3f uF\" %(C1*10**6))\n",
+ "print(\"at half full load\")\n",
+ "print(\"value of capacitance=%.3f uF\" %(C2*10**6))\n",
+ "print(\"at full load\")\n",
+ "print(\"value of capacitance=%.3f uF\" %(C3*10**6))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "at no load\n",
+ "value of capacitance=26.404 uF\n",
+ "at half full load\n",
+ "value of capacitance=59.927 uF\n",
+ "at full load\n",
+ "value of capacitance=98.834 uF\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.3 Page No 764"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "I_c=10.0\n",
+ "f=50.0\n",
+ "V_s=230.0\n",
+ "\n",
+ "#Calculations\n",
+ "C=I_c/(2*math.pi*f*V_s) \n",
+ "I_l=10\n",
+ "L=V_s/(2*math.pi*f*I_l) \n",
+ "\n",
+ "#Results\n",
+ "print(\"value of capacitance=%.3f uF\" %(C*10**6))\n",
+ "print(\"value of inductor=%.3f mH\" %(L*1000))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "value of capacitance=138.396 uF\n",
+ "value of inductor=73.211 mH\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.4, Page No 765"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "V_s=230.0\n",
+ "I_L=10.0\n",
+ "X_L=V_s/I_L\n",
+ "I_f1=6.0\n",
+ " #B=2*a-math.sin(2*a)\n",
+ "B=2*math.pi-I_f1*math.pi*X_L/V_s\n",
+ "a=0\n",
+ "i=1.0\n",
+ "for a in range(1,360):\n",
+ " b=2*a*math.pi/180-math.sin(math.radians(2*a)) \n",
+ " if math.fabs(B-b)<=0.001 : #by hit and trial\n",
+ " i=2\n",
+ " break\n",
+ "print(\"firing angle of TCR = %.1f deg\" %a)\n",
+ " #(a-.01)*180/math.pi)\n",
+ " \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "firing angle of TCR = 359.0 deg\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.5 Page No 766"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "L=.01\n",
+ "\n",
+ "\n",
+ "#Calculations\n",
+ "print(\"for firing angle=90deg\")\n",
+ "a=90*math.pi/180\n",
+ "L_eff=math.pi*L/(2*math.pi-2*a+math.sin(2*a)) \n",
+ "print(\"effective inductance=%.0f mH\" %(L_eff*1000))\n",
+ "print(\"for firing angle=120deg\")\n",
+ "a=120*math.pi/180\n",
+ "L_eff=math.pi*L/(2*math.pi-2*a+math.sin(2*a)) \n",
+ "print(\"effective inductance=%.3f mH\" %(L_eff*1000))\n",
+ "print(\"for firing angle=150deg\")\n",
+ "a=150*math.pi/180\n",
+ "L_eff=math.pi*L/(2*math.pi-2*a+math.sin(2*a)) \n",
+ "print(\"effective inductance=%.2f mH\" %(L_eff*1000))\n",
+ "print(\"for firing angle=170deg\")\n",
+ "a=170*math.pi/180\n",
+ "L_eff=math.pi*L/(2*math.pi-2*a+math.sin(2*a)) \n",
+ "print(\"effective inductance=%.3f H\" %L_eff)\n",
+ "print(\"for firing angle=175deg\")\n",
+ "a=175*math.pi/180\n",
+ "L_eff=math.pi*L/(2*math.pi-2*a+math.sin(2*a)) \n",
+ "\n",
+ "#Results\n",
+ "print(\"effective inductance=%.2f H\" %L_eff)\n",
+ "print(\"for firing angle=180deg\")\n",
+ "a=180*math.pi/180\n",
+ "L_eff=math.pi*L/(2*math.pi-2*a+math.sin(2*a)) \n",
+ "print(\"effective inductance=%.3f H\" %L_eff)\n",
+ " #random value at firing angle =180 is equivalent to infinity as in answer in book\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "for firing angle=90deg\n",
+ "effective inductance=10 mH\n",
+ "for firing angle=120deg\n",
+ "effective inductance=25.575 mH\n",
+ "for firing angle=150deg\n",
+ "effective inductance=173.40 mH\n",
+ "for firing angle=170deg\n",
+ "effective inductance=4.459 H\n",
+ "for firing angle=175deg\n",
+ "effective inductance=35.51 H\n",
+ "for firing angle=180deg\n",
+ "effective inductance=-128265253940037.750 H\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.6 Page No 766"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "Q=100.0*10**3\n",
+ "V_s=11.0*10**3\n",
+ "\n",
+ "#Calculations\n",
+ "f=50.0\n",
+ "L=V_s**2/(2*math.pi*f*Q) \n",
+ "\n",
+ "#Results\n",
+ "print(\"effective inductance=%.4f H\" %L)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "effective inductance=3.8515 H\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Power_Electronics_by_P_S_Bimbhra/Chapter13_4.ipynb b/Power_Electronics_by_P_S_Bimbhra/Chapter13_4.ipynb
index 62d2a926..a5664090 100755
--- a/Power_Electronics_by_P_S_Bimbhra/Chapter13_4.ipynb
+++ b/Power_Electronics_by_P_S_Bimbhra/Chapter13_4.ipynb
@@ -1,342 +1,340 @@
-{
- "metadata": {
- "name": ""
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 13 : Power Factor Improvement"
- ]
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 13.1, Page No 754"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "V_s=250.0\n",
- "R_l=5.0\n",
- "I_l=20.0\n",
- "V_l1=math.sqrt(V_s**2-(R_l*I_l)**2)\n",
- "reg2=(V_s-V_l1)/V_s*100 \n",
- "pf1=1.0\n",
- "\n",
- "#Calculations\n",
- "P_l1=V_l1*I_l*pf1 #load power\n",
- "P_r1=V_s*I_l*pf1 #max powwible system rating\n",
- "utf1=P_l1*100/P_r1 \n",
- "pf2=0.5\n",
- " #(.5*V_l)**2+(.866*V_l+R_l*I_l)**2=V_s**2\n",
- " #after solving\n",
- "V_l2=158.35 \n",
- "reg2=(V_s-V_l2)/V_s*100 \n",
- "P_l2=V_l2*I_l*pf2 #load power\n",
- "P_r2=V_s*I_l #max powwible system rating\n",
- "utf2=P_l2*100/P_r2 \n",
- "\n",
- "\n",
- "#Results\n",
- "print(\"for pf=1\")\n",
- "print(\"load voltage=%.2f V\" %V_l1)\n",
- "print(\"voltage regulation=%.2f\" %reg1)\n",
- "print(\"system utilisation factor=%.3f\" %utf1)\n",
- "print(\"energy consumed(in units)=%.1f\" %(P_l1/1000))\n",
- "print(\"for pf=.5\")\n",
- "print(\"load voltage=%.2f V\" %V_l2)\n",
- "print(\"voltage regulation=%.2f\" %reg2)\n",
- "print(\"system utilisation factor=%.3f\" %utf2)\n",
- "print(\"energy consumed(in units)=%.2f\" %(P_l2/1000))\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "ename": "NameError",
- "evalue": "name 'reg1' is not defined",
- "output_type": "pyerr",
- "traceback": [
- "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[1;31mNameError\u001b[0m Traceback (most recent call last)",
- "\u001b[1;32m<ipython-input-2-ffdbe43fd921>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 25\u001b[0m \u001b[1;32mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"for pf=1\"\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 26\u001b[0m \u001b[1;32mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"load voltage=%.2f V\"\u001b[0m \u001b[1;33m%\u001b[0m\u001b[0mV_l1\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 27\u001b[1;33m \u001b[1;32mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"voltage regulation=%.2f\"\u001b[0m \u001b[1;33m%\u001b[0m\u001b[0mreg1\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 28\u001b[0m \u001b[1;32mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"system utilisation factor=%.3f\"\u001b[0m \u001b[1;33m%\u001b[0m\u001b[0mutf1\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 29\u001b[0m \u001b[1;32mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"energy consumed(in units)=%.1f\"\u001b[0m \u001b[1;33m%\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mP_l1\u001b[0m\u001b[1;33m/\u001b[0m\u001b[1;36m1000\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
- "\u001b[1;31mNameError\u001b[0m: name 'reg1' is not defined"
- ]
- },
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "for pf=1\n",
- "load voltage=229.13 V\n"
- ]
- }
- ],
- "prompt_number": 2
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 13.2, Page No 756"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "f=50.0\n",
- "V_s=230.0\n",
- "I_m1=2\n",
- "pf1=.3\n",
- "\n",
- "#Calculations\n",
- "I_c1=I_m1*math.sin(math.radians(math.degrees(math.acos(pf1))))\n",
- "C1=I_c1/(2*math.pi*f*V_s) \n",
- "I_m2=5\n",
- "pf2=.5\n",
- "I_c2=I_m2*math.sin(math.radians(math.degrees(math.acos(pf2))))\n",
- "C2=I_c2/(2*math.pi*f*V_s) \n",
- "I_m3=10\n",
- "pf3=.7\n",
- "I_c3=I_m3*math.sin(math.radians(math.degrees(math.acos(pf3))))\n",
- "C3=I_c3/(2*math.pi*f*V_s) \n",
- "\n",
- "#Results\n",
- "print(\"at no load\")\n",
- "print(\"value of capacitance=%.3f uF\" %(C1*10**6))\n",
- "print(\"at half full load\")\n",
- "print(\"value of capacitance=%.3f uF\" %(C2*10**6))\n",
- "print(\"at full load\")\n",
- "print(\"value of capacitance=%.3f uF\" %(C3*10**6))"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "at no load\n",
- "value of capacitance=26.404 uF\n",
- "at half full load\n",
- "value of capacitance=59.927 uF\n",
- "at full load\n",
- "value of capacitance=98.834 uF\n"
- ]
- }
- ],
- "prompt_number": 3
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 13.3 Page No 764"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "I_c=10.0\n",
- "f=50.0\n",
- "V_s=230.0\n",
- "\n",
- "#Calculations\n",
- "C=I_c/(2*math.pi*f*V_s) \n",
- "I_l=10\n",
- "L=V_s/(2*math.pi*f*I_l) \n",
- "\n",
- "#Results\n",
- "print(\"value of capacitance=%.3f uF\" %(C*10**6))\n",
- "print(\"value of inductor=%.3f mH\" %(L*1000))\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "value of capacitance=138.396 uF\n",
- "value of inductor=73.211 mH\n"
- ]
- }
- ],
- "prompt_number": 4
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 13.4, Page No 765"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "V_s=230.0\n",
- "I_L=10.0\n",
- "X_L=V_s/I_L\n",
- "I_f1=6.0\n",
- " #B=2*a-math.sin(2*a)\n",
- "B=2*math.pi-I_f1*math.pi*X_L/V_s\n",
- "a=0\n",
- "i=1.0\n",
- "for a in range(1,360):\n",
- " b=2*a*math.pi/180-math.sin(math.radians(2*a)) \n",
- " if math.fabs(B-b)<=0.001 : #by hit and trial\n",
- " i=2\n",
- " break\n",
- "print(\"firing angle of TCR = %.1f deg\" %a)\n",
- " #(a-.01)*180/math.pi)\n",
- " \n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "firing angle of TCR = 359.0 deg\n"
- ]
- }
- ],
- "prompt_number": 5
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 13.5 Page No 766"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "L=.01\n",
- "\n",
- "\n",
- "#Calculations\n",
- "print(\"for firing angle=90deg\")\n",
- "a=90*math.pi/180\n",
- "L_eff=math.pi*L/(2*math.pi-2*a+math.sin(2*a)) \n",
- "print(\"effective inductance=%.0f mH\" %(L_eff*1000))\n",
- "print(\"for firing angle=120deg\")\n",
- "a=120*math.pi/180\n",
- "L_eff=math.pi*L/(2*math.pi-2*a+math.sin(2*a)) \n",
- "print(\"effective inductance=%.3f mH\" %(L_eff*1000))\n",
- "print(\"for firing angle=150deg\")\n",
- "a=150*math.pi/180\n",
- "L_eff=math.pi*L/(2*math.pi-2*a+math.sin(2*a)) \n",
- "print(\"effective inductance=%.2f mH\" %(L_eff*1000))\n",
- "print(\"for firing angle=170deg\")\n",
- "a=170*math.pi/180\n",
- "L_eff=math.pi*L/(2*math.pi-2*a+math.sin(2*a)) \n",
- "print(\"effective inductance=%.3f H\" %L_eff)\n",
- "print(\"for firing angle=175deg\")\n",
- "a=175*math.pi/180\n",
- "L_eff=math.pi*L/(2*math.pi-2*a+math.sin(2*a)) \n",
- "\n",
- "#Results\n",
- "print(\"effective inductance=%.2f H\" %L_eff)\n",
- "print(\"for firing angle=180deg\")\n",
- "a=180*math.pi/180\n",
- "L_eff=math.pi*L/(2*math.pi-2*a+math.sin(2*a)) \n",
- "print(\"effective inductance=%.3f H\" %L_eff)\n",
- " #random value at firing angle =180 is equivalent to infinity as in answer in book\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "for firing angle=90deg\n",
- "effective inductance=10 mH\n",
- "for firing angle=120deg\n",
- "effective inductance=25.575 mH\n",
- "for firing angle=150deg\n",
- "effective inductance=173.40 mH\n",
- "for firing angle=170deg\n",
- "effective inductance=4.459 H\n",
- "for firing angle=175deg\n",
- "effective inductance=35.51 H\n",
- "for firing angle=180deg\n",
- "effective inductance=-128265253940037.750 H\n"
- ]
- }
- ],
- "prompt_number": 6
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 13.6 Page No 766"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "#initialisation of variables\n",
- "Q=100.0*10**3\n",
- "V_s=11.0*10**3\n",
- "\n",
- "#Calculations\n",
- "f=50.0\n",
- "L=V_s**2/(2*math.pi*f*Q) \n",
- "\n",
- "#Results\n",
- "print(\"effective inductance=%.4f H\" %L)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "effective inductance=3.8515 H\n"
- ]
- }
- ],
- "prompt_number": 7
- }
- ],
- "metadata": {}
- }
- ]
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 13 : Power Factor Improvement"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.1, Page No 754"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "V_s=250.0\n",
+ "R_l=5.0\n",
+ "I_l=20.0\n",
+ "V_l1=math.sqrt(V_s**2-(R_l*I_l)**2)\n",
+ "reg1=(V_s-V_l1)/V_s*100 \n",
+ "pf1=1.0\n",
+ "\n",
+ "#Calculations\n",
+ "P_l1=V_l1*I_l*pf1 #load power\n",
+ "P_r1=V_s*I_l*pf1 #max powwible system rating\n",
+ "utf1=P_l1*100/P_r1 \n",
+ "pf2=0.5\n",
+ " #(.5*V_l)**2+(.866*V_l+R_l*I_l)**2=V_s**2\n",
+ " #after solving\n",
+ "V_l2=158.35 \n",
+ "reg2=(V_s-V_l2)/V_s*100 \n",
+ "P_l2=V_l2*I_l*pf2 #load power\n",
+ "P_r2=V_s*I_l #max powwible system rating\n",
+ "utf2=P_l2*100/P_r2 \n",
+ "\n",
+ "\n",
+ "#Results\n",
+ "print(\"for pf=1\")\n",
+ "print(\"load voltage=%.2f V\" %V_l1)\n",
+ "print(\"voltage regulation=%.2f\" %reg1)\n",
+ "print(\"system utilisation factor=%.3f\" %utf1)\n",
+ "print(\"energy consumed(in units)=%.1f\" %(P_l1/1000))\n",
+ "print(\"for pf=.5\")\n",
+ "print(\"load voltage=%.2f V\" %V_l2)\n",
+ "print(\"voltage regulation=%.2f\" %reg2)\n",
+ "print(\"system utilisation factor=%.3f\" %utf2)\n",
+ "print(\"energy consumed(in units)=%.2f\" %(P_l2/1000))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "for pf=1\n",
+ "load voltage=229.13 V\n",
+ "voltage regulation=8.35\n",
+ "system utilisation factor=91.652\n",
+ "energy consumed(in units)=4.6\n",
+ "for pf=.5\n",
+ "load voltage=158.35 V\n",
+ "voltage regulation=36.66\n",
+ "system utilisation factor=31.670\n",
+ "energy consumed(in units)=1.58\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.2, Page No 756"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "f=50.0\n",
+ "V_s=230.0\n",
+ "I_m1=2\n",
+ "pf1=.3\n",
+ "\n",
+ "#Calculations\n",
+ "I_c1=I_m1*math.sin(math.radians(math.degrees(math.acos(pf1))))\n",
+ "C1=I_c1/(2*math.pi*f*V_s) \n",
+ "I_m2=5\n",
+ "pf2=.5\n",
+ "I_c2=I_m2*math.sin(math.radians(math.degrees(math.acos(pf2))))\n",
+ "C2=I_c2/(2*math.pi*f*V_s) \n",
+ "I_m3=10\n",
+ "pf3=.7\n",
+ "I_c3=I_m3*math.sin(math.radians(math.degrees(math.acos(pf3))))\n",
+ "C3=I_c3/(2*math.pi*f*V_s) \n",
+ "\n",
+ "#Results\n",
+ "print(\"at no load\")\n",
+ "print(\"value of capacitance=%.3f uF\" %(C1*10**6))\n",
+ "print(\"at half full load\")\n",
+ "print(\"value of capacitance=%.3f uF\" %(C2*10**6))\n",
+ "print(\"at full load\")\n",
+ "print(\"value of capacitance=%.3f uF\" %(C3*10**6))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "at no load\n",
+ "value of capacitance=26.404 uF\n",
+ "at half full load\n",
+ "value of capacitance=59.927 uF\n",
+ "at full load\n",
+ "value of capacitance=98.834 uF\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.3 Page No 764"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "I_c=10.0\n",
+ "f=50.0\n",
+ "V_s=230.0\n",
+ "\n",
+ "#Calculations\n",
+ "C=I_c/(2*math.pi*f*V_s) \n",
+ "I_l=10\n",
+ "L=V_s/(2*math.pi*f*I_l) \n",
+ "\n",
+ "#Results\n",
+ "print(\"value of capacitance=%.3f uF\" %(C*10**6))\n",
+ "print(\"value of inductor=%.3f mH\" %(L*1000))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "value of capacitance=138.396 uF\n",
+ "value of inductor=73.211 mH\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.4, Page No 765"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "V_s=230.0\n",
+ "I_L=10.0\n",
+ "X_L=V_s/I_L\n",
+ "I_f1=6.0\n",
+ " #B=2*a-math.sin(2*a)\n",
+ "B=2*math.pi-I_f1*math.pi*X_L/V_s\n",
+ "a=0\n",
+ "i=1.0\n",
+ "for a in range(1,360):\n",
+ " b=2*a*math.pi/180-math.sin(math.radians(2*a)) \n",
+ " if math.fabs(B-b)<=0.001 : #by hit and trial\n",
+ " i=2\n",
+ " break\n",
+ "print(\"firing angle of TCR = %.1f deg\" %a)\n",
+ " #(a-.01)*180/math.pi)\n",
+ " \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "firing angle of TCR = 359.0 deg\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.5 Page No 766"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "L=.01\n",
+ "\n",
+ "\n",
+ "#Calculations\n",
+ "print(\"for firing angle=90deg\")\n",
+ "a=90*math.pi/180\n",
+ "L_eff=math.pi*L/(2*math.pi-2*a+math.sin(2*a)) \n",
+ "print(\"effective inductance=%.0f mH\" %(L_eff*1000))\n",
+ "print(\"for firing angle=120deg\")\n",
+ "a=120*math.pi/180\n",
+ "L_eff=math.pi*L/(2*math.pi-2*a+math.sin(2*a)) \n",
+ "print(\"effective inductance=%.3f mH\" %(L_eff*1000))\n",
+ "print(\"for firing angle=150deg\")\n",
+ "a=150*math.pi/180\n",
+ "L_eff=math.pi*L/(2*math.pi-2*a+math.sin(2*a)) \n",
+ "print(\"effective inductance=%.2f mH\" %(L_eff*1000))\n",
+ "print(\"for firing angle=170deg\")\n",
+ "a=170*math.pi/180\n",
+ "L_eff=math.pi*L/(2*math.pi-2*a+math.sin(2*a)) \n",
+ "print(\"effective inductance=%.3f H\" %L_eff)\n",
+ "print(\"for firing angle=175deg\")\n",
+ "a=175*math.pi/180\n",
+ "L_eff=math.pi*L/(2*math.pi-2*a+math.sin(2*a)) \n",
+ "\n",
+ "#Results\n",
+ "print(\"effective inductance=%.2f H\" %L_eff)\n",
+ "print(\"for firing angle=180deg\")\n",
+ "a=180*math.pi/180\n",
+ "L_eff=math.pi*L/(2*math.pi-2*a+math.sin(2*a)) \n",
+ "print(\"effective inductance=%.3f H\" %L_eff)\n",
+ " #random value at firing angle =180 is equivalent to infinity as in answer in book\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "for firing angle=90deg\n",
+ "effective inductance=10 mH\n",
+ "for firing angle=120deg\n",
+ "effective inductance=25.575 mH\n",
+ "for firing angle=150deg\n",
+ "effective inductance=173.40 mH\n",
+ "for firing angle=170deg\n",
+ "effective inductance=4.459 H\n",
+ "for firing angle=175deg\n",
+ "effective inductance=35.51 H\n",
+ "for firing angle=180deg\n",
+ "effective inductance=-128265253940037.750 H\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.6 Page No 766"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#initialisation of variables\n",
+ "Q=100.0*10**3\n",
+ "V_s=11.0*10**3\n",
+ "\n",
+ "#Calculations\n",
+ "f=50.0\n",
+ "L=V_s**2/(2*math.pi*f*Q) \n",
+ "\n",
+ "#Results\n",
+ "print(\"effective inductance=%.4f H\" %L)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "effective inductance=3.8515 H\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ }
+ ],
+ "metadata": {}
+ }
+ ]
} \ No newline at end of file
diff --git a/Practical_C_Programming/.ipynb_checkpoints/Chapter_14_1-checkpoint.ipynb b/Practical_C_Programming/.ipynb_checkpoints/Chapter_14_1-checkpoint.ipynb
new file mode 100755
index 00000000..c25523b7
--- /dev/null
+++ b/Practical_C_Programming/.ipynb_checkpoints/Chapter_14_1-checkpoint.ipynb
@@ -0,0 +1,175 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:aaf3603d1f605477459dd54990dcc4c8c154c9c808805468e92c30fde9487343"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Chapter 14: File input/output"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 14.1, Page number: 253"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "# Variable declaration\n",
+ "import os\n",
+ "count = 0\n",
+ "in_file = open ('input.txt', 'r')\n",
+ " \n",
+ "# Calculation and result\n",
+ "if not os.path.exists ('input.txt') :\n",
+ " print ('Cannot open input.txt\\n')\n",
+ "\n",
+ "while (1) :\n",
+ " ch = in_file.read(1)\n",
+ " if not ch :\n",
+ " break\n",
+ " count += 1\n",
+ "\n",
+ "print ('Number of characters in input.txt is %d\\n' % count)\n",
+ "\n",
+ "in_file.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number of characters in input.txt is 0\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 14.3, Page number: 257"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "\n",
+ "# Variable declaration\n",
+ "import sys\n",
+ "import os\n",
+ "in_file = open ('input.txt', 'r')\n",
+ " \n",
+ "# Calculation and result\n",
+ "if not os.path.exists ('input.txt') :\n",
+ " print ('Could not open file\\n')\n",
+ " sys.exit(1)\n",
+ "print ('File found\\n')\n",
+ "\n",
+ "in_file.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "File found\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 14.4, Page number: 260"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "# Variable declaration\n",
+ "import sys\n",
+ "import os\n",
+ "out_file = open ('test.out', 'w')\n",
+ " \n",
+ "# Calculation and result\n",
+ "if not os.path.exists ('test.out') :\n",
+ " print ('Cannot open output file\\n')\n",
+ " sys.exit(1)\n",
+ "\n",
+ "for cur_char in range (0, 128) :\n",
+ " out_file.write(str (cur_char))\n",
+ " out_file.write('\\n')\n",
+ "\n",
+ "out_file.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 14.5, Page number: 267"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "\n",
+ "# Variable declaration\n",
+ "txt_file = open ('input.txt')\n",
+ "\n",
+ "source_content = txt_file.read()\n",
+ "\n",
+ "target = open ('output.txt', 'w')\n",
+ "\n",
+ "# Calculation and result\n",
+ "target.write(source_content)\n",
+ "print ('Content copied')\n",
+ "\n",
+ "target.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Practical_C_Programming/.ipynb_checkpoints/Chapter_15_1-checkpoint.ipynb b/Practical_C_Programming/.ipynb_checkpoints/Chapter_15_1-checkpoint.ipynb
new file mode 100755
index 00000000..05286d0f
--- /dev/null
+++ b/Practical_C_Programming/.ipynb_checkpoints/Chapter_15_1-checkpoint.ipynb
@@ -0,0 +1,351 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:23b3891085deb8af52412d44380b6187a4110d7e026531ec90b3b2ae79d61d0f"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 15: Debugging and optimization"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 15.1, Page number: 275"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "# Function declaration\n",
+ "def lookup (name) :\n",
+ " lists = ['John', 'Jim', 'Jane', 'Clyde']\n",
+ " result = 0\n",
+ "\n",
+ " for index in range (0, 4) :\n",
+ " if (lists[index] == name) :\n",
+ " result = 1\n",
+ " break\n",
+ " \n",
+ " return result\n",
+ "\n",
+ "# Calculation and result\n",
+ "name = 'John'\n",
+ "\n",
+ "if (lookup (name)) :\n",
+ " print ('%s is in the list\\n' % name)\n",
+ "else :\n",
+ " print ('%s is not in the list\\n' % name)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "John is in the list\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 15.6, Page number: 288"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "# Variable and function declaration\n",
+ "seven_count = 0\n",
+ "three_count = 0\n",
+ "data = []\n",
+ "\n",
+ "def get_data (data) :\n",
+ " for i in range (0, 5) :\n",
+ " x = 3\n",
+ " data.append(int(x))\n",
+ " print (data)\n",
+ "\n",
+ "# Calculation\n",
+ "get_data (data)\n",
+ "for index in range (0, 5) :\n",
+ " if data[index] == 3 :\n",
+ " three_count += 1\n",
+ "\n",
+ " if data[index] == 7 :\n",
+ " seven_count += 1\n",
+ "\n",
+ "# Result\n",
+ "print ('Threes %d Sevens %d' % (three_count, seven_count))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "[3, 3, 3, 3, 3]\n",
+ "Threes 5 Sevens 0\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 15.7, Page number: 292"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "# Variable declaration\n",
+ "import sys\n",
+ "import os\n",
+ "in_file = open ('numbers.dat', 'r')\n",
+ "\n",
+ "data = []\n",
+ "max_count = 0\n",
+ " \n",
+ "# Calculation and result\n",
+ "if not os.path.exists ('numbers.dat') :\n",
+ " print ('Error:Unable to open numbers.dat\\n')\n",
+ " sys.exit(1)\n",
+ "\n",
+ "for line in in_file :\n",
+ " data.append(line)\n",
+ " max_count += 1\n",
+ "\n",
+ "while (1) :\n",
+ " search = 6\n",
+ " \n",
+ " if (search == -1) :\n",
+ " break\n",
+ "\n",
+ " low = 0\n",
+ " high = max_count\n",
+ "\n",
+ " while (1) :\n",
+ " mid = (low + high) / 2\n",
+ " middle = int (mid) \n",
+ "\n",
+ " if (int (data[middle]) == search) :\n",
+ " print ('Found at index %d\\n' % (middle + 1))\n",
+ " break\n",
+ "\n",
+ " if (low == high) :\n",
+ " print ('Not found\\n')\n",
+ " break\n",
+ "\n",
+ " if (int (data[middle]) < search) :\n",
+ " low = middle\n",
+ " else :\n",
+ " high = middle \n",
+ "\n",
+ "in_file.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": "*"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 15.8, Page number: 300"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "\n",
+ "# Variable declaration\n",
+ "import sys\n",
+ "import os\n",
+ "in_file = open ('numbers.dat', 'r')\n",
+ "\n",
+ "data = []\n",
+ "max_count = 0\n",
+ " \n",
+ "# Calculation and result\n",
+ "if not os.path.exists ('numbers.dat') :\n",
+ " print ('Error:Unable to open numbers.dat\\n')\n",
+ " sys.exit(1)\n",
+ "\n",
+ "for line in in_file :\n",
+ " data.append(line)\n",
+ " max_count += 1\n",
+ "\n",
+ "while (1) :\n",
+ " search = 14\n",
+ " \n",
+ " if (search == -1) :\n",
+ " break\n",
+ "\n",
+ " low = 0\n",
+ " high = max_count\n",
+ "\n",
+ " while (1) :\n",
+ " mid = (low + high) / 2\n",
+ " middle = int (mid) \n",
+ "\n",
+ " if (int (data[middle]) == search) :\n",
+ " print ('Found at index %d\\n' % (middle + 1))\n",
+ " break\n",
+ "\n",
+ " if (low == high) :\n",
+ " print ('Not found\\n')\n",
+ " break\n",
+ "\n",
+ " if (int (data[middle]) < search) :\n",
+ " low = middle\n",
+ " else :\n",
+ " high = middle \n",
+ "\n",
+ "in_file.close()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": "*"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 15.10, Page number: 304"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "# Variable declaration\n",
+ "i = 1\n",
+ "j = 1\n",
+ "\n",
+ "# Calculation and result\n",
+ "print ('Starting\\n')\n",
+ "print ('Before divide...')\n",
+ "i = i / j\n",
+ "print ('After\\n')"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Starting\n",
+ "\n",
+ "Before divide...\n",
+ "After\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 15.11, Page number: 304"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "# Variable declaration\n",
+ "import sys\n",
+ "i = 1\n",
+ "j = 1\n",
+ "\n",
+ "# Calculation and result\n",
+ "print ('Starting\\n')\n",
+ "sys.stdout.flush()\n",
+ "print ('Before divide...')\n",
+ "sys.stdout.flush()\n",
+ "i = i / j\n",
+ "print ('After\\n')\n",
+ "sys.stdout.flush()"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Starting\n",
+ "\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Before divide...\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "After\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Practical_C_Programming/Chapter_14_1.ipynb b/Practical_C_Programming/Chapter_14_1.ipynb
index 6d3c736e..c25523b7 100755
--- a/Practical_C_Programming/Chapter_14_1.ipynb
+++ b/Practical_C_Programming/Chapter_14_1.ipynb
@@ -52,17 +52,15 @@
"metadata": {},
"outputs": [
{
- "ename": "IOError",
- "evalue": "[Errno 2] No such file or directory: 'input.txt'",
- "output_type": "pyerr",
- "traceback": [
- "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[1;31mIOError\u001b[0m Traceback (most recent call last)",
- "\u001b[1;32m<ipython-input-1-038814efe2a7>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 6\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mos\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 7\u001b[0m \u001b[0mcount\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;36m0\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 8\u001b[1;33m \u001b[0min_file\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mopen\u001b[0m \u001b[1;33m(\u001b[0m\u001b[1;34m'input.txt'\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m'r'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 9\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 10\u001b[0m \u001b[1;31m# Calculation and result\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
- "\u001b[1;31mIOError\u001b[0m: [Errno 2] No such file or directory: 'input.txt'"
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number of characters in input.txt is 0\n",
+ "\n"
]
}
],
- "prompt_number": 1
+ "prompt_number": 2
},
{
"cell_type": "heading",
@@ -84,7 +82,7 @@
"in_file = open ('input.txt', 'r')\n",
" \n",
"# Calculation and result\n",
- "if not os.path.exists (name) :\n",
+ "if not os.path.exists ('input.txt') :\n",
" print ('Could not open file\\n')\n",
" sys.exit(1)\n",
"print ('File found\\n')\n",
@@ -95,17 +93,15 @@
"metadata": {},
"outputs": [
{
- "ename": "IOError",
- "evalue": "[Errno 2] No such file or directory: 'input.txt'",
- "output_type": "pyerr",
- "traceback": [
- "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[1;31mIOError\u001b[0m Traceback (most recent call last)",
- "\u001b[1;32m<ipython-input-2-370dc09ecbc3>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 6\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0msys\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 7\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mos\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 8\u001b[1;33m \u001b[0min_file\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mopen\u001b[0m \u001b[1;33m(\u001b[0m\u001b[1;34m'input.txt'\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m'r'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 9\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 10\u001b[0m \u001b[1;31m# Calculation and result\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
- "\u001b[1;31mIOError\u001b[0m: [Errno 2] No such file or directory: 'input.txt'"
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "File found\n",
+ "\n"
]
}
],
- "prompt_number": 2
+ "prompt_number": 5
},
{
"cell_type": "heading",
diff --git a/Practical_C_Programming/Chapter_15_1.ipynb b/Practical_C_Programming/Chapter_15_1.ipynb
index 34a86a67..05286d0f 100755
--- a/Practical_C_Programming/Chapter_15_1.ipynb
+++ b/Practical_C_Programming/Chapter_15_1.ipynb
@@ -173,19 +173,8 @@
],
"language": "python",
"metadata": {},
- "outputs": [
- {
- "ename": "IOError",
- "evalue": "[Errno 2] No such file or directory: 'numbers.dat'",
- "output_type": "pyerr",
- "traceback": [
- "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[1;31mIOError\u001b[0m Traceback (most recent call last)",
- "\u001b[1;32m<ipython-input-5-ce867c3a4ec5>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 6\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0msys\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 7\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mos\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 8\u001b[1;33m \u001b[0min_file\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mopen\u001b[0m \u001b[1;33m(\u001b[0m\u001b[1;34m'numbers.dat'\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m'r'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 9\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 10\u001b[0m \u001b[0mdata\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;33m[\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
- "\u001b[1;31mIOError\u001b[0m: [Errno 2] No such file or directory: 'numbers.dat'"
- ]
- }
- ],
- "prompt_number": 5
+ "outputs": [],
+ "prompt_number": "*"
},
{
"cell_type": "heading",
@@ -248,19 +237,8 @@
],
"language": "python",
"metadata": {},
- "outputs": [
- {
- "ename": "IOError",
- "evalue": "[Errno 2] No such file or directory: 'numbers.dat'",
- "output_type": "pyerr",
- "traceback": [
- "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[1;31mIOError\u001b[0m Traceback (most recent call last)",
- "\u001b[1;32m<ipython-input-6-8cd3b79f72a3>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 6\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0msys\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 7\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mos\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 8\u001b[1;33m \u001b[0min_file\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mopen\u001b[0m \u001b[1;33m(\u001b[0m\u001b[1;34m'numbers.dat'\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m'r'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 9\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 10\u001b[0m \u001b[0mdata\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;33m[\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
- "\u001b[1;31mIOError\u001b[0m: [Errno 2] No such file or directory: 'numbers.dat'"
- ]
- }
- ],
- "prompt_number": 6
+ "outputs": [],
+ "prompt_number": "*"
},
{
"cell_type": "heading",
@@ -277,7 +255,7 @@
"\n",
"# Variable declaration\n",
"i = 1\n",
- "j = 0\n",
+ "j = 1\n",
"\n",
"# Calculation and result\n",
"print ('Starting\\n')\n",
@@ -289,26 +267,18 @@
"metadata": {},
"outputs": [
{
- "ename": "ZeroDivisionError",
- "evalue": "integer division or modulo by zero",
- "output_type": "pyerr",
- "traceback": [
- "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[1;31mZeroDivisionError\u001b[0m Traceback (most recent call last)",
- "\u001b[1;32m<ipython-input-7-289ff2a55d4d>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 10\u001b[0m \u001b[1;32mprint\u001b[0m \u001b[1;33m(\u001b[0m\u001b[1;34m'Starting\\n'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 11\u001b[0m \u001b[1;32mprint\u001b[0m \u001b[1;33m(\u001b[0m\u001b[1;34m'Before divide...'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 12\u001b[1;33m \u001b[0mi\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mi\u001b[0m \u001b[1;33m/\u001b[0m \u001b[0mj\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 13\u001b[0m \u001b[1;32mprint\u001b[0m \u001b[1;33m(\u001b[0m\u001b[1;34m'After\\n'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
- "\u001b[1;31mZeroDivisionError\u001b[0m: integer division or modulo by zero"
- ]
- },
- {
"output_type": "stream",
"stream": "stdout",
"text": [
"Starting\n",
"\n",
- "Before divide...\n"
+ "Before divide...\n",
+ "After\n",
+ "\n"
]
}
],
- "prompt_number": 7
+ "prompt_number": 9
},
{
"cell_type": "heading",
@@ -322,11 +292,11 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "\n",
+ "from __future__ import division\n",
"# Variable declaration\n",
"import sys\n",
"i = 1\n",
- "j = 0\n",
+ "j = 1\n",
"\n",
"# Calculation and result\n",
"print ('Starting\\n')\n",
@@ -356,17 +326,23 @@
]
},
{
- "ename": "ZeroDivisionError",
- "evalue": "integer division or modulo by zero",
- "output_type": "pyerr",
- "traceback": [
- "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[1;31mZeroDivisionError\u001b[0m Traceback (most recent call last)",
- "\u001b[1;32m<ipython-input-8-eedd2fda3e82>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 13\u001b[0m \u001b[1;32mprint\u001b[0m \u001b[1;33m(\u001b[0m\u001b[1;34m'Before divide...'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 14\u001b[0m \u001b[0msys\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mstdout\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mflush\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 15\u001b[1;33m \u001b[0mi\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mi\u001b[0m \u001b[1;33m/\u001b[0m \u001b[0mj\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 16\u001b[0m \u001b[1;32mprint\u001b[0m \u001b[1;33m(\u001b[0m\u001b[1;34m'After\\n'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 17\u001b[0m \u001b[0msys\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mstdout\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mflush\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
- "\u001b[1;31mZeroDivisionError\u001b[0m: integer division or modulo by zero"
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "After\n",
+ "\n"
]
}
],
"prompt_number": 8
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
}
],
"metadata": {}
diff --git a/Practical_C_Programming/numbers.dat b/Practical_C_Programming/numbers.dat
new file mode 100644
index 00000000..573541ac
--- /dev/null
+++ b/Practical_C_Programming/numbers.dat
@@ -0,0 +1 @@
+0
diff --git a/Practical_C_Programming/numbers.dat~ b/Practical_C_Programming/numbers.dat~
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/Practical_C_Programming/numbers.dat~
diff --git a/Principles_Of_Electronic_Communication_Systems_by_L_E_Frenze/chapter22.ipynb b/Principles_Of_Electronic_Communication_Systems_by_L_E_Frenze/chapter22.ipynb
new file mode 100755
index 00000000..2fc3916b
--- /dev/null
+++ b/Principles_Of_Electronic_Communication_Systems_by_L_E_Frenze/chapter22.ipynb
@@ -0,0 +1,94 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:d66b7b0a5ebd4fcdf9eb24f98ae81ac03aa2dcdb229f576b47a170647bd9ea49"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 22 Communication tests and measurments"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 22.1 Page no 854"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "Vp=8 #volts\n",
+ "R=75 #Ohm\n",
+ "\n",
+ "#Calculation\n",
+ "Vmax=0.707*Vp\n",
+ "P=Vmax**2/R\n",
+ "\n",
+ "#Result\n",
+ "print\"Power is dissipated in the load is \",round(P,4),\"Watt\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Power is dissipated in the load is 0.4265 Watt\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 22.2 Page no 857"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "Pf=380.0 #Watt\n",
+ "Pr=40 #Watt\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "m=math.sqrt(Pr/Pf)\n",
+ "SWR=(1+m)/(1-m)\n",
+ "print\"SWR= \",round(SWR,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "SWR= 1.96\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Programming_With_Java_A_Primer/.ipynb_checkpoints/chapter13-checkpoint.ipynb b/Programming_With_Java_A_Primer/.ipynb_checkpoints/chapter13-checkpoint.ipynb
new file mode 100755
index 00000000..28830641
--- /dev/null
+++ b/Programming_With_Java_A_Primer/.ipynb_checkpoints/chapter13-checkpoint.ipynb
@@ -0,0 +1,266 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:5b64344dd4b10e210167de1e2d127d9539461b4485363c51a2c3ddba9df7db38"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 13: Managing Errors & Exceptions"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 13.1, page no. 231"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "\"\"\"\n",
+ "there is no need of semicolon. We will show error for something else\n",
+ "\"\"\"\n",
+ "\n",
+ "print \"Hello Python...\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Hello Python...\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 13.2, page no. 232"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "a = 10\n",
+ "b = 5\n",
+ "c = 5\n",
+ "x = a/(b-c) #It will show ZeroDivisionError\n",
+ "print \"x = \", x\n",
+ "y = a/(b+c)\n",
+ "print \"y = \", y"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "ename": "ZeroDivisionError",
+ "evalue": "division by zero",
+ "output_type": "pyerr",
+ "traceback": [
+ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[0;31mZeroDivisionError\u001b[0m Traceback (most recent call last)",
+ "\u001b[0;32m<ipython-input-5-9289236a4a07>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[0mb\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;36m5\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 4\u001b[0m \u001b[0mc\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;36m5\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 5\u001b[0;31m \u001b[0mx\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0ma\u001b[0m\u001b[0;34m/\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mb\u001b[0m\u001b[0;34m-\u001b[0m\u001b[0mc\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 6\u001b[0m \u001b[0;32mprint\u001b[0m \u001b[0;34m\"x = \"\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mx\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 7\u001b[0m \u001b[0my\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0ma\u001b[0m\u001b[0;34m/\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mb\u001b[0m\u001b[0;34m+\u001b[0m\u001b[0mc\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
+ "\u001b[0;31mZeroDivisionError\u001b[0m: division by zero"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.3 page no : 235"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "a = 10\n",
+ "b = 5\n",
+ "c = 5\n",
+ "try:\n",
+ " x = a/(b-c)\n",
+ "except Exception,e :\n",
+ " print \"Division by zero\"\n",
+ "y = a/(b+c)\n",
+ "print \"y = \",y"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Division by zero\n",
+ "y = 1\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.4 page no : 236"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "import sys\n",
+ "invalid = 0\n",
+ "count = 0\n",
+ "for i in sys.argv:\n",
+ " try:\n",
+ " a = int(i)\n",
+ " except:\n",
+ " invalid += 1\n",
+ " print \"Invalid number\" , i\n",
+ " continue\n",
+ " count += 1\n",
+ "\n",
+ "print \"Valid Numbers : \" ,count\n",
+ "print \"Invalid numbers \",invalid\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Invalid number -c\n",
+ "Invalid number -f\n",
+ "Invalid number /tmp/tmp1tOqar/profile_default/security/kernel-082ebfe6-5650-4ba4-8bcf-cd17bc99af7a.json\n",
+ "Invalid number --IPKernelApp.parent_appname='ipython-notebook'\n",
+ "Invalid number --profile-dir\n",
+ "Invalid number /tmp/tmp1tOqar/profile_default\n",
+ "Invalid number --parent=1\n",
+ "Valid Numbers : 0\n",
+ "Invalid numbers 7\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 13.5, page no. 239"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "a = [5,10]\n",
+ "b = 5\n",
+ "try:\n",
+ " x = a[2]/b - a[1]\n",
+ "except AssertionError:\n",
+ " print \"AssertionError:\"\n",
+ "except IndexError:\n",
+ " print \"Array Index Error\"\n",
+ "except Exception:\n",
+ " print \"Any Error\"\n",
+ "y = a[1]/a[0]\n",
+ "print \"y = \" , y "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Array Index Error\n",
+ "y = 2\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 13.6 page no : 239"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "x = 5\n",
+ "y = 1000\n",
+ "\n",
+ "class MyException(Exception):\n",
+ " def __init__(self, message):\n",
+ " Exception.__init__(self, message)\n",
+ " def error(self):\n",
+ " print self.message\n",
+ "\n",
+ "try:\n",
+ " z = x/y\n",
+ " if(z<0.01):\n",
+ " raise MyException(\"Number is too small\")\n",
+ "except MyException, error:\n",
+ " print \"Caught MyException\"\n",
+ " print error.message\n",
+ "finally:\n",
+ " print \"I am always here\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Caught MyException\n",
+ "Number is too small\n",
+ "I am always here\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Programming_With_Java_A_Primer/chapter13.ipynb b/Programming_With_Java_A_Primer/chapter13.ipynb
index 7c07d269..28830641 100755
--- a/Programming_With_Java_A_Primer/chapter13.ipynb
+++ b/Programming_With_Java_A_Primer/chapter13.ipynb
@@ -33,21 +33,20 @@
"there is no need of semicolon. We will show error for something else\n",
"\"\"\"\n",
"\n",
- "print \"Hello Python..."
+ "print \"Hello Python...\""
],
"language": "python",
"metadata": {},
"outputs": [
{
- "ename": "SyntaxError",
- "evalue": "EOL while scanning string literal (<ipython-input-1-c13cce4dd116>, line 7)",
- "output_type": "pyerr",
- "traceback": [
- "\u001b[1;36m File \u001b[1;32m\"<ipython-input-1-c13cce4dd116>\"\u001b[1;36m, line \u001b[1;32m7\u001b[0m\n\u001b[1;33m print \"Hello Python...\u001b[0m\n\u001b[1;37m ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m EOL while scanning string literal\n"
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Hello Python...\n"
]
}
],
- "prompt_number": 1
+ "prompt_number": 2
},
{
"cell_type": "heading",
@@ -65,7 +64,7 @@
"a = 10\n",
"b = 5\n",
"c = 5\n",
- "x = a/(b-c)\n",
+ "x = a/(b-c) #It will show ZeroDivisionError\n",
"print \"x = \", x\n",
"y = a/(b+c)\n",
"print \"y = \", y"
@@ -75,16 +74,16 @@
"outputs": [
{
"ename": "ZeroDivisionError",
- "evalue": "integer division or modulo by zero",
+ "evalue": "division by zero",
"output_type": "pyerr",
"traceback": [
- "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[1;31mZeroDivisionError\u001b[0m Traceback (most recent call last)",
- "\u001b[1;32m<ipython-input-2-d52b7922541b>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 4\u001b[0m \u001b[0mb\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;36m5\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 5\u001b[0m \u001b[0mc\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;36m5\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 6\u001b[1;33m \u001b[0mx\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0ma\u001b[0m\u001b[1;33m/\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mb\u001b[0m\u001b[1;33m-\u001b[0m\u001b[0mc\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 7\u001b[0m \u001b[1;32mprint\u001b[0m \u001b[1;34m\"x = \"\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mx\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 8\u001b[0m \u001b[0my\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0ma\u001b[0m\u001b[1;33m/\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mb\u001b[0m\u001b[1;33m+\u001b[0m\u001b[0mc\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
- "\u001b[1;31mZeroDivisionError\u001b[0m: integer division or modulo by zero"
+ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[0;31mZeroDivisionError\u001b[0m Traceback (most recent call last)",
+ "\u001b[0;32m<ipython-input-5-9289236a4a07>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[0mb\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;36m5\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 4\u001b[0m \u001b[0mc\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;36m5\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 5\u001b[0;31m \u001b[0mx\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0ma\u001b[0m\u001b[0;34m/\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mb\u001b[0m\u001b[0;34m-\u001b[0m\u001b[0mc\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 6\u001b[0m \u001b[0;32mprint\u001b[0m \u001b[0;34m\"x = \"\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mx\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 7\u001b[0m \u001b[0my\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0ma\u001b[0m\u001b[0;34m/\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mb\u001b[0m\u001b[0;34m+\u001b[0m\u001b[0mc\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
+ "\u001b[0;31mZeroDivisionError\u001b[0m: division by zero"
]
}
],
- "prompt_number": 2
+ "prompt_number": 5
},
{
"cell_type": "heading",
diff --git a/Programming_With_Java_A_Primer/chapter17.ipynb b/Programming_With_Java_A_Primer/chapter17.ipynb
index c8344546..75e227d6 100755
--- a/Programming_With_Java_A_Primer/chapter17.ipynb
+++ b/Programming_With_Java_A_Primer/chapter17.ipynb
@@ -45,14 +45,14 @@
"evalue": "The value b cannot be zero",
"output_type": "pyerr",
"traceback": [
- "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[1;31mAssertionError\u001b[0m Traceback (most recent call last)",
- "\u001b[1;32m<ipython-input-3-39ef7600cfd3>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 9\u001b[0m \u001b[1;32mprint\u001b[0m \u001b[1;34m\"The result is: \"\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mc\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 10\u001b[0m \u001b[0mdiv\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mDivision\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 11\u001b[1;33m \u001b[0mdiv\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0massertcheck\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;36m5\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
- "\u001b[1;32m<ipython-input-3-39ef7600cfd3>\u001b[0m in \u001b[0;36massertcheck\u001b[1;34m(self, a, b)\u001b[0m\n\u001b[0;32m 5\u001b[0m \u001b[1;32mclass\u001b[0m \u001b[0mDivision\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 6\u001b[0m \u001b[1;32mdef\u001b[0m \u001b[0massertcheck\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0ma\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mb\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 7\u001b[1;33m \u001b[1;32massert\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mb\u001b[0m\u001b[1;33m!=\u001b[0m\u001b[1;36m0\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m\"The value b cannot be zero\"\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 8\u001b[0m \u001b[0mc\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0ma\u001b[0m\u001b[1;33m/\u001b[0m\u001b[0mb\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 9\u001b[0m \u001b[1;32mprint\u001b[0m \u001b[1;34m\"The result is: \"\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mc\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
- "\u001b[1;31mAssertionError\u001b[0m: The value b cannot be zero"
+ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[0;31mAssertionError\u001b[0m Traceback (most recent call last)",
+ "\u001b[0;32m<ipython-input-1-426e5021b6ba>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 6\u001b[0m \u001b[0;32mprint\u001b[0m \u001b[0;34m\"The result is: \"\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mc\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 7\u001b[0m \u001b[0mdiv\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mDivision\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 8\u001b[0;31m \u001b[0mdiv\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0massertcheck\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m5\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m0\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
+ "\u001b[0;32m<ipython-input-1-426e5021b6ba>\u001b[0m in \u001b[0;36massertcheck\u001b[0;34m(self, a, b)\u001b[0m\n\u001b[1;32m 2\u001b[0m \u001b[0;32mclass\u001b[0m \u001b[0mDivision\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0massertcheck\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0ma\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mb\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 4\u001b[0;31m \u001b[0;32massert\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mb\u001b[0m\u001b[0;34m!=\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m\"The value b cannot be zero\"\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 5\u001b[0m \u001b[0mc\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0ma\u001b[0m\u001b[0;34m/\u001b[0m\u001b[0mb\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 6\u001b[0m \u001b[0;32mprint\u001b[0m \u001b[0;34m\"The result is: \"\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mc\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
+ "\u001b[0;31mAssertionError\u001b[0m: The value b cannot be zero"
]
}
],
- "prompt_number": 3
+ "prompt_number": 1
}
],
"metadata": {}
diff --git a/Programming_in_C/.ipynb_checkpoints/Chapter_16-checkpoint.ipynb b/Programming_in_C/.ipynb_checkpoints/Chapter_16-checkpoint.ipynb
new file mode 100755
index 00000000..535875b5
--- /dev/null
+++ b/Programming_in_C/.ipynb_checkpoints/Chapter_16-checkpoint.ipynb
@@ -0,0 +1,294 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 16: Input and Output Operations in Python"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 16.1, Page number: 350"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "def main():\n",
+ "\n",
+ " #Variable Declaration\n",
+ " c='X'\n",
+ " s=\"abcdefghijklmnopqrstuvwxyz\"\n",
+ " i=425\n",
+ " j=17\n",
+ " u=0xf179\n",
+ " l=75000\n",
+ " L=0x1234567812345678\n",
+ " f=12.978\n",
+ " d=-97.4583\n",
+ " cp=c\n",
+ " ip=i\n",
+ " \n",
+ "\n",
+ " #Print Integers\n",
+ " print(\"Integers:\\n\")\n",
+ " print(\"%i %o %x %u\" %(i,i,i,i))\n",
+ " print(\"%x %X %#x %#X\" %(i,i,i,i))\n",
+ " print(\"%+i % i %07i %.7i\" %(i,i,i, i))\n",
+ " print(\"%i %o %x %u\" %(j,j,j,j))\n",
+ " print(\"%i %o %x %u\" %(u,u,u,u))\n",
+ " print(\"%ld %lo %lx %lu\" %(l,l,l,l))\n",
+ " print(\"%li %lo %lx %lu\" %(L,L,L, L))\n",
+ "\n",
+ " #Print Floats & Doubles\n",
+ " print(\"\\nFloats and Doubles:\")\n",
+ " print(\"%f %e %g\"%( f, f, f))\n",
+ " print(\"%.2f %.2e\"%( f, f))\n",
+ " print(\"%.0f %.0e\"%( f, f))\n",
+ " print(\"%7.2f %7.2e\"%( f, f))\n",
+ " print(\"%f %e %g\"%( d, d, d))\n",
+ " print(\"%.*f\"%( 3, d))\n",
+ " print(\"%*.*f\" %(8, 2, d))\n",
+ "\n",
+ " #Print Characters\n",
+ " print(\"\\nCharacters:\")\n",
+ " print(\"%c\"%(c))\n",
+ " print(\"%3c%3c\"%( c, c))\n",
+ " print(\"{0:x} \".format(ord(c))) \n",
+ "\n",
+ " #Print Strings\n",
+ " print(\"\\nStrings:\")\n",
+ " print(\"%s\"%(s))\n",
+ " print(\"%.5s\"%(s))\n",
+ " print(\"%30s\"%(s))\n",
+ " print(\"%20.5s\"%(s))\n",
+ " print(\"%-20.5s\"%(s))\n",
+ "\n",
+ " #Print variables pointers\n",
+ " print(\"\\nPointers:\")\n",
+ " print(\"{0:x} {1:x}\\n\".format(int(ip),ord(cp)))\n",
+ "\n",
+ " print(\"This%n is fun.\")\n",
+ " print(\"c1 = %i, c2 = %i\\n\"%(4, 12))\n",
+ "\n",
+ "\n",
+ "if __name__=='__main__':\n",
+ " main()\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integers:\n",
+ "\n",
+ "425 651 1a9 425\n",
+ "1a9 1A9 0x1a9 0X1A9\n",
+ "+425 425 0000425 0000425\n",
+ "17 21 11 17\n",
+ "61817 170571 f179 61817\n",
+ "75000 222370 124f8 75000\n",
+ "1311768465173141112 110642547402215053170 1234567812345678 1311768465173141112\n",
+ "\n",
+ "Floats and Doubles:\n",
+ "12.978000 1.297800e+01 12.978\n",
+ "12.98 1.30e+01\n",
+ "13 1e+01\n",
+ " 12.98 1.30e+01\n",
+ "-97.458300 -9.745830e+01 -97.4583\n",
+ "-97.458\n",
+ " -97.46\n",
+ "\n",
+ "Characters:\n",
+ "X\n",
+ " X X\n",
+ "58 \n",
+ "\n",
+ "Strings:\n",
+ "abcdefghijklmnopqrstuvwxyz\n",
+ "abcde\n",
+ " abcdefghijklmnopqrstuvwxyz\n",
+ " abcde\n",
+ "abcde \n",
+ "\n",
+ "Pointers:\n",
+ "1a9 58\n",
+ "\n",
+ "This%n is fun.\n",
+ "c1 = 4, c2 = 12\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 16.2, Page number: 362"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "import sys\n",
+ "\n",
+ "def main():\n",
+ " \n",
+ " while (True):\n",
+ " #c=raw_input() #User Input\n",
+ " c=\"this is a sample text\" #Dummy text\n",
+ " print(c); #Display Result\n",
+ " \n",
+ " #Un-comment this while executing from terminal/command line\n",
+ " #if(c==\"EOF\"): #Check Exit condition\n",
+ " sys.exit()\n",
+ " \n",
+ "\n",
+ "if __name__=='__main__':\n",
+ " main()\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "ename": "SystemExit",
+ "evalue": "",
+ "output_type": "pyerr",
+ "traceback": [
+ "An exception has occurred, use %tb to see the full traceback.\n",
+ "\u001b[1;31mSystemExit\u001b[0m\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "this is a sample text\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stderr",
+ "text": [
+ "To exit: use 'exit', 'quit', or Ctrl-D."
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Program 16.3, Page number: 366"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import sys\n",
+ "def main():\n",
+ "\n",
+ " #Variable Declaration/ User Input\n",
+ " print(\"Enter name of the file to be copied: \")\n",
+ " inName=\"source.txt\"\n",
+ " #inName=raw_input()\n",
+ "\n",
+ " print(\"Enter name of the output file: \")\n",
+ " outName=\"target.txt\"\n",
+ " #outName=raw_input()\n",
+ "\n",
+ " \n",
+ " try:\n",
+ " inn=open(inName,\"r\") \n",
+ " except:# Exception:\n",
+ " print(\"cant open {0} for reading\".format(inName))\n",
+ " sys.exit()\n",
+ "\n",
+ " try:\n",
+ " out=open(outName,\"w\") \n",
+ " except:# Exception:\n",
+ " print(\"cant open {0} for writing\".format(outName))\n",
+ " sys.exit()\n",
+ "\n",
+ " string=inn.read() #Read content from File-1\n",
+ " out.write(string) #Write content to File-2\n",
+ "\n",
+ " inn.close()\n",
+ " out.close()\n",
+ "\n",
+ " print(\"File has been copied.\\n\");\n",
+ "\n",
+ "if __name__=='__main__':\n",
+ " main()\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "ename": "SystemExit",
+ "evalue": "",
+ "output_type": "pyerr",
+ "traceback": [
+ "An exception has occurred, use %tb to see the full traceback.\n",
+ "\u001b[0;31mSystemExit\u001b[0m\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Enter name of the file to be copied: \n",
+ "Enter name of the output file: \n",
+ "cant open source.txt for reading\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stderr",
+ "text": [
+ "To exit: use 'exit', 'quit', or Ctrl-D.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/Programming_in_C/Chapter_16.ipynb b/Programming_in_C/Chapter_16.ipynb
index 2b519af8..535875b5 100755
--- a/Programming_in_C/Chapter_16.ipynb
+++ b/Programming_in_C/Chapter_16.ipynb
@@ -1,6 +1,6 @@
{
"metadata": {
- "name": "Chapter 16"
+ "name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
@@ -211,7 +211,7 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "\n",
+ "import sys\n",
"def main():\n",
"\n",
" #Variable Declaration/ User Input\n",
@@ -252,14 +252,12 @@
"metadata": {},
"outputs": [
{
- "ename": "NameError",
- "evalue": "global name 'source' is not defined",
+ "ename": "SystemExit",
+ "evalue": "",
"output_type": "pyerr",
"traceback": [
- "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[1;31mNameError\u001b[0m Traceback (most recent call last)",
- "\u001b[1;32m/home/jovina/TBC/nalin/Stephen G Kochan--Programming in C/<ipython-input-3-388aacca0b5d>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 40\u001b[0m \u001b[1;31m#Setting top level conditional script\u001b[0m\n\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 41\u001b[0m \u001b[1;32mif\u001b[0m \u001b[0m__name__\u001b[0m\u001b[1;33m==\u001b[0m\u001b[1;34m'__main__'\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 42\u001b[1;33m \u001b[0mmain\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 43\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n",
- "\u001b[1;32m/home/jovina/TBC/nalin/Stephen G Kochan--Programming in C/<ipython-input-3-388aacca0b5d>\u001b[0m in \u001b[0;36mmain\u001b[1;34m()\u001b[0m\n\u001b[0;32m 19\u001b[0m \u001b[0minn\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mopen\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0msource\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mtxt\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;34m\"r\"\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 20\u001b[0m \u001b[1;32mexcept\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;31m# Exception:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 21\u001b[1;33m \u001b[1;32mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"cant open {0} for reading\"\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mformat\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0msource\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mtxt\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 22\u001b[0m \u001b[0msys\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mexit\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 23\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n",
- "\u001b[1;31mNameError\u001b[0m: global name 'source' is not defined"
+ "An exception has occurred, use %tb to see the full traceback.\n",
+ "\u001b[0;31mSystemExit\u001b[0m\n"
]
},
{
@@ -267,11 +265,19 @@
"stream": "stdout",
"text": [
"Enter name of the file to be copied: \n",
- "Enter name of the output file: \n"
+ "Enter name of the output file: \n",
+ "cant open source.txt for reading\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stderr",
+ "text": [
+ "To exit: use 'exit', 'quit', or Ctrl-D.\n"
]
}
],
- "prompt_number": 3
+ "prompt_number": 2
},
{
"cell_type": "code",
diff --git a/Schaum's_Outlines:_Programming_with_C++/README.txt b/Schaum's_Outline/README.txt
index 272f5329..272f5329 100755
--- a/Schaum's_Outlines:_Programming_with_C++/README.txt
+++ b/Schaum's_Outline/README.txt
diff --git a/Schaum's_Outlines:_Programming_with_C++/ch1.ipynb b/Schaum's_Outline/ch1.ipynb
index 175e4501..175e4501 100755
--- a/Schaum's_Outlines:_Programming_with_C++/ch1.ipynb
+++ b/Schaum's_Outline/ch1.ipynb
diff --git a/Schaum's_Outlines:_Programming_with_C++/ch10.ipynb b/Schaum's_Outline/ch10.ipynb
index eb3d1761..eb3d1761 100755
--- a/Schaum's_Outlines:_Programming_with_C++/ch10.ipynb
+++ b/Schaum's_Outline/ch10.ipynb
diff --git a/Schaum's_Outlines:_Programming_with_C++/ch11.ipynb b/Schaum's_Outline/ch11.ipynb
index 321fb35b..321fb35b 100755
--- a/Schaum's_Outlines:_Programming_with_C++/ch11.ipynb
+++ b/Schaum's_Outline/ch11.ipynb
diff --git a/Schaum's_Outlines:_Programming_with_C++/ch12.ipynb b/Schaum's_Outline/ch12.ipynb
index 2743b6a5..2743b6a5 100755
--- a/Schaum's_Outlines:_Programming_with_C++/ch12.ipynb
+++ b/Schaum's_Outline/ch12.ipynb
diff --git a/Schaum's_Outlines:_Programming_with_C++/ch13.ipynb b/Schaum's_Outline/ch13.ipynb
index eea108dd..eea108dd 100755
--- a/Schaum's_Outlines:_Programming_with_C++/ch13.ipynb
+++ b/Schaum's_Outline/ch13.ipynb
diff --git a/Schaum's_Outlines:_Programming_with_C++/ch14.ipynb b/Schaum's_Outline/ch14.ipynb
index 457669dc..457669dc 100755
--- a/Schaum's_Outlines:_Programming_with_C++/ch14.ipynb
+++ b/Schaum's_Outline/ch14.ipynb
diff --git a/Schaum's_Outlines:_Programming_with_C++/ch2.ipynb b/Schaum's_Outline/ch2.ipynb
index 8697f28c..8697f28c 100755
--- a/Schaum's_Outlines:_Programming_with_C++/ch2.ipynb
+++ b/Schaum's_Outline/ch2.ipynb
diff --git a/Schaum's_Outlines:_Programming_with_C++/ch3.ipynb b/Schaum's_Outline/ch3.ipynb
index d023e19b..d023e19b 100755
--- a/Schaum's_Outlines:_Programming_with_C++/ch3.ipynb
+++ b/Schaum's_Outline/ch3.ipynb
diff --git a/Schaum's_Outlines:_Programming_with_C++/ch4.ipynb b/Schaum's_Outline/ch4.ipynb
index 557d2d6a..557d2d6a 100755
--- a/Schaum's_Outlines:_Programming_with_C++/ch4.ipynb
+++ b/Schaum's_Outline/ch4.ipynb
diff --git a/Schaum's_Outlines:_Programming_with_C++/ch5.ipynb b/Schaum's_Outline/ch5.ipynb
index 1fddf23f..1fddf23f 100755
--- a/Schaum's_Outlines:_Programming_with_C++/ch5.ipynb
+++ b/Schaum's_Outline/ch5.ipynb
diff --git a/Schaum's_Outlines:_Programming_with_C++/ch6.ipynb b/Schaum's_Outline/ch6.ipynb
index 2c52f179..2c52f179 100755
--- a/Schaum's_Outlines:_Programming_with_C++/ch6.ipynb
+++ b/Schaum's_Outline/ch6.ipynb
diff --git a/Schaum's_Outlines:_Programming_with_C++/ch7.ipynb b/Schaum's_Outline/ch7.ipynb
index 63248e07..63248e07 100755
--- a/Schaum's_Outlines:_Programming_with_C++/ch7.ipynb
+++ b/Schaum's_Outline/ch7.ipynb
diff --git a/Schaum's_Outlines:_Programming_with_C++/ch8.ipynb b/Schaum's_Outline/ch8.ipynb
index 2b83cace..2b83cace 100755
--- a/Schaum's_Outlines:_Programming_with_C++/ch8.ipynb
+++ b/Schaum's_Outline/ch8.ipynb
diff --git a/Schaum's_Outlines:_Programming_with_C++/ch9.ipynb b/Schaum's_Outline/ch9.ipynb
index d8416ec9..d8416ec9 100755
--- a/Schaum's_Outlines:_Programming_with_C++/ch9.ipynb
+++ b/Schaum's_Outline/ch9.ipynb
diff --git a/Schaum's_Outlines:_Programming_with_C++/screenshots/ratio.png b/Schaum's_Outline/screenshots/ratio.png
index 68bb8cd0..68bb8cd0 100755
--- a/Schaum's_Outlines:_Programming_with_C++/screenshots/ratio.png
+++ b/Schaum's_Outline/screenshots/ratio.png
Binary files differ
diff --git a/Schaum's_Outlines:_Programming_with_C++/screenshots/swap.png b/Schaum's_Outline/screenshots/swap.png
index 7d707e37..7d707e37 100755
--- a/Schaum's_Outlines:_Programming_with_C++/screenshots/swap.png
+++ b/Schaum's_Outline/screenshots/swap.png
Binary files differ
diff --git a/Schaum's_Outlines:_Programming_with_C++/screenshots/vector.png b/Schaum's_Outline/screenshots/vector.png
index b51554ce..b51554ce 100755
--- a/Schaum's_Outlines:_Programming_with_C++/screenshots/vector.png
+++ b/Schaum's_Outline/screenshots/vector.png
Binary files differ