Thread: Running Algorithm on Rails Database

  1. #1
    Registered User
    Join Date
    Aug 2011
    Posts
    2

    Running Algorithm on Rails Database

    Hi,

    So I am currently running an iPhone program that basically draws a lot of statistics from a scientific test. I am storing the results in a Rails backend. I have one cell with the userID, and another cell with all the data in a string such in the format "Statistic1=5, Statistic2=6, etc." (all separate variables are separated by commas) I want to run an algorithm on this data, and output the result. How do I draw the data from the Rails backend into a form that I can play with in C? (aka getting the data, and then breaking up the cell data into a format that I can run an algorithm on it?) Cheers!

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    I'm not sure how you ended up in the Game Programming section, unless there's some significant context missing.

    In any rate: I'm assuming your Rails is storing some file somewhere (other than your iPhone). Do you know what format that file is in?

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Moved (for now).
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  4. #4
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    It depends on what database rails is using as a backend.

    Is there a .yml file with the database adapter details somewhere in the rails app? If so, look what adapter its using and look for a C library for that backend

    Could be mysql (MySQL :: MySQL 5.0 Reference Manual :: 19.8 MySQL C API) or sqlite (An Introduction To The SQLite C/C++ Interface) or whatever...

  5. #5
    Registered User
    Join Date
    Aug 2011
    Posts
    2
    Yes, it's a mysql database (sorry for posting in the game section, it said something about algorithms). How would I go about implementing this library? Sorry, I'm a bit of a noob- if you could point me in the right direction, that would be amazing :-)

  6. #6
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    Those red bits in Fordy's post are links, so maybe you should click them.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 13
    Last Post: 12-09-2008, 11:09 AM
  2. server rails
    By ginoitalo in forum Tech Board
    Replies: 1
    Last Post: 11-01-2008, 12:37 PM
  3. Database to Database Transfer?
    By draggy in forum C++ Programming
    Replies: 4
    Last Post: 01-17-2007, 10:50 AM
  4. Database Search Algorithm
    By Krupux in forum C Programming
    Replies: 1
    Last Post: 08-28-2003, 09:57 PM
  5. Replies: 1
    Last Post: 10-09-2001, 10:20 PM

Tags for this Thread