The Palate Whistle

I was wondering how the guy whistles in this youtube video: Home - Edward Sharpe and The Magnetic Zeros Acoustic Cover (Jorge & Alexa Narvaez).  He does some crazy no lip whistle.  Googling "whistle without lips" led me to this little bit of info.

How to whistle with your mouth:

  1. This whistle may require some practice and exercise because it takes strength in your tongue, jaw, and other parts of the mouth.
  2. Draw your lips and the corners of your mouth as far back as you can. Your bottom teeth should not be visible, but it is okay if your top teeth show.
  3. Pull the tongue taut and draw it back.
  4. Broaden and flatten the tip of the tongue.
    • Be sure there is a space between your teeth and tongue.
    • Your tongue should float in your mouth more or less at the level of your bottom row of teeth.
  5. Blow air gently out.
  6. Direct your breath downwards towards your lower teeth. You should be able to feel the downward force of the air on your tongue.
    • The sound is created by the tongue working with the upper teeth to force air over the surface of the tongue and into the lower teeth.
  7. Experiment with the position of your tongue, cheek muscles, jaw, and anything else for a wide variety of whistle sounds.

AnyDVD Not Ripping DVDs to English

Working on a video editing project, I've started using AnyDVD to decode and rip DVDs to my machine.  It's been a great tool,  works efficiently and just as I would expect it to, however on a couple of the DVDs I've ripped it's, seemingly randomly, ripping one or two of the video files in French. The problem is that the language settings on AnyDVD have been set to "Automatic" by default.  To fix this, open AnyDVD and select "Language Selection" from the settings bar on the left, and change the language to English (or whichever language you want).

I'd also like to find a painless way to string the outputted VOB files back together, however for this project it's not critical, since I've only ripped these DVDs for the sake of taking two or three 30 second clips from each.  Once I do find an easy tool to string link the VOB files back up into a semi-production level looking file I'll post it here as a comment.

Candy Jar Estimator Launches

unnamed.png

Yesterday Bryce (my business partner) and I launched "Candy Jar Estimator" on the Android Market.  It's designed to help you win candy guessing competitions - it takes your candy, the jar type, any custom jar measurements, and computes the expected number of candies in the jar.  Basically it means automatic WIN if you use it the next time a candy estimating competition rolls around at work, church, holiday festivities, etc.  so... it's pretty awesome.

Anyway we've also entered our app in the BYU mobile app competition.  The competition runs through November 16 and there are several prizes that we could potentially take home, including $6000 grand prize, $3000 judge's prize, and a local company's choice: brand new iPads for all team members.  If you'd like to help our team out here a few things you could do.

unnamed
  1. If you have an Android phone, download the app (yes it costs a dollar), l eave a 5 star rating and a SUPER AWESOME comment.
  2. Tell your Android friends to download it and leave some awesome reviews for us.  Say "my brother is entering his android app into BUY's mobile app competition. check...it...OUT! http://bit.ly/tmlitR" (and then make sure they download it and not just look at it)
  3. Even if you don't have an Android, you can help us by +1-ing our app on the Android Market. go here (http://bit.ly/tmlitR) and click the +1 button on the top right of the screen.

The biggest help will probably be sharing, so if you want to tweet it, Facebook it, or blog it that would be very helpful.  Also - if you have friends that are big blogger's a little spotlight from their blog goes a LONG way.

Available in Android Market

Dropdown Menu in PHP

Browsing around the web you'll notice tons of drop-down menus that let you navigate to different areas of that web site.   Drop down menu navigation is great because it lets you add a lot of navigation options, without taking up much space.  I know, for the web dev buffs out there you would probably never want to do this in PHP alone, but I found a cool tidbit of info on this and wanted to share.  So if you're looking for how to do this on a large-scale you probably want to turn to JavaScript.

With that said, one way to replicate a drop down menu with PHP is to setup an HTML form somewhere on your page and have it pass the site's URL to a PHP page when you submit it.  For example:

<form action="jump.php" method="post"> <select name=url> <option value="http://php.about.com">About PHP</option> <option value="http://www.identity.st">Identity</option> </select> <input type="submit" value="Go"> </form>

Then have the PHP file jump.php use basic redirection to send them to the right page.  For example:

<?php $url = $_POST["url"]; header("Location: $url"); ?>

Give it a shot!

Using LogCat in NetBeans

The best way to debug in Android is to use LogCat.  I've yet to figure out an easy way to do this though -- using NetBeans -- but it can be done.  LogCat should be installed with your Android SDK and AVD (android virtual device) kits, however the problem is that NetBeans doesn't display logcat in a "console"-like format.  I was looking at this tonight and figured out how you can still get your LogCat printout -- it just prints straight to a text file and not in a nice built-in display window like Eclipse has.
USING LOGCAT IN NETBEANS
1) First, you'll have to add the adb tools path the Windows global variable (if you're on a mac you'll have to google how to do this).  See http://www.shahz.net/android/adb-installation-and-how-to-logcat.html
2) Then, whenever you run your app and it crashes (or anytime you want to debug), open the command prompt and enter:
adb logcat -v time > logcat.txt
This will create a file in the current folder with the current LogCat logs.  You'll have a lot of stuff in there so it's important that you've used LogCat properly in your code so that you know what to look for.  Run "start logcat.txt" to take a look.
3) To to use LogCat in your code you'll first need to import the Log library:
import android.util.Log;
Then, down where you would normally print something out, you'll replace "System.out.println("HERE");" with:
Log.d("LOGCAT", "HERE");
4) Now, run the logcat command again, then open the text file with the start command:
adb logcat -v time > logcat.txt
start logcat.txt
5) Now, use CTRL-F "LOGCAT" to look through all your LOGCAT debugging statements.
Also - If your app is crashing try searching for "E/AndroidRuntime"... this will take you to the information on what caused the error.
I know it's a little complicated, but it works!  And it'll let you debug crash errors too.  The problem with using toasts for debugging is that the app may crash before you ever reach the toast.  Which... ends up not really helping you at all.  So if you can bear the pain of these steps for your debugging, it should help out a lot!   And if you find a better way to use LogCat in NetBeans please let me know.  It would be awesome if they let you view the LogCat logs directly in NetBeans.  Man that would be sweet.  Good luck!
Let me know if you find any mistakes with the info above.

Android Toast Example

Android lets you "toast" a display message that pops up on top of the current window. This usually occurs on some condition and is generally simple in nature, something like "OK", or "File submitted", etc. The code below can be plugged into any android class to launch a toast.

    Toast toast = Toast.makeText(getApplicationContext(), "Invalid Parameter", Toast.LENGTH_SHORT);
    toast.show();

This bit of code will launch a short toast that displays the text "Invalid Parameter". The length of the toast is 2 seconds, and can be changed to a longer 3.5 second toast by changing the duration(Toast.LENGTH_SHORT) to Toast.LENGTH_LONG.

Toast away!

Getting Started Project as a "Web Specialist"

Starting my new job as a web specialist for the BYU Law School this week.  The getting started project is as below... super stoked. Create a page using php, mysql and html where users can login or sign up and fill in forms about themselves (first name, last name, age, email address). Provide a spot for them to upload a document of type pdf, reject other types of uploads. Also, create a field that uses CKeditor to get a quick "user blurb" or description of themselves. After they are logged in, have a page in which all users are listed and linked to their profiles which will appear in a Colorbox when clicked upon. Be sure to style everything using CSS. Things you will need to know to do this:

    • How to create a form and use php post variables
    • How to upload and check uploaded documents
    • Session variables in php
    • How to create and use a correctly structured MYSQL database
    • How to use Colorbox
    • How to use CKeditor
    • How to do CSS styling

Tip: We highly recommeded thoroughly completing Lynda.com's PHP with MySQL Essential Training course to assist in preparing for the training exercise.

 

Dec 2011 update: See my mini content management system - still a work in progress.

PHP - What and Why

Who invented PHP? Rasmus Lerdorf, a guy who wrote it as CGI binaries in C in order to help manage his personal webpages (back in 1994). Lerdorf named it PHP for "Personal Home Page". Later it was renamed "PHP: Hypertext Preprocessor" by some of the colleagues Lerdorf teamed up with in order to improve on PHP and make it more standardized. Why use PHP?

  • Open source/FREE
  • Cross platform (Windows, Mac, Linux)
  • Powerful, robust, scalable (it'll be able to handle the traffic growth)
  • Web development specific (unlike java, ruby on rails, c, and others)
  • Large developer community
Resources:

How do I remove my comment from the Android Market?

 Needed to remove a comment from the Android Market and figured out how: Initially it wouldn't let me edit my comment to include no text.  It just won't let you save it.  What you have to do go to the app on the Android Market and hit the menu button.  There, in the "More" option there's a "Clear my review" button.  Hit that and your comment and rating are removed.

BYU vs Utah State 2011

There's been a lot of talk lately about BYU football and Jake Heaps in particular.  The team is solid this year, but Heaps has yet to step up.  He had all of last season for his "transition year" to NCAA div 1 football and it's about time the guy starts producing. I was at the painful BYU - Utah State game in Logan last year.  Man, it was the worst.  Here's hoping Heapsy boy can step it up and play like a man.  Granted, you could argue that BYU's o-line isn't helping, but the guy still needs to hit his receivers and throw some decent passes across the middle.  It almost makes me miss Max Hall.  Did I just say that?

So excited I can't sleep

Seriously, I can't sleep.  I'm sitting here in Eclipse messing with these layouts and getting stoked for the BYU Mobile App Competition.  A partner and I are developing a super awesome Android app that is going to be a blast.  Too bad I can't say what it is yet.  But, in about three weeks we should be ready to push it out.  We're under way right now and will be working on it as much as possible to get it ready for the competition. Man, I feel like saying more but I guess I won't for now.  People could be out there snatching up our idea as we speak.  That sucks.  But believe me once it's out there I'll be all about spreading the news.  The cool thing is that this app has never been done before on Android, it's a fresh market!  There's one on the iOS app store, but it's lame.  Maybe we'll try xcode and iphone development if this goes well.

Here's how the BYU mobile app competition works:

  • Teams of 1 to 4, with at least one member a current BYU student
  • Build your app for Android, iOS, WP7, or Blackberry
  • Release it to the Market/App Store November 2-16
  • Cash prizes as follows:
  • Grand Prize: $6,000
  • Analytics 1st Place: $3,000
  • Judged 1st Place: $3,000
  • Analytics 2nd Place: $1,500
  • Judged 2nd Place: $1,500
  • Audience Choice: All team members will be awarded with an iPad 2 (or 3). This award will be based on audience input at the final event
Basically there's a grand prize, a first and second for most popular based off the analytics, and a first and second based off the judge's opinions.  Then there's iPad prizes for audience choice.  So there's a good chance of winning something if you have a good idea, successful implementation of that idea, and a killer marketing strategy.  Assuming we get the product we want we're going to spread the word like wildfire.  I'm talking BYU, UVU, Utah State booths, and spreading the word all across the map... up in Washington, back in Georgia, Michigan, out in Hawaii.   I'm pumped about the whole project.
In other exciting news, Mango's came out yesterday, the $250 Amazon tablet is being announced today, and iPhone 5 is set to come out in less than a week.  This is huge!  I want an Amazon Kindle Fire tablet (or whatever it's going to be called) already.

Do number of installs spike when you publish a new version to the Android Market?

I just published a new release (the first update) of Cow Tipping (http://market.android.com/details?id=com.kyleclegg.cowtipping).  Just in the time since the update 36 hours ago the stats are saying that the number of installs has increased about 50 times it's normal rate.  Seriously... it's averaged like 10 or 20 a day and yesterday there were about 500.  WHY?!?  Are these (a) new downloads or (b) a combination of new downloads and reinstallations of the latest version by existing users?  Seems like an enormous spike. Is there anything that would affect the number of installs around the time you publish a new version?

Don't know the answers to these questions.  Someone out there might.

Cow Tipping on the Steady Rise

Cow Tipping has been live on the Android Market for a month and a half now!  It's been pretty exciting to see it happen.  Granted, it's my first app and it's extremely simple, but I'm happy with it.  The app's making about a quarter a day now in admob ads and has almost 2500 downloads, 36% retention.  Trying to push out an update - possibly tonight - when I get to it.

Notes on some features to add:

  • Back button - from finished gameplay
  • Hint - for new users
  • Size Optimization - drop from 3.6 MB to under 2.0 MB
  • New finishing messages
  • Sheep - to distract from tipping the cows
  • Levels with different objectives, background, etc.

Any suggestions?  How can I make it something worth using?

Building a Web Scraper

ISYS 403.  Business oriented programming.  Goal: Program a news aggregator. Project statement: Program a news aggregator that scrapes a news page and posts the top news stories.  The assignment gives a view into how search engines and other scrapes work online.

Many sources publish the news: local radio and TV stations, the Associated Press, national and international sources, and aggregators.  Aggregators like Google News don’t actually create news stories; instead, they parse the news stories created by other sources, discover like stories, and publish a combined view.

The problem is each site on the web publishes in HTML — a plain-text, free-flowing format.  You’ll have to code a technique called page scraping.  Page scraping is programatically going through a retrieved HTML source file and picking specific data pieces, such as news headlines and links, from the HTML.

Regular expressions are one of the best text parsing techniques available.  Beyond parsing HTML, they are useful for searching through all types of free-form text.

Completed project using businessweek.com/technology:

I thought this project was awesome!  I've been wanting to see how Java interfaces with the web and this was it.  My first time using java to hit the web and it really wasn't too bad.  Downloading the URL's HTML to a string was surprisingly simple.  My code looked something like this:

        String lineOfHTML = "";         String content = "";         //download home page         try {             URL url = new URL("http://www.businessweek.com/technology/");             BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream()));             while ((lineOfHTML = reader.readLine()) != null) {                 content += lineOfHTML;             }             reader.close();         }  catch (IOException e) {             e.printStackTrace();         }

As you can see the hard part really isn't that hard.  I used the URL library to grab the webpage and a buffered reader to read in all the HTML, then just stored it as a string.  The samples out there on bing made it really easy to.  Try searching "download webpage in java" on bing.  You'll get a lot of hit, trust me.

Parsing the HTML to find the new stories meant looking up businessweek's HTML source code, finding the tags surrounding news stories, and using regex to grab the information we wanted, which was the name, link, and description in our case. My regex expression ended up looking like this in order to get the top two stories: String regex = ".*?href=\"(.*?)\".*?>(.*?).*?

(.*?)

.*?href=\"(.*?)\".*?>(.*?).*?

(.*?)

";  Fun eh?

So that was it.  Put it together and you have the news parser as pictured above!

Why Can't I Alt-F4 the Command Prompt

On my Windows 7 machine I noticed that the Alt-F4 combination does not close a command prompt window.  I was wondering why this is and found this explanation: The command window uses special key combinations for various applications within the DOS emulating window. If Alt-F4 closed the window, it may be impossible to use certain utilities.  If you are looking for a keyboard-only fix just type exit to quit.

How to Install WAMP for Wordpress

I'm a web and mobile app developer and recently had a friend tell me all about MAMP. I've always used a PC and when I heard about WAMP (Windows Apache MySQL PHP) I wanted to give it a shot. I was working on setup and found out how to get WAMP running, and get a virtual environment of Wordpress going using WAMP. I'm going to show you how in a couple easy steps. I'm running Windows 7 on a 32-bit machine. 1) Start by downloading the WAMP server software on your Windows machine. 2) After downloading, install it to the preferred directory, C:/wamp. 3) Download the latest Wordpress package. The file downloaded will be a .zip file. Extract this to the folder C:/wamp/www. All of the files will come in a folder called WordPress.  You can either leave the folder as is, or you can cut them from the wordpress folder and paste them directly into the www folder.  I left tham in the wordpress folder (helpful if you want to add more sites to the www directory later). 4) Open up the WAMP server by left-clicking the WAMP icon in your Windows icon tray and clicking Start All Services.  The icon should go green.  Now, click the icon again and select phpMyAdmin. Note: If you see an error page here, you'll need to turn off IIS (Control Panel -> Programs and Features -> Turn Features on or off), since both IIS and apache use port 80 (you can also change WAMP config not to use port 80 but it can get messy). Selecting phpMyAdmin will open an new tab in your browser and there will be a field for creating a database. Put in any name you want name and hit create. 5) Now all you have to do is open a new tab in your browser and localhost/wordpress (if you didn't unzip it to the wordpress folder it will just be localhost/whatever folder you put it in). This will bring up a window that asks you for all of your information. Provide the database name you chose, your database username, which is root, and password, which you can leave blank (you can change these if you want). Now, connect, install, and you are up and running!

Let me know if you have any questions. If you haven't used WordPress before you're bound to run into a few problems.

New Changes

A couple new changes for me.  Things might get crazy.

First, as you can see, this blog now houses google adsense text ads. Your first response - jerk, sellout, shmuck. Right? Relax. This blog is my testing zone for wp junk so don't have a cow if I do something stupid.  Just consider it as having done the web a favor- one less rookie mistake for the next time around if I screw something up.  I think they look pretty good, actually.

The next new thing is that I am now running Android! Switched from iphone to Motorola Atrix and boy it is sweet. I feel empowered. Take that Jobs. This little guy is now my testing ground for my Cow Tipping app and anything else I get into this summer.

One last thing- posting this from Wordpress for Android. Android fo' lyfe.