Monday, October 31, 2011

Matrix Multiplication is Associative

Showing \( \left( A B \right) C = A \left( B C \right) \) is relatively a simple matter using the super duper summation convention.
Firstly the ith row, jth column of a matrix \( A \) is designated by \( A_{ij} \), \( A^{i}_{j} \) or \( A^{ij} \). Matrix multiplication is then defined as $$ \left[ XY \right]_{ij} = X_{ik}Y_{kj} $$ where square brackets have been placed around \( X Y \) to designate the \( i j \) element of the matrix \( X \cdot Y \). \begin{aligned} \left[ \left( A B \right) C \right]_{ij} & = \left( A B \right)_{ik} C_{kj} \\ & = A_{il} B_{lk} C_{kj} \\ & = A_{il} \left( B_{lk} C_{kj} \right) \\ & = A_{il} \left[ B C \right]_{lj} \\ & = \left[ A \left( B C \right) \right]_{ij} \\ \therefore \left( A B \right) C & = A \left( B C \right) \end{aligned}

Sunday, October 30, 2011

Matrix Inverses are unique

Left Inverse = Right Inverse

Let \( A \) be an \( n \times n \) matrix and \( AB = \mathbb{I} \), so that \( B = A^{-1} \).
It follows that \( BA = \mathbb{I} \)...
\begin{aligned} AB & = \mathbb{I} \\ B \left( AB \right) & = B \mathbb{I} \\ \left( B A \right) B & = B \\ \therefore \left( B A \right) & = \mathbb{I} \end{aligned}

Inverses Are Unique

Suppose another inverse of \( A \) existed, \( C \), so that \( AC = CA = \mathbb{I} \).
It follows that \( B = C = A^{-1} \)...
\begin{aligned} A B & = \mathbb{I} \\ C \left( A B \right) & = C \mathbb{I} \\ \left( C A \right) B & = C \\ \left( \mathbb{I} \right) B & = C \\ \therefore B & = C \end{aligned}

Tuesday, March 22, 2011

GCC stuff

I've often had to build some programs from source have been a little confused as to what shared libraries, static libraries, .a files, and .so files are, and how they relate to the -I -L -l options for GCC. A wonderful website that cleared all this up for me is http://www.network-theory.co.uk/docs/gccintro/index.html, here are some notes I've just scrapped down for my own reference

What is a Library
A library is
  • Useful code that has been compiled already 
  • Hence saves having to recompile that same bit of code
  • Can be used (linked to) in other programs or by other people
  • DRY (don't repeat yourself) principles - don't need to reinvent the wheel for universal functions. Eg you don't want to have to program how to draw a window with the maximize, minimize, close buttons for every program you make, so instead you can link to the windows libraries.
Static vs. Shared (Dynamic)
Static Library
  • Stored in archive .a files
  • Machine code for external functions is copied directly to your final executable
  • Makes your executable larger
  • (makes it easier to give to friends, they don't need library installed?)
Shared Library
  • Stored as shared object .so files 
  • Only a table of functions used is stored in your exe
  • when your exe starts, it loads up the linked libraries into memory (dynamic linking)
  • Final exe is smaller
  • OS will load the linked library into virtual memory, this can be used by multiple programs at once - saving memory usage
  • Can update library without recompiling code (unless the APIs change)

Thursday, March 10, 2011

RSA

Can not serve alcohol to
  • Minors
  • Intoxicated people
Standard Drink
Contains 10 grams of alcohol
  • 30ml of Spirits (1 shot)
  • 60ml of Port or Fortified Wine
  • 100ml of red, white or sparkling wine
  • 285ml of full strength Beer (Pot)
BAC
Blood Alcohol Concentration = number of grams of alcohol per 100ml of blood. So a BAC of 0.05 means 0.05g of alcohol in 100ml of blood.

Minors
Can be on licensed premises if
  • accompanied by an adult
  • partaking in a meal
  • they live on premises
  • employed there (but can't be serving liquor)
  • are doing work experience or training program
  • the premesis has a Restaurant and Cafe licence and it is before 11.00pm
Can have an alcoholic drink if
  • they are partaking in a meal and
  • are in the company of a spouse (must be married), parent or legal gaurdian
Proof of Age
  • Australian Drivers Licence
  • Australian or Foreign Passport
  • "Proof of Age" card or equivalent 
  • Victorian Learners Permit
  • Keypass Card
Packaged Liquor
Minors can't be employed to supply liquor, however they can be employed to deliver packaged liquor off the premises to somebody over 18 y.o. Eg. Can carry slabs to customer's car.

Can not sell to intoxicated person.

Secondary Supply
Can't sell liquor to a minor or to somebody where there are reasonable grounds to think that they are purchasing alcohol for a minor. For example
  • 18 y.o in store making a large purchase with a couple of 17 y.o mates
  • parents purchasing liquor for a child
  • you decline to serve minors and a short time later an adult enters the store and makes the same order
FINES
Minors illegally on a licensed premises $7,164
Server illegally supplies liquor to minor $1,194
Licensee illegally supplies liquor to minor $7,164
Licensee illegally allows minor to supply liquor $7,164
Licensee supplies liquor to an intoxicated customer $14,328
Adult purchases liquor for minors $7,164

Wednesday, March 2, 2011

Liqueur Coffee

Liqueur Coffee

Build / Layer

  • 30ml Liqueur/Spirit (Kahlua)
  • Bar Spoon Sugar (optional)
  • Hot Coffee
  • Cream (Make sure cream is aerated and shaken with ice then strained)
Serve in a Wine Glass (or Martini Glass) with a Coffee Bean for garnish

LinkWithin

Related Posts with Thumbnails