Javier Neira's Library tagged → View Popular
The Continuation Monad in Clojure
-
(defn func-a [x]
(inc x))
(defn func-b [x]
(* 2 x))
(defn func-c [x]
(dec x))
(defn fn1 [x]
(let [a (func-a x)
b (func-b a)
c (func-c b)]
c)) -
Also note that fn1 could have been defined like:
(def fn1 (comp func-c func-b func-a))
- 6 more annotations...
Working in Java time - JavaWorld
1. Java reckons time in milliseconds before or after the start of January 1, 1970.
2. The Date class's constructor Date() returns an object that represents the moment the object was created. Date's getTime() method returns a long value whose number equals the number of milliseconds before or after January 1, 1970.
3. The DateFormat class is used to convert Dates to Strings, and vice versa. The static getDateInstance() method returns a DateFormat object in the default format; the getDateInstance(DateFormat.FIELD) returns a DateFormat object with a specified format. The format(Date d) method returns a String that represents the date, such as "January 1, 2002." Conversely, the parse(String s) method returns a Date object based on the date the String argument represents.
4. The appearance of Strings returned by the format() method can vary according to the regional settings on the computer where the program is being run.
5. The GregorianCalendar class has two important constructors: GregorianCalendar(), which returns an object that represents the moment it was created, and the GregorianCalendar(int year, int month, int date) constructor used to create an object that represents an arbitrary date. The GregorianCalendar class's getTime() method returns a Date object. The add(int field, int amount) method calculates dates by adding or subtracting units of time like days, months, or years.
-
- This article builds on the information presented in my Calculating Java Dates article (JavaWorld, December 29, 2000). Here I've listed some key points from that article that should be familiar to you. If these points are
- Java reckons time in milliseconds before or after the start of January 1, 1970.
- The
Dateclass's constructorDate()returns an object that represents the moment the object was created.Date'sgetTime()method returns alongvalue whose number equals the number of milliseconds before or after January 1, 1970.
- The
DateFormatclass is used to convertDates toStrings, and vice versa. The staticgetDateInstance()method returns aDateFormatobject in the default format; thegetDateInstance(DateFormat.FIELD)returns aDateFormatobject with a specified format. Theformat(Date d)method returns aStringthat represents the date, such as "January 1, 2002." Conversely, theparse(String s)method returns aDateobject based on the date theStringargument represents.
- The appearance of
Strings returned by theformat()method can vary according to the regional settings on the computer where the program is being run.
- The
GregorianCalendarclass has two important constructors:GregorianCalendar(), which returns an object that represents the moment it was created, and theGregorianCalendar(int year, int month, int date)constructor used to create an object that represents an arbitrary date. TheGregorianCalendarclass'sgetTime()method returns aDateobject. Theadd(int field, int amount)method calculates dates by adding or subtracting units of time like days, months, or years.
not clear to you, I recommend that you read "Calculating Java Dates" for further explanation.
Clojure tutorial: fetching web comics (part 1) « Occasionally sane
-
for each comic:
get the html
extract the image URL with a regex
display the complete image URL
Selected Tags
Related Tags
Sponsored Links
Top Contributors
Groups interested in tutorial
-
Poster Ideas
photoshop Tutorials , Ideas...
Items: 9 | Visits: 220
Created by: marco flores
-
Screencast/Tutorial Software
Items: 13 | Visits: 207
Created by: Darren Draper
-
Tutorials
Une liste dédiée aux tutori...
Items: 7 | Visits: 93
Created by: DELBAR Edouard
Highlighter, Sticky notes, Tagging, Groups and Network: integrated suite dramatically boosting research productivity. Learn more »
Join Diigo
