@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16



Comments:

<0> then separate the types of variables into their own table
<0> and have a key table
<1> actually i'll probably make variableid the single factor, and then have a table variableid (PRIMARY) / systemid / variablename
<2> yes
<1> poutine: so 3 tables, one for integers, one for floats, one for strings.. ?
<2> but your application should probably know which table a given variable exists in
<0> yes groogs
<1> Two-Bits: oh yeah, i guess it would also need a type column
<0> NO TYPE COLUMNS
<0> READ ON NORMALIZATION
<2> if you use a type column, you'd need extra queries
<1> poutine: ... so it knows what table to look in
<2> your application should know. not your database
<1> so .. how should the application 'know'?
<3> I think we need context. You need to tell us explicitly what "setting up a system" means and pastebin some example records.
<1> it only knows what variables there are by looking in the database..



<1> okay. it's a remote monitoring system for water treatment plants (though can be applied to .. anything really)
<0> groogs, I'd do probably keytab: systemid - variableid - table, strvar: variableid - string, intvar: variableid - int, etc
<1> variables are measured values, like, chlorine_residual, distribution_pressure, pump1_runtime
<0> hmm
<4> hey
<2> by what logic is the system going to determine which variable to update?
<1> poutine: ok well your "table" field is what i meant by "type"
<2> er
<2> ok, not system, but the application
<4> whats a deccent photo manipluation program (other than photoshop)
<4> dialupp, I cant be downloading that
<1> Two-Bits: .. it continually scans all the sensors
<0> some people like gimp
<5> fuehrer: what does that have to do with php?
<1> Two-Bits: every minute, it puts the current value into the log
<4> is there a windows version poutine?
<0> fuehrer, yes
<4> well
<0> http://gimp.sf.net
<2> groogs: and at that time, it knows it's own data type, doesn't it?
<3> groogs: If you know what data you're taking in, why try to generalize it?
<4> web design people generally deal photos, grphics
<6> @google 1 windows gimp
<7> Search results for windows gimp:
<7> http://gimp-win.sourceforge.net/
<7> http://www.google.com/search?hl=en&ie=ISO-8859-1&q=windows+gimp&btnG=Google+Search
<4> seemed a logical place to ask
<0> jmm
<4> thank you
<1> Two-Bits: (there is another part of the info for the variable, that tells it where to get the data from, ie, the IP of the i/o unit or usb port, module #, point #, etc)
<8> is mod rewrite bidirectional? or do i have to change all my links from blah.com?var1=x to blah.com/var1/
<1> Two-Bits: yeah, when it reads it knows the type
<0> I'd have to see some example data sets and an example of how you'd want to view them to give a better design
<2> not exactly what i meant. i'm just trying to figure out how the data extraction for the reports would work
<1> raizor: because it needs to apply to multiple systems. i want to be able to 100% setup a new system without doing any coding
<2> might need that type field afterall
<2> numerical constants of course
<3> groogs: xml config :)
<1> yeah, well. poutine suggested a 'table' field to tell what table its in.. same thing
<1> raizor: yeah that would give me some synergy
<2> is there some nifty way with that database to store table references in fields?
<2> or would you have to translate it for use in a subsequent query?
<5> like a pointer, baby
<5> i don't believe so
<1> hm, postgres has some funky things, it wouldnt surprise me...
<2> perhaps a UDF could handle the logic?
<5> hmmm i wonder what the best way of doing this kind of thing is
<1> right now, on each system i'm storing it just in a varchar field (in mysql) ..
<2> like a switch block to return the result set of the table you want to query on, and have a subquery like select value from getvariabletable(variabletypeid)
<5> if we were going to translate this to a program, a unit that contains different types of data would be a "record" type, implemented as a struct or cl***
<2> not sure if there's a shortcut for that
<1> and then aggregating it on a central system into one giant table (again, mysql) .. but the performance is awful..
<5> Two-Bits: you really don't want to do that
<2> i didn't know if it'd be optimizable by the dbms
<1> up to this point, i've only used the central table as a backup.. but now i want to pull live data from it for a web interface
<5> groogs: describe this data better for us
<1> pizza_milkshake: okay.. well lets say for chlorine_residual. it's going to be a number from 0 to 5 usually.. ie, 0.63
<5> and what does chlorine_residual represent? a measurement?
<1> it is also sometimes 'unknown' (ie, the sensor is malfunctioning, i/o unit disconnected, etc)
<1> pizza_milkshake: yeah, sorry. we use this for remotely monitoring water treatment systems
<5> do you have measurement groups? like measure A,B,C every at a regular interval



<3> bridgeconfigbridgeconfigbridgeconfig
<5> s/every //
<1> pizza_milkshake: it's connected to various I/O units that take measurements from sensors. logged at say, 1 minute or 5 minute intervals
<9> (again, mysql)
<9> ;P
<2> groogs: are all variables for a given system not all checked on the same interval?
<5> groogs: ok, and this is currently going into an existing database? or you're going to create a new one for storing it?
<5> scratch that, i see your response above. already being stored.
<1> Two-Bits: well, they're all checked continously. but they're logged at different intervals (it's limited to 1 minute, 5 minute, or 'runtime' ATM .. runtime is basically, if it goes from 0 to non-zero, it starts a timer. when it goes back to 0, it inserts the number of seconds)
<2> bummer
<1> pizza_milkshake: it's going to a db now, but i'm creating a new one on a new system, that will collect data from all the other systems
<5> groogs: ok, do you have more than 1 of each type of sensor?
<1> pizza_milkshake: its gotta be flexible. some sites have one, some sites have 10
<2> so ATM is basically event logging
<5> like location A has sensors type A,B and location B has sensors type A,C
<1> pizza_milkshake: yeah
<5> ok
<1> and location C has sensors, A, A, A, B,B, C
<1> and location D has sensors E, F, G
<5> ok, multiple instances of the same sensor type at each location
<5> and there is no simple pattern to it
<1> exactly
<2> by "sensor type" do you mean one recorded value or a set of values?
<5> and each sensor type could potentially record a different type of data
<1> one value
<5> and each instance of a sensor type at a location provides a stream of measurements over time
<1> pizza_milkshake: yes. for example. chlorine_residual is a float, from 0 to 5 .. pump status is 'on' 'off' 'underload' 'overload'
<5> ok, here's what you do
<2> so sensors A, C, and F could all be float values for things like temp, %'s, and capcities or the like?
<1> filter_power is 0 or 1
<1> Two-Bits: yep
<5> create a table for each distinct sensor type
<5> tbl_sensor_a, tbl_sensor_b, etc.
<1> well, thats too specific
<5> even if sensor types A and B record the same type of measurement
<5> why?
<2> pizza_milkshake: but he can logically group sensor types into the data types they are defined by
<1> i could do it for tbl_float, tbl_double, tbl_string ..
<2> hence the original int, float, string, etc type tables
<1> pizza_milkshake: because some sites will use sensors that don't exist yet
<1> pizza_milkshake: or that we haven't used before
<5> ah ok, i see
<1> or that they haven't made in 40 years
<5> ok, then i guess you do group by data type
<5> and in each tbl_reading_[type] you have fields for (minimally) sensor_type_id, sensor_id and reading
<2> the only problem i see is that getting all the data back OUT will be a potential pain in the arse
<10> i want some help about PHP
<5> hmm, well let's think
<10> pleasee
<1> why type_id ?
<2> you'd have to query each data type seperately and put it all together in the report. which could mean sorting a mixed resultset
<10> i want some help about PHP
<3> AdeQ^BoY: just ask your question
<2> AdeQ^BoY: ask a freakin question then
<1> pizza_milkshake: because i already have to store some metadata about the sensor .. ie the name of the variable in the system, the name shown to users, the physical location and address
<1> Two-Bits: data won't be mixed between sensors
<10> i want to download a new PHP version
<10> but i dont know to use it
<5> well i suppose you could have a sensor_type and sensor table, and have sensor.sensor_id
<1> Two-Bits: they may all go on the same report, but it'll be like.. min/max chlorine_residual, avg pump_runtime, etc
<5> AdeQ^BoY: rtfm
<10> ahaks
<2> no, but if you want a linear list of sensor values recorded for a given system, it would be mixed, no?
<2> over a time range and sorted by time?
<5> Two-Bits: that is possible
<5> i guess you'd have to cast the readings to strings though, lowest common denominator :/
<1> yeah..
<1> pizza_milkshake: well thats what i do now.
<5> ok
<5> so what's your problem again?
<1> and in mysql at least, for example, taking a min/max for all variables for a year takes almost 300 seconds
<2> that or they'd have to be combined and resorted in php
<5> groogs: something's definitely wrong there. try indexing :P


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #php
or
Go to some related logs:

#php
#india
#kl
#chat-world
#india
Skip Ewing Christmas Carol.mp3
what is the difference between debootstrap and cdebootstrap
#chat-world
www.dating line for kids 13-14
#linux



Home  |  disclaimer  |  contact  |  submit quotes