From 382dcd99543b2c77b46f738b697be722ae67564f Mon Sep 17 00:00:00 2001 From: Offray Luna Date: Fri, 15 Apr 2022 07:36:53 -0500 Subject: [PATCH] Calculating time subperiods for tweets histogram. --- .../Integer.extension/instance/periodsSince.until..st | 11 +++++++++++ .../Integer.extension/properties.json | 3 +++ 2 files changed, 14 insertions(+) create mode 100644 Socialmetrica.package/Integer.extension/instance/periodsSince.until..st create mode 100644 Socialmetrica.package/Integer.extension/properties.json diff --git a/Socialmetrica.package/Integer.extension/instance/periodsSince.until..st b/Socialmetrica.package/Integer.extension/instance/periodsSince.until..st new file mode 100644 index 0000000..9f71e5d --- /dev/null +++ b/Socialmetrica.package/Integer.extension/instance/periodsSince.until..st @@ -0,0 +1,11 @@ +*Socialmetrica +periodsSince: startingDate until: endingDate + | endings subperiodDuration | + subperiodDuration := (endingDate - startingDate) / self. + endings := OrderedCollection new. + endings add: startingDate. + 1 to: self do: [ :i | | ending | + ending := startingDate + (subperiodDuration * i). + endings add: ending. + ]. + ^ endings \ No newline at end of file diff --git a/Socialmetrica.package/Integer.extension/properties.json b/Socialmetrica.package/Integer.extension/properties.json new file mode 100644 index 0000000..a8c2b93 --- /dev/null +++ b/Socialmetrica.package/Integer.extension/properties.json @@ -0,0 +1,3 @@ +{ + "name" : "Integer" +} \ No newline at end of file