TinyURL widget - shorten your URL's for free!

Enter a long URL to make tiny:

Thursday, October 2, 2014

How to make a butter knife when you are travelling abroad so you can make a peanut butter sandwich.

How do you get a knife from basic materials when you are at a hotel and just want a peanut and jelly sandwich?  Say you are in a foreign hotel. You couldn't carry a knife since you went through security. And hotels want you to buy a restaurant meal so there's nothing close not even tea spoons in most hotels.

You could go to corner stores but you can't buy a single plastic knife.

So here's a simple way.

Go to a local market and buy a set of plastic cups.

Plastic cups come in two varieties. Soft ones and hard ones.

For Hard ones, shatter the plastic cup bottom and then peel away one side for the knife.  You can bend it back and forth to make a sharp edge where you want it.


For Soft plastic cups, you bend the top rim so it has a crease, then take a pen and jab the side of the cup.  That will open the plastic and it will tear along the fibres.   Remove the bottom of the cup from the sides. For softer cups I would tear a larger sheet of plastic and fold it in half for more strength.

Now you can make that peanut butter sandwich on the cheap!


Friday, September 19, 2014

How to make clear path lines inside Google Earth paths

If you don't want to see the lines you make in Google Earth, there is little documentation on this aspect. 

I found one simple way to do it.

Select the Path from the Places subtab or inside the right-click menu from the path select the Properties

Then select Style, Color submenu

Then change the line width to zero and it will disappear.




Monday, September 15, 2014

Finding the overall minimum, maximum of an arbitrary matrix in MATLAB and/or Octave.

It's one logical step from what's presented in the GNU Octave Manual, but for a given arbitrary n-dimensional matrix, to find the overall minimum or maximum value within the matrix, you simply recurse the min() or max() function as many times as there are dimensions. So for a 3-dimensional matrix, recurse function calls to min or man three times like this min(min(min(X))))


Example:
 
size(out)
ans = 3 32 32
     min(min(min(out)))
ans = -0.99914
    max(max(max(out)))

    ans = 1











Removing Dimensions from Matrices in Octave or MATLAB - squeeze()

For many math applications you want to run through many variables all at once and gather data. Of course, having several variables that will lead to n-dimensional matrices.

For example I was converting from a spherical coordinate system to a Cartesian and experimenting with what the x,y,z coordinates would be for two changing angles.  This lead to a rank (3 by n by m)  3-dimensional matrix where first dimension is the xyz, the second is angle one and the last is angle two.  To get the matrix for any single variable, do the following: extract a submatrix and then use squeeze to get a single 3 by n or 3 by m matrix.

Example:

Let A = [3*n*m]  say=
size(A) = 3 32 32

a = A(:,1,m)   # takes single dimension matrix from 3*m*n using column one of second dimension

size(a) = 3 1 32

a = squeeze(a) 

size(a) = 3 32

squeeze() looks for the singleton dimension and then does the tedious  matrix copy and paste operations for you.


Of course this gives you one of many, then duplicate for the remainder.

Tuesday, September 9, 2014

Including SVG graphics into LaTeX documents.

The epub book format relies on XHTML / HTML / and MathML for converting from a page-based book like .pdf format or .dvi format into a scaled free-flowing page that can make for reading on a phone, tablet, or any size screen.

I am working on converting my book into XHTML with nice looking graphics.  The first attempts to make a .epub from .pdf caused a mess of a book.  The symbols go all over the page when they aren't locked into position.

The way I solved this was to convert all math equations into graphics - inline and display formulas - and then reinclude graphics into the .tex file rather than equations.

I found the svg package that acts like the graphicsx allowing you to

  \includesvg[<options>]{<svg filename>}
 
include svg image directly.
 
You can find the svg package on CTAN here  
 
 
For Ubuntu and Fedora,  this BASH shellscript should install and reconfigure texmf 

#!/bin/sh
# svg standard install script
# must be run inside the top  svg directory
# must be run as root or sudo root

mkdir /usr/share/texmf/tex/latex/svg
cp -rf * /usr/share/texmf/tex/latex/svg


texhash

Monday, August 4, 2014

Really Really useful LaTeX symbol list: The Great Big List of LaTeX Symbols.

One of the problems, disadvantages not really a problem, with using a modular word processing system like LaTeX is that with all the development spread out and independent like the Bazaar versus the Microsoft Office cathedral  (Eric S. Raymond) is that there is probably at least one solution for your problem - perhaps seven, but there is no single way to find them unless you comb through many many websites, searches etc. etc.

Well, here is one way to find things in LaTeX:  The Great Big List of LaTeX Symbols.

http://www.rpi.edu/dept/arc/training/latex/LaTeX_symbols.pdf


This is a good starting point for anyone looking for something, it should save many searches.

One way people can contribute without writing code is to make it easier for others to use.

Saturday, August 2, 2014

How to find apt in Ubuntu

So I was looking for the Xerces-c Compiler library so I could run blahtex and make a nicer epub for my poker book (below)




















because I wrote it with LaTex using Olaf's cool poker card style file.

The biggest problem with package management tools like yum and apt / apt-get  for linux and their databases of really what are source files is a very simple problem; over time the developers - all eager beavers - change the names or upgrade versions of that same library set and that causes people constant problem of finding the right packages to install.   The Linux user community is so large and effective that this is a constant problem.  Lots of people take on old software and make it better. Just try installing GCC and see what I mean.  Half my Google searches are a direct result of not knowing the name of the packages.

So today while working on my ubuntu machine, I found a way to search the database for a fragment that might make sense. 

  • apt-cache search libxerces

  • I was able to look into the database and find this:


     apt-cache search libxerces

    libxerces2-java - Validating XML parser for Java with DOM level 3 support
    libxerces2-java-doc - Validating XML parser for Java -- Documentation and examples
    libxerces2-java-gcj - Validating XML parser for Java with DOM level 3 support (native code)
    libxerces-c-dev - validating XML parser library for C++ (development files)
    libxerces-c-doc - validating XML parser library for C++ (documentation)
    libxerces-c-samples - validating XML parser library for C++ (compiled samples)
    libxerces-c2-dev - validating XML parser library for C++ (development files)
    libxerces-c2-doc - validating XML parser library for C++ (documentation)
    libxerces-c28 - validating XML parser library for C++
    libxerces-c3.1 - validating XML parser library for C++
    So if you are looking into a Debian/Ubuntu based distribution with apt then try the apt-cache search.