Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newspeer1.nac.net!newspump.sol.net!posts.news.twtelecom.net!nnrp3.twtelecom.net!not-for-mail From: "Hans Michel" Newsgroups: comp.soft-sys.math.mathematica Subject: Re: Chained-functional notation examples? Date: Fri, 9 May 2014 06:07:26 +0000 (UTC) Sender: steve@smc.vnet.net Approved: Steven M. Christensen , Moderator Message-ID: References: <000901cf6ac8$b3fb5470$1bf1fd50$@cox.net> Lines: 135 Organization: Time-Warner Telecom NNTP-Posting-Date: 09 May 2014 06:13:44 GMT NNTP-Posting-Host: 10cb54c9.news.twtelecom.net X-Trace: DXC=60]E[oLZD978mB8O8Rk7=0C_A=>8kQj6=;[h;PUXBgb4j4eD5l`OG??EFiONJ7[Go6VY7Scc8_6J3 X-Complaints-To: abuse@twtelecom.net Xref: csiph.com comp.soft-sys.math.mathematica:16922 I think the dates would have to be rounded to Day then the AbsoluteTime would be more comparable. AbsoluteTime[DayRound[DateList[], All]] < AbsoluteTime[DayRound[DayPlus[DateList[], 3], All]] Issues may be file dates compared to current date time, rounding and location (timezone) issues. DayRound is New in version 9 Switch to Take[] goes all the back to v1. AbsoluteTime v2. AbsoluteTime[Take[DateList[], 3]] < AbsoluteTime[Take[DayPlus[DateList[], 3], 3]] FileDate[] in the original suggestion by Daniel only goes back to v3. To address the poster's original questions: I don't believe that Mathematica has issues in filtering or using a water-fall like method. I can't speak to if Mathematica optimizes such a process. Hans -----Original Message----- From: Daniel Lichtblau [mailto:danl@wolfram.com] Sent: Thursday, May 08, 2014 9:37 AM To: Hans Michel; mathgroup@smc.vnet.net Subject: Re: Chained-functional notation examples? On 05/08/2014 09:20 AM, Hans Michel wrote: > Daniel: > > Now What's the catch with Today? > > Today will only work in Wolfram Language (Mathematica v 10), which may > be officially released Tomorrow? > > One can go on with a Who's on First theme. (Goes along with W|A > baseball > data) > > But currently the DateObject "Today" would have to be changed to > something that would work in Mathematica 9 or below. > > Hans Hans et al, You are correct, I was using an unreleased version. Actually some good came of it (I found a weakness in date comparisons that got addressed). I'll leave modification for versions <=9 to others more adept at this sort of thing. I never was much good with dates... As for baseball, http://www.redreporter.com/2012/2/13/2796324/hus-on-first-a-modernization Daniel > -----Original Message----- > From: Daniel Lichtblau [mailto:danl@wolfram.com] > Sent: Thursday, May 08, 2014 3:08 AM > To: mathgroup@smc.vnet.net > Subject: Re: Chained-functional notation examples? > > > A query such as this might do what you have in mind. Here > directoryname should be changed to whatever directory you want searched. > > Select[FileNames[("*uid*" | "*UID*"), directoryname, Infinity], > ((StringMatchQ[DirectoryName[#] , "*egal*"] && Today < > DayPlus[FileDate[#], 3]) &] > > Also there is a case sensitive switch if you want to allow strings with e.g. > "uID". If you want to allow that uid only in the name and not full > string > > Daniel Lichtblau > Wolfram Research > > ------------------- > > On Tue, 06 May 2014 06:26:46 +0000, Unknown wrote: > > > I came to 'Mathematica' via Xahlee's criticism of the ad-hoc > nature of > unix-piping [functional notation]. He claims [& I > believe him] that > Mathematica has a better, more consistent > notation. But the facility of > PRE, IN & POST-fix alternatives, > seems bad. You want ONE way of > acieving the goal. More rules just increases mental load. > > > > A major benefit of functional [unix-piping] programming style, is > that > you don't need to remember the-full-journey: you just need to > remember > the previous stage's output. Nor do you need to remember several names: > > the previous output is just "it". A superficial read through a > recent > article[s] here, about servers, and > agregating it, and sending the result to a master> > seemed very > interesting, and matches my ideas of using functional > programming. But > I can't afford to invest in ANOTHER > notation/syntax, without good > prospect of productivety increase. > > > > Just as a test, how would Mathematica handle the following [or > part of] >> little task: > > > > search all files in Dir=tree D | > > which are less than N days-old | > > and which contain string S1 | > > and which contain string S2 . > > > > Actually, this seems not a good example, since it's biased towards > the > *nix file system's format/syntax. > > > > Try: > > Search in table of ListOfOpenFiles for lineS with path-P [field] | > > which have same tty-field as line with path-P2 & program-M [field] > > > This sounds like a data-base problem? > > > > Or is there a nice list of 'such' Mathematica examples? > > > > Thanks, > > > > == John Grant. > > Here's a related real-live problem: > list all files in Dir-tree:D | > which are less-than daysOld:N | > and contain "egal" in the FullPathName | > and contain String:"uid" OR "UID" >