Error when trying to install MySQL on a Mac with Ruby on Rails

When trying to install mysql I got the following error:

Building native extensions.  This could take a while...
ERROR:  Error installing mysql:
ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb --with-mysql-dir=/usr/bin --with-mysql-lib=/usr/lib64/mysql
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h

Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/mysql-2.8.1 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/mysql-2.8.1/ext/mysql_api/gem_make.out

After some googling, I found the following tutorial which I think should help me fix this:

.. only problem with the above blog post is that instead of it being
location mysql_config 
it should be
locate mysql_config

Edit 1: Still didn't work. Installing XCode to see if that fixes it.

Edit 2: After installing XCode it finally installed!!

Edit 3: Looks like it actually didn't work. New error when I used the command: rake db:migrate

rake aborted!
uninitialized constant MysqlCompat::MysqlRes
After googling, I found a StackOverflow post which said to use the command
sudo env ARCHFLAGS="-arch x86_64" gem install mysql
Then I tried the "rake db:migrate" command and it worked!!! I'll update again if something breaks.

How to change the path variable in Mac OS X

This is a bit trickier than it was in Windows, but not too bad once you get the hang of it.

1. Open up the terminal

2. Type the following: 

export PATH=$PATH:/usr/local/mysql/bin>> ~/.bash_profile

Note: You would replace "/usr/local/mysql/bin" with whatever path you want to add to your system. 

What this does is take your current path, represented by the variable "$PATH", and concatenates the string that follows it, ending with the ">>". It then adds that new string to the path, represented by PATH=, and it knows what file to edit by looking at the last part "~/.bash_profile" The first 2 characters "~/" simply tell the machine to search anywhere in the hard drive for the file ".bash_profile" and finally, the "." before "bash_profile" tells us that this file is hidden.

3. Type enter
Screen_shot_2010-10-15_at_12
4. Type the following:

env

5. Type enter

6. Look for the line that starts with PATH= and you should see your path added to the others.

7. Do a happy dance! You're done.

Happy_dance

Helpful Videos and Tools When Taking CS 124 at BYU

As I go through the semester, I'll add videos and other resources to this list that I found useful. Hope you find this helpful!

 

 

Prof. Anant Agarwal from MIT explains concepts similar to CS 124. This guy is really good at explaining things on an intuitive level and also every lecture he has a different surprise about half-way through to help drive home the concepts he's teaching. Highly recommended lecturer if you're feeling lost about NAND gates, AND gates, and digital abstraction.

MIT Basics of digital abstraction (starts getting into the stuff we cover in this course at about 42:20)

MIT Inside the Digital Gate

 

Multiplexer

 

Simple Binary Math

Sign & Integer, One's Complement, and Two's Complement

 

AND, OR, NOT, NOR, NAND, XOR, ADD

http://teahlab.com/ I used this site as a reference to remember what the difference between NOT, OR, AND etc. are.

 

Online Digital-Circuit Sandbox

http://logic.ly/

Just made the switch to Posterous

They made it so easy to import from Wordpress I couldn't resist! They even copy your old URL structure so your links don't break.

Apple iPad - Why it will become a hit

Media_httpwwwadamchav_dkzjl
My initial reaction to the iPad was "meh." But as I started reading some blog posts about it my mind has changed. I think of my mom, and what she does at the computer -- basically it's email, craigslist, & the occasional news story. That's pretty much it, & she just wants it to work.

The iPad seems to fit very well in that category of people. People who just need something that lets them browse the web, do some occasional shopping, maybe read a book from time to time, but who have no need for the ability to tweak it under the hood. I don't know exactly what Jobs' marketing plans are for the iPad, but my hunch is that he will go after the baby-boomer generation who needs to have a computer but don't want/need to have all the bells/whistles of a regular computer.

The problem with most of the reviews of the iPad is that the people who are on the "front row" of the iPad announcement are geeks, & they look at the iPad and go "uuh, what's in it for me?" That's the thing -- there's not much there for them. But there's something there for their mom or dad. So while I won't be running out to the nearest Apple store to get one being the geek that I am, I predict that the device will be a big hit among the non-geek.

They Have Forgotten their "aha" Experience

Many people watching the presentation and commenting/blogging about it forget what it was like before they tried the iPhone. Before the iPhone, phones were just phones. Personally, I was using a Cricket phone because it was the cheapest monthly data plan. I used my phone for phone calls, & nothing else.

But when I tried out the iPhone, I knew that something incredible had happened. I was at Walmart. I had never experienced multi-touch. This ONE thing was a huge paradigm-shift for me, among many other things. The mobile web browsing experience ALONE had me excited enough to buy one. All mobile browsing before that was annoying, slow, & non-intuitive. You really have to go back to that first-iPhone experience to appreciate what "classic-computer" users are going to experience the first time they try the iPad.  Now let's switch back to your mom.

Media_httpwwwadamchav_gjwlz

Your mom is where you were before you tried the iPhone, except instead of an "old junk phone" it's an "old junk computer." She's been looking over your shoulder as you showed her how to use a PC. "Yeah, first you click Control Panel, then Network & Internet Connections, then look for an icon that says Network Connections then...." and on and on.

I have nothing against Microsoft - I love Windows myself & enjoy tweaking things from time to time and having full control over it. But by the time you're done explaining to your mom how to connect to the internet she thinks "Wow, my son's a genius & I don't ever want to try to do what he just showed me!" So she comes from that paradigm, and then she tries the iPad. It's simple, intuitive, & requires no understanding of the inner-system in order to operate it.

That's a big deal, & I think she'll have her own "aha" experience with the simplicity, but also with multi-touch, always-on internet, beautiful resolution, 10-hour battery life, etc. I believe the device will be another game-changer, just this time it won't be changing the game for the young and tech-savvy, but for the older generation who are less tech-savvy.

When you look at this from a business standpoint, it makes sense right? What's the market size of the tech-savvy? Now what's the market size of those who are not tech savvy? Yeah. "Normal" people make up like 90% of the population. Jobs and his team have just cracked the door to the mass-market, & I think they've picked the perfect device to do it with.

Why Hasn't Voice Dictation Gone Mainstream?

Seeing this new Dragon Dictation iPhone app renewed the excitement I've had for a long time about voice dictation to control a computer, type, etc. You can speak like 160 words per minute and only type (if you're above average) around 60 or 70 -- some incredible office workers can go up to 80 or 90 wpm. This is a huge productivity boost, so why hasn't the mainstream adopted it yet?

I think part of it is that it would be really awkward to sit in a cubicle surrounded by a bunch of other workers -- & speak the things you normally type. At least that's part of what has stopped me from really getting into it. Somebody needs to create some kind of darth-vader mask so others can't hear you when you're dictating -- like noise-cancelling headphones in reverse and for your voice.

Perhaps it's also because of the bad reputation that voice dictation software has. Even though Dragon Naturally Speaking has all but perfected voice-to-text software, I don't think that it has penetrated the consciousness of the mainstream. Most people still think of voice-dictation software as being buggy; well, that's probably because most of it is. Like the software Google Voice uses for its voicemail dictation. It's pretty bad.

There are so many advantages to being able to use something like Dragon. Cut way down your risk of carpel tunnel syndrome, write a 10-page paper in the amount of time it used to take to write a 20-page doc, cut down on eye-strain because you can dictate without staring into a computer screen. There are probably others that I haven't thought of, but I think you see the point. Anyway, if you have any thoughts about why the lack of adoption, let me know in the comments.

Getting rid of the "Replace the lamp" message: How to reset the lamp timer Sony XGA vpl-px15 projector

If you replaced the lamp in your Sony Projector, but continue getting the "Replace the Lamp" message when you turn it on, follow the steps below to reset your lamp timer and get rid of that message:
  1. Turn off the projector. Normally when the projector is on, you will see a green light lit up. When you turn the projector off, this green light will flicker, then turn red. Wait until the light turns solid red, then go to step 2.
  2. Quickly press (a) reset, (b) left arrow, (c) right arrow, (d) Enter in that order. You must press this sequence within 3 seconds from the time you hit the "reset" button.
  3. You might want to repeat step 2 a couple of times, as there will be no indication by the machine that you have successfully reset the lamp. Going through the sequence multiple times will not cause any problems, as reseting the lamp timer again will do nothing but... well... reset the lamp timer.
  4. Turn on the projector. If it has worked, you will no longer see the message "Replace the lamp" and you are done!
  5. If you still see the message, try steps 1-4 again. If it still won't work, dial the official Sony Projector specialists at 800-883-6817. Press option 2, then option 6 and you should connect to the right people.

Beware of TaggedMail.com scam - Tagged.com Wants Your Credit Card info

Update Jun 24 1:47PM: I just received a note from Greg Tseng -- he wrote a public statement that you can see here: http://blog.tagged.com/?p=4

Update Jun 6 11:08PM: It looks like the CEO, Greg Tseng, has a bit of a history with spamming people to get businesses off the ground. See http://dir.salon.com/story/tech/feature/2002/08/07/crushmaster/index2.html

I contacted him to get his side of the story. If I hear back from him I'll report it here.

Media_httpadamchavezn_hespq

Just got this email from a friend of mine -- but he didn't send it. It's from a site called Tagged.com or TaggedMail.com -- the scam apparently wants you to sign up at their site, and give them your email and credit-card info. It is not clear whether the site sells a legitimate product or service, but their marketing tactics are certainly immoral. Breaking into people's email accounts and sending out false emails ain't a good way to build trust with the community. It appears that once you've given them your email Tagged.com adds your email to a list -- so the spam will only get worse. If you get an email like this below are a few steps you might want to take to make sure nobody else gets tricked: 1. Delete the email 2. Email your friend to recommend that they email the people in their address book to make sure others don't fall for the phishing scam 3. Advise your friend from whom the message was sent to change their email password of the sending account Hope this helps! P.S. You can read about other people who have been attacked by this scam at this live search on Twitter: http://search.twitter.com/search?q=taggedmail
Tags