This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # See also http://astropython.blogspot.in/2011/12/script-illustrating-how-to-do-linear.html | |
| import numpy, pylab, scipy | |
| import nemmen | |
| # Data taken from http://orion.math.iastate.edu/burkardt/data/regression/x01.txt. | |
| # I removed the header from the file and left only the data in 'testdata.dat'. | |
| xdata,ydata = numpy.loadtxt('testdata.dat',unpack=True,usecols=(1,2)) | |
| xdata=numpy.log10(xdata) # take the logs | |
| ydata=numpy.log10(ydata) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ######################################################################## | |
| # | |
| # Configuration file for Mac Os X (Darwin, serial) | |
| # | |
| ######################################################################## | |
| CC = gcc | |
| CFLAGS = -c -fast -finline-functions -Winline -Wundef | |
| LDFLAGS = -bind_at_load -lm |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ! Opens a datafile and reads the columns as arrays. | |
| ! Illustrates the use of dynamic allocated arrays. | |
| program test | |
| implicit none | |
| real, dimension(:), allocatable :: x, y | |
| integer :: i,n | |
| character(len=50) :: in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # | |
| # Convert Markdown to LaTeX | |
| # | |
| # Run this inside your document folder: | |
| # md2tex.sh <MARKDOWN FILE> <MAIN TEX FILE> | |
| # | |
| # where: | |
| # - <MAIN TEX FILE>: main latex file of your project | |
| # - <MARKDOWN FILE>: meat of text written in markdown |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ! Generates arrays of random numbers. Saves them as binary | |
| ! unformatted files. | |
| program test | |
| implicit none | |
| real, dimension(:,:), allocatable :: y | |
| integer :: n | |
| character(len=50) :: out |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # | |
| # Given a BibTeX file containing bibliographic references named | |
| # `refs.bib`, this script changes all bibtexkey fields from the | |
| # format "Yuan14" to "Yuan2014". | |
| # | |
| # Here, "Yuan" refers to the paper's first author surname and "14" | |
| # refers to the two last digits of the year when the paper was | |
| # published (the script follows precisely this pattern matching). | |
| # |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Gets a command-line argument that provides the number of | |
| elements in an array. Dynamically allocates the array. | |
| Generates random numbers and print them. | |
| Usage: | |
| args 10 | |
| will print out the 10 random numbers. |