Using DropBox For Mac OS X

I recently was able to get in on the limited Beta Release (which is now in public beta) of Evenflow Inc.’s Dropbox application for Mac OS X. Dropbox is a secure file storage application for Mac OS X created by 3 students from MIT. I’ve been using this cool app for about 4-5 months now and I have to say I absolutely love it. Its very intuitive. Its always available. And its fast!

I can get to my shared files via a web browser or the Finder integration for OS X, which is awesome because if I don’t have my MacBook with me (which isn’t often), I can get to a file I need access to. This is great for documents I don’t want to store in Google Docs. I’d say the Finder integration is pretty solid. One thing I’m a little disappointed about is that the default action when dragging files from Dropbox to my MacBook is a Move, not a Copy. There aren’t many instances where I’d want to permanently move a file from Dropbox to my local disk.

Since the limited beta release, it appears they’ve added a new tier of access above the free 2GB storage limit. Now, for $99.99 a year or $9.99 a month, you can have 50GB of storage. I’m not sure I’ll jump on that yet as I don’t use the 2GB I have now, but it could be an interesting backup solution, especially if they can get some integration where you can automatically backup your files either through Dropbox, or perhaps even Time Machine.

All in all I’d say this is an awesome application. No more need to FTP stuff around or email documents and files. You can just fire it up to your Dropbox and share with friends! I’m really looking forward to where these guys can take this app in the future. I’m sure we’ll see great things.

PayPal Doesn’t Mind Fraud?

We use PayPal exclusively (for better or worse) to collect payments on one of the e-commerce sites I manage. Recently, we noticed a lot of suspicious transactions being allowed through PayPal. High dollar value, Overnight Shipping, to shipping addresses that didn’t match billing addresses. What was odd is it seemed like it was happening all of a sudden. Turns out, we’d been hit be what appeared to be the same group for about 12 days.

I was really shocked this problem just popped up because you’d think PayPal would be on top of this sort of thing and let us know of suspicious transactions. Well, that isn’t the case. I’m not 100% sure if PayPal changed something in account settings or not, but it turns out that we had all of our Risk Controls set to Accept. Now, I’ve never seen this stuff before in our PayPal profile, but I also don’t manage the PayPal account on a daily basis.

What I found shocking, and absolutely ridiculous, is that PayPal didn’t set the defaults for these settings to the safest possible, but the unsafest. We were set to accept all transactions, regardless of address verification, credit card security verification, and a whole bunch of other settings. I couldn’t believe it when I saw it. The only reason I actually looked was that I had posed my problem to the PayPal Developer Community. Needless to say I locked the entire account down so we were as safe as possible, but I just couldn’t believe PayPal would do this by default.

It seems obvious, since PayPal isn’t a bank or even your typical credit card processor, that PayPal is just interested in collecting its fees. They probably could care less about you as a merchant and how you need protected. I’m sure we’ll be investigating other processors (which I know there are plenty of out there) to use in the future. PayPal just doesn’t seem to be the safest way to pay (pun totally intended).

Wakeboarding = Fun!

Sunday afternoon, I was able to take my first crack at wakeboarding. My friend Bob took me out on his boat with my wife and my other friend Jay for an afternoon on the lake. After a few tips from Bobby and Jay, out I went.

The hardest part is definitely getting up out of the water. You basically have 2 seconds to turn the board and get up or over on your face you go. I did ok I guess for my first time out. I got up out of the water and went for a few “rides” down the lake, but nothing fancy. Keeping the board edges up correctly is definitely key too. A few times I got the nose of the board down going out over the wake and face planted hard. I definitely got a good case of whiplash hitting the water face first.

Monday I was sore as hell. My legs and arms definitely took a beating. It takes a lot of strength to pull yourself up out of the water. A lot more than water skiing, which I’ve done before. All in all it was a ton of fun though. I’m definitely hooked and can’t wait to go again!

WordPress Login Redirect Issue

WordPress

It’s been a while since I’ve written here. I’ve been busy taking care of some personal and work business that’s just taken up more time than it should have. A few people have wondered where I’ve been and were clamoring for some new content to read. So here we go!

I upgraded the version of WordPress that this blog runs today, but ran into a problem when I went to log in. Each time I logged in, I’d just get redirected back to the login page. Turns out, I was a victim of a security hole in an older version of WordPress. I found a useful article by John Hawkins that details the issue. His solution was a little more involved than I wanted to get into, so I tried something on my own that worked.

John notes in step 4 that you need to delete the current value of active_plugins in the wp_options table. Turns out, this is all I needed to do, e.g.

update wp_options set option_value = '' where option_name = 'active_plugins'

I cleared that out, logged back in, and re-activated all of my plugins. Problem solved!

Red Sox Opening Day at Fenway Park!

The Boston Red Sox opened their 2008 season at Fenway Park yesterday with a bang! Being 2007 World Series Champions, it was only fitting that we had the 2007 World Series banner unfurled and the players received their rings (or bling as owner John Henry calls it). It was a great day from what I could tell from the highlights on T.V. I wasn’t able to attend the game or watch it on T.V. since I was at work.

Daisuke Matsuzaka threw a gem and the Sox won the game over the (lifeless) Detroit Tigers. Manny provided the offense with a triple turned home run on an error from the Tigers, who had 2 on the day. Go Sox!

I think the most touching part of the day though was the arrival of Bill Buckner to throw out the first pitch. This guy has been dogged by a dumb play in the 1986 World Series for over 20 years. Driven out of the Boston area by Boston media and fans, I wasn’t sure this guy would ever be able to come back. But, the Red Sox ownership shows time and time again that anything is possible and had him throw out the first pitch yesterday in a roar of cheers from Boston fans. Buckner deserves this and more. It wasn’t his fault the Sox lost the 1986 World Series. Heck, there was a whole other game to play that they could have won. Yeah, it was a sucky play that he should have had, but hey, shit happens. You play the game and move on to the next one.

Anyway, great stuff that Buckner was able to bask in Boston Red Sox cheers in the sun one final time. Cheers to you Bill and I hope we’ll see you at Fenway park again in the future!

Astronomers Find Newborn Planet Just Around The Block

According to an article I found via the BBC, Astronomer’s found what could be a baby planet, just outside of our solar system a mere 520 light-years away. This is basically “across the city” as far as space is concerned. I find stuff like this to be really really cool. Definitely puts things in perspective as far as how you fit into the universe.

Baby Planet

I guess the image above (via radio emissions from its nearby star), courtesy of the BBC article, shows the new planet in the top right. I’m no rocket scientist, so I can’t see much, but I’m sure its cool!

Anyway, apparently this will be a Jupiter like planet and may have started forming in the last 2,000 years. Take a look at the article here!

Updating Pagination When Deleting Items with AJAX In Ruby on Rails

Ruby on Rails & AJAXRuby on Rails

Lately, I seem to be on a tear here with my Ruby on Rails development related posts. I suppose its more for my own documentation, but if it helps someone else out with their own development struggles, even better.

Today, I wanted to find a solution to updating pagination using AJAX. My issue was I use AJAX to update the DOM to remove an item when its deleted. However, the pagination doesn’t update and the listings don’t adjust as you delete them from the middle of the list. My solution, while not rocket science, I think is pretty cool. Basically, just keep using AJAX!

The first thing I need is a div to encapsulate my list. Something like:

     <div id="my_list">
          <%= render :partial => "items", :collection => items %>
          <%= will_paginate items, :renderer => 'ItemLinkRenderer' %>
     </div>

Obviously, that’s my original list inside the my_list div. I’ll get to what ItemLinkRenderer is in a big.

I delete my items from the list by updating the dom from within the delete action. So, something like this:

    @item = Item.find(params[:id])
    if !@item.nil?
        @item.destroy
        render(:update) { |page|
            page.remove dom_id(@item)
        }
    end

This should look pretty straight forward. Delete the item from the database, then remove it from the current document.

But what about updating the pagination and the list? We can remove an item, but how do we adjust the displayed list? Well, just fetch the list of items again.

    @items = Item.paginate :all, :page => params[:page], :per_page => 10
    if @items.length > 0
        page.replace_html "my_items", :partial => "items", :locals => {:items => @items}
    else
        page.replace_html "my_items", "<p>You have no items.</p>"
    end

Ok, so we can render the items. But, if you put this in, then start deleting items, you’ll notice your pagination links get messed up and you have your delete action in the URL. This isn’t good, but, like I mentioned earlier, this is where ItemLinkRenderer comes in. You can define a helper class called ItemLinkRenderer (in item_link_renderer.rb) to render your links properly.

    class ItemLinkRenderer < WillPaginate::LinkRenderer
        def page_link_or_span(page, span_class = 'current', text = nil)
            text ||= page.to_s
            if page and page != current_page
                @template.link_to text, :controller => "items", :action => "list", :page => page
            else
                @template.content_tag :span, text, :class => span_class
            end
        end
    end

This will render your pagination links properly. Hopefully this works out well for anyone who stumbles upon this. Let me know if it does or if you find any errors with what I’ve presented.

Accessing “Child” Associations in Ruby on Rails

Ruby on Rails
My good buddy Dan of SecondRotation.com helped me out with a Rails problem last night. I wanted to access the associations defined on an association of one of my model classes when calling find, in essence, accessing a “child” association. I looked high and low for this, but with no luck so Dan was able to come to my rescue. He said you can do this:

@collection = MyClass.find(:all, :conditions => ["id = ?", params[:id]], 
      :include => [:foo => [:bar]], :order => sort)

I guess using :include like this is will tell Rails and ActiveRecord that you want to include the Bar class association in the JOIN you’re doing in SQL so you can enhance your query. Makes sense, but too bad it seems to be hardly documented!

Why I Can’t Stand Charter Communications

Charter Communications

I’ve never enjoyed being a customer of Charter Communications for my cable provider. In fact, I’m drooling with anticipation for the day Verizon brings FiOS to my area. Anyway, it seems every time I have to deal with this company I want to scream. Several years ago, it was issues transferring service to someone else in my apartment. Long story made short, they wouldn’t do it and I had to return all of the equipment and my apartment mates would have to re-subscribe. I basically told them all it seemed they wanted was to get their $50 setup fee again. Talk about extortion.

This time, its my HD DVR receiver that wasn’t working properly. Shows don’t play back very smoothly and the HD service is sometimes pretty chopping. Not what you call a stellar T.V. viewing experience.

I call their customer support. The lady I talked to was pleasant and nicely explained that I should just take the receiver to my local Charter location and they’d swap it for a new one. Since one is down the road I said, no problem. Better than wasting 2-4 hours of my day waiting for a service guy, right? I head down there this afternoon to swap out my box. I walk up to the counter and explain my problem to the young lady. The conversation goes something like this:

Me: Hi, I’m having an issue with my HD DVR receiver and Charter customer service said to come in and swap it out for a new one.
Her: We don’t have anymore right now.
Me: Do you know when you’ll get some in?
Her: Well, we’re supposed to get a shipment of equipment in about an hour, but there’s no guarantee that any HD DVR receivers will be in it.
Me: Is there a number I can call in an hour to see if you got any?
Her: No. We don’t want lots of people calling us to see if we have them. We’re having inventory problems and those phone calls would be too much to handle.

One thought before I continue. Charter doesn’t want customer calling because they can’t handle the same question over and over again? Hmm…

Me: Well, I’m paying for DVR service that isn’t working, I’d like to get this fixed so I can actually use the service.
Her: You can schedule an appointment and we can send out a service person to look at it and swap it out. That’s actually the only way you can get a refund is if a technician comes out to test your equipment. Just swapping it out won’t get you anything other than a new box.
Me: Sure, but then I have to block out 4 hours of my day to wait for them. I really just want a working HD DVR receiver.
Her: We have shorter time windows now. I can schedule you an appointment for Monday.
Me: So basically that’s the quickest way I’ll get a new box?
Her: Yes

So I begrudgingly schedule the appointment for Monday between 5pm and 7pm. Two hours I have to sit around waiting for the cable guy. To the young ladies credit, she apologized for the crappy customer service. So even their own customer service employees know that Charter isn’t the best when it comes to making and keeping their customers happy.

Update: So, I just came home and am having issues with live playback now being choppy and pausing on me. Doesn’t matter if its live programming or recorded. After spending an hour on the phone and getting passed to 4 customer service reps, I was hung up on.

Quick note to Charter here, being transfered rom people who are English speaking to obviously outsource people in India who you can hardly understand is annoying. Note to Charter, this infuriates annoyed customer even more. Perhaps you should improve your customer service and transfer people to where they can get their problems resolved, not to people who can’t help let alone not be understood.

Anyway, being the persistent bastard that I am, I called back and talked to two really pleasant people. Josh, who is a customer service rep, passed me on to his supervisor named Chris. She was able to basically just help me out by crediting me for my service for the weekend since I can’t use it (why should I pay for something I can’t use) until a technician can come out Monday and figure out what the issue is.

I just wanted to post this update to point out that not everyone in Charter’s customer service department is completely useless. There are genuine people who care about their product who want to help you. In the end, I’m getting a credit for 3-4 days of service I can’t use. Though its not perfect, its a decent gesture to at least keep me a happy customer. However, as soon as Verizon FiOS comes through the area, Charter is getting the boot!

AJAX Pagination and Sorting in Ruby On Rails

I recently decided the account section of a Rails application I’m working on will be completely AJAX. Every link the user would click on would just replace a section of the account page giving them the impression that they’ve never left their account section because the URL isn’t changing. However, I needed to do pagination and sorting for lists of different things. So hunting on Google I went.

I first came across this article over at Rails on the Run about how to do it with will_paginate, prototype, and low pro. I mucked around with it for about 30 minutes and definitely had some struggles, so I went back to Google. I eventually came across this article at Redline Software’s Weblog about an easier way to do it with will_paginate. The nuts and bolts of it is you can use a helper class to write your pagination links for you very easily (I won’t steal their code and post it here. Check out the link to grab it.)!

But I’m not done yet. Remember, I also need to be able to sort my lists of data. So I ran with the same idea presented by Redline Software and came up with this way to write out the anchor tags for my sort links:

def sort_remote_url(text, value)
    value += "_reverse" if params[:sort] == value
    @template.link_to_remote text, {:url => params.merge(:sort => value)}
end

What sort_remote_url does is take in the text for the link and the value of the sort parameter. When you click on the sort link, it works just like the pagination and updates the current view.