“Exporting” a project from a Git repository

What do you do when you want to distribute or release source code that is stored in a Git repository? Obviously, if your target audience is using Git, you can just compress the directory that contains the repository and distribute the copies, or give the users a way to clone your repository (such as GitHub). … Continue reading “Exporting” a project from a Git repository

Advertisements

Collaborative Git workflow: Shared Repository on a File Server

GitHub is a great tool for collaborating on projects. However, sometimes it is necessary to mimic the "GitHub workflow" using a shared repository on a local Linux server. The following example shows how I shared an example repository with multiple users.  We are also using the Git flow model for branching, aided by the handy … Continue reading Collaborative Git workflow: Shared Repository on a File Server

Tricks for Writing XML with Python 3

I've added a Python 3 XML example to my Shocksolution_Examples repo on GitHub.  The new example shows how to generate an XML file which functions as a template for building a GUI with wxGlade.  However, this example should be helpful for anyone who needs to create XML files with Python.  The full example is on … Continue reading Tricks for Writing XML with Python 3

Python string format examples

The format method for Python strings (introduced in 2.6) is very flexible and powerful.  It's also easy to use, but the documentation is not very clear.  It all makes sense with a few examples.  I'll start with one and add more as I have time: Formatting a floating-point number "{0:.4f}".format(0.1234567890) "{0:.4f}".format(10.1234567890) The result is the … Continue reading Python string format examples

Parsing INI configuration files with FORTRAN

Fortran would not be my first choice for working with text, in any form! However, sometimes even numerical codes need to read data from configuration files. The easiest way to read a configuration file from a Fortran 90 routine is by using namelist I/O (I really need to add an example of that). If you're … Continue reading Parsing INI configuration files with FORTRAN

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 … Continue reading A git branching strategy suitable for large projects

Replacing text in place with GNU sed

sed is a stream editor, which means that it accepts a stream of text, processes it, and spits out another stream of text.  sed can process files that are too large to load into memory, and it is a completely command-line tool that can easily be integrated into shell scripts.  This excellent sed tutorial was … Continue reading Replacing text in place with GNU sed

A self-contained Fortran linear equation solver

I've just released a self-contained Fortran module that solves a system of linear equations using the LU decomposition. Download the Fortran linear solver from github This module is based on code that was implemented and released on the Web by Jean-Pierre Moreau.  His implementation was based on one of the Numerical Recipes books.  I updated … Continue reading A self-contained Fortran linear equation solver

Finding a value in an unordered Fortran array

I have been optimizing some Fortran code that involved searching for an integer value in an unordered array (we know the value occurs only once).  Since there is no intrinsic procedure to accomplish this, I thought I'd try a couple of approaches to see which was fastest.  The simple answer is that, in this case, … Continue reading Finding a value in an unordered Fortran array