Posts
LaTeX
LaTeX is the the best way to create technical documents. I’m using it to write my dissertation at the University of Central Florida (I have already used it to write my Master’s thesis). This time, I’m writing my own document class. The existing unofficial UCF class uses a lot of raw TeX to achieve its formatting goals. It’s hard to read and does not work well with modern LaTeX packages. My new document class is much cleaner and simpler, uses no TeX, and requires only standard LaTeX packages that come with every distribution.
Removing an axis or both axes from a matplotlib plot
Sometimes, the frame around a matplotlib plot can detract from the information you are trying to convey. How do you remove the frame, ticks, or axes from a matplotlib plot? matplotlib plot without a y axis
Some books you may find useful when working with matplotlib:
The full example is available on github.
First, we construct a figure and an axes object:
fig1 = plt.figure(facecolor='white')
ax1 = plt.axes(frameon=False)The Axes object is a container that holds the axes, the ticks, the labels, the plot, the legend, etc. You will always have an Axes object, even if the axes are not visible! The keyword argument frameon=False turns the frame off. An alternative method is:
A git branching strategy suitable for large projects
Git is an amazing tool…but what is the best way to use it? Like any tool that gives you great power and flexibility, it’s up to you to use the tool in the best way to suit your purpose. A friend of mine who manages an enterprise-class software development team recommended the git branching strategy explained in this blog post. I highly recommend reading it.
Running Sage on Windows with VirtualBox
The easiest way to run Sage on Windows is with a virtual machine. Sage is a collection of tools that were primarily developed for UNIX-based operating systems (such as Solaris or Mac OS X) or UNIX-like operating systems (BSD, Linux, etc). Since a standard Windows installation lacks many of the features provided by a UNIX-like environment, Sage is packaged as a Linux virtual machine. You need free virtualization software–VMWare Player or VirtualBox--to run the virtual machine. I find VMWare Player easier to work with, but it’s not an open-source solution. VirtualBox is truly free software, but it’s also harder to configure. When you download Sage, you can choose between a .ova file (for VirtualBox) or a zipped VMware virtual machine. The easiest thing to do is choose the appropriate format for your VM. However, it’s also possible to run the VMware image on Virtualbox, and I’ll show you how. If you want to learn more about Sage, check out the Sage Beginner’s Guide from Packt Publishing. Download, install, and run VirtualBox, and then click the “New” button to get started. Also, unzip the .zip file that contains the VMware virtual machine. VirtualBox Manager
Numbering equations in Word 2007
Microsoft Word isn’t the best software for technical writing, but sometimes we have to use it. Here is the best way I’ve found to emulate the automatic equation numbering that LaTeX has been doing for years:
Insert an equation (old-style)
Use the Object button on the Insert tab to bring up the dialog box. Choose Microsoft Equation 3.0 and enter an equation. Insert equation
Python: lists to tuples and tuples to lists
Get the code for this example The zip function in Python accepts a number of sequences (such as lists or arrays) and returns a list of tuples. The first element of each tuple comes from the first sequence, the second from the second sequence, and so on. For example: [code language=“Python”]a = range(0, 5) b = range(5, 10) c = range(10, 15) sequence_of_tuples = zip(a, b, c) print(sequence_of_tuples)[/code]
[(0, 5, 10), (1, 6, 11), (2, 7, 12), (3, 8, 13), (4, 9, 14)]Blog infrastructure updated
I’m almost finished with a round of updates to the infrastructure of this site. I upgraded Wordpress and changed my hosting from a friend’s virtual server to Linux hosting with GoDaddy.com. The price is right and so far the service has been great. I’ve used GoDaddy for domain name registration for many years. [ad#GoDaddy Hosting] Comments are now protected with reCaptcha to try to reduce the amount of link spam that I have to sort through. If you have a problem posting a comment, or notice any other aspect of the site that is “broken,” please contact me at the email address shown on the About page. I still have a bit of work to do on updating my theme to take advantage of the features of Wordpress 3.
Finding dimensions of a bounding box in Jmol
The Jmol applet (or Java application) is widely used to visualize the structure of molecules. It is very powerful, but not that well documented. If you don’t have Jmol running, open the page for Glucose Oxidase (1CF3) from the Protein Databank so you can follow the instructions for finding the size of the bounding box. Right-click on the applet to get a pop-up menu with lots of options. Under the Stylesubmenu, click onBoundboxto show a bounding box around the molecule: Show bounding box
Sage Beginner's Guide: Code and Errata
Sage is a free open-source mathematics software system. It’s a GPL alternative to commercial software such as Magma, Maple, Mathematica and MATLAB. Sage is a research-grade tool, cited in nearly 100 academic research articles (with dozens more in press). I’ve written a book to help engineers, scientists, and students get started with Sage. It’s available in print and e-book formats. Please check it out!
Code
I am aware that there are a number of issues with the code bundle that is available on the Packt site, but I have not been able to get the publisher to replace it.