Re: [PLUG] Raspbian sqlite project...
> Why don't you make the (sensor,timestamp) combination the primary key > instead? > Makes sense, how do I set the combination (sensor,timestamp) as the primary key in C code? Note that I'm using sqlite3.h. ___ PLUG mailing list PLUG@lists.pdxlinux.org http://lists.pdxlinux.org/mailman/listinfo/plug
Re: [PLUG] Raspbian sqlite project...
> "Michael" == Michael Christopher Robinson> writes: Michael> I'm wondering how to count the number of rows in the database Michael> I'm creating from a C program. The database has a row number Michael> or Id that is the primary key. I need to know how many rows Michael> there are to know the next row number so I can add more Michael> temperatures to the database. I'm developing on a Raspberry Pi Michael> 3 Model B 2016. I have six USB temperature sensors hooked up Michael> that I read from in a loop. I generate a timestamp using Michael> time.h and step through the six sensors. Each sensor has an Michael> internal temperature and an external temperature. Michael> Table is like so: Michael> id, sensor, timestamp, temp_inner, temp_outer. Michael> With data types: Michael> Integer, Integer, Integer, float, float. Michael> If I can't get a row count in the C program, I have to pass it Michael> in every time I do another round of readings. I'm using Michael> sqlite3.h for database access and manipulation. Michael> I've been trying to answer this question on my own, but finding Michael> sample C code that does this is not proving to be easy. Why don't you make the (sensor,timestamp) combination the primary key instead? -- Russell Senior, President russ...@personaltelco.net ___ PLUG mailing list PLUG@lists.pdxlinux.org http://lists.pdxlinux.org/mailman/listinfo/plug
Re: [PLUG] Multiple hard drive types in SAS raids.
Here is how I look at this... There are couple of potential issues with mixing different disks and speeds - 1. reliability 2. economy 1. Reliability - The level of risk depends mainly on whether you are using software or hardware RAID. There is no additional risk for software RAID as long as the disks work. The risk for hardware RAID comes from insufficient testing and not following your HW RAID controller recommendations/spec. Check your RAID card manual and spec - that should answer the risk level. In my somewhat limited experience with couple of hundreds drives - there is rarely speed/manufacture requirement. It is just usual practice in the enterprise, not often followed by the storage vendors themselves. 2. Economy - mixing fast and slow drive is waste of $$$ for the faster drives - the RAID is only as fast as its slowest component. Please note that there are other reliability issues to consider beside mixing different drives and speeds - such as are all the drives suitable for 24/7 operations, MTTF, max spin up counts, heat, etc. Perhaps it is one of these monkey's wisdom cases: https://www.youtube.com/watch?v=y-PvBo75PDo Tomas On Tue, 2017-03-21 at 19:28 -0700, Thomas Groman wrote: > It has become quite expensive to maintain all the same vendor and > model > 15K SAS drives in large raid arrays. > > Would using different vendor SAS drives in the same array cause any > problems/performance degradation/reliability/ differences? > > ___ > PLUG mailing list > PLUG@lists.pdxlinux.org > http://lists.pdxlinux.org/mailman/listinfo/plug ___ PLUG mailing list PLUG@lists.pdxlinux.org http://lists.pdxlinux.org/mailman/listinfo/plug
Re: [PLUG] Raspbian sqlite project...
On Tue, 2017-03-21 at 21:18 -0700, Jonas Augusto wrote: > Once you have the command line client running you can count the rows > from a > table with this query: > > SELECT Count(*) FROM tblName > > Please change the table name at the end (tblName) > > On 21 Mar 2017 21:14, "Jonas Augusto"wrote: > > You can use the command line client for SQLite: https://www.sqlite. > org/cli.html > > Once it is connected to your database it is simple to make a SQL > query. If > you don't know how the query language works I can help you. > > Jonas I don't think I want to be doing this manually. I need to find out the row count in the C program so I can continue adding temperature data. This is the program that actually probes the sensors, it needs to do it's work quietly. Want to be able to open the database, get the row count, and continue adding rows to it. I appreciate the suggestion on the SQL statement I need, I just need to figure out how to use that statement in C and what it returns? I think you get an array back instead of an int, but there is an int in the array? ___ PLUG mailing list PLUG@lists.pdxlinux.org http://lists.pdxlinux.org/mailman/listinfo/plug
Re: [PLUG] Raspbian sqlite project...
Once you have the command line client running you can count the rows from a table with this query: SELECT Count(*) FROM tblName Please change the table name at the end (tblName) On 21 Mar 2017 21:14, "Jonas Augusto"wrote: You can use the command line client for SQLite: https://www.sqlite. org/cli.html Once it is connected to your database it is simple to make a SQL query. If you don't know how the query language works I can help you. Jonas On 21 Mar 2017 21:03, "Michael Christopher Robinson" < mich...@robinson-west.com> wrote: > I'm wondering how to count the number of rows in the database I'm > creating from a C program. The database has a row number or Id that > is the primary key. I need to know how many rows there are to know the > next row number so I can add more temperatures to the database. I'm > developing on a Raspberry Pi 3 Model B 2016. I have six USB > temperature sensors hooked up that I read from in a loop. I generate a > timestamp using time.h and step through the six sensors. Each sensor > has an internal temperature and an external temperature. > > Table is like so: > > id, sensor, timestamp, temp_inner, temp_outer. > > With data types: > > Integer, Integer, Integer, float, float. > > If I can't get a row count in the C program, I have to pass it in every > time I do another round of readings. I'm using sqlite3.h for database > access and manipulation. > > I've been trying to answer this question on my own, but finding sample > C code that does this is not proving to be easy. > ___ > PLUG mailing list > PLUG@lists.pdxlinux.org > http://lists.pdxlinux.org/mailman/listinfo/plug > ___ PLUG mailing list PLUG@lists.pdxlinux.org http://lists.pdxlinux.org/mailman/listinfo/plug
Re: [PLUG] Raspbian sqlite project...
You can use the command line client for SQLite: https://www.sqlite.org/cli.html Once it is connected to your database it is simple to make a SQL query. If you don't know how the query language works I can help you. Jonas On 21 Mar 2017 21:03, "Michael Christopher Robinson" < mich...@robinson-west.com> wrote: > I'm wondering how to count the number of rows in the database I'm > creating from a C program. The database has a row number or Id that > is the primary key. I need to know how many rows there are to know the > next row number so I can add more temperatures to the database. I'm > developing on a Raspberry Pi 3 Model B 2016. I have six USB > temperature sensors hooked up that I read from in a loop. I generate a > timestamp using time.h and step through the six sensors. Each sensor > has an internal temperature and an external temperature. > > Table is like so: > > id, sensor, timestamp, temp_inner, temp_outer. > > With data types: > > Integer, Integer, Integer, float, float. > > If I can't get a row count in the C program, I have to pass it in every > time I do another round of readings. I'm using sqlite3.h for database > access and manipulation. > > I've been trying to answer this question on my own, but finding sample > C code that does this is not proving to be easy. > ___ > PLUG mailing list > PLUG@lists.pdxlinux.org > http://lists.pdxlinux.org/mailman/listinfo/plug > ___ PLUG mailing list PLUG@lists.pdxlinux.org http://lists.pdxlinux.org/mailman/listinfo/plug
[PLUG] Raspbian sqlite project...
I'm wondering how to count the number of rows in the database I'm creating from a C program. The database has a row number or Id that is the primary key. I need to know how many rows there are to know the next row number so I can add more temperatures to the database. I'm developing on a Raspberry Pi 3 Model B 2016. I have six USB temperature sensors hooked up that I read from in a loop. I generate a timestamp using time.h and step through the six sensors. Each sensor has an internal temperature and an external temperature. Table is like so: id, sensor, timestamp, temp_inner, temp_outer. With data types: Integer, Integer, Integer, float, float. If I can't get a row count in the C program, I have to pass it in every time I do another round of readings. I'm using sqlite3.h for database access and manipulation. I've been trying to answer this question on my own, but finding sample C code that does this is not proving to be easy. ___ PLUG mailing list PLUG@lists.pdxlinux.org http://lists.pdxlinux.org/mailman/listinfo/plug
Re: [PLUG] Multiple hard drive types in SAS raids.
> "Thomas" == Thomas Gromanwrites: Thomas> It has become quite expensive to maintain all the same vendor Thomas> and model 15K SAS drives in large raid arrays. Thomas> Would using different vendor SAS drives in the same array cause Thomas> any problems/performance degradation/reliability/ differences? I know people who refuse to use the same vendor's drives in a raid array. Or at least, never sequential serial numbers! Systematic errors--, diversity++! -- Russell Senior, President russ...@personaltelco.net ___ PLUG mailing list PLUG@lists.pdxlinux.org http://lists.pdxlinux.org/mailman/listinfo/plug
[PLUG] Multiple hard drive types in SAS raids.
It has become quite expensive to maintain all the same vendor and model 15K SAS drives in large raid arrays. Would using different vendor SAS drives in the same array cause any problems/performance degradation/reliability/ differences? ___ PLUG mailing list PLUG@lists.pdxlinux.org http://lists.pdxlinux.org/mailman/listinfo/plug
Re: [PLUG] two post racks for free
i might be interested. do you got any photos so i know what i'm lookin at? On 03/20/2017 09:42 PM, Randall Gray wrote: > Joe, > Are these full-height racks? Have you got anything shorter like the 12U or > 24U desk-top models? > > Thanks! > > Randall Gray > > On Mon, Mar 20, 2017 at 3:39 PM, Joe Pruettwrote: > >> we have a number of two post racks available if someone wants them. they >> are disassembled, and i think i can find all the bolts to hold them >> together, but you might have to make a trip to a hardware store. >> >> contact me directly if you're interested. they'll be going to a scrapper >> soon. >> >> ___ >> PLUG mailing list >> PLUG@lists.pdxlinux.org >> http://lists.pdxlinux.org/mailman/listinfo/plug >> > ___ > PLUG mailing list > PLUG@lists.pdxlinux.org > http://lists.pdxlinux.org/mailman/listinfo/plug ___ PLUG mailing list PLUG@lists.pdxlinux.org http://lists.pdxlinux.org/mailman/listinfo/plug
Re: [PLUG] PLUG Advanced Topics Volunteer?
On 3/20/17 10:41 AM, Brian P. Martin wrote: > I heartily second JJJ's sentiment regarding Michael! Seven years at this? That can't be right. Thank you Brian! Michael ___ PLUG mailing list PLUG@lists.pdxlinux.org http://lists.pdxlinux.org/mailman/listinfo/plug