RoR: Integrating a Forums Application

In Categorygeneral tech, programming, software
Bylab

Firedog is coming along quite nicely in my free time.  This long weekend, I got some QT in, and through trial and error, and a little help from some friends, I integrated a forums application into my RoR app.  First off, picking the right forums application to integrate is key, and after a lot of research, I decided to go with "Savage Beast", a plugin version of "Beast" which is known for it’s lightweight approach to forum building, with under 500 lines of code!  I found a write up on Savage Beast here, and although it was slightly painful to get integrated, it was well worth the time spent.  Especially since I already have an authentication mechanism (act as authenticated) that I am using, SB plays very nicely with my login/logout mechanism in place.  Here is a step by step process for integrating SB into your RoR app that is already using Act As Authenticated.  I hope it helps you get through the process quick and painlessly!!!

Preliminary Steps:
1) Read this blog entry from the SB guru.
2) If you don’t have a SVN already, download Tortoise
3) You’ll also need a console driven SVN, which can be downloaded here.
4) Use Tortoise to get the SB Demo from: http://svn.nnovation.ca/svn/savage_beast_demo/

Installation & Integration Instructions:
1) From your app’s root directory, install the SB plugin like this:
ruby script\plugin install http://svn.nnovation.ca/svn/savage_beast/trunk
2) Check out the SB Demo directory that you just downloaded.
3) Create a mysql database called savage_beast_demo
4) Open the demo’s config\database.yml file and alter the information to point to your new demo db.
3) From the root of the demo directory do a rake db:schema:load, this should create all the necessary tables.
3) Now we need to do some copies.  As a windows weenie, I found it useful to have two Explorer windows up, so that I could keep an eye on my directory structure. 
    – In the Demo, navigate to the vendors\plugins directory, and copy all of those plugins into your App’s \vendors\plugins directory.  The specific plugins are: browser_filters, engines, exception_notification, restful_authentication, savage_beast,  white_list, and white_list_formatted_content.
    – In the Demo\app\controller directory, copy sessions_controller.rb and users_controller.rb to your App’s controller directory.
    – In the Demo\app\views directory, copy the folders sessions and users into your App’s views directory.
4) Now we need to copy those tables that were created into our App’s existing database.  The tables to copy are: forums, moderatorships, monitorships, posts, and topics.
5)  In addition to the table copies, we need to add 3 columns to our existing Users table, which was created when Act As Authenticated was integrated.  The columns to add are: username varchar(255), posts_count int(11), and last_seen_at (datetime).  Add these three columns under your primary id and before the login field.
6) Next we need to change the routes in our App’s config\routes.rb file.  Open the Demo’s config\routes.rb file and copy these lines:
#get routes for beast
  map.from_plugin :savage_beast
  map.resources :users, :sessions
  map.signup ‘/signup’, :controller => ‘users’, :action => ‘new’
  map.login  ‘/login’, :controller => ’sessions’, :action => ‘new’
  map.logout ‘/logout’, :controller => ’sessions’, :action => ‘destroy’
  map.connect ‘forum’, :controller => "forums", :action => "index"
     
7) Open your user.rb under your App’s model directory.  Add this line near the top, after your class declaration:
 include SavageBeast::UserInit 
8) Time to BOUNCE the webserver!!!!  Restart your App, I did a Ctrl-C where my local webserver was running and restarted it.

That should do it … I’m pretty sure that is everything!!!  Now here’s the moment of truth …. you should be able to browse to: http://localhost:3000/forums

I found this thread on google groups really helpful, and definitely check out the demo and blog entry I linked to above!  Now the challenge becomes making it look like part of your existing Rails App!  I don’t have any tips for that one yet … Good-luck!!

A New Project

In Categorygeneral tech, programming, software
Bylab

I have been neglecting my blog lately, mostly because I am spending all of my free blogging time thinking about a new venture.  I have an idea for a web application .. codenamed Firedog.  Lets just say it is inspired by TripAdvisor.  So … I am doing some research on the best way to build this type of web application.  The backend will need to be database driven, and the front end needs to be slick and flexible.  So far Ruby on Rails has my interest.  I have been following this online tutorial, which I highly recommend.  It is fast paced and really well laid out.  One note, is that MySQL Front, which the tutorial uses, is not available where they say it is.  I finally found a download for it here

If anyone has other recommendations on technologies that could support this type of web application let me know … I am still in the design phase! ;-)

How the HD-DVD key was hacked

In Categorygeneral tech
Bylab

After reading about the HD-DVD key being cracked for all currently released DVD’s and players, it became more interesting to me to find out how exactly the 16 digit hexadecimal number was found.  Was it a brute force algorithm?  Was the key ripped off the hardware somehow?  I searched around google, and although most people are talking about the fact that the system was hacked, I did manage to also find out how

"nothing was actually hacked, cracked or even reverse engineered." All he had to do was keep an eye on his memory, watch what changed, and voila… the processing key appeared.

That is from this write up.  The more I think about it though, it reminds me of a few years back when napster was a household name, and people were downloading free music everywhere.  "They" really cracked down on that, and with the age of iTunes, most of us casual music buyers pay the $0.99 cents a song.  But you can also go out and buy a CD, and burn it to your iPod.  With the iPod now capable of movies, it only seems logical for you to be able to buy a DVD and burn it for play on your video iPod .. right?  This whole key paradigm is going to have to change, not only because the flaw in their system has been exposed, but also because the video industry is expanding across multiple devices, not just DVD players anymore.  It will be interesting to see how this pans out.

It happens once every 100 years

In Categorymathematics
Bylab

To indulge your number fetish, see the clock strike, 02:03:04 am on 05/06/07 … this Sunday!  There are so many of these silly little numerical time/dates, and some are more clever than others.  PI Day for instance happens once every year.  This one is pretty good, because it only happens once every century!  The next time the clock will strike this time will be in 2107.  To continue to feed your number hunger, click here.

“Like trying to take pee out of a swimming pool”

In Categorygeneral tech, software
Bylab

This is a crazy story of how a 16 digit hexadecimal number is causing a lot of trouble and a lot of excitement all at the same time.  Ever want to burn a DVD, but can’t because of that pesky encryption key?  Well the universal encryption key was posted all over the Internet today, and consumers are pumped!  The AACS …. not so happy.  In fact, posts containing the key have been removed all over the internet, and users have even been blocked from websites such as digg.

As Joe Rogan’s character on Newsradio once quite accurately quipped, "Dude, you can’t take something off the Internet.. that’s like trying to take pee out of a swimming pool." The content providers have attempted to do exactly that, remove pee from the proverbial swimming pool that is the Internet and, as we’ve witnessed so many times before, they’ve failed miserably.

[AACS] has taken action, in cooperation with relevant manufacturers, to expire the encryption keys associated with the specific     implementations of AACS-enabled software.

In the meantime, all currently released DVD’s can be unlocked using the key.

LINK to full article

Theme Provided By: Warcraft Wordpress Theme - Commercial Space