Ammar's Techno Babble

All kinds of technology related things I learn and jot down.

  • iSight Camera Problems with Flash 10.6.5

    • 25 Dec 2010
    • 1 Response
    •  views
    • Edit
    • Delete
    • Tags
    • Autopost

    So today I spent about 4 hours trying to get my MacBook Pro's iSight camera to work with sites that use webcams via Flash, sites like yFrog.com and Justin.tv.  After updating Flash to the latest version 10.6.5, everything iSight related stopped responding, no matter what browser I tried, Firefox, Safari or Chrome, all had the same problem.  I tried uninstalling and installing other versions of Flash without luck.

    So then I came across this article in MacWorld, http://www.macworld.com/article/156357/2010/12/isight_flash.html, it seems that this is a pretty big problem that has been affecting many Mac users!  The first thing the article said was to run GoogleVoiceAndVideoUninstaller.app in /Library/Application Support/Google, the second I did this it fixed my problem!  So there seems to be a conflict between Google Video and Flash, something that screws up the iSight driver.  Hope this article solves your issue if you are having trouble.

    • Tweet
  • Getting Google Top Stories with Nokogiri

    • 22 Dec 2010
    • 0 Responses
    •  views
    • google google news nokogiri scrape
    • Edit
    • Delete
    • Tags
    • Autopost

    So I wanted to get the Top Stories from Google News, to my surprise I found out that there was no API available for Google News, I had to resort to a brute force method and scrape.  Here is the scraper the I wrote in about 10 minutes.

    require 'rubygems'
    require 'nokogiri'
    require 'open-uri'

    url = "http://news.google.com/"
    doc = Nokogiri::HTML(open(url))

    doc.css(".topic").each do |topstory|
      item = topstory.at_css("a").text
      puts item
    end

    This produces a nice list for me:

    Spider-Man
    Dow Jones Industrial Average
    Network neutrality
    North Korea
    Missile defense
    Human rights
    Los Angeles
    Philadelphia 76ers
    Green Bay Packers
    Lindsay Lohan

    • Tweet
  • Ruby Inspect Method Behavior

    • 22 Dec 2010
    • 0 Responses
    •  views
    • active record inspect rails ruby
    • Edit
    • Delete
    • Tags
    • Autopost

    So today while at work I was trying to debug a bit of code and see the contents of an Ruby object, which is a simple enough task.  I used the 'inspect' method to print a string representation of the object, this worked perfectly and I was able to see all the attributes of the object in the console.  Then later tonight I was working on Shoutreel and used 'inspect' again, but this time in the View, something that I had never really tried before, and to my surprise it failed to print a string representation of the object.  A hash sign was printed out.  Why is this?

    So is this a bug in Rails, does the 'inspect' method in the view not work for model objects?  My guess is that the inspect method in ActiveRecord, which is what the model object inherits from, has a bug.

    I'll investigate this and write back soon.

    This is the code I had in the view:

    <%= reel.inspect %>
    <%= [ 1, 2, 3..4, 'five' ].inspect %>

    The top line printed the hash, while the bottom line printed out the array as a string.

    • Tweet
  • About

    I am a web developer living outside of Washington DC. I love to keep learning new, better ways to program. Currently I am working with Ruby on Rails, Android SDK, and iOS4. I also own a site called Shoutreel.com, we're trying to create a new type of video site that makes it easy for people to share video recordings with family and friends.

    11601 Views
  • Archive

    • 2011 (10)
      • March (1)
      • February (2)
      • January (7)
    • 2010 (3)
      • December (3)

    Get Updates

    Subscribe via RSS
    Twitter