ive considered it but i still come back to the fundamental problem of
sucking out all the information contained in one "sheet" and
organizing it into a manageable hash or array or whatever would work
best. i think thats where my greatest problem lies.. taking the info
and turning it into one meaningful structure i can loop through.
having everything "sparse" (im using the term to mean.. not every
column of every row will be filled in) seems to make it hard for me to
just merge arrays...

i think...

its getting harder and harder to describe hehehe.

On Feb 10, 12:51 pm, pepe <p...@betterrpg.com> wrote:
> I am not an expert by any means on this, I am just trying to offer a
> suggestion, but have you thought about storing the data as XML? If you
> do it right you should be able to extract the information you need
> very easily.
>
> Pepe
>
> On Feb 10, 10:35 am, "frankjmat...@gmail.com" <frankjmat...@gmail.com>
> wrote:
>
>
>
> > my bottleneck at the moment is "how do i properly merge all this quasi-
> > normal data into an array FROM a rails find"... i can find all the
> > sheets.. i can "find" all the sheets columns, i can find all the
> > columns data... but i cant merge them into one cohesive structure
> > which can then be easily iterated over ie:
>
> > please take this for the psudocode that it is.
>
> > --table--
> >   --thead--
> >     --tr--
> >       columngroups.each do |columngroup|
> >       --th colspan=columngroup.column_count--
> >         columngroup.name
> >       --/th--
> >       end
> >     --/tr--
> >     --tr--
> >       columns.each do |column|
> >       --th--
> >         column.name
> >       --/th--
> >       end
> >     --/tr--
> >   --/thead--
> > etc...
>
> > my main problem is that the find returns the columns, columngroups
> > etc... are all in random order... i think i need them returned as a
> > key/value so i can align everything properly.. but i dont know.
>
> > a sheet is just a way of giving all the columns/rows something to say
> > "hey, this is my parent object"...
>
> > On Feb 10, 10:04 am, Randy Kramer <rhkra...@gmail.com> wrote:
>
> > > (top posting and not snipping very much so that somebody else can pick
> > > up the thread)--I think I'm out of my depth trying to deal with the
> > > best (i.e., fastest) way to deal with your data in Ruby/Rails.  (If I
> > > was to hazard a guess, I might try dealing with each table as an array,
> > > just for the sake of speed.)
>
> > > OTOH, if this is a rails application, presumably there is a client and a
> > > server (and TCP/IP communication between them)--is the database
> > > processing on the server really the bottleneck?
>
> > > At least one more comment interspersed below.
>
> > > On Tuesday 10 February 2009 09:37 am, frankjmat...@gmail.com wrote:
>
> > > > ive toyed around with just using txt files but my limited
> > > > understanding of "proper technique" in dealing with them makes them
> > > > just as cumbersome...
>
> > > > im very familiar with normalization and if it was practical (and the
> > > > cost didnt outweigh the benefit) id make sure everything was
> > > > absolutely 6NF and then some... but coulda, woulda, shoulda... its not
> > > > practical.. the best im shooting for is 3NF or 4NF but its not a
> > > > stringent requirement...
>
> > > > i guess you could say i know my way around databases, im just lost
> > > > with trying to implement this in a ruby way. my database breakdown
> > > > will probably look as follows (i think, unless someone can point me in
> > > > a better direction)...
>
> > > > over time there may be 5000 sheets... each sheet may have up to 20
> > > > columns. each column will eventually belong to exactly one group. each
> > > > group may have up to 400 "rows"... .. so if a sheet has 4 columns and
> > > > 2 groups like my prev. example and is filled to capacity... theres
> > > > going to be 400 rows for each set of groups... 800 rows... they need
> > > > to then be translated into one cohesive unit for display. the final
> > > > display will have all 4 columns separated into groups and "merged" so
> > > > all the "toolnumbers" line up in rows.. displaying only 400 rows.
>
> > > Without a lot more thinking, I don't fully follow the above description.  
> > > I guess "sheet" is the first thing that puzzles me--is a sheet a table,
> > > or is there a table containing up to 5000 sheets?  (Maybe the "schema"
> > > you list below would answer that and my other questions, but it would
> > > probably take me a while to puzzle it out--more time than I have atm.)
>
> > > If I really wanted to understand it, I'd ask for an example using "real"
> > > data--sheets, columns, and rows just confuse me (would that be
> > > metadata?).
>
> > > > i **think** i understand the database side.. im lost on the ruby
> > > > implementation (or any implementation).. is there a "most effective"
> > > > way to construct my relationships?
>
> > > > Sheets
> > > > - id (int)
> > > > - name (string)
>
> > > > Columns
> > > > - id (int)
> > > > - sheet_id (int)
> > > > - column_group_id (int)
> > > > - name (string)
>
> > > > ColumnGroups
> > > > - id (int)
> > > > - name (string)
>
> > > > Data
> > > > - id (int)
> > > > - sheet_id (int)
> > > > - column_id (int)
> > > > - tool_number (string)
> > > > - value (int)
>
> > > > then i'll have a possible array as such for a query like:
> > > > select tool_number, value from data where sheet_id = x
>
> > > > whats an effective way to iterate over the returned dataset and sort
> > > > it out into its corresponding columns column groups and rows... im
> > > > seeing a join in my head but i dont know on what.
>
> > > > :(
>
> > > > hopefully my problem is becoming a little more clear... but the deeper
> > > > i dig the more i suspect theres an elegent solution im not advanced
> > > > enough to see.
>
> > > Good luck!
> > > Randy Kramer
> > > --
> > > I didn't have time to write a short letter, so I created a video
> > > instead.--with apologies to Cicero, et.al.- Hide quoted text -
>
> > > - Show quoted text -- Hide quoted text -
>
> > > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to