Saturday, August 27, 2011

Another Note to Self

In Android, to get things to center properly, use the android:gravity tag in the Layout surrounding it....


<LinearLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:orientation="horizontal"
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  android:gravity="center">
 
<Button   android:text="Add"
          android:id="@+id/button_dialog_set"
          android:textStyle="bold"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          >
</Button>
<Button   android:text="Cancel"
          android:id="@+id/button_dialog_cancel"
          android:textStyle="bold"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          >
</Button>
</LinearLayout>


Produces two buttons, centered, next to each other

Tuesday, August 23, 2011

GNU Octave plots

Because I can't afford Matlab, I have been experimenting with GNU Octave on my Linux computer.  It is very expandable via free packages, and seems more command line based.

Anyway, this entire post is to remind myself that you can capture plots via the 'print command' and the following syntax:

print -djpg filename.jpg ....it took a while to understand the help print command, and that you are specifying the 'device' via the print -dFILETYPE_OR_DEVICE syntax

In conclusion, here are some plots of the LMS algorithm converging on a static, unknown system:

Elements Converging

Error Converging

Thursday, August 18, 2011

Garden Success and Failure


Delicious, if small, carrots

Because in my mind, I'm preparing for the apocalypse, I started a garden.  It was a mildly successful mixture of the following:

  • peppers
  • onions
  • carrots
  • pumpkins
  • zucchini
  • lettuce
  • spinach
  • herbs
  • tomatoes

Spot the grasshopper

In review, there are some lessons learned:




1: Pumpkins and Squash have flowers that bloom for maybe 1.5 hours a day, and if they aren't pollinated, they die

2: BUGS oh the bugs.  Everyone is out to eat my vegetables.  Constant vigilance is required, inspecting all leaves for eggs or other abnormal signs

3: Spacing is important....one garden is full of tomato plants, zucchini, and some wildflowers.  A little too much, with no room to grow

4: Carrots grow to be as big as they can go deep.  I guess this made sense in retrospect.



Oh well, there is always fall crop