TinyURL widget - shorten your URL's for free!

Enter a long URL to make tiny:

Sunday, December 28, 2014

How to mount TV mount

Ok, I am no professional  but I've now installed a TV mount on three walls and no wall has fallen down yet. Nor TV. So here are my tips.

The first tip is don't let your wife make you move an installed TV.  My wife thought nothing of asking me to replace and move an already mounted TV.  In less time than it took her to come up with that, I figured out that would mean moving three TVs: take down one, install two, reinstall one.  No thanks. If you need a better excuse here's a real good one: these brackets are designed to be installed: once.  There is no guarantee the bolts will all work as designed if you replace them.  Mounting bolts most importantly.  You're looking at $30 in replacement bolts.

So my motto is new wall, new mount.

1. Wait till it goes on sale! This paid for the mounting bracket.



2. The most important part is not the brackets clamped onto the TV, it's making sure that the mounting screws are in dead centre of the 2 inch stud.  The fact is you're better off digging into the drywall to make certain that's right.  You don't want the TV falling if a screw gives way.  The drywall holes don't matter because the metal brackets cover it over. Use the stud finder to narrow down the studs, move left and right for the edges.

Once I get close and mark the outer edge of the stud I dig into the drywall.

I use a 1/2 inch drill bit to bore out the hole. It stops at the stud. You can see the full stud that way to make sure you are in the middle. If the hole is off centre I move the pilot screw over.


They tell you to hand crank the bolts and use soap to reduce friction. Use a smaller 3 inch screw to make a pilot hole. You see my stud finder marks and the pilot hole. The screw will go into the center of the stud thanks to a guide path.





























2. Plan for expansion when you mount it.




I found the marks for six mounting screws aligned for a larger TV. I used the rightmost two rows. You won't see the third row behind that TV and you can use it for extra mounting of shelves if you need it. You can shift the TV over to the centre.

3. They tell you to hand screw them in, but that will lead to more friction and you might wreck your work.



I use a ratchet to work in the guide hole. If the screw is not solid within 10 turns you don't have it centred in the stud or you are driving it crooked. Remove and dig into drywall more.

Then I remove the bolts to place the mounting bracket.

4. Get a kid to help hold it in place. Wives want to be the supervisor and tell you you're doing it wrong.  Kids just want to help and they are happy to hold it.


 Your prepositioned holes will make the first two go in smoother.  Take turns on the bolts. This reduces friction that might heat the bolt, switch bolts after half an inch to let them cool down. The ratchet makes it easy to snug them up to the bracket.

5. Don't worry about position until you are almost ready to snug them.


6.   You should be at this stage now.





7. Use vice grips with the screwdriver to mate bolts and nuts.  The metal they use is the bare minimum for weight, so the screw heads strip easily. I use the vice grip on the nut end to tighten not the screwdriver so it doesn't strip them as much.




8.Get that helper again and mount the TV. Turn it on before you throw anything away. Let the family clean it up, you've earned a break!


9.  Now you are ready to enjoy it.










Friday, November 14, 2014

How to include SVG graphics in latex compiles

Don't use latex, use pdflatex with  --shell-escape option

pdflatex --shell-escape condition-test

Example:  condition-test.tex


\documentclass{article}
\usepackage[inkscape=/usr/bin/inkscape]{svg}
\usepackage{amsmath}
\usepackage{etoolbox}

\newbool{EPUB}
\booltrue{EPUB}

\begin{document}
This is a test of the conditional change to SVG graphics for cards.

\begin{figure}[test]
      \centering
    \ifbool{EPUB}{\includesvg{queen-diamond-red}
    }{
    \includesvg{king-skull-black}
    }%
  \caption{svg image switch}%
\end{figure}

\end{document}
The  queen-diamond-red  SVG image.
https://www.dropbox.com/s/aug0drcrl45xj5h/queen-diamond-red.svg?dl=0

The King skull alternative SVG image.

 https://www.dropbox.com/s/3sw7tdsojydu3at/king-skull-black.svg?dl=0

Online Free HTML Editor with instant preview

http://www.w3schools.com/html/tryit.asp?filename=tryhtml_table

OK so you need to do a little HTML editing but you don't want to run any software or load it onto your machine?

Go to TryIt Editor from W3C Schools at the link above and edit an HTML text snippet online. 

Tuesday, November 4, 2014

Forcibly removing debian packages from ubuntu

If you have a broken package on ubuntu and you want to get rid of it, then you need to remove the bad package - in this file called PACKAGE - from the file  folder  /var/lib/dpkg/info/* . It holds the info files:

for example

nordugrid-arc-ldap-infosys.conffiles
nordugrid-arc-ldap-infosys.list
nordugrid-arc-ldap-infosys.md5sums
nordugrid-arc-ldap-infosys.postinst
nordugrid-arc-ldap-infosys.postrm
nordugrid-arc-ldap-infosys.prerm
These must all be moved out to avoid dpkg from exiting on error.

Run these commands on the Package to excoriate it:



mv /var/lib/dpkg/info/PACKAGE.* /tmp/
 
dpkg --remove --force-remove-reinstreq PACKAGE
  


Saturday, November 1, 2014

My complaints against LaTeX

There are a lot of real advantages to the LaTeX / TeX document preparation software suites developed for real publishing applications.  Those that know these tools can recite all of them to you at length. 

I am not going to describe them to you because they are well documented by people cheering for them.  I can't argue that LaTeX / TeX and so on can't be used to do many things.  I hope to be able to do these great things, presuming

The great things done are all based on one simple fact: you need to know the system, to understand them fully, and to spend a lot of time reading and researching to get all the arcane answers.

It's ultimate power is also it's greatest weakness.  The problem is that the knowledge is held by a cabal, a group of technocrats that look down their noses at you if you don't want to spend a lot of time getting acquainted with all the ways to use LaTeX. 

I used to be an apologist for a lot of problems in Linux or open source software, the fact that free and open are big assets to many projects.  But not everyone can accept the weaknesses that come with no support, little documentation, and a small community that could help you if they were still around to answer emails.  A lot of open source software dies on the vine because people aren't paid to develop it at school, they get bored or have a kid and so on. Without the monetary incentive it gets lost.  It's actually a great tragedy - code that wastes away without use.

Now, LaTex is the same kind of development, lots of power, lots of thoughtful users, but it still needs a lot of quaint specific knowledge.  And the possessors are mostly snobby and unhelpful. 

Most people use simple word processors because they don't want the hassle of learning to code their word processing.  LaTex and ilk requires an investment that most people don't want to make.  They aren't paid to learn processing - that can be solved by simpler software.

So it's a new fresh hell when you try to learn - because most people weren't educated with LaTeX  - most weren't in diapers when it was written.  It's hard to get help and the people that know this stuff don't waste their time improving documentation - especially new examples - to help those that need it. 

To sort this out, the LaTeX community must get past their egos and truly help people learn their system or it will end up in the open source graveyard. 

Saturday, October 11, 2014

Replace Audi Ax key fob battery



The new Audi keys have the same battery as Apple TV remotes : the CR 2032.
Front side has buttons. Back side is black plastic.

You take the chrome key out of the bottom with a button. Push button and pull out.  Inside the key on the front side there is another button on the other side inside of that recess. Push button and pull slide out to reveal the battery case.

Battery pops into holder.

Reverse operation to complete. 

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.

    Thursday, July 31, 2014

    Font OMS/jkp/m/n/10=jkpsy at 10.0pt not loadable: Metric (TFM) file not found Error Latex Fedora 18

    I was compiling the kpfonts into a LaTeX document on Fedora 18 and got the following errors:

    ...

    Font OMS/jkp/m/n/10=jkpsy at 10.0pt not loadable: Metric (TFM) file not found
    Font T1/jkp/m/n/10=jkpmn8t at 10.0pt not loadable: Metric (TFM) file not foun
    Font OT1/jkp/m/n/8=jkpmn7t at 8.0pt not loadable: Metric (TFM) file not found
    Font OT1/jkp/m/n/6=jkpmn7t at 6.0pt not loadable: Metric (TFM) file not found


    ...

    The full log entries look like this

    (/usr/share/texlive/texmf-local/texmf-compat/tex/latex/kpfonts/t1jkp.fd
    File: t1jkp.fd 2007/01/24 Fontinst v1.928 font definitions for T1/jkp.
    )
    ! Font T1/jkp/m/n/10=jkpmn8t at 10.0pt not loadable: Metric (TFM) file not foun
    d.
    <to be read again>
    relax
    l.24 \begin{document}
    I wasn't able to read the size data for this font,
    so I will ignore the font specification.
    [Wizards can fix TFM files using TFtoPL/PLtoTF.]
    You might try inserting a different font spec;
    e.g., type `I\font<same font id>=<substitute font name>'.

    ! Font T1/jkp/m/n/8=jkpmn8t at 8.0pt not loadable: Metric (TFM) file not found.
    <to be read again>
    relax
    l.24 \begin{document}


    I saw some posts claiming to install texlive-fontrecommend like this:

    sudo yum install texlive-collection-fontsrecommended texlive-times


    but they were updated and installed. The packages I installed were all wildcard * font packages like this:

    sudo yum install texlive-collection-fonts*

    then I ran

    sudo texhash

    and for Lyx I reconfigured and it worked.








    Friday, July 11, 2014

    Printing JPEG files to Epson XP-400 printer

    So I was trying to print out my tickets for the Rockstar Mayhem concert when the Windows machine I was trying to use stalled.

    http://rockstarmayhemfest.com/dates/phoenix-az-2

    So I used Fedora on my laptop to save the day.

    I couldn't get the pdf ticket files to print on the networked Epson XP-400.

    Instead, I loaded them into GIMP and exported them to JPEG format.  Unfortunately, that didn't work.


    In the Epson printer manual,
    (https://files.support.epson.com/pdf/xp400_/xp400_ug.pdf )
    it says:

    You can insert memory cards in your product containing files that meet these specifications.
    File format JPEG with the Exif version 2.3 standard Image size 80×80 pixels to 9200×9200 pixels
    Number of files Up to9990

    So I re-exported them and made sure they were in unoptimized uninterlaced format JPEG.  That worked, they were recognized.

    So convert PDF to raw JPEG, and load them onto an SD ram card and you can get the printer to print out pages.

    Wednesday, January 29, 2014

    USB Keyboard problems on the Dell Optiplex 9020 - use the mini-DIN ports!


    I had a problem getting the boot menu and the system menu to appear while rebooting a Dell Optiplex 9020.

    According to the manual here, the System menu in BIOS comes up with the F2 key and the boot menu comes up with the F12 key. But when I plugged a USB keyboard in, I could not get those options to appear before it booted Windows.

    I noticed mini DIN keyboard and mouse connectors on the back; Why would a brand new computer have a really old interface? So, I found a mini-DIN keyboard and plugged it in. It works, now you can get the data to the BIOS before the DOS / Windows takes over.

    My diagnosis is that the BIOS does not initialize the USB device in the proper sequence early enough so that you can use the keyboard in time, perhaps that's why they included mini-DIN interfaces? Great design feature, Dell!

    Friday, January 10, 2014

    Simple way to add doxygen to your GNU Autotools project

    [Edited with changes in Autotools 2016...]

    I tried Oren Ben-Kiki's doxygen support here and got some errors when trying doxygen generation inside a directory that wasn't source code directory because of the way it's configured. So here is my simple version:


    1. inside top source dir execute:

    doxygen -g

    to generate Doxyfile.

    2. copy that to Doxyfile.in

    3. edit Doxyfile.in with the following variables inserted where it makes sense:

    PROJECT_NAME = @PACKAGE@
    PROJECT_NUMBER = @VERSION@
    OUTPUT_DIRECTORY = doxygen
    down halfway in the doxygen.in file change
    INPUT = @SRC_SUBDIRS@

    Then, inside configure.ac insert:
    SRC_SUBDIRS = src
    # shell script to find directories
    for FILE in `ls -d src/*`
    do
    case "$FILE" in
    autom4te* ) continue ;; #
    doxygen* ) continue ;; # exclude doxygen dir
    *Makefile* ) continue ;; # exclude doxygen dir
    m4*) continue ;; #
    * )
    SRC_SUBDIRS+=" $FILE"
    esac
    done
    at the bottom of configure.ac:

    AC_SUBST([SRC_SUBDIRS])

    and make sure you add the target doxygen file (it will start with doxygen.in and generate doxygen)

    # OUTPUT STAGE
    AC_CONFIG_FILES([Makefile Doxyfile])

    Then inside your Makefile.am add:


    EXTRA_DIST += Doxyfile.in

    # simple doxygen target
    dox: Doxyfile.in
    doxygen Doxyfile


    # clean up the extras including doxygen
    clean-local:
    cd ${top_srcdir}
    rm -rf doxygen


    now when you
    make clean

    it will remove the doxygen directory.
    When you

    make dox

    it will run doxygen and make html and latex outputs. You will need to configure other changes to the doxygen to get specific output but this will get you started fast...

    GNU Autotools make dist-bz2

    If you are making a GNU autotools / automake package, the make command to make a bzip2 compressed distribution tarball is make dist-bzip2