Skip to content

Commit

Permalink
More codes for future reference.
Browse files Browse the repository at this point in the history
  • Loading branch information
Srinath Vadlamani committed Aug 22, 2011
1 parent 450ad2a commit 0423ff4
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 7 deletions.
1 change: 0 additions & 1 deletion codingTests/cplusplus/File.txt
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
4, hello, hello, yes, below, "try", file, crap, yestereda, big,
Binary file modified codingTests/cplusplus/filewrite
Binary file not shown.
Binary file modified codingTests/fortran90/hello1
Binary file not shown.
2 changes: 1 addition & 1 deletion codingTests/macOSx/lt1/README
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ Particularly, we want to:
3) link to an executable
4) all while using common global symbols.


gcc -c a.c b.c; rm -rf libab.a a.out; ar -q libab.a a.o b.o; gcc m.c libab.a
3 changes: 2 additions & 1 deletion codingTests/macOSx/lt1/a.c
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
int *g=0;
int *g;
//int *g=0; // This initialization allows for the library to work.
5 changes: 2 additions & 3 deletions codingTests/macOSx/lt1/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
# 2006, see the COPYRIGHT file for more information.

## This puts the cvs ID tag in the output configure script.
AC_REVISION([$Id: configure.ac 714 2011-04-22 18:02:17Z pletzer $])
AC_REVISION([$Id: configure.ac 714 2011-04-22 18:02:17Z srinath $])

## Running autoconf on this file will trigger a warning if
## autoconf is not at least the specified version.
AC_PREREQ([2.59])

## Initialize with name, version, and support email address.
AC_INIT([libcf], [1.0-beta1], [[email protected]])
AC_INIT([macosxlibs], [1.0-beta1], [[email protected]])
AC_CONFIG_MACRO_DIR([m4])

AC_MSG_NOTICE([libcf AC_PACKAGE_VERSION])
Expand Down Expand Up @@ -49,7 +49,6 @@ AC_CONFIG_HEADERS([nfconfig.inc:nfconfig.in],
AM_INIT_AUTOMAKE([foreign no-installinfo subdir-objects -Wall])

# Check for the existance of this file before proceeding.
AC_CONFIG_SRCDIR([src/nccoord.c])

AC_MSG_NOTICE([checking user options])

Expand Down
2 changes: 1 addition & 1 deletion pythonTools/newClass.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class simplePrint:
"print the input to screen"
def __init__(self):
pass
def what(toPrint):
def what(self,toPrint):
print "You say " + toPrint


Expand Down
Binary file modified pythonTools/newClass.pyc
Binary file not shown.
38 changes: 38 additions & 0 deletions pythonTools/plotting/mpltools.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
from numpy import *
import pylab as p
#import matplotlib.axes3d as p3
import mpl_toolkits.mplot3d.axes3d as p3

# u and v are parametric variables.
# u is an array from 0 to 2*pi, with 100 elements
u=r_[0:2*pi:100j]
# v is an array from 0 to 2*pi, with 100 elements
v=r_[0:pi:100j]
# x, y, and z are the coordinates of the points for plotting
# each is arranged in a 100x100 array
x=10*outer(cos(u),sin(v))
y=10*outer(sin(u),sin(v))
z=10*outer(ones(size(u)),cos(v))


fig1=p.figure(1)
ax = p3.Axes3D(fig1)
ax.plot_wireframe(x,y,z)
ax.set_xlabel('X')
ax.set_ylabel('Y')
ax.set_zlabel('Z')


# this connects each of the points with lines
fig2=p.figure(2)
ax = p3.Axes3D(fig2)
# plot3D requires a 1D array for x, y, and z
# ravel() converts the 100x100 array into a 1x10000 array
ax.plot3D(ravel(x),ravel(y),ravel(z))
ax.set_xlabel('X')
ax.set_ylabel('Y')
ax.set_zlabel('Z')
fig2.add_axes(ax)

p.show()

0 comments on commit 0423ff4

Please sign in to comment.