From mark at purdue.edu Mon Dec 5 05:12:27 2016 From: mark at purdue.edu (Mark Senn) Date: Mon, 05 Dec 2016 08:12:27 -0500 Subject: [Purdue-pm] Perl 6 advent calendar Message-ID: <15046.1480943547@pier.ecn.purdue.edu> The following is a quick summary of Perl 6 articles in the Perl 6 Advent calendar at https://perl6advent.wordpress.com. More articles will be posted there through December 25 or so---I won't be posting about what I thought about stuff there again. There are perl5 advent calendars and others but I've moved on to Perl 6. FROM 2016-12-01 Getting information from git using Bailador (Dancer for Perl 6). https://perl6advent.wordpress.com/2016/12/01/consuming-github-webhooks/ FROM 2016-12-02 Bioinformatics with Perl 6 https://perl6advent.wordpress.com/2016/12/02/ FROM 2016-12-03 Object Hashes https://perl6advent.wordpress.com/2016/12/03/ FROM 2016-12-04 Covers so, all, any, one, none, zip, permutations, pick, element, subset, tc (title case), one way to send email with Perl 6, junctions (a variable representing several values at the same time), etc. These functions are one of the big reasons I switched to Perl 6. https://perl6advent.wordpress.com/2016/12/04/ FROM 2016-12-05 You may want to skip this for now---they'll probably be better documentation on this somewhere else. Covers traits, class, is, mixins, etc. but is not a good explanation for Perl 6 beginners in my opinion. https://perl6advent.wordpress.com/2016/12/05/ -mark From mdw at purdue.edu Mon Dec 5 10:54:05 2016 From: mdw at purdue.edu (Mark Daniel Ward) Date: Mon, 5 Dec 2016 13:54:05 -0500 Subject: [Purdue-pm] Perl 6 advent calendar In-Reply-To: <15046.1480943547@pier.ecn.purdue.edu> References: <15046.1480943547@pier.ecn.purdue.edu> Message-ID: <48102d59-6ebd-1db3-d945-b9a94c2733e8@purdue.edu> Dear Mark, This is really interesting. I read some of the Perl 6 Advent calendar briefly, and I find it all fascinating. I haven't dived into Perl 6 (yet), but I should take the plunge sometime. Thank you for sharing, as always! Mark Mark Daniel Ward, Ph.D. Associate Professor and Undergraduate Chair Department of Statistics Purdue University 150 North University Street West Lafayette, IN 47907-2067 mdw at purdue.edu phone: (765) 496-9563 On 12/5/16 8:12 AM, Mark Senn wrote: > The following is a quick summary of Perl 6 articles in the Perl 6 Advent > calendar at https://perl6advent.wordpress.com. More articles will be > posted there through December 25 or so---I won't be posting about what I > thought about stuff there again. There are perl5 advent calendars and > others but I've moved on to Perl 6. > > > FROM 2016-12-01 > > Getting information from git using Bailador (Dancer for Perl 6). > https://perl6advent.wordpress.com/2016/12/01/consuming-github-webhooks/ > > > FROM 2016-12-02 > > Bioinformatics with Perl 6 > https://perl6advent.wordpress.com/2016/12/02/ > > > FROM 2016-12-03 > > Object Hashes > https://perl6advent.wordpress.com/2016/12/03/ > > > FROM 2016-12-04 > > Covers so, all, any, one, none, zip, permutations, pick, element, subset, > tc (title case), one way to send email with Perl 6, junctions (a variable > representing several values at the same time), etc. These functions are > one of the big reasons I switched to Perl 6. > https://perl6advent.wordpress.com/2016/12/04/ > > > FROM 2016-12-05 > > You may want to skip this for now---they'll probably be better documentation > on this somewhere else. Covers traits, class, is, mixins, etc. but is not > a good explanation for Perl 6 beginners in my opinion. > https://perl6advent.wordpress.com/2016/12/05/ > > > -mark > _______________________________________________ > Purdue-pm mailing list > Purdue-pm at pm.org > http://mail.pm.org/mailman/listinfo/purdue-pm From mark at purdue.edu Tue Dec 13 21:59:40 2016 From: mark at purdue.edu (Mark Senn) Date: Wed, 14 Dec 2016 00:59:40 -0500 Subject: [Purdue-pm] a Perl 6 quick example Message-ID: <39746.1481695180@pier.ecn.purdue.edu> # The "is-prime" sub is defined in Perl 6. is-prime(5) True # The parentheses are not needed. is-prime 5 True # The "is-prime" method is defined in Perl 6. 5.is-prime True # Get all primes from 2 to 10. grep {$_.is-prime}, (2..10) (2 3 5 7) # If an object is not specified, "$_" is assumed. grep {.is-prime}, (2..10) (2 3 5 7) # Get first three primes---I know the third prime comes before 10. (grep {.is-prime}, (2..10))[0..2] (2 3 5) # Using "^3" will give first three also---I think of "^3" # as from 0 up to but not including 3. (grep {.is-prime), (2..10))[^3] (2 3 5) # Let Perl 6 generate as many candidate integers # as we need (from 2 to infinity) to test for # primality but stop after we get 3 primes. (grep {.is-prime}, (2..Inf))[^3] (2 3 5) # Use "*" ("whatever") instead of "Inf". # Instead of 2 to infinity think of it # as 2 to whatever. (grep {.is-prime}, (2..*))[^3] (2 3 5) # Exercise for the reader, do the previous # computation in Perl 5 but make the code # at least as clear as the Perl 6 solution. # Perl 6 uses really big integers in software # if an integer is too big for machine computation. 10**1000 - 3 99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999! 99999999997 -mark From jacoby.david at gmail.com Wed Dec 14 06:55:41 2016 From: jacoby.david at gmail.com (Dave Jacoby) Date: Wed, 14 Dec 2016 09:55:41 -0500 Subject: [Purdue-pm] Reminder: Starship Mongers! Message-ID: We meet at 5:30pm in EE 317 for "Starship Mongers"! Everybody talks! No one quits! 5 minutes min on a topic of your choice. This will be a great time to get a read on each others' interests and capabilities, and will provide the ideas for a number of Mongers meetings in the next year. Followed by HackLafayette Open Source Food & Chat at Lafayette Brewing Company downtown. Beyond that: If you're signed up with HackLafayette, you likely receive the HackLafayette Weekly Newsletter . If you have events, you can contribute by forking on GitHub and submitting your changes to the next_week branch, or adding as repo issue. The latest newsletter includes a mention of HackLafayette Thunder Talks, a quarterly event featuring presentations that are longer than a Lightning Talk (or Starship Monger presentation) but don't go to the length and detail of full conference presentations. Next one is 2pm January 28 and features fellow monger Joe Kline's "To Serve Man". Our January meeting will be on Google's new C++ Test framework, Google Test . Thanks to Derrick for this. Thunder Talks organizer Ben Cotton mentioned an idea I had, being an introduction to R, the free software environment for statistical computing and graphics. I do not have enough time to put this together for January's TT, but will workshop it for February. (Yes, this means that we'll be hitting non-Perl or non-primarily-Perl subjects for three months straight. March will have to be deep hardcore Perl, like Moose or something.) Anyway, I look forward to seeing everyone tonight in EE 317. -- -- Dave Jacoby jacoby.david at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdw at purdue.edu Wed Dec 14 13:09:10 2016 From: mdw at purdue.edu (Mark Daniel Ward) Date: Wed, 14 Dec 2016 16:09:10 -0500 Subject: [Purdue-pm] a Perl 6 quick example In-Reply-To: <4957.1481748827@pier.ecn.purdue.edu> References: <39746.1481695180@pier.ecn.purdue.edu> <81E63F00-59FC-49DD-AB59-85CC236D2D7B@purdue.edu> <4957.1481748827@pier.ecn.purdue.edu> Message-ID: <43cced18-1b3e-ac33-6ed8-b8e3b3b14ca1@purdue.edu> Dear Mark, OK, I know the algorithm you are referring to. Thanks! Is this the book that you helped him to typeset? http://bookstore.ams.org/stml-68/ Mark On 12/14/16 3:53 PM, Mark Senn wrote: > Mark Ward, > > 1. I helped Dr. Wagstaff typeset a book having to do with factoring > large integers and haven't been sending him stuff because I think he's > already aware of anything I've ever heard of. I will bcc this to him in > case he or he would like his students to use Perl 6 (I also recommend > Mathematica) to easily experiment with ideas without having to write > much code. > > 2. Perl 6's is-prime sub/method uses the "Rabin-Miller" (also known as the > "Miller-Rabin") algorithm. See > http://examples.perl6.org/categories/99-problems/P36-ovid.html > for a simple example of how to factor integers using Perl 6. > > Some more information about Perl 6: > > Another simplification that can be done to the code below. > # "(2..*)" can be simplified to "2..*" > (grep {.is-prime}, 2..*)[^3] > (2 3 5) > > Type > <>.permutations > to print all permutations of "a", "butterfly wings", and c.) > > Mark Senn > > > > > Cc: purdue-pm at pm.org > X-Mailer: iPhone Mail (13G36) > From: Mark Daniel Ward > Subject: Re: [Purdue-pm] a Perl 6 quick example > Date: Wed, 14 Dec 2016 04:51:25 -0500 > To: Mark Senn > X-PerlMx-URL-Scanned: Yes > X-PerlMx-Virus-Scanned: Yes > X-ECN-MailServer-Origination: mailhub247.itcs.purdue.edu 128.210.5.247 > X-ECN-MailServer-SpamScanAdvice: DoNotScan (-7.9/5.0) > X-ECN-MailServer-VirusScanned: by ecn-av-milter > > Mark Daniel Ward wrote on 2016-12-14 at 0451: > Dear Mark, > > Thank you again for your email. This email alone might have finally > convinced me to consider moving from Perl 5 to Perl 6. > > I have two things for you to consider. > > 1. You might send your email to Sam Wagstaff, who is one of Purdue's > experts on primes and factoring. > > 2. I am curious what kinds of algorithms that Perl 6 is using under the > hood, for its factoring algorithms. Here is a classic kind of > challenge: if you give Perl 6 a 200 digit number that has only 2 > factors, each of which are about 100 digits long, how does it know if > the 200 digit number is prime or not? What algorthm(s) is Perl 6 > trying, under the hood, to perform such a calculation? > > I am genuinely curious to know. > > Mark > >> On Dec 14, 2016, at 12:59 AM, Mark Senn wrote: >> >> # The "is-prime" sub is defined in Perl 6. >> is-prime(5) >> True >> >> # The parentheses are not needed. >> is-prime 5 >> True >> >> # The "is-prime" method is defined in Perl 6. >> 5.is-prime >> True >> >> # Get all primes from 2 to 10. >> grep {$_.is-prime}, (2..10) >> (2 3 5 7) >> >> # If an object is not specified, "$_" is assumed. >> grep {.is-prime}, (2..10) >> (2 3 5 7) >> >> # Get first three primes---I know the third prime comes before 10. >> (grep {.is-prime}, (2..10))[0..2] >> (2 3 5) >> >> # Using "^3" will give first three also---I think of "^3" >> # as from 0 up to but not including 3. >> (grep {.is-prime), (2..10))[^3] >> (2 3 5) >> >> # Let Perl 6 generate as many candidate integers >> # as we need (from 2 to infinity) to test for >> # primality but stop after we get 3 primes. >> (grep {.is-prime}, (2..Inf))[^3] >> (2 3 5) >> >> # Use "*" ("whatever") instead of "Inf". >> # Instead of 2 to infinity think of it >> # as 2 to whatever. >> (grep {.is-prime}, (2..*))[^3] >> (2 3 5) >> >> # Exercise for the reader, do the previous >> # computation in Perl 5 but make the code >> # at least as clear as the Perl 6 solution. >> >> # Perl 6 uses really big integers in software >> # if an integer is too big for machine computation. >> 10**1000 - 3 >> 999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999! > 99! >> 99999999997 >> >> -mark >> _______________________________________________ >> Purdue-pm mailing list >> Purdue-pm at pm.org >> http://mail.pm.org/mailman/listinfo/purdue-pm From mark at ecn.purdue.edu Wed Dec 14 12:53:47 2016 From: mark at ecn.purdue.edu (Mark Senn) Date: Wed, 14 Dec 2016 15:53:47 -0500 Subject: [Purdue-pm] a Perl 6 quick example In-Reply-To: <81E63F00-59FC-49DD-AB59-85CC236D2D7B@purdue.edu> References: <39746.1481695180@pier.ecn.purdue.edu> <81E63F00-59FC-49DD-AB59-85CC236D2D7B@purdue.edu> Message-ID: <4957.1481748827@pier.ecn.purdue.edu> Mark Ward, 1. I helped Dr. Wagstaff typeset a book having to do with factoring large integers and haven't been sending him stuff because I think he's already aware of anything I've ever heard of. I will bcc this to him in case he or he would like his students to use Perl 6 (I also recommend Mathematica) to easily experiment with ideas without having to write much code. 2. Perl 6's is-prime sub/method uses the "Rabin-Miller" (also known as the "Miller-Rabin") algorithm. See http://examples.perl6.org/categories/99-problems/P36-ovid.html for a simple example of how to factor integers using Perl 6. Some more information about Perl 6: Another simplification that can be done to the code below. # "(2..*)" can be simplified to "2..*" (grep {.is-prime}, 2..*)[^3] (2 3 5) Type <>.permutations to print all permutations of "a", "butterfly wings", and c.) Mark Senn Cc: purdue-pm at pm.org X-Mailer: iPhone Mail (13G36) From: Mark Daniel Ward Subject: Re: [Purdue-pm] a Perl 6 quick example Date: Wed, 14 Dec 2016 04:51:25 -0500 To: Mark Senn X-PerlMx-URL-Scanned: Yes X-PerlMx-Virus-Scanned: Yes X-ECN-MailServer-Origination: mailhub247.itcs.purdue.edu 128.210.5.247 X-ECN-MailServer-SpamScanAdvice: DoNotScan (-7.9/5.0) X-ECN-MailServer-VirusScanned: by ecn-av-milter Mark Daniel Ward wrote on 2016-12-14 at 0451: Dear Mark, Thank you again for your email. This email alone might have finally convinced me to consider moving from Perl 5 to Perl 6. I have two things for you to consider. 1. You might send your email to Sam Wagstaff, who is one of Purdue's experts on primes and factoring. 2. I am curious what kinds of algorithms that Perl 6 is using under the hood, for its factoring algorithms. Here is a classic kind of challenge: if you give Perl 6 a 200 digit number that has only 2 factors, each of which are about 100 digits long, how does it know if the 200 digit number is prime or not? What algorthm(s) is Perl 6 trying, under the hood, to perform such a calculation? I am genuinely curious to know. Mark > On Dec 14, 2016, at 12:59 AM, Mark Senn wrote: > > # The "is-prime" sub is defined in Perl 6. > is-prime(5) > True > > # The parentheses are not needed. > is-prime 5 > True > > # The "is-prime" method is defined in Perl 6. > 5.is-prime > True > > # Get all primes from 2 to 10. > grep {$_.is-prime}, (2..10) > (2 3 5 7) > > # If an object is not specified, "$_" is assumed. > grep {.is-prime}, (2..10) > (2 3 5 7) > > # Get first three primes---I know the third prime comes before 10. > (grep {.is-prime}, (2..10))[0..2] > (2 3 5) > > # Using "^3" will give first three also---I think of "^3" > # as from 0 up to but not including 3. > (grep {.is-prime), (2..10))[^3] > (2 3 5) > > # Let Perl 6 generate as many candidate integers > # as we need (from 2 to infinity) to test for > # primality but stop after we get 3 primes. > (grep {.is-prime}, (2..Inf))[^3] > (2 3 5) > > # Use "*" ("whatever") instead of "Inf". > # Instead of 2 to infinity think of it > # as 2 to whatever. > (grep {.is-prime}, (2..*))[^3] > (2 3 5) > > # Exercise for the reader, do the previous > # computation in Perl 5 but make the code > # at least as clear as the Perl 6 solution. > > # Perl 6 uses really big integers in software > # if an integer is too big for machine computation. > 10**1000 - 3 > 999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999! 99! > 99999999997 > > -mark > _______________________________________________ > Purdue-pm mailing list > Purdue-pm at pm.org > http://mail.pm.org/mailman/listinfo/purdue-pm From mark at senn.us Thu Dec 15 00:27:49 2016 From: mark at senn.us (Mark Senn) Date: Thu, 15 Dec 2016 03:27:49 -0500 Subject: [Purdue-pm] Perl 5 vs. Perl 6 object oriented programming Message-ID: <12b2e8501b5be102e56b110b31c0f66f@senn.us> PERL 5 OBJECT-ORIENTED (OO) PROGRAMMING From http://search.cpan.org/dist/Moose/lib/Moose/Manual.pod Moose is a complete object system for Perl 5. Consider any modern object-oriented language (which Perl 5 definitely isn't). It provides keywords for attribute declaration, object construction, inheritance, and maybe more. These keywords are part of the language, and you don't care how they are implemented. Moose aims to do the same thing for Perl 5 OO. We can't actually create new keywords, but we do offer "sugar" that looks a lot like them. More importantly, with Moose, you define your class declaratively, without needing to know about blessed hashrefs, accessor methods, and so on. [... -mark] Moose is based in large part on the Perl 6 object system, as well as drawing on the best ideas from CLOS, Smalltalk, and many other languages. PERL 6 OBJECT-ORIENTED PROGRAMMING From https://docs.perl6.org/language/objects Perl 6 is an object oriented language at its core, even though it allows you to write programs in other programming styles. From https://docs.perl6.org/language/classtut Perl 6 has a rich built in syntax for the definition and use of classes for object oriented programming, allowing for the definition of state (as attributes) and behaviour (as methods) in the objects of a class. I prefer using Perl 6 which was designed and built with object-oriented features built in over using Perl 5 with Moose. Offhand I don't know of anything that Moose supports that Perl 6 doesn't support. If you use Moose because you have code written in Perl 5 that you haven't converted to Perl 6 see https://github.com/niner/Inline-Perl5 for information on how to use Perl 5 from Perl 6. Perl 6 has many features that Perl 5 doesn't have (see https://docs.perl6.org/language.html and pages it links to). I miss Perl 6 features when programming in Perl 5. See the "Basic OO in Perl 6" talk at https://www.youtube.com/watch?v=7mkmZVIizFY for how to do object oriented programming in Perl6 if you're interested. It's harder to change the Perl 5 than the Perl 6 system software so I expect more innovation to happen in Perl 6. -mark From jacoby.david at gmail.com Thu Dec 15 11:00:04 2016 From: jacoby.david at gmail.com (Dave Jacoby) Date: Thu, 15 Dec 2016 14:00:04 -0500 Subject: [Purdue-pm] Fwd: [hacklafayette] HackLafayette holiday giveway In-Reply-To: <1186113069.1481828032307.JavaMail.nobody@james0.pvt.meetup.com> References: <1186113069.1481828032307.JavaMail.nobody@james0.pvt.meetup.com> Message-ID: Since PPM is a part of HackLafayette ---------- Forwarded message ---------- From: Ben Cotton Date: Thu, Dec 15, 2016 at 1:53 PM Subject: [hacklafayette] HackLafayette holiday giveway To: hacklafayette-announce at meetup.com Hi everyone! O'Reilly and GitLab have sent us some swag recently, so I have a lot of stuff in my house that I need to share with you. I will select 5 people at random from everyone who RSVP'ed Yes to a HackLafayette event in the past 3 months. I'll also select 5 people at random from the general membership who fills out this form: https://goo.gl/forms/TQRPKalvbEREgPa42 (that way we know you're at least paying attention to HackLafayette) If you've been at an event in the past 3 months, please fill out the form anyway to double your chance to win (and also to reduce the back-and-forth in order to get your prize selected). I will do the drawing sometime after 12:01 AM Eastern on December 23, so you have just over a week to fill this out. If you don't win, don't worry, we'll keep giving stuff away at events. -- This message was sent by Meetup on behalf of Ben Cotton from HackLafayette . To report this message, please click here To block the sender of this message, please click here To unsubscribe from special announcements from your Organizer(s), click here Meetup, POB 4668 #37895 NY NY USA 10163 <#m_3900286156332648931_> | support at meetup.com -- Dave Jacoby jacoby.david at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark at senn.us Thu Dec 15 13:49:43 2016 From: mark at senn.us (Mark Senn) Date: Thu, 15 Dec 2016 16:49:43 -0500 Subject: [Purdue-pm] followup to last night's meeting Message-ID: <843e0084399cc7c1ca5b0305cce35afb@senn.us> This is a followup to last night's meeting regarding Jupyter worksheets (similar to Mathematica notebooks), Mathematica, and Mathematica's built-in data---in particular, WeatherData and WeatherForecastData. DERRICK, Even if I could get Jupyter to run locally, instead of over the web I'd still want to use Mathematica. The breadth and depth of the Mathematica language plus all the curated data that's available conveniently for Mathematica makes it too nice and too productive not to use for science-related programming. JOE, Regarding working with weather data, you may be interested in: typing "lafayette indiana weather" into wolframalpha.com An explanation of how to use numerical weather data in Mathematica: http://www.wolframalpha.com/examples/WeatherAndMeteorology.html http://reference.wolfram.com/language/ref/WeatherData.html http://reference.wolfram.com/language/ref/WeatherForecastData.html And a simple example: # Type a semicolon followed by Enter after each line # if you're writing a program---type Shift-Enter if # you are entering the commands one-by-one and want # to see results for each line immediately. # Get mean monthly temperatures for 1600 through 2016. wd = WeatherData["KLAF", "Temperature", {{1600}, {2016}, "Month"}] # 528 data points from 1973-01-01 to 2016-12-01 are returned. Length[wd] # Plot the time series. p = DateListPlot[wd] # Export the time series plot to a "z.png" file. Export["z.png", p] (To see if the globe is warming, one could loop over weather stations, get temperature data, and test (perhaps do a best fit of the data to a linear equation and plot a dot at each weather station that varies from blue to red depending on the slope of the best fit). Mathematica also has routines for contour lines and confidence ellipses built-in.) -mark From gizmo at purdue.edu Fri Dec 16 11:31:24 2016 From: gizmo at purdue.edu (Joe Kline) Date: Fri, 16 Dec 2016 14:31:24 -0500 Subject: [Purdue-pm] followup to last night's meeting In-Reply-To: <843e0084399cc7c1ca5b0305cce35afb@senn.us> References: <843e0084399cc7c1ca5b0305cce35afb@senn.us> Message-ID: <3023b1d0-9a46-d8cd-2de2-b8daae6fb84b@purdue.edu> Mark, that is partly helpful. I want hourly data and looks to be daily data. My data set is approximately 43x365.25x24 (since the KLAF data only goes back to January 01, 1973 midnight). joe -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: OpenPGP digital signature URL: From mark at senn.us Fri Dec 16 20:55:01 2016 From: mark at senn.us (Mark Senn) Date: Fri, 16 Dec 2016 23:55:01 -0500 Subject: [Purdue-pm] followup to last night's meeting In-Reply-To: <3023b1d0-9a46-d8cd-2de2-b8daae6fb84b@purdue.edu> References: <843e0084399cc7c1ca5b0305cce35afb@senn.us> <3023b1d0-9a46-d8cd-2de2-b8daae6fb84b@purdue.edu> Message-ID: <8c715ae1fa996b020aad62cf680481dc@senn.us> Joe Kline wrote on 2016-12-16 at 14:31: | that is partly helpful. | | I want hourly data and looks to be daily data. | | My data set is approximately 43x365.25x24 (since the KLAF data only goes | back to January 01, 1973 midnight). Type each Mathematica code line below followed by Shift-Enter. # Get Purdue Airport temperature data for 2016-12-15 0200 to 2100. wd = WeatherData["KLAF", "Temperature", {{2016, 12, 15, 2,0,0}, {2016, 12, 15, 21,0,0}}] # The data is shown---there were 20 entries, the first at 02:54:00, the last at 20:54:00. # Plot the data. The "PlotMarkers->Automatic" marks each data point with a dot. DateListPlot[wd, PlotMarkers -> Automatic] # Show the second element of wd. wd[[2]] # Left click on "show all" to show all the data. # Note that there is a "Missing[NotAvailable]" entry. # Show the times of the readings in an integer representing number of seconds. times = Flatten[wd[[2,2]]] # Convert the times to a human readable form. FromUnixTime /@ times # Left click on "show all" to show the human readable times. # A total of twenty times are shown. # Get weather data for 1970 through the present. wd = WeatherData["KLAF", "Temperature", {{1970, 1, 1, 0, 0, 0}, DateList[]}] # The first entry returned was for one hour before 1973-01-01 0100. # (I don't write 0000 because some people think that's at the end of the # day instead of the beginning.) # A short summary of the time series produced is printed. # It stated that 440,960 points were returned. # Ask Mathematica how many hours it has been since January 1, 1973 # using it's natural language interface. = how many hours ago was 1am, January 1, 1973? # The result was 385,343. My guess is it is working ok. I can't explain # the difference between 385,343 hours and 440,960 points offhand # but I'll but there is an explanation for it and data is taken somewhere # around once an hour when everything is working ok. Typing, for example = how many hours ago was 1am, January 1, 1973? in Mathematica uses WolframAlpha technology to answer the question. You can go to wolframalpha.com and ask it questions using natural language---you don't need to prefix questions with a "=" though. -mark