<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: ComputerSmiths</title>
    <description>The latest articles on DEV Community by ComputerSmiths (@computersmiths).</description>
    <link>https://dev.to/computersmiths</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F48044%2Fc411f001-2a5b-452d-8271-ed83d4861b06.jpg</url>
      <title>DEV Community: ComputerSmiths</title>
      <link>https://dev.to/computersmiths</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/computersmiths"/>
    <language>en</language>
    <item>
      <title>Synchronize SQL database time stamps?</title>
      <dc:creator>ComputerSmiths</dc:creator>
      <pubDate>Tue, 12 Mar 2019 13:30:47 +0000</pubDate>
      <link>https://dev.to/computersmiths/synchronize-sql-database-time-stamps-4o4e</link>
      <guid>https://dev.to/computersmiths/synchronize-sql-database-time-stamps-4o4e</guid>
      <description>&lt;p&gt;Hi All,&lt;/p&gt;

&lt;p&gt;I've got several SQL databases from machines logging sunlight data that I'd like to synchronize for solar power studies.  One example is:&lt;/p&gt;

&lt;p&gt;mysql&amp;gt; select ComputerTime, Pac, IntSolIrr from SMA where ComputerTime &amp;gt;= (unix_timestamp(now())-(60*10)) order by ComputerTime;&lt;br&gt;
+--------------+------+-----------+&lt;br&gt;
| ComputerTime | Pac  | IntSolIrr |&lt;br&gt;
+--------------+------+-----------+&lt;br&gt;
|   1552395307 | 3738 |       557 |&lt;br&gt;
|   1552395366 | 3869 |       583 |&lt;br&gt;
|   1552395425 | 3813 |       578 |&lt;br&gt;
|   1552395487 | 3874 |       586 |&lt;br&gt;
|   1552395546 | 3853 |       587 |&lt;br&gt;
|   1552395607 | 3917 |       598 |&lt;br&gt;
|   1552395666 | 3998 |       611 |&lt;br&gt;
|   1552395728 | 4054 |       621 |&lt;br&gt;
|   1552395785 | 4114 |       633 |&lt;br&gt;
|   1552395846 | 4149 |       634 |&lt;br&gt;
+--------------+------+-----------+&lt;br&gt;
10 rows in set (0.84 sec)&lt;/p&gt;

&lt;p&gt;While another nearby one is:&lt;/p&gt;

&lt;p&gt;MariaDB [Weather]&amp;gt; select Epoch,WF$UDP$obs_sky$obs$SolarRadiation_Wpm2 from WeatherFlow where Epoch &amp;gt;= (unix_timestamp(now())-(60*10)) order by Epoch;&lt;br&gt;
+------------+----------------------------------------+&lt;br&gt;
| Epoch      | WF$UDP$obs_sky$obs$SolarRadiation_Wpm2 |&lt;br&gt;
+------------+----------------------------------------+&lt;br&gt;
| 1552395304 | 433                                    |&lt;br&gt;
| 1552395364 | 433                                    |&lt;br&gt;
| 1552395424 | 445                                    |&lt;br&gt;
| 1552395484 | 442                                    |&lt;br&gt;
| 1552395544 | 448                                    |&lt;br&gt;
| 1552395604 | 450                                    |&lt;br&gt;
| 1552395664 | 457                                    |&lt;br&gt;
| 1552395724 | 467                                    |&lt;br&gt;
| 1552395784 | 476                                    |&lt;br&gt;
| 1552395844 | 483                                    |&lt;br&gt;
+------------+----------------------------------------+&lt;br&gt;
10 rows in set (0.82 sec)&lt;/p&gt;

&lt;p&gt;As you can see, they are logging on one-minute intervals, but can be off from each other by a few seconds.  &lt;/p&gt;

&lt;p&gt;Is there an easy way in SQL to get these measurements synchronized?  My brute force approach would probably be to look for the closest one-minute timestamp by subtracting and then ordering by delta and taking the last one, but for one-minute intervals over several year that's going to take a long time...  8*}&lt;/p&gt;

&lt;p&gt;Alternately, I can read them into separate arrays and do the math outside SQL, but if there's an easy way to say "to the closest Epoch/60" or something, that might be easier...&lt;/p&gt;

&lt;p&gt;Many thanks in advance for any pointers to real programming techniques as eventually I'll have a dozen or more datasets to sync up...&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Synchronize program start over network</title>
      <dc:creator>ComputerSmiths</dc:creator>
      <pubDate>Sat, 09 Feb 2019 12:46:41 +0000</pubDate>
      <link>https://dev.to/computersmiths/synchronize-program-start-over-network-4l1b</link>
      <guid>https://dev.to/computersmiths/synchronize-program-start-over-network-4l1b</guid>
      <description>&lt;p&gt;I'm trying to get two computers to start a program (to play a video) simultaneously using a network connection in Python.&lt;/p&gt;

&lt;p&gt;I'm starting down the path of opening a socket server on one machine, connecting to it on the other, and sending some kind of communication saying "Now!", which is do-able, but seems unnecessarily complicated.&lt;/p&gt;

&lt;p&gt;Is there some easy thing I'm missing here?  Ideally I'd have a program called "Block.py" that I'd start from a bash script on one machine, which would wait till I run it on the other machine, and they'd then both continue on to the omxplayer command...&lt;/p&gt;

&lt;p&gt;Both machines have static IPs, if that helps simplify things.&lt;/p&gt;

&lt;p&gt;Many Thanks in advance!&lt;/p&gt;

</description>
      <category>python</category>
      <category>network</category>
    </item>
  </channel>
</rss>
