// home

Latest Post

Getting OpenCV setup on iOS

Let me start off by saying, I don’t claim to be an expert. I had to find out how to get OpenCV running on an iOS device by reading a lot of other people’s advice, hacking, then trial and error. Step 1. Use port to install OpenCV and all the dependencies. sudo port selfupdate sudo [...]

Asides

  • Fear is the enemy of ambition. Anger is the enemy of control. Panic is the enemy of focus. Action is the best friend of luck. #
  • sunlightjs syntax highlighting is fun and awesome. Thanks, Tommy! http://sunlightjs.com/ #
  • Let me preface this post by saying, these are hacks. Neither the best or the only ways to achieve the desired results. But hey, if they work for me, they may work for you. Enjoy! ping -i 10 4.2.2.2 Send a ping request to an IP address once every 10 seconds. Why would I do this? I've noticed that on some wifi connections, I disconnected after so many minutes of inactivity. This keeps my connection active when I'm not. for i in {1..25}; do mysql -u user -ppassword -h some-load-balancer-vip -e "SELECT @@hostname" -s ; done Ask mysqld 25 times what host name it's running for a particular hostname (-h). Why would I do this? If you're calling a real host, then it's not much fun... however, against a Load Balancer VIP, that's another story. It's a down and dirty way to check which hosts are members of a Load Balancer VIP and to see if the balance method is behaving as expected. e.g. if you have 3 mysqld hosts behind a VIP, you should expect to see at least 3 different host names depending on the balance algorithm of the LB. sar -i 1 10 For ten seconds, show system activity every second. echo "722 / 846" | bc -l Use the "bc" command for basic calculations! Or just: echo $((722 / 846)); #
  • It's shameless, I know... but these are some books I want to read: Ajax: The Definitive Guide Algorithms in a Nutshell AppleScript in a Nutshell bash Cookbook Building Cocoa Applications: A Step by Step Guide Cocoa in a Nutshell iOS 4 Programming Cookbook iPhone App Development: The Missing Manual iPhone Game Development JavaScript Cookbook JavaScript Patterns jQuery Cookbook Linux iptables Pocket Reference Programming iOS 4 - Early Release Programming the iPhone User Experience PThreads Programming Regular Expressions Cookbook Secure Programming Cookbook for C and C++ Securing Ajax Applications XML in a Nutshell, Third Edition They are all available at: http://oreilly.com/store/publisher/oreillycomplete.html #
  • As I've aged after about 25 years old, I've noticed that my metabolism is incredibly slow and weight loss using conventional means, balanced diet and exercise, was impossible. I've had to resort to research and experiments to find what works for me. Some of the conclusions I've made have been echoed in other diet books such as "The 4-hour body" and "Atkins Diet". I've experienced first hand weight loss of 60 lbs over 3 1/2 months without any additional exercise and no adverse effects. Granted, this is a hard turn and impossible for most to do since it is sheer will power that will get you through the first 30 days. However, if you make it, you will lose 1lb per day from day 31 onward until you want to stop. I've done this twice in my life. The first time losing 80lbs over six months. After you reach your desired weight/BMI, then slowly add foods back into your diet that you like and measure the effects. If you're like me, then only a lot of exercise will allow you to eat more than 1500 calories a day. As you get older and more committed this becomes difficult. Yo-Yo dieting has become a way of life for me until I can consistently exercise for an hour a day. So, what is this magic diet that allows stubborn metabolisms to burn body-fat for fuel? For your convenience, I've encapsulated my daily regimen into the outline below. Wake up: - Immediately drink 8 ounces of ice-cold water. - Take gluten-free, gelatin based multi-vitamin. Breakfast: - Zero Carb Rockstar Brunch: - 8 ounces of ice-cold water Lunch: - 1/2 chicken breast or 1/4lb beef - Iced tea w/o Lemon - 1 baby aspirin pill, no sweeteners, no liquids, or 1 adult aspirin ever couple of days Dinner - 1 full chicken breast, add any seasoning as long as it is 0 carbohydrates - 1 cup broccoli florets or spinach leaves - Take gluten-free, gelatin based multi-vitamin. Note: if it is not on this list, don't eat it. No sugar, no bread, no rice, no wheat, no potatoes, nada. If you aren't experienced with dieting and its effects on you, consult a physician. #