Automating file download…!

I really don’t know if we’ll have file sharing services in… say… 5 years from now. Since megaupload has been taken down, and it’s CEO imprisoned, several other file sharing services have begun shutting down their services.

But many of them are still alive and kicking. So… whenever you need to download a huge amount of different files, manually entering the captchas (plus opening the links, one my one) turns into a tedious task.

That’s where jDownloader comes in. It’s a java based, multi platform app, which helps you download files form multiple sources. It has lots of plugins, and gets updated periodically. So chances are… it supports whatever filehosting service you’re using.

It has automatic captcha recognition (at least for several hostings). And if the hosting you’re using doesn’t have ‘auto-captcha-recog’, you’ll simply get a popup with the image itself.

It’s REALLY useful!

Useful Firefox Plugins

Google Chrome is definitely my favorite web browser. It has OSX Lion fullscreen support… it’s fast and lightweight, and Google itself is in charge of pushing it forward. But sometimes it just falls short… you just can’t find a suitable plugin for whatever you need to do. That’s the only reason i have firefox installed in my mac. Even the latest version of FF, release 11, doesn’t support OSX fullscreen feature.

So… let’s stop pointing out weak spots of this browser… and let’s go to the point!. The following plugins make my life easier. Really… so… i suggest you check them out.

  1. Firebug
    Yes… it’s also available for Chrome. But this version has far more functionality than the google counterpart. It’s really useful when you’re developing websites…!
  2. Video DownloadHelper
    Suppose you wanna download FLV files from whatever site you’re visiting. This is your friend!… it allows you to capture videos from a huge list of different websites.

I hope you find this helpful!

UITableView: Make room for a new cell, and insert it!

Suppose you wanna insert a new row at the bottom of a table. The first thing you need to do is to calculate the content offset. Suppose you already know the height of the new cell, and it’s stored into the variable ‘newCellsHeight’. Then…

[cc lang=”objc”]
CGPoint contentOffset = CGPointZero;

contentOffset.y = _tableView.contentSize.height
+ newCellsHeight
– _tableView.frame.size.height
+ _tableView.contentInset.bottom;

Once you’ve calculated the contentOffset (considering the current contentInsets)… you should make sure it’s a non-negative value, to prevent quirks:

// Do we need to scroll down?
if(contentOffset.y > 0.0f)
{
[_tableView setContentOffset:contentOffset animated:YES];
}
[/cc]

The last step would be to actually insert the rows. Please, consider that a delay should be applied, so the insert rows animations won’t break the scroll animation!

Xcode: Number of lines

I’ve been unable to figure out how to do this, actually, within Xcode. But this can also be accomplished by means of this short script:

[cc lang=”bash”]find . “(” -name “*.m” -or -name “*.mm” -or -name “*.cpp” “)” -print | xargs wc -l[/cc]

Google Chrome Plugins

Google Chrome’s time has come. I love this browser because… it’s the fastest thing out there. It had a lot of glitches when it was first released. I remember Facebook wouldn’t work fine on it… and of course, i had to fix the HTML of many of the websites i maintain.

But i stil love it. It gets updated in background… and you hardly get to notice it!. As almost everything out there… it’s better when tweaked… right?. So i’d like to recommend three different plugins, available in the Chrome Web Store:

  1. AdBlock
    As weird as it may sound… popups are still annoying these days. Furthermore, websites with ads are the worst thing that could happen to you. At least while you’re surfing the web. Well, adBlock takes care of that. It just locks out popups, and disable the download of annoying banners. Try it!.
  2. Google Docs
    Wouldn’t it be great to access your google docs, without actually having to hit ‘docs.google.com’ ?. Well, Google Docs plugin allows you to access them right from a shortcut placed by the location bar.
  3. Firebug Lite
    Although it’s not a full version… it’s a lite… FireBug is one of the best plugins out there. It allows you to play, realtime, with the DOM. Just click few buttons, and you can tweak almost anything. Sorry to say this, but Firefox version of this plugin is sooo much better…

I hope this helps!