Wednesday, December 28, 2011

30 Day Voice Over Trial - Day 21

I decided to quit early.  I wasn't satisfied with the sound quality, and I'm unwilling to buy a microphone.  I'm also just kind of bored with it, and there's no point in forcing it.  I learned a lot and had some fun.  I call it a win.

Monday, December 19, 2011

30 Day Voice Over Trial - Day 12

This time I went back to trying to copy a good voice that was closer to my own.  I think his still has more bass in it, but its close.  I don't have the words for what I mean actually.  Its not that the pitch is lower, it just has more oomph behind it.  Maybe I'm thinking of timbre.  Anyway, here's his (start at :40):



And here's mine:



I recorded it MANY times trying to match and trying my own.  I eventually settled on this.  I had a lot of things to fine tune.  Because of my lack of professional hardware, I think my mic is always going to be my bottleneck.  It seems to distort quickly at medium-high volume.  I just softened my volume for the final cut.

I grabbed a music loop that seemed to match the tone of the commercial.  It wasn't the same at all as the original, but still seemed to fit.

I transcribed the words this time, but always have the problem of actually seeing them while recording in garage band.  I used the Air Display app on my iPad with the Mac to just show TextEdit on the iPad while I kept garage band open on the Mac.  Perfect.

I still have problems getting the volumes correct between the music and vocal tracks.  It sounds correct in garage band, but when I export the m4a, its way off.

The other thing I did was add a fade out at the end.  Pretty simple.

I learned that my enunciation isn't as good right off the bat.  I need to work on that.  I still need more modulation.  When I go up, it sounds a bit strained too.

Saturday, December 17, 2011

30 Day Voice Over Trial - Day 10

I wanted to copy one of the movie trailer voice overs; so, I found the Geico commercial with Don LaFontaine.  I thought it would be neat to just record my voice right over his; so, I figured out how to get the youtube audio into garage band (see steps below).

Original from youtube:



My audio dubbed over on soundcloud recorded in garage band:



Steps to get audio from youtube into garage band:

  1. Install Google Chrome extension: https://chrome.google.com/webstore/detail/ebidjllhlibdgnenghhnlkmffolcklnj
  2. Reload youtube video in a tab
  3. Download as mp3
  4. Drag mp3 into an open garage band project
I tried a lot harder to get this one right.  I re-recorded a ton of times.  I eventually stopped trying to get the nuance of his voice and just focus on inflection and pace.  I learned a lot more about garage band and editing the tracks.  I figured out how to mute tracks, delete chunks of tracks, adjust volumes of individual tracks to make everything match, mess with different voice effects.  I even got to add a neat cinematic sound loop under my vocals to give it more drama like LaFontaine's.  That sound loop dramatically increased the quality.  If you tried to submit a commercial demo without the sound, you'd be stupid.

Thursday, December 15, 2011

30 Day Voice Over Trial - Day 8

I haven't found a mentor (I've barely looked), but I decided to just try out my idea of reading the blogs that I like.  I started with a popular blog by Tim Ferriss: The Art of Letting Bad Things Happen (and Weapons of Mass Distraction).  To get over myself, I decided to just open up garage band and record the thing without any prep work.  That's not really true though, because I went through at least 5 other blog posts before deciding on this one.  Here's what I got:



Towards the end, I had to keep re-recording sections because I would mess something up.  Not sure if my focus dies off that quick, or I just started noticing things.  A few things I noticed/learned:

  1. My tone got more natural very fast.  I was sort of doing "announcer guy" in the beginning, but got a little bit more conversational (which is more appropriate for this blog).  I fluttered back and forth with this.  I usually fell back to more stiff when I was concentrating on something specifically.
  2. I smacked my lips a bunch in the beginning.  After having to re-record a few sections, I heard myself doing it.  You can hear that I did it much less in the last half.
  3. As I get more relaxed, my voice raises pitch a bit, back into my normal speaking range.  It sounds better there too.
  4. I think I have a bit of back-of-the-through, nasal sound in my voice.  I should work on moving the "forward".
  5. There were a few sentences that sounded very bad when read aloud.  I had to to figure out where to put the accent(s).
  6. I learned a few things in garage band:
    1. Record/play/back up shortcuts
    2. You can just start recording over an existing part of a track.  No need to delete anything.
    3. So far the easiest way to get a project into soundcloud is to export to disk.  This creates an .m4a which is accepted by soundcloud.
I'm not even getting my 1hr/day average so far (I spent longer on this blog post than I did recording), but it's nice to get something out there.

Monday, December 12, 2011

30 Day Voice Over Trial - Day 5

I'm pretty much sucking at this.  I'm not event forcing myself to record something stupid or call one of these voice/acting teachers.  Weak.  I didn't do anything yesterday or today.

Sunday, December 11, 2011

30 Day Voice Over Trial - Day 4

Having a short timeframe might make the coaching/training part of this harder.  Finding/contacting/meeting with a coach could take a lot of time (still haven't been in contact with anyone).  Considering I only 30 days, I might not get the full benefit of a mentor.

It occurred to me after reading that voice over/acting is a subset of acting.  Furthermore, my immediate, obvious shortcoming so far was a lack of dynamics in my voice.  That's the non-actor in me.  Here's a few more places I'm looking to contact with that in mind:

Saturday, December 10, 2011

30 Day Voice Over Trial - Day 3

I read some more blog posts and looked up a few books that I could read on voice over (aka voice acting).  I decided to get some audio down.  I transcribed the beginning of a great demo I found on SoundCloud (Anthony Gettig Commercial Voiceover Demo by anthonygettig).  Then I recorded a bit of me doing it in GarageBand.  I uploaded it to SoundCloud.

VO Trial - Day 3 - Commercial Voiceover Demo by Jeremy Barth

The main problem I think I have so far is a lack of pitch variance.  My highs aren't high enough specifically.  It takes the excitement out.

As soon as I had GarageBand ready to record, I realized something that I hadn't considered before.  I was extremely self-conscious about doing the voice.  Its not even a different voice than mine, but I had to wait until Angela left.  I could barely get more than a couple of takes.  I need to get over that.

Friday, December 9, 2011

30 Day Voice Over Trial - Day 2

So, I've decided to go through with this trial.  Ever since Steve Pavlina started posting about his 30 Day Music Trial, it got me jealous that I hadn't tried anything brand new for a while.

I've wanted to do voice over stuff since high school, but never had the balls to try anything.  That's what this trial is about: a small commitment to try it out with no obligation to continue past the 30 days.  Hopefully it will work out great, and I'll become the next movie trailer voice, but either way, I finally did something.

Today I read those Steve Pavlina posts about the 30 day trial just to get some tips.  Not much there I needed.  The other main thing I did was decide that I want to contact Dave Courvoisier (http://courvo.com/ http://www.courvo.biz/) to help guide me a bit.  Dave is a great voice over talent that lives here in Vegas.

Thursday, December 8, 2011

30 Day Voice Over Trial - Day 1


I read http://expertenough.com/778/practice-like-an-expert and http://expertenough.com/658/becoming-an-expert and it re-inspired me to try my hand/voice at doing voice over work.  These articles emphasized having an expert mentor.  I think that's what I've skipped in other pursuits.  

So I started by googling 'las vegas voice over'.  I found http://www.courvo.biz/ which made me excited about doing audio books.  They're mostly done from home, but the money doesn't get that good until you're pretty established.  I need to ignore the money for the 30 day trial though.  

His site also directed me to http://patfraley.com/ who is a top voice over coach in LA.  He has a ton of free videos and a bunch of training stuff you can buy.  In some of the videos I watched, I learned some good stuff:
  • Skills + Personal Style + Demo + Marketing = $$$
    • Demo is 3 x 1 min excerpts
  • Mimic/Matching might be a good fit, because I already do that and it can pay well.
  • Learn the rules, but use your limitations to make money.  For me, my scientific, slightly monotone voice could work better than a trained actor for non-fiction books (or stuff like that).
  • Its important to train the entire vocal range for injury prevention (like stretching).


I have a few ideas:
  • Start a blog (or just post links to some sound sharing site) of me reading some popular blogs (4hww, seth godin, steve pavlina, etc).  I need to look up the legal on that.
  • Find a local voice over mentor.
  • Definitely post recordings publicly (daily if possible) and get as much feedback as possible.
  • Find out what gear I can borrow.

I created a SoundCloud.com account http://soundcloud.com/jeremyjbarth and recorded a couple words.  It actually didn't sound that bad, so maybe I can skip the hardware stuff for this trial.

Monday, October 10, 2011

Rails 3.1 Simple Custom Authentication and CanCan Authorization

After adding a simple blog to my Rails 3.1 app, I needed to add security to lock it all down. I'm writing this app for someone else, so a degree of user-friendliness was desired.

My 'requirements' were login with admin account. Anyone can read posts, read comments, and add comments. Admins can add, update, and delete posts. Admins can also remove comments. For usability, the links for these actions should be hidden unless the user is an admin. Of course the urls and actions should be locked down as well.

I decided to write the authentication part from scratch following railscasts Authentication in Rails 3.1 and Authentication from Scratch. For my purposes, I just need one admin account. I don't need to sign up users or any other ui for managing users. I figure, I can create the admin account from the command line, and that'd be about it. So, I skipped the parts from railscasts above that created views for User. I did create a login page of course (no logout).

Here are the authentication commands and code:

User
rails g model user email:string password_digest:string

class CreateUsers < ActiveRecord::Migration
  def change
    create_table :users do |t|
      t.string :email
      t.string :password_digest

      t.timestamps
    end
  end

end

class User < ActiveRecord::Base
  has_secure_password
end
Sessions
rails g controller sessions new

class SessionsController < ApplicationController
  def new
  end
 
  def create
    user = User.find_by_email(params[:email])
    if user && user.authenticate(params[:password])
      session[:user_id] = user.id
      redirect_to posts_path
    else
      flash.now.alert = "Invalid username or password"
      render "new"
    end
  end

end
views/sessions/new.html.erb

<h1>Login</h1>
<%= form_tag sessions_path do %>
<div class="field">
  <%= label_tag "Username" %>
  <%= text_field_tag :email, params[:email] %>
</div>
<div class="field">
  <%= label_tag :password %>
  <%= password_field_tag :password %>
</div>
<div class="actions">
  <%= submit_tag "Login" %>
</div>
<% end %>
BlankRailsMysql::Application.routes.draw do
  resources :sessions
  resources :posts do
    resources :comments
  end

  get "login" => "sessions#new", :as => "login"
end
At this point, a user (if one existed) could go to localhost:3000/login and it would authenticate them and save their user id to the session. By the way, here's the command to add a user:
rails c
User.create(:email => "admin", :password => "password", :password_confirmation => "password")

If you need to run this in your heroku environment, just do:
heroku run rails c --app your_app

Sunday, October 9, 2011

Rails 3.1 Asset Pipeline on Heroku

After updating my Rails 3.0.4 app to 3.1 on Heroku, I wanted to use the built in SASS functionality.  What I didn't realize was that you have to also use the asset pipeline to get the built in support.  I had skipped this in my previous step.  Using the same railscast, I converted my app to use the asset pipeline.  This did not work on heroku.

Long story short, you need to use the cedar stack on heroku for the asset pipeline to work well.  Here are the commands I saved for creating new apps on heroku in the future:

heroku create app_name --addons custom_domains -r git_remote -s cedar
heroku run rake db:migrate --app app_name
heroku domains:add www.your_domain.com --app app_name
change dns entry to point to app_name.heroku.com

Heroku References:
http://devcenter.heroku.com/articles/custom-domains
http://devcenter.heroku.com/articles/rails31_heroku_cedar

Friday, September 30, 2011

Upgrading to Rails 3.1 from Rails 3.0.4 with MySQL on Heroku

I ran into a few issues when trying to update my Rails 3.0.4 app to Rails 3.1.0.  I was using a MySQL database (all vanilla stuff) and heroku.  This all worked fine.  I wanted to try SCSS and found that Rails 3.1 has built in support for it; so, I decided to upgrade.  Here's what I did:


Watched the railscast for upgrading: http://railscasts.com/episodes/282-upgrading-to-rails-3-1  Which instructed me to follow these steps:

  1. Change Gemfile rails version to 3.0.10
  2. bundle update
  3. make sure it still works
  4. Change Gemfile rails version to 3.1.0
  5. Comment out line in development.rb: config.action_view.debug_rjs
  6. bundle update
  7. make sure it still works
This is where I got my first issue.  It said the mysql2 gem was too old (mine was < 0.3).  I change the Gemfile to use the newest version and ran 'bundle update' again.  

Then there was another issue related to the mysql2 bundle pointing to the correct library.  This is a common issue running on OS X I guess.  Here's the fix and the link where I got it: http://freddyandersen.wordpress.com/2010/10/03/mysql-5-5-snow-leopard-and-rails/

sudo install_name_tool -change libmysqlclient.18.dylib /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/local/lib/ruby/gems/1.9.1/gems/mysql2-0.3.7/lib/mysql2/mysql2.bundle
At this point I can run the app as normal locally.  The next step was to push to heroku.  I created a separate heroku location in case I ran into issues or if they used a different stack for 3.1 vs 3.0.x.  I'll skip those steps.  The error I got when I pushed was: `rescue in establish_connection': Please install the postgresql adapter: `gem install activerecord-postgresql-adapter` (pg is not part of the bundle. Add it to Gemfile.) (RuntimeError)
Unbeknownst to me, heroku actually uses postgress and not mysql.  I guess it just worked before.  I didn't really want to change my local stuff if I didn't need to so I found a solution here: http://stackoverflow.com/questions/6410623/heroku-error-when-launch-rails3-1-app-missing-postgres-gem
The actual fix was to just add the below to the Gemfile and run bundle with the '--without production' flag:
group :production do
  gem 'pg'
end
After that pushing to heroku worked fine.
P.S. I must have run heroku db:migrate at some point, but I can't remember when.  I think it was before I got the postgress error.

Pretty Print XML in Java

I got my solution from http://stackoverflow.com/questions/1264849/pretty-printing-output-from-javax-xml-transform-transformer-with-only-standard-ja

import javax.xml.transform.OutputKeys;

import javax.xml.transform.Source;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;

Transformer transformer = TransformerFactory.newInstance().newTransformer(); 
transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
transformer.setOutputProperty(OutputKeys.INDENT, "yes");

Source xmlInput = new StreamSource(new StringReader(xml));


StreamResult xmlOutput = new StreamResult(new StringWriter());
transformer.transform(xmlInput, xmlOutput);
System.out.println(xmlOutput.getWriter().toString());

Thursday, August 4, 2011

Simple Session Timeout Handling with Seam/JSF/Facelets

I took Christian's great post http://relation.to/Bloggers/ImplementingGracefulSessionTimeoutWithSeamJSFAndJQuery and simplified it for my use.  My solution uses the same session checking mechanism, but assumes all pages should be handled the same, and that we just want to kick the user back to the landing page instead of the fancy stuff Christian did. Leave a comment if you need any of the code explained.

I'm assuming you're using Facelets, so you have some layout.xhtml (or whatever) that all your pages are using.  Just add this to the <head>:

<s:remote include="httpSessionChecker"/>
<script type="text/javascript">
var sessionChecker = Seam.Component.getInstance("httpSessionChecker");


   function alertTimeout(newSession) {
       if (newSession) {
           clearInterval(sessionTimeoutInterval);
           window.location = '#{facesContext.externalContext.request.contextPath}';
           alert('Your session has expired.  You have been logged out.');
       }
   }


        var sessionTimeoutInterval = setInterval('sessionChecker.isNewSession(alertTimeout)', '#{httpSessionChecker.timeout}'*1000+3000);
</script>


For Seam Remoting, add the jboss-seam-remoting.jar to your project and this to your web.xml:

 <servlet>
  <servlet-name>Seam Resource Servlet</servlet-name>
  <servlet-class>org.jboss.seam.servlet.SeamResourceServlet</servlet-class>
 </servlet>
 <servlet-mapping>
  <servlet-name>Seam Resource Servlet</servlet-name>
  <url-pattern>/seam/resource/*</url-pattern>
 </servlet-mapping>



Create the HttpSessionChecker (modified from Christian's):


@Name("httpSessionChecker")
@Scope(ScopeType.APPLICATION)
public class HttpSessionChecker {

@WebRemote
    public boolean isNewSession() {
return ServletContexts.instance().getRequest().getSession().isNew();
    }

public int getTimeout() {
return ServletContexts.instance().getRequest().getSession().getMaxInactiveInterval();
}
}

For simplicity and safety, your best bet is to match all of the timeout times.  You want to match your web.xml, components.xml, and the server timeout.  Here's 30 minutes for all of them (a normal default):

  • your web.xml
 <session-config>
  <session-timeout>30</session-timeout>
 </session-config>
  • components.xml
<core:manager concurrent-request-timeout="500"
conversation-timeout="1800000" conversation-id-parameter="cid"
parent-conversation-id-parameter="pid" />
  • C:\jboss-5.1.0.GA\server\default\deployers\jbossweb.deployer\web.xml
   <session-config>
      <session-timeout>30</session-timeout>
   </session-config>

That should be it.  Now if they leave any page for 30 minutes, it will redirect them to the landing page, and alert them that their session expired.  Its not fancy, but its a good default to start with.

Wednesday, June 29, 2011

Las Vegas Startup Weekend June 2011

http://lasvegas.startupweekend.org/

I attended on the Technical track.  I think it was about 50% Technical and the rest were mixed backgrounds.  It was a lot of fun and I learned a lot.  I even got to meet Tom from MySpace and Kevin Rose (milk.com, digg.com, etc).  Kevin is much taller than you might expect.  I've only seen him on The Random Show with Tim Ferriss.

It was interesting to be in demand.  Many of the folks pitching ideas were vying for me to work with them.  Initially, it didn't seem like there were any standout ideas; so, I struggled to pick where I wanted to work.  I was proven wrong by presentation day.  I think I just didn't get the other ideas.

I ultimately chose to work with bloomworlds.com on a Family Friendly Android App Store.  They had already done a good amount of work on the business model and website for this prior to the weekend; so, we were not eligible for the competition :(  The main piece that they wanted me to fill was the app store client, which is an android app.  This was an exciting challenge to learn how to write android apps in 2 days.  We eventually got the functionality we wanted working by presentation time, but constant internet connection issues killed the demo.  It was great working with them, and I'll likely continue to work with them to finalize a beta release.

The main purpose for this post was to list out my lessons-learned.

  • Kill the presentation.  The groups that really jazzed up the presentation got the best crowd reaction.  This didn't necessarily translate into winning however, but it gives a great sense of accomplishment.
  • If you want to win, target the judges.  This kind of sucks, but the judges are going to be interested in stuff they're involved in.  If you look at stuff they don't get or don't care about, nothing else really matters.
  • You don't need a flushed out idea to pitch.  A lot of folks did, but many just had an idea and went with it.  The more you have the better, but it is relatively low risk to pitch.  If you don't get any takers, you can scrap the idea and work with another group.
  • Make sure you have some environment stuff ready.  My group had everything already, but other groups had to set all that up.  
  • Keep the group together.  My group split for a while so they could get better internet.  This made it more difficult to fix communications between theirs and my stuff.
  • Along with environment setup, internet was a killer.  The WiFi was constantly breaking and slow.  It also killed our demo.
  • The amount that was able to be built when focusing the entire weekend on one thing was amazing.  I plan to use this same method for my own en devours from now on.
  • Have business cards.
  • Don't get distracted by other people or stuff that doesn't matter for the presentation.  This is not a problem for me, because I'm laser focused.  Everyone else reminded me of the chumps in my old CS lab the day before the FTP Client/Server project was due for Dr. Tan.  Maybe stop worrying about the other teams' html and worry about fixing your database.
Overall, I met great people, got inspired, and learned a ton.  Well worth $75.

Saturday, May 28, 2011

Warrior Day 20

Weight: 189
BF: 19.4%
Muscle: 152.33
Fat: 36.67

I had a very good week this week.  My post cheat weekend weight was 195.6.  I was able to get some kind of workout in every day.  I created a meal plan that is about 1200 calories 40/30/30 protein/carbs/fat and stuck to it every day.  With naps, I was able to average 7 hours of sleep per day.

I look better too.  I have sun burn right now, otherwise I would post pictures.  Maybe I'll wait until I get to 185 so it will be a 10lb difference.  The workout I do 10 pull ups, 100 pushups, 100x50lb kettle bell swings is really working well too.  My chest, triceps, biceps, shoulders, and back are all shaping nicely.  On the other days, I'm doing tabata sprints (got up to 10.5 mph) and myotatic crunches.

Today is cheat day.  I'm pumped as always, but I could probably go another week without one if I tried.  I've had this dilema before on slow-carb.  I tried it a couple times and it always fails.  By Tuesday, I'm completely off the train, and I ruin the whole week.  It might be different on Warrior, but I'd rather not risk it.

I'll be looking to eat chocolate, taco bell tacos, funions, chicken fried rice, and alcohol.  I'll try to keep my hydration up, get some fiber throughout the day, and put in some hard workouts.  I might try to max out on pull ups, push ups, kettle bells.

My "warrior meal" is (not eaten in this order):

  • 4 eggs
  • 3 servings of green beans
  • 2 servings of kidney beans
  • 1 serving of almonds
  • 5oz chicken
  • fresh spinach (with the chicken as a salad)
  • 2 slices of ham
  • 1 serving of carrots

I know that 6 pounds in 20 days is no big deal, but this is the first week I've done it correctly.  If I can get a few more weeks like this one, I'll be solid.

Friday, May 20, 2011

JSF sharing across multiple WARs in JBoss/Tomcat

This will be where I keep notes until I have a final solution. Then I'll reformat.

If someone decides that your application should be split up between more than one WAR, but they need to share some data such as User information (even just a logged in token or something), you have to find your own solution as this is not supported by the J2EE spec.  So far I've decided to do some sharing by making one of the WARs (we'll likely have 4 by the end) the one that holds the shared content.  I'll call it 'war1'.  In JBoss/Tomcat, this will give it a context name of '/war1'.  So, in 'war2', we need to look up the /war1 context and grab info out of its session.  I'll give some more detail.

In JBoss/Tomcat, there is a property in the server.xml called crossContext.  Depending on your JBoss/Tomcat version, it may be split into separate config files.  For example, in my JBoss 5.1, the actual config file is C:\jboss-5.1.0.GA\server\default\deploy\jbossweb.sar\context.xml.  You'll need to set this property to true.  The default is true in JBoss 5.1.  I don't know about other versions or standalone Tomcat.  Setting crossContext=true will allow us to lookup contexts from other contexts.

To set something in the shared context, I've done this: (this is in war1)

HttpServletRequest request = (HttpServletRequest)FacesContext.getCurrentInstance().getExternalContext().getRequest();
request.getSession().getServletContext().getContext("/war1").setAttribute("shared", shared);


In war2, we get it out similarly:

HttpServletRequest request = (HttpServletRequest)FacesContext.getCurrentInstance().getExternalContext().getRequest();
ServletContext medicalportal = request.getSession().getServletContext().getContext("/war1");
Object s = medicalportal.getAttribute("shared");


Ideally, I would like to have a context dedicated to sharing: /shared.  Then all wars would go to the same spot for sharing.  This is all in an EAR; so, we have a jar with some JSF code.  We can shove the shared context accessing code there so that we can have code like this:

FacesUtility.setSharedAttribute("name", value);
Object value = FacesUtility.getSharedAttribute("name");


An over-the-top solution but way cool would be to have a JSF variable resolver that would look in the shared context for beans.  ...  Actually, that might not be over the top.  It would make the code much less complex.

Warrior Day 12

Weight: 191.4
BF%: 20.7
Muscle: 151.78
Fat: 39.62

Thursday, May 19, 2011

Warrior Day 11

Weight: 192.2
BF%: 21.3%
Muscle: 151.26
Fat: 40.94

Didn't log for a while because I didn't do well over the weekend.

For some reason my bf% jumped from Monday: 19.8, Tuesday: 20.7, today.  Conversely, my weight is going down from 195.  I think I need to just decide on the exact food I'll eat each day, even if that's different depending on the workout.

I'm working towards my goal of one round of 10 pullups (medium-wide grip), 100 pushups, 100 50lb kettle bell swings (Russian).  I started with 10 rounds of 10.  Monday I did 3x20, 4x10.  Wednesday I did 4x20, 2x10.  I'm planning to gradually reduce the rounds over time.  I'll probably give up on this, but I'm liking it so far.  It really pumps my chest and triceps.  The pushups are by far the hardest part, but i probably couldn't do one round for pullups or kettle bells.

I was planning on posting weekly pictures, but I didn't like how the last half of last week went.  Oh, I decided not to do supplements this week (other than vitamin d and multi).

Didn't do a workout because I was lazy, but we did go for a decent walk before we ate.  I felt a lot more hunger than I have before.

Friday, May 13, 2011

Warrior Day 5

6a
Weight: 194
BF%: 19.90%
Muscle: 155.39
Fat: 38.61

11p
It's nice to see the BF% and its probably accurate, because I was good with water yesterday.  I got pretty hungry a couple times in the afternoon.  I did my pull ups, push ups, kettle bells workout.  I'd like to focus on that workout going forward.  Probably three times a week or more.  I did another lightish meal, but definitely got full.  We got a glass of wine and walked a bit too.

Warrior Day 4

7a
Weight: 195
BF%: 20.30%
Muscle: 155.42
Fat: 39.59

Don't get too excited about the body fat percentage.  When you go on a real cheat day/meal like Red Lobster, its very high in sodium and you end up dehydrated the next day.  This skews the BF% down.  You'll see tomorrow.  Also, I only slept few hours.

9p
Skipped the workout because I was sore.  Did a pretty light meal.  Probably less than 1000 calories, but I felt full.  Did the normal supplements before the meal and before bed.

Wednesday, May 11, 2011

Using jQuery to switch Richfaces tabs

The requirement is to have a 'next' button at the bottom of each tab to forward to the next tab (wizard-like). The tabs are implemented with as vanilla rich:tab.  An additional requirement is to not have any onclick/oncomplete/etc attributes on the commandButton.  I'll post the solution first and then go into the explanation for those who had the same issues I did.

<script type="text/javascript">
jQuery(document).ready(function(){
jQuery('[id=form:next_button]').click(function() {
jQuery('[id=form:tab2_shifted]').click();
});
});
</script>


The first problem is the ids.   If you've used JSF, you know that JSF doesn't just use the id that you set on the tag.  It creates ids like 'form:tab2' instead of the 'tab2' that you set.  Not a huge deal at first.  The other thing you won't guess, is that the tab doesn't use your id either.  It adds a '_shifted' suffix resulting in 'form:tab2_shifted'.  So, if you only need to solve the first part, just do this:

<h:commandButton id="next_button" value="Next" action="next" onclick="document.getElementById('form:tab2_shifted').onclick();"/>


If you want to keep your javascripty stuff out of the tags, you need to be able to 'listen' to javascript events on tags.  The only way I know how to do that is with jQuery.  However, those colons in the ids cause a lot of people problems with jQuery.  Normally you look up a tag in jQuery like this:

$('#tab2_shifted').click();


That won't work in JSF, because the real id is 'form:tab2_shifted'.  So you'd think that this would work:

$('#form:tab2_shifted').click();


But it won't.  After LOTS of trial and error, I determined the correct way to do it:

$('[id=form:tab2_shifted]').click();


I can't remember what that's called, but you need to do it.

Adding the 'listener' (called an event handler in jQuery) was very easy to find.  This will call a popup every time the next button is clicked.

$('[id=form:next_button]').click(function() {
alert('hello');
});


Of course, if you just put this in the a <script> tag, it won't do anything.  For some reason you have to wrap it in $(document).ready.  I didn't get this forever.

$(document).ready(function(){
$('[id=form:next_button]').click(function() {
alert('hello');
});
});



The last part is pretty simple if you've got all this.  You just find the tab and click it.  We can do it with jQuery though to make it a bit prettier than document.getElementById.  See final result above.

Also, because I'm using the built in jQuery that comes with Richfaces, we use the jQuery variable instead of $ so that it doesn't conflict with other javascript libraries likey prototype that use $.

Here are some links that motivated me or helped me to write all this down:

Warrior Day 3

8a
Weight: 192.2
BF%: 20.70%
Muscle: 152.41
Fat: 39.79

Getting a little concerned with the BF%.  The only thing I can guess is that I properly rehydrated yesterday.  I'm coming off 7 meals a day slow-carb, so that could have something to do with it as well.  I'm not going to change anything this week.  At least I'm losing weight.  My overall goal is to get 170; so, if that means losing a couple pounds of muscle, I guess I'll have to live with it.

9p
Did a hard squats, deadlifts, and myotatic crunches.  Took supplements and went to Red Lobster.  Went hard.  Took another batch of supplements and ate a can of pringles, pop tarts, and oreos.

Tuesday, May 10, 2011

Warrior Day 2

8a
Weight: 193.8
BF%: 20.50%
Muscle: 154.07
Fat: 39.73

I don't completely trust the BF% accuracy; when it goes up a bit, I don't get too worried.

Last night I learned that this other guy used PAGG only before the main meal and bed.  I will do that too, along with 2000 mg of cissus quadrangularis (cq).  I need to research this though, as Tim Ferris's recommended daily dose was 2.4 g three times a day before meals on cheat days.

I think I'm going to shoot for a higher fiber intake today.  I also want to research adding some sort of fermented food, but they all sound awful.

4p
I still haven't actually gotten hungry.  Any feeling of hunger was easily satiated by a glass of water.  I didn't get as cold today either, but I also had the heat on to 76F.  I've already noticed a difference in my face.  It seems like my skin is tighter all over.  Not sure what it means, but it looks better.

I couldn't find any blogs or forums talking about using cq on warrior or intermittent fasting.  I guess I'll just take 2.5g for now along with AGG (regular dose - also need to research).  I couldn't find much on taking EGCG while fasting either, so I'm not going to take any supplements except vitamin d during the fast.

I found this guy who's got some crazy progress pictures.  He started with slow-carb and switched to IF via leangains.com: http://www.myfourhourbodydiary.com/  Not sure I'll read it regularly, but he's definitely got it figured out.  I like that he has performance goals and not just body recomposition goals.

7p
Tried the workout again (pronated pull ups), but failed on the push ups on the 8th set.  I guess I should have taken a day off. Those are the right pull ups though.  I'll keep using those.

Took AGG, D, CQ, and multi after workout.  Then ate:

  1. green beans w/ butter
  2. carrots throughout
  3. water
  4. kidney beans
  5. water
  6. ham
  7. water
  8. green beans w/ butter
  9. water
  10. 6 oz chicken w/ spinach
  11. water 
  12. kidney beans
  13. water
  14. 24 almonds
  15. water
  16. eggs
I have to fight the urge to try and be productive and/or start an energy drink.  Half the point of warrior is to allow the sympathetic and parasympathetic systems to work everyday.  Now is the time for the parasympathetic nervous system to be dominant.  I need to just be lazy.

10p
Took PAG, D, and teaspoon of cod liver oil

Monday, May 9, 2011

Warrior Day 1

7a
Weight: 195.2
BF%: 20.10%
Muscle: 155.96
Fat: 39.24


12:30p
Experiencing similar coldness in hands and feet as I used to during the fast/undereating phase.  Took a short cold shower to see if forcing my body to warm itself up would keep my hands and feet warm.  I left my shirt and pants off for the same reason.  The coldness came back in about an hour after the shower.

I still haven't felt hungry at all.  I'm just drinking some water and rockstar (sugar free).  Despite only getting 5 hours sleep.  I'm pretty focused.  Basically I feel completely normal except for being cold.

9p
Never got hungry.  Its a bit weird.  I took a 2 hour nap at 5 which was awesome.  I need to research napping with warrior and sympathetic/parasympathetic nervous systems.

Did the same workout as yesterday even though I was pretty sore: 10 rounds of 1 pull up (supine grip), 10 pushups, 10 kettle bell swings w/ 50 lb dumbell.  I did it in 17.5 minutes.  I'll be trying this workout everyday this week to try to get the time down.  I'll also be trying more difficult pull up grips.

Warrior Meal (in order):

  • green beans w/ a little butter
  • a few carrots
  • ~6oz chicken, fresh spinach, kidney beans
  • ham
  • 12 almonds
  • 600 mg alpha lipoic acid, 2000 iu vitamin d, 2000 mg cissus quadrangularis, multi vitamin
  • 5 whole eggs
  • green beans w/ a little butter
  • l-glutamine
I was wondering about the use of PAGG on warrior and found an incredibly detailed blog of someone who did what I'm trying to do.  They're much more fit, almost bodybuilder; so, they have a really great perspective from all their other experiences.  Really good resource.  They basically just used AGG before the main meal and PAG before bed.


11p
Took PAG, D, and teaspoon of cod liver oil

Warrior Diet

I decided to blog my progress this time instead of just writing in my little Evernote notebook.  My goal is get my weight down to 170 from my current 195 (depends on the day).  As a disclaimer, I've successfully did the Warrior Diet for about 2 months in October/November/December and lost about 20 lbs (215 to 195).  I usually refer to it as Paleo/Warrior, because I also only ate Paleo.  Previously, I primarily did a water fast until the main warrior meal instead of bits of fruits and vegetables.  This was mostly out of convenience, because I don't like many vegetables.

This go 'round, I will be closer to Warrior/Slow-Carb, as I will not be eating fruit, and I will be eating beans.   This is an attempt to maximize my fat loss by limiting high-glycemic index foods.  I may also experiment with the PAGG non-stimulant stack from the Four Hour Body.  I didn't use any supplements on warrior previously.

I haven't decided an exact workout plan yet, but I'll likely do some poor man's version of a crossfit workout everyday or every other day depending on the intensity.  (my previous success with warrior was also while I was going to crossfit ~3 times a week)  It is very unlikely that I will do any extended cardio (running, biking, elliptical) as I think that shit is a waste of time compared to a badass crossfit workout.

I record my weight, body fat %, and calculated muscle and fat.  I use a scale that calculates my bodyfat with bioelectrical impedance.  I'll try to post those numbers every day along with relevant observations, decisions, issues, etc.