Number of permit to carry / conceal and carry permit holders in Minnesota
Getting rid of Windows end of line characters in Linux
Ever run into the error: “bad interpreter: No such file or directory”? The problem is you have CRLF end of line characters… The solution, run this command on the file in Linux…
sed -i 's/\r//' filename
Rooting ASUS Transformer Infinity with Jellybean without unlocking the bootloader
[Update] While these are great instructions for rooting any Asus Transformer Infinity, I would encourage you to look at other tablets instead. Asus has had massive quality control issues with their Transformer line. One of the worst issues is the random screen cracks that can occur when docked. See this search for the latest of thousands of unhappy customers that have witnessed their screen cracking while they were not touching their tablet.” While this seems not plausible, I witnessed this myself on one of our devices. To this date, Asus has refused to honor their defect warranty for almost all such cases. Your money would be much better spent on a manufacturer with a better reputation and higher quality control. Check out the Samsung Note 10.1 for a good alternative to the Asus Transformer Infinity.
[/Update]
My wonderful wife gave me a new Transformer Infinity today and I immediately decided I needed to root it. Unfortunately, it was already on Android 4.1.1 so it is unrootable in that state (without unlocking the bootloader).
Here are my notes on the downgrading and rooting process. Make sure your battery is fully charged and you have everything backed up. This will wipe your device (because the downgrade is a full system image).
This is based on Steve Hamilton’s advice here: http://androidforums.com/transformer-infinity-tf700t-all-things-root/637903-trouble-rooting-asus-transformer-infinity-tf700t-4-1-1-jellybean.html#post5123594
We are going to assume that you have a US Based sku for your Infinity. If not, some numbers may be different.
- Download the Stock Ice Cream Sandwich Rom for the ASUS Transformer Infinity. You can get it here: http://d-h.st/Zo7 and here: http://pdadb.net/index.php?m=repository&author=Asus If you live in the US, make sure you get the version that ends in “.30″ (9.4.5.30). If not, get the version for your country.
- Extract the downloaded zip file, there will be a zip file inside called US_epad_user_9_4_5_30_20120907_UpdateLauncher.zip and place it on the root of your “internal SD card”.
- Power off the device while holding the volume down and power buttons for about 10 seconds. It will load in safe mode.
- It will show an update available. DO NOTHING. After 10 seconds, the device will reboot and you will load a safe mode version of the OS.
- When your device is restarted, the settings bar will show that there is an update to install. Select it.
- Click through the warnings. WARNING: This will delete your data.
- Your device will restart with Ice Cream Sandwich.
- Go here to download the latest automated Debug FS Root tool: http://forum.xda-developers.com/showthread.php?t=1706588
- Extract the zip file and save in some folder of your choice.
- Make sure your tablet is plugged in and recognized by your computer. If not, install appropriate drivers.
- Run RootDebugfs.bat
- Choose option 1 to root your device (Read and follow instructions at the prompts). The most important parts are to enable installing from unknown sources and enable USB debugging.
- Open up the SU app at least once before doing anything.
- On your device, download OTA Rootkeeper from Google Play: https://play.google.com/store/apps/details?id=org.projectvoodoo.otarootkeeper&hl=en
- Click on “protect root” in the Rootkeeper app.
- Upgrade via over-the-air updates to Jellybean.
- If needed, go back into OTA Rootkeeper and restore root.
Programming terms you have never heard of
The title above may be a lie. It just depends on your context or situation. You may have heard these terms (especially if you read Jeff Atwood’s recent post or Dodgy Coder’s 2011 post). Note that there may be very practical uses for some of these in real life. Others simply describe situations that should never happen.
Yoda condition
if(constant==variable) instead of if(variable==constant)
This is equivalent to saying “If blue is the sky”.
This is no insult to Yoda, after all, ”When nine hundred years old you reach, look as good, you will not, hmmm?”

Heisenbug
A bug that naturally disappears when you look for it.
This notorious bug gets its name from the Heisenberg Uncertainty Principle. The classic example is outlined in this Wikipedia article. The bug manifests itself with an optimized (normal) compiler. But when the programmer compiles with the debug option, the bug disappears. In debug mode, values are often stored in memory instead of registers, allowing for slight differences in floating point values.
One example I have experienced is in using different Java environments. Our test environment used the IBM JVM and the production environment used the Sun JVM. The Sun JVM evaluates the “==” operators differently than the IBM JVM. That’s why you should always compare strings with “string1.equals(“string2″)”.
Fermat’s last post
A poster to a forum or discussion list claims a solution, but never gives the answer.
I’ve seen this hundreds of times. Someone posts a complicated question on a forum and no answer is known. Finally, the person writes back and says “Nevermind, I figured it out.” But, they never share their results.
This term comes from Pierre de Fermat’s infamous last theorem, where he claimed he had a proof for the conjecture that no positive integers a,b,c that are greater than 2 can satisfy the equation an + bn = cn.
Unfortunately, he never published his full proof because he said it would not fit in the margin of his book (which if it existed, would have been done without a computer, so it would have been simple enough for an intelligent person to understand). No proof existed until 1995, a full 358 years after Fermat claimed he had a proof.
Support Gary Johnson in 2012
Gary Johnson, Libertarian candidate for president needs your help. He is seeking to raise $1 million for a national ad campaign. The hope is that this ad campaign will give him a big enough boost in the polls to get included in the presidential debates.
The debate commission sets a minimum of 15% polling to be included in the debates. This is a doable and acheivable goal.
By crowdsourcing this goal, it should be easily acheivable. If you can give $5, $10, $50, or any other amount, we can bring the ideas of liberty and freedom to the mainstream.
After watching the video, visit his website to become part of the solution!
Also feel free to get your Gary Johnson gear here: http://shop.cafepress.com/gary-johnson
You may also want to check out this link for a limited selection of Gary Johnson products (but they are cheaper!)
I am not voting for either of them
If you want my vote, earn it. Show respect for
individual freedom in the nominating process as well as in governing or you will lose my vote. Mitt Romney has failed in both. Neither major party embraces freedom and i refuse to give allegiance to a group that constantly uses a “crisis” to sway my vote.
For the past countless elections the parties have said “it really matters this time” only to abuse the electorate and turn on the freedoms they said were in jeopardy. A win in name only is no win at all.
Corrupt nominations process at RNC 2012
As was expected, the Republican “big tent” party decided to railroad any effort to show opposition in their convention. The party that once stood against slavery now cannot even have the courage to acknowledge dissent and differing opinions in their ranks.
Specifically, watch the last few seconds where the chair refuses to even announce that a competing candiate (Ron Paul) received any votes.
Scrolling to bottom of an Android scrollable view
Today I found the need to automatically scroll to the bottom of an Android scrollable view through Java. In case you need to do the same, here is how:
Get your scrollable layout:
scrollView01 = (ScrollView) findViewById(R.id.ScrollView01);
ScrollView scrollView01;
Scroll down when certain action is taken…
scrollView01.fullScroll(ScrollView.FOCUS_DOWN);
In my case, I am making a sub-layout view visible when a button is clicked. But, I want the users to see the results right away. This allows me to immediately show the users the results.
What is a singleton on Java/Android?

A singleton is simple a class that can be instantiated, but only one instance can exist at a given time in the Java Virtual Machine (Or in Dalvik if you are using Android).
Why is this useful?
In the context of Android, you are the only one running on the JVM. Your phone is not a server where many people connect.
A very specific way this could be useful is when your app is accessing an application object. For your app, there is one application object that can exist. So once one exists in the Dalvik machine, creating a new identical object would be a waste of time and resources.
Picture this, you have a custom Application class, Named MyApplication, that gets user preferences. So you could go about getting the preferences this way:
MyApplication myApplication = new MyApplication();
String userName = myApplication.getUserName();
String password = myApplication.getPassword();
And this code would cause a new MyApplication to be regenerated on every screen and class that needed the preferences. Creating and destroying objects is not an efficient use of resources. Especially when every time you create the MyApplication object, it will look exactly the same.
So that brings us to singletons. Basically, using a little bit of magic (not really), we can make our MyApplication class always return the same instance once an object is created:
public Class MyApplication myApplication{
//1. Create an object of the same type as the class above. This must be static.
private static MyApplication singleton;
//2. Change the empty constructor to private...
private MyApplication{
}
//3. Create a generator for the class. This will return our class object and essentially replace the constructor.
public getMyApplication(){
if (singleton == null){
singleton= new MyApplication(); //This only executes if singleton does not exist
}
return singleton;
}
Then to instantiate the MyApplication object, you simply call the generator instead of a constructor:
MyApplication myApplication = MyApplication.getMyApplication();
String userName = myApplication.getUserName();
String password = myApplication.getPassword();
By operating in this fashion, only one instance is ever created, potentially saving cpu cycles and memory. There are many uses of singletons, but this is just one very specific and practical use in Android.
The end result is a more efficient and more responsive app for your Android users! Happy coding!
The role of automation in business
Tim Ferris once said:
“Never automate something that can be eliminated, and never delegate something that can be automated or streamlined. Otherwise, you waste someone else’s time instead of your own, which now wastes your hard-earned cash. How’s that for incentive to be effective and efficient?”
-Tim
Simplify the equation by eliminating unneccessary steps.
Ferris, The Four Hour Workweek
This is wise advice. The importance of automation in business is huge. Using computer programs to reduce work puts your company in a place where you will dominate your competition (Shameless plug: contact us for more information on how we can automate your processes. We’ll save you money and give you a competitive edge!)
However, automation is but one portion of a strategy to put your business on top. Like a finely carved statue, you must first cut away that which is inefficient or unneeded. Oftentimes, inefficient processes are simply a crutch. They may have been necessary at one time, but as your business and clients changed, they just became something that “we’ve always done.”
In order to eliminate wasteful procedures, make it a habit to regularly question your operations. Mentally think through a few key questions and re-evaluate accordingly:
- Is this process doing anything that is achieved by something else? – This includes things like having a customer fill out a customer info sheet that is later entered into the computer. Skip the paper step and enter it directly. Then when the customer comes in the next time, you’ll see the info has already been entered. It will save you both time and frustration.
- Can I eliminate the task without causing harm? – What is the worst that could happen? If you eliminate a task and it only causes a little issues, ask yourself if those issues are worth the cost of continuing the task. Oftentimes, the more streamlined process will make you and the customer happier.
- Does the current process cause frustration? – This seems obvious, but so often we accept the status quo. There is a chance that you require an employee or yourself to go through a process again and again that just frustrates everyone. Maybe it is time you find a better way to do it, eliminate it entirely, or automate it.
- Do others like me do this too? – If your competition has eliminated the process, think about why they did. Maybe this gives you an edge, but maybe they are more efficient and they have the edge. Evaluate your options and determine the best course of action.
In the end, you know your business better than anyone. Make sure eliminating a task makes sense, but also don’t be afraid to do it. If you are afraid to make the jump, talk it over with your employees and maybe start with the elimination on an experimental basis. But by all means, simplify, simplify, simplify when possible!
AVSHost - Android and Web Development



