Library as a control desk

596 views
Skip to first unread message

Javier Peñas Fernández

unread,
Sep 8, 2023, 6:39:21 AM9/8/23
to mementodatabase
I have a library that contains customer data (name, phone number, city, etc.) and another one for employee data (name, phone number, city, etc.). Would it be possible for a third database to serve as a control desk so that it contains fields that perform calculations on the two initial libraries (customers and employees)?

For example, a field in this third database could be "the number of customers living in a certain city," and another one that adds the number of customers from a certain city in the 'customers' library to the number of employees from the same city in the "employees" library.

The purpose of this third database is to have aggregated information from each of the two main libraries without the need to open each one to retrieve data and then manually sum them.

Thank you very much.

Bill Crews

unread,
Sep 8, 2023, 7:51:35 AM9/8/23
to Javier Peñas Fernández, mementodatabase
When would you add an entry to the Composite (3rd) library? What would be its entry name? City?

I think that, if you flesh out your actual anticipated use cases, you'll find answers to such questions. Its entries list will be a list of what?

If it were to be City, you'd add a city the first time you run across a city that previously had no customers or employees. Then link to it from the Customers & Employees that are located there.

What about customers that have multiple locations? Maybe the locations are equivalent, maybe one is a headquarters, or maybe each one has a special function, like research & development or a distribution center.

If you don't use a 3rd library, you could use grouping & filters & tabs in one to identify cities or time zones and access the other library via links of some sort?

Maybe just think it through a little farther. I hope this helps with that.


--
You received this message because you are subscribed to the Google Groups "mementodatabase" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mementodataba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mementodatabase/2eb3826f-b220-4a4d-aca1-4fefcc07ca7dn%40googlegroups.com.

Javier Peñas Fernández

unread,
Sep 8, 2023, 11:40:47 AM9/8/23
to mementodatabase
Thank you for your interest, Bill.

Actually, I've wanted to simplify my need by imagining two libraries (Customers and Employees), but perhaps I've complicated it. My problem arises because I have three libraries with the data of my books (title, author, format, reading date, rating, etc.). I have three libraries because the volume of entries is so high (many thousands) that the application frequently crashed. By dividing it into three libraries, the application no longer crashes.

In the first library, there are books where the author's name begins with A to H; in the second, those that start from I to M; and in the third, those that start from N to Z. When I had a single library, I could easily make queries like, "how many books have I read?", "how many books do I have in paper format and how many in ebook?" etc. Now, with three libraries, I need to open each of them, note down the data I need from each one, and manually add them up outside of the application.

What would be very helpful to me is to know a way to query all three libraries at once and have the aggregated information in another library for reference with the sum of the three libraries. I assumed that I could create a library with fields for the queries/aggregations I mentioned. But I'm not sure if it's possible to do so, and if it is, how it would be best to do it.

Thank you very much.

Regards,

Bill Crews

unread,
Sep 8, 2023, 1:57:10 PM9/8/23
to Javier Peñas Fernández, mementodatabase
Oh, I'm sure it's doable. What comes to my mind is that you probably can't use JavaScript or Lookup fields due to the number of total entries. So, instead, either pick one of the libraries as the location of your queries or create a new library for that. Then let's look at the links & scripts you'll need to do your queries.

I'm imagining library Q that links to libraries B1, B2, & B3. Actually, you don't really need the links on an entry-by-entry basis, so let's leave them unlinked. There's an "authorization" process (simple) you have to do to authorize the scripts to access the other libraries. (Just press the Shield icon at the appropriate time.)

So, what are the fields to be involved in the queries, and what are the queries? I would imagine you have a name, author, ISBN, some List fields for categorization by topic or genre, and maybe a checkbox or two, maybe a #pages field.

So if you're querying counts of books read per category or genre, let's see what we'd have with a library action in Q with a couple of parameters/arguments...

let ah = libByName("B1");
let im = libByName("B2");
let nz = libByName("B3");

let topic = arg("Topic");  // Gets the topic from you
let genre = arg("Genre");  // Gets the genre from you

let ahentries = ah.entries();
let imentries = im.entries();
let nzentries = nz.entries();

let nbooks = 0;
let npages = 0;

for (x in ahentries) {
    let e = ahentries[x];
    if ((e.field("Topic") == topic) && (e.field("Genre") == genre)) {
        nbooks += 1;
        npages += e.field("Pages");
    }
}
for (x in imentries) {
    let e = imentries[x];
    if ((e.field("Topic") == topic) && (e.field("Genre") == genre)) {
        nbooks += 1;
        npages += e.field("Pages");
    }
}
for (x in nzentries) {
    let e = nzentries[x];
    if ((e.field("Topic") == topic) && (e.field("Genre") == genre)) {
        nbooks += 1;
        npages += e.field("Pages");
    }
}
message(nbooks + " matching books, " + npages + " pages");

Now, other than that brief message, what do you want to do with the result? You might want to keep some residual info in the Q library as statistics fields, updated upon execution of an action by button pushes or daily or whatever.

Now, these arrays (ahentries, imentries, & nzentries) will be very large, since your libraries are large. They'll probably fit in RAM and you'll get no execution errors, but it's possible you will. Memento's API doesn't really allow for access entry by entry, but only to grab all the data at once & then go through it.

You could have several actions, one per query type, maybe with different arguments/parameters.

Let me know if you have other ideas, need some help, or whatever. Good luck.


Er Mo

unread,
Sep 8, 2023, 2:32:20 PM9/8/23
to mementodatabase
Hallo
Dafür könnte man die Widgets verwenden . Diese so einrichten das sie alle 3 Bibliotheken abfragen und Anzeigen . Das dann in alle 3 Bibliotheken einbauen . So habe ich eine Einheitlichen aussehen das überall verfügbar ist .

Hello
You could use the widgets for this. Set this up so that you query and display all 3 libraries. Then install this in all 3 libraries. So I have a uniform look that is available everywhere.

Ernst

Bill Crews

unread,
Sep 8, 2023, 3:20:52 PM9/8/23
to Er Mo, mementodatabase
Ah, yes. I really need to try widgets. I haven't touched them yet, though I do see how the UI library works.


Javier Peñas Fernández

unread,
Sep 9, 2023, 7:06:47 AM9/9/23
to mementodatabase
Hello, Bill:
I must have done something wrong while following your instructions because I'm getting this error message: "Script error: ReferenceError: 'epub' is not defined."
Here's what I've done:
1. I created a library called CONTROL with a single field named EPUB with the format "Integer."
2. Within this library, I created an action script with the action location set to "Library" with the following content:
let ah = libByName("Libros 0-H");
let im = libByName("Libros I-M");
let nz = libByName("Libros N-Z");
let topic = arg("epub");  // Gets the topic from you

let ahentries = ah.entries();
let imentries = im.entries();
let nzentries = nz.entries();
let nbooks = 0;
let npages = 0;
for (x in ahentries) {
    let e = ahentries[x];
    if (e.field("epub") == 1) {
        nbooks += 1;

    }
}
for (x in imentries) {
    let e = imentries[x];
    if (e.field("epub") == 1) {
        nbooks += 1;

    }
}
for (x in nzentries) {
    let e = nzentries[x];
    if (e.field("epub") == 1) {
        nbooks += 1;

    }
}
message(nbooks + " matching books, " + npages + " pages");

3. I have granted all the permissions for the script.

What I intended was for the EPUB field in the CONTROL library to collect the sum of the number of entries in the LIBROS 0-H library where the EPUB field is equal to "1," plus the same for entries in the LIBROS I-M library, and also for the LIBROS N-Z library.

Thank you very much for your assistance.

Javier Peñas Fernández

unread,
Sep 9, 2023, 7:08:43 AM9/9/23
to mementodatabase
Hello, Ernst:
I have tried using widgets, but they don't work, perhaps due to the large number of fields they have to handle: tens of thousands.
Thank you for your interest.

Bill Crews

unread,
Sep 9, 2023, 7:57:38 AM9/9/23
to Javier Peñas Fernández, mementodatabase
Several things...

The error message identifies the error line with js#4 or whatever line number. What line is identified in your error message? I don't see a line that would produce this error.

You prompt yourself for a topic and then don't use it. Maybe it's not needed? Maybe delete line 4.

You talk about an EpUb field with various capitalizations of epub. Both Memento and JavaScript are very picky about capitalization. If it's EPUB, stick with that. (Is it EPUB in CONTROL and epub in your book libraries?) If so, your script is OK in this regard.

Not important, but you define npages, but you don't use it. Maybe you don't need it.

As I understand you & your code, you want to create a new entry in CONTROL each time you query and retain the count of books across the 3 book libraries? If it were me, if probably want to retain any other query parameters along with the integer result. Otherwise, CONTROL will be just a library of counts with no indication of what query yielded the result. At least the date and time?

The actual query used is to count the books for which the epub (lowercase) is equal to 1, yes? If epub is a Checkbox field, compare it to True instead. If it's really an Integer field, maybe you want count += e.field("epub").

If you do intend to create entries in CONTROL per query as above and use no argument/parameters (prompts), then you probably should put the script in an entry trigger AfterCreatingTheEntry trigger instead of an action. So, in that case, you would go to CONTROL, press the + to add an entry, enter any query info you might want to save with the count, if any, then save the entry. The script will then run, and the added entry will contain an EPUB field with your calculated result.

Add the following line as the first line of your script...

let result = entry();

Replace the final message() line with...

result.set("EPUB", nbooks);
// Also, add similar result.set() lines for each other query field, if any, you may have
message(nbooks + " matching books");

Please let us know how it goes. (By the way, what time zone are you in, if I may ask?)


Er Mo

unread,
Sep 9, 2023, 1:50:29 PM9/9/23
to mementodatabase
Hallo
Wenn ich schon ein Bibliothek NUR für das Zählen der Felder  " epub " mit Wert 1 habe , würd ich da 3 Einträge machen . Für jede Bibliothek einem Eintrag und hab die Summe bilden . Zur Änderung der Anzahl würde ich In den Bibliotheken ( 0-H , I-M, N-Z ) ein Skript laufen lassen , das bei einen Neuen Eintrag mit den Wert 1 die Zahl in der Sammlungsbibliothek ebensfals erhöt . Weiß nicht ob es möglich sein soll den Wert von 1 auf 0 zu ändern .

Hello
If I already have a library ONLY for counting the fields “epub” with a value of 1, I would make 3 entries there. For each library an entry and have the sum. To change the number, I would run a script in the libraries (0-H, I-M, N-Z) that would also increase the number in the collection library when there is a new entry with the value 1. Don't know if it should be possible to change the value from 1 to 0.

Ernst

Javier Peñas Fernández

unread,
Sep 10, 2023, 8:51:05 AM9/10/23
to mementodatabase
Hello, Bill:

As you indicated me:

1. I have removed the topic request from line 4.
2. I have changed the name of the field in the CONTROL library to avoid it matching the field name in the LIBROS 0-H, LIBROS I-M, and LIBROS N-Z libraries. I have now named the CONTROL library field EBOOKEPUB, while the fields in the 3 LIBROS libraries are named EPUB.
3. I have made the capitalization of field names consistent across the different libraries.
4. You understood correctly: I want to create a new entry in CONTROL each time I query and retain the count of books across the three book libraries. Ideally, and to start with, I would like to create a CONTROL library entry with fields every time I run the script, with the intention of tracking data changes over time:
   a. DATE: Date and hour of the query
   b. EBOOKEPUB: Number of EPUB format books in the three libraries LIBROS 0-H, I-M, and N-Z.
   c. Once this aggregation works well, I will add more fields such as the number of paperback books, the number of books I have read between two dates, etc., but always as the sum of the three mentioned libraries.
5. Entries with books in the LIBROS 0-H, I-M, and N-Z libraries have a field named EPUB of the checkbox type, so I have changed the conditions to "True" instead of "1".
6. I have added the first line you indicated: let result = entry();
7. I have replaced the last line as you instructed: result.set(“EBOOKEPUB", nbooks);
8. I don't understand your paragraph regarding the type of script I should use and where to place it. I have placed the script in the CONTROL library > Menu > Scripts > Action > Action place > Library. Where do you suggest it would be better to place it and how?
9. With all these changes, this is the script that remains:
let result = entry()

let ah = libByName("Libros 0-H");
let im = libByName("Libros I-M");
let nz = libByName("Libros N-Z");
let ahentries = ah.entries();
let imentries = im.entries();
let nzentries = nz.entries();
let nbooks = 0
for (x in ahentries) {
    let e = ahentries[x];
    if (e.field("EPUB") == True) {

        nbooks += 1;
    }
}
for (x in imentries) {
    let e = imentries[x];
    if (e.field("EPUB") == True) {

        nbooks += 1;
    }
}
for (x in nzentries) {
    let e = nzentries[x];
    if (e.field("EPUB") == True) {
        nbooks += 1;
    }
}
result.set("EBOOKEPUB", nbooks);

10. When I execute the script in the CONTROL library, Memento takes a long time to and, finally, it takes me out of the library and returns me to the main screen with all the LIBROS 0-H, I-M, N-Z libraries. No entry has been created in the CONTROL library. It doesn't display any error message. I have executed the script several times, and it always does the same thing. Could it be due to the large number of entries it has to process (tens of thousands)?

Thank you very much for your help, Bill.

Greetings from Spain (time zone UTC+1).

Javier Peñas Fernández

unread,
Sep 10, 2023, 8:58:16 AM9/10/23
to mementodatabase
Hello, Ernst:

If I understand you correctly, in the end, I would have to do something similar to what Bill suggests, but generating three results that would go to three different fields, whose results could be summed up in a fourth field. What I don't understand is having a script in each of the LIBROS 0-H, I-M, and J-Z libraries. Also, I wouldn't be able to put a second script in these latter libraries since I already have one to create the entry date for each entry (I have the Free version of Memento).


Thank you for your interest.

Er Mo

unread,
Sep 10, 2023, 2:17:33 PM9/10/23
to mementodatabase
Hallo
Du musst das Skript von Bill in einnen Trigge ( Auslöser ) speichern . Unter " Erstellen eine Eintrag " " Vor den Speichern " . Wenn du dann einen Neuen Eintrag erstellst wird das Skript ausgeführt und der Wert in das Feld "EBOOKEPUB " geschriben .
Zu Meinen Vorschlag: Du hast in der " CONTROL " Bibliothek das Skript , das alle 3 Bibliotheken durchsucht und die Werte in das Feld einträgt . Dabei müsse alle 3 Bibliotheken durchsucht werden . Mein Vorschlag geht einen Anderen Weg . Die Bibliothek meldet die Änderung der CONTROL Bibliothek . So muss ich keine Bibliothek durchsuchen und habe den Aktuellen Stand ohne das ich etwas Aufrufen muss .

Hello
You need to save Bill's script into a trigger. Under “Create an entry” “Before saving”. When you then create a new entry, the script is executed and the value is written into the "EBOOKEPUB" field.
To my suggestion: You have the script in the "CONTROL" library that searches all 3 libraries and enters the values in the field. All 3 libraries must be searched. My suggestion takes a different approach. The library reports the change to the CONTROL library. This way I don't have to search through a library and I have the current status without having to call anything up.

Ernst

Bill Crews

unread,
Sep 10, 2023, 6:02:38 PM9/10/23
to Javier Peñas Fernández, mementodatabase

Well, excellent, Javier. So, we're past the error message, at least. When I said to replace the final message() line with the e.set() line, I also suggested you retain the shortened message(), but since you didn't do that one thing, you're getting no indication of a result when it finishes. And since the action script doesn't add an entry to CONTROL, you get no result there, either. We'll fix it.


It may sound bad right now, but we're getting there. I think the next try may get you what you want. I'll try to be clear enough to help you make that the case.


So, what I was trying to shift you to do was to use an entry in CONTROL to represent a query, with a timestamp, optionally 2 query input fields, & one query output field. Your current action script doesn't create that entry.


So, to create it, though we could manually create an entry from within the action script, it is much cleaner & more natural to just add the entry, provide any input, like date & time, maybe an author and/or a genre, and the script can match against the inputs and create the entry.


To run upon creating an entry in CONTROL, it is most natural to place your script into a trigger that fires After Creating The Entry. For the following procedure, I'll assume you might care about the author and maybe also the genre. The result cab be in a field called EBOOKEPUB if you like, but I'd probably call it #Books or something like that.


First, the procedure to run the query…

  1. Open CONTROL

  2. The current date & time will be filled in automatically. If you want a count only of books by an author, fill in the Author field. (If authors are kept in their own library, that would be a selection from the list of author links. If they're in a choice list field in CONTROL, then it would be a selection from that list. The same for the genre.) If you don't care about the author or genre (field Genre), don't enter anything into those fields, but do create those fields if you want my script to work.

  3. When you push the checkmark icon to save & close the entry, the trigger script will run, so some time will pass, and then the entry will be saved with the #Books field filled in, and if you entered an author and/or a genre, that'll be there, as well.


So, you'll be collecting the timestamped queries along with any query parameters & the number of matching books based on those parameters.


To get from where you are to that status, I think you'll need to do the following…

  1. Copy my trigger script below. It is an edit from your action script.

  2. Still within Scripts, add a trigger this time, indicating that it should trigger After Creating The Entry.

  3. Then, you'll be in the script editor, so start by pasting my copied script into the editor.

  4. Name the script whatever you like & save it.

  5. If you want to disable your action script, you could do that now. It's just a matter of whether the Play button shows up when you open CONTROL.


Here's the trigger script…


let e = entry();

let author = e.field("Author");

let genre = e.field("Genre");


let ah = libByName("Libros 0-H");

let im = libByName("Libros I-M");

let nz = libByName("Libros N-Z");

let ahentries = ah.entries();

let imentries = im.entries();

let nzentries = nz.entries();


let nbooks = 0;

for (x in ahentries) {

    let ebook = ahentries[x];

    if (ebook.field("EPUB") == True) {

        if (((author == null) || (author == ebook.field("Author")) &&

            ((genre == null) || (genre == ebook.field("Genre")))

           nbooks += 1;

    }

}

for (x in imentries) {

    let ebook = imentries[x];

    if (ebook.field("EPUB") == True) {

        if (((author == null) || (author == ebook.field("Author")) &&

            ((genre == null) || (genre == ebook.field("Genre")))

            nbooks += 1;

    }

}

for (x in nzentries) {

    let ebook = nzentries[x];

    if (ebook.field("EPUB") == True) {

        if (((author == null) || (author == ebook.field("Author")) &&

            ((genre == null) || (genre == ebook.field("Genre")))

            nbooks += 1;

    }

}


e.set("#Books", nbooks);


Now, about the script changes…


Triggers operate on the current entry, so we by convention set e to that entry (in CONTROL). The next 2 lines fetch any parameter values you might have entered into variables for use in the for loops.


In the for loops, I changed the entry variable name to ebook to distinguish it from the entry in CONTROL. I also added additional conditions for nbooks to be incremented. If you don't enter anything into a parameter field, the variable (author or genre) will be null and will therefore not affect the match.


I used my name for the book count in the CONTROL entry. Sorry. I typed it before thinking.


So, we're using the same general mechanism as we were before, just making it into a trigger to get the CONTROL entry.


Regarding Ernst's message, we each contribute ideas and don't feel we are competing. His ideas are good. In this case, I argue for mine for the flowing reasons…

  • I don't see that you want to keep query information about each book library, but only overall. Of course, I could be wrong.

  • Putting scripts in the book libraries would complicate the process. Maybe Ernst envisions a benefit that I'm not realizing.


I'm sure that my colleague Ernst will agree that we hope you'll use whatever ideas either of us contributes. We are each guessing what you really want, so of course, either of us could guess incorrectly.


Please continue to let us know how it goes, and good luck.



Javier Peñas Fernández

unread,
Sep 11, 2023, 3:28:25 AM9/11/23
to mementodatabase
Hello, Bill:

To avoid issues with field names, I've left the trigger script exactly as you wrote it and modified the CONTROL field names to be #Books, Author, and Genre.

I've placed the script as a trigger when creating an entry and after saving it. When running it, the following error message appears:

">Script error: missing ) in parenthetical (Trigger 1.js#17)

I've reviewed the parentheses, and I can't figure out where they are missing. I apologize.

Thank you very much, Bill.

Bill Crews

unread,
Sep 11, 2023, 11:45:35 AM9/11/23
to Javier Peñas Fernández, mementodatabase
Please, no apologies! You're taking action very well, and frankly, I didn't (yet) created my own versions of your libraries & fields, your trigger, and try out the code myself, and due to that, this error is all mine, so I guess I owe you the apology. I'm making the libraries etc now.

(Time passes.)

WOW! I have made SO many errors, and Memento has returned results I wouldn't have expected! I should have created the libraries and tested in the beginning. Many apologies. This illustrates why I shouldn't be doing this kind of work any more.

Well, I'm sending you may latest code with debugging (message() statements) still in there, because at the moment, with my text data and current lacking brain power, I can advance it any farther. I might be able to fix it on my own late this afternoon. Here's my code...

let e = entry();
let author = e.field("Author");
let genre = e.field("Genre");

let ah = libByName("Libros 0-H");
let im = libByName("Libros I-M");
let nz = libByName("Libros N-Z");
let ahentries = ah.entries();
let imentries = im.entries();
let nzentries = nz.entries();

var nbooks = 0;
message(ahentries.length + " in ahentries")
for (x in ahentries) {
    let ebook = ahentries[x];
    if (ebook.field("EPUB") == true) {
        if ( ((author == null) || (author == ebook.field("Author")) &&
            ((genre == null) || (genre == ebook.field("Genre"))) )) {
        nbooks += 1;
        }
    }
}
message(imentries.length + " in imentries")
for (x in imentries) {
    let ebook = imentries[x];
    if (ebook.field("EPUB") == true) {
        if ( ((author == null) || (author == ebook.field("Author")) &&
            ((genre == null) || (genre == ebook.field("Genre"))) )) {
            nbooks += 1;
        }
    }
}
message(nzentries.length + " in nzentries")
for (x in nzentries) {
    let ebook = nzentries[x];
    if (ebook.field("EPUB") == true) {
        message("nz EPUB is true, author " + author + ", genre " + genre);
        if ( ((author == null) || (author == "") || (author == ebook.field("Author")) &&
            ((genre == null) || (genre == "") ||  (genre == ebook.field("Genre"))) )) {
            message("Incrementing nz nbooks");
            nbooks += 1;
        }
    }
}

message(nbooks + " books")
e.set("#Books", nbooks);

If you don't fill in Author or Genre, you should get your full count of books with the EPUB box checked. The debug message well give you a glimpse of its status along the way. I'm sorry to do this to you. I think we can get it soon, but my brain is falling at the moment.

Please keep in touch. I will, too.


Javier Peñas Fernández

unread,
Sep 11, 2023, 1:02:01 PM9/11/23
to mementodatabase
Hello Bill,

I've used your latest script, but every time I executed it, Memento would crash and kick me out of the CONTROL library without any error message. This led me to suspect that it might be a problem due to the number of entries in the three LIBROS libraries.

As a result, I've created three more libraries with the same LIBROS structure and just a few entries in each. Additionally, I simplified your script because I wanted to test its functionality only when the EPUB checkbox was checked (I changed "True" to "1" because it was giving me an error). Here's how the script looks now:

let e = entry();
let ah = libByName("Libros 0-H Copy");
let im = libByName("Libros I-M Copy");
let nz = libByName("Libros N-Z Copy");

let ahentries = ah.entries();
let imentries = im.entries();
let nzentries = nz.entries();
var nbooks = 0;

for (x in ahentries) {
    let ebook = ahentries[x];
    if (ebook.field("EPUB") == 1) {

        nbooks += 1;
        }
    }

for (x in imentries) {
    let ebook = imentries[x];
    if (ebook.field("EPUB") == 1) {

        nbooks += 1;
        }
    }

for (x in nzentries) {
    let ebook = nzentries[x];
    if (ebook.field("EPUB") == 1) {
        nbooks += 1;
        }
    }

e.set("#Ebooks", nbooks);

And it worked perfectly: it summed the number of entries with the EPUB field checked in the three LIBROS libraries and it places it in the #Ebooks field. Therefore, your script is correct, but it doesn't work due to the large number of entries in the LIBROS libraries, which have thousands of entries.

Once again, the issue of the large number of entries that forced me to split a single library into three smaller but still very large ones is causing new problems that, I'm afraid, cannot be solved the way Memento currently functions. What a pity.

Thank you very much, Bill, for your interest and the time you've dedicated.

Best regards,

Er Mo

unread,
Sep 11, 2023, 2:14:10 PM9/11/23
to mementodatabase
Hallo
Ich Glaube Der Fehler Liegt Nicht in der Größe der Bibliotheken , sonder in der Schreibweise . In der IF Anweisung muss die Klammer in der selben Zeile geschlossen sein . So ist in Bill´s Skript das 1 Zeile :

if ( ((author == null) || (author == ebook.field("Author")) &&
            ((genre == null) || (genre == ebook.field("Genre"))) )) {

Diese Info kan durch das Kopieren verloren gegangen sein .


Hello
I don't think the error is the size of the libraries, but in the spelling. In the IF instruction, the bracket must be closed in the same line. So the 1 line is in Bill's script:

if ( ((author == null) || (author == ebook.field("Author")) &&
            ((genre == null) || (genre == ebook.field("Genre"))) )) {

This info can be lost by copying.


Ernst

Javier Peñas Fernández

unread,
Sep 11, 2023, 2:19:57 PM9/11/23
to mementodatabase
Thanks, Ernst.

Bill Crews

unread,
Sep 11, 2023, 6:34:53 PM9/11/23
to Er Mo, mementodatabase
Yes, Ernst, I had parenthesis-matching trouble in the time you quoted, which was before I built a test database and started debugging my code directly with Memento. However, I should say that elements of a statement in JavaScript (including parentheses (), brackets [], & braces{}) can be separated by whitespace, including vertical whitespace (line breaks), and that wasn't my problem. Before I started testing my code, I was just visualizing the parts of the statement wrong and thus matching my parentheses wrong.

Anyway, the last code I sent was after testing and ran successfully. My only trouble in the end was testing with various test data and queries and ensuring I was getting the right answers. It might have been right, but by then, my brain was fried, and I needed a break.

I learned couple of things... that true is a Boolean value in JavaScript, and True is not. (I had just forgotten and had programmed in too many languages.) Also, I thought Memento returned null for text fields that were not entered at all, but it appears that it returns an empty string ("").

So, after spending some time with my wife tonight, I'll take any input from the forum and finish testing the script and get back to the forum with my result.

By the way, after receiving the count, wouldn't it be nice to get links to the matching books, so I wouldn't have to go looking for them? I may add that code, though that would cause Javier to add some more structure (links) to his database. Thanks to both of you for your input. I'll get back to you after some hours.


Bill Crews

unread,
Sep 12, 2023, 7:45:19 PM9/12/23
to Er Mo, mementodatabase
I apologize for taking so long to get back to you. My problem is when including Author & Genre checking in the script. Memento insists that I add 2 parentheses )) to get it to work, but then the code doesn't work. I doubt the developer can address this issue. It appears to be a problem with the Rhino JavaScript engine built into Memento. I haven't tried it yet on the desktop edition. It may work fine there, but I've kept you in suspense for too long, so I have commented out the code Memento doesn't like and removed Author & Genre from my test libraries.

Here's my script, seeming to work fine for what you asked for. I have also attached a template file that will create my test libraries (all starting with "Javier ", so there should be no conflicts). You need not add the libraries. It is just an option.

Here's the script. Let me know if it works for you. I'll try on the desktop edition tomorrow with comments & extra parentheses removed and get back to you on whether it works with my code uncommented...

let e = entry();
// let author = e.field("Author(s)")[0].field("Name");
// let author = e.field("Author");
// let genre = e.field("Genre");

let ah = libByName("Javier Libros 0-H");
let im = libByName("Javier Libros I-M");
let nz = libByName("Javier Libros N-Z");
let ahentries = ah.entries();
let imentries = im.entries();
let nzentries = nz.entries();

let nbooks = 0;
// message(ahentries.length + " in ahentries")
for (x in ahentries) {
    let ebook = ahentries[x];
    if (ebook.field("EPUB") == true) {
/* Strange requirement by Memento to spoil by adding 2 parentheses
        if ( ((author == null) ||
              (author == ebook.field("Author")) &&
             ((genre == null) ||
              (genre == "") ||
              (genre == ebook.field("Genre")) ))) {
            message("Incrementing & linking ah");
*/
        nbooks += 1;
            e.link("0-H matches", ebook);
//        }
    }
}
// message(imentries.length + " in imentries")
for (x in imentries) {
    let ebook = imentries[x];
    if (ebook.field("EPUB") == true) {
/*
        if ( ((author == null) ||
              (author == "") ||
              (author == ebook.field("Author")) &&
             ((genre == null) ||
              (genre == "") ||
              (genre == ebook.field("Genre")) ))) {
            message("Incrementing & linking im");
*/
            nbooks += 1;
            e.link("I-M matches", ebook);
//        }
    }
}
// message(nzentries.length + " in nzentries")
for (x in nzentries) {
    let ebook = nzentries[x];
    if (ebook.field("EPUB") == true) {
/*
        message("nz EPUB is true, author [" + author + "], genre [" + genre + "]");
        if ( ( (author == null) ||
               (author == "")   ||
               (author == ebook.field("Author")) ) &&
             ( (genre  == null) ||
               (genre  == "")   ||
               (genre  == ebook.field("Genre")) ) ) ) {
                  message("Incrementing & linking nz");
*/
                  nbooks += 1;
                  e.link("N-Z matches", ebook);
//        }
    }
}

// message(nbooks + " books");
e.set("#Books", nbooks);

Javier Peñas Fernández

unread,
Sep 13, 2023, 2:18:46 AM9/13/23
to mementodatabase
Hello, Bill,

When running it, the following error message appears: "> Can`t execute script Trigger 1 org.mozilla.javascript.EcmaError: ReferenceError: “0-H martches” is not defined. (Trigger 1.js#51) at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java: 4280)"


Thank you very much, Bill.

Regards,

Javier
P.S.: Remember, please, no apologies.

Javier Peñas Fernández

unread,
Sep 13, 2023, 7:50:46 AM9/13/23
to mementodatabase
Hello, Ernst,

I would like to explore the alternative solution you suggested, which, as I understood it, is as follows: instead of having the CONTROL library calculate the data for each of the three libraries, LIBROS 0-H, LIBROS I-M, and LIBROS N-Z, each of these libraries should send the data to the CONTROL library. This way, instead of having a single script located in CONTROL, there would be three scripts, one in each LIBROS library. All of this is because, even though the single script in CONTROL is correct, Memento crashs due to the large number of entries it has to process. By dividing the script into each LIBROS library, it is possible that Memento may not crash. Do you know how to write in the script of each library so that the results of their calculations are written in a field of another library as CONTROL ?


Thank you very much.

Regards,

Javier

El sábado, 9 de septiembre de 2023 a las 19:50:29 UTC+2, ernst...@gmail.com escribió:

Bill Crews

unread,
Sep 13, 2023, 8:07:05 AM9/13/23
to Javier Peñas Fernández, mementodatabase
I am confused by the line #51, which points to code that would not generate such a message.

But I do see that I mistakenly sent you my code without adjusting to change the library names on lines 6-8 to remove "Javier " from the front of each, leaving the names you use. So, if you haven't already, make that adjustment yourself. There should be no further discrepancies.

Apology appeared in my head, but it remains unspoken, due to our agreement. 😉

Bill Crews

unread,
Sep 13, 2023, 8:26:21 AM9/13/23
to Javier Peñas Fernández, mementodatabase
The "crashing" you've mentioned is not an actual app crash, but rather a script for message not sure to the size of the libraries. I assure you that, on my test database, it ran through to the end 3 times, each with a different setting for the EPUB fields in the test entries.

I suggest staying on this course, and if you are satisfied with not limiting the results by author or genre, which you didn't actually ask for, was should have this working very soon.

I just sent you my response to your previous message. Let's see how that goes. I awakened just recently and have yet to drag out my laptop to try the desktop edition. I'll do that today. I have time before 10:00 my time (US eastern time) and then after 16:00.

WHAT EDITION & WHAT PLATFORM ARE YOU USING? If it's the desktop edition, I am hopeful JavaScript will work right there and that I can get that working, including the limits on author & genre.

I'm still working on the unified solution. If we (either you & I or you & Ernst) were to switch to the non-unified solution, how would during work? Independently on each of the 3 libraries. I don't know how to cause a script to run in another library from within CONTROL, so I guess it would have to be separately.

We should be translating for Ernst, so...
_________

Bei dem von Ihnen erwähnten „Absturz“ handelt es sich nicht um einen tatsächlichen App-Absturz, sondern um ein Skript zur Meldung, bei dem die Größe der Bibliotheken nicht bekannt ist.  Ich versichere Ihnen, dass es in meiner Testdatenbank dreimal bis zum Ende durchgelaufen ist, jeweils mit einer anderen Einstellung für die EPUB-Felder in den Testeinträgen.

Ich schlage vor, auf diesem Kurs zu bleiben, und wenn Sie damit zufrieden sind, die Ergebnisse nicht auf Autor oder Genre zu beschränken, was Sie eigentlich nicht gewünscht haben, sollte dies sehr bald funktionieren.

Ich habe Ihnen gerade meine Antwort auf Ihre vorherige Nachricht gesendet.  Mal sehen, wie das geht.  Ich bin erst kürzlich aufgewacht und muss meinen Laptop noch herausholen, um die Desktop-Edition auszuprobieren.  Das werde ich heute machen.  Ich habe Zeit vor 10:00 Uhr meiner Zeit (US-Ostzeit) und dann nach 16:00 Uhr.

WELCHE EDITION UND WELCHE PLATTFORM VERWENDEN SIE?  Wenn es sich um die Desktop-Edition handelt, hoffe ich, dass JavaScript genau dort funktioniert und ich es zum Laufen bringen kann, einschließlich der Einschränkungen für Autor und Genre.

Ich arbeite immer noch an der einheitlichen Lösung.  Wenn wir (entweder Sie und ich oder Sie und Ernst) auf die nicht einheitliche Lösung umsteigen würden, wie würden wir das während der Arbeit tun?  Unabhängig von jeder der 3 Bibliotheken.  Ich weiß nicht, wie ich ein Skript dazu veranlassen kann, in einer anderen Bibliothek innerhalb von CONTROL ausgeführt zu werden, daher müsste es vermutlich separat erfolgen.

Wir sollten für Ernst übersetzen, also...


Javier Peñas Fernández

unread,
Sep 13, 2023, 9:32:06 AM9/13/23
to mementodatabase
Hello Bill,

Yes, I had already changed the library names by removing "Javier." I have rerun the script, and it still gives me the same error message: "0-H matches" is not defined on line 51. In my possibly mistaken opinion, the error might be in the command line e.link("0-H matches", ebook); since there is no field or library name called "0-H matches" in any of my libraries. Just in case there was a missing field called "0-H matches" in the CONTROL library, I created it, and then the error message, also on line 51, is different: "Please specify 'Link to entry' field."

I am using a fairly powerful Android mobile device. I don't use any desktop platform because syncing times become endless with such large libraries and eventually result in a lockup.

Thank you, Bill.

Bill Crews

unread,
Sep 13, 2023, 10:55:12 AM9/13/23
to Javier Peñas Fernández, mementodatabase
OK, well, until I understand why JavaScript isn't working with my if statements, or into I manage to change them to accommodate Memento's JavaScript, I'll not be having author or genre matches, so we're talking about basic matches on EPUB.

Yes, you're right, I also neglected to mention that one of the things that does work is that those 3 link-to-entry fields will contain links to the books marked with EPUB, which to me seems like a big boon. So you need a many-to-many "0-H matches" link-to-entry field pointing to Libros 0-H, and a corresponding one for "I-M matches" & "N-Z matches". This fields will fill up with links to your EPUB books. If you have any difficulty with that, I can readily turn it off or modify it to your liking.


Er Mo

unread,
Sep 13, 2023, 1:26:08 PM9/13/23
to mementodatabase
Hallo Bill
Ich habe schon öffter broblemen mit den Befehl " link() " gehabt . Dieser hat auf der Mobilen Version nicht funktionirt , aber in der PC Version . Versuche es mal Ohne link()

Hello Bill
I've often had problems with the "link()" command. This didn't work on the mobile version, but it did work on the PC version. Try it without link()

Ernst

Javier Peñas Fernández

unread,
Sep 13, 2023, 1:36:18 PM9/13/23
to mementodatabase
Hello Bill.

I've made the changes you indicated me. When I run the script on the LIBROS 0-I libraries, etc. with just a few entries each, it works perfectly. However, when I run it on the complete Memento libraries, it freezes and terminates the script without doing anything or displaying an error message. It seems clear that there is a capacity issue in the Memento mobile version.

Thanks.

Bill Crews

unread,
Sep 13, 2023, 3:59:55 PM9/13/23
to Er Mo, mementodatabase
The link() worked fine on my test libraries on the mobile edition. I've never had trouble with it in the past. I haven't tried it yet on the desktop edition, but Javier doesn't use that edition anyway.


Bill Crews

unread,
Sep 13, 2023, 4:02:57 PM9/13/23
to Javier Peñas Fernández, mementodatabase
Sigh. I guess that's it. I'll pare down the script to do the least that might cause a Memento crash. I'll remove the links. Within the next 2 hours, we can test that, and if that's not good enough, I guess we'll have to try the 3-library script idea.


Er Mo

unread,
Sep 14, 2023, 2:17:33 PM9/14/23
to mementodatabase

Hallo Javier

Hab 2 Bibliotheken zum Testen erstellt .

CONTROL : enthält 1 Eintrag mit 2 Feldern . Datum = das Datum der letzten Änderung und das Feld EPUB mit einen Zahl . Diese Werten werden vom Skript Überschrieben . Es wird IMMER in den Letzten Eintrag geschrieben . Wenn du einen Wert behalten willst , kannst du einen Neuen Eintrag erstellen und der Vorige wird nicht mehr geändert . Du muss aber das Feld „ EPUB „ auf den Aktuellen Stand bringen.

LIBROS : 1 Feld Name ist ein Text. 2 Feld EPUB ein Kontrollkästchen und 3 Feld Die Schaltfläche. Diese Bibliothek brauch die Erlaubnis auf die CONTROL zuzugreifen .Wenn du auf die Schaltfläche klickst wird der Wert im Kontrollkästchen geändert und in der Bibliothek „ CONTROL“ ( der Letzte Eintrag )das Datum auf Heute gestellt und die Zahl um 1 Erhöht oder Verringert . Das Skript dafür ist in der Schaltfläche gespeichert und kann einfach auf andere Felder geändert werden . So könntest du in der CONTROL weitere Zählfelder einbauen .

 

Zum ansehen der Bibliotheken muss du sie Kopieren und die Kopie öffnen


 Hello Javier

Created 2 libraries for testing.

CONTROL: contains 1 entry with 2 fields. Date = the date of the last change and the EPUB field with a number. These values are overwritten by the script. It is ALWAYS written to the last entry. If you want to keep a value, you can create a new entry and the previous one will no longer be changed. But you have to update the “EPUB” field.

LIBROS : 1 Field Name is a text. 2 field EPUB a checkbox and 3 field the button. This library needs permission to access the CONTROL. When you click on the button, the value in the checkbox is changed and in the library "CONTROL" (the last entry), the date is set to Today and the number is increased or decreased by 1. The script for this is stored in the button and can easily be changed to other fields. So you could install additional counting fields in the CONTROL.

 

To view the libraries you must copy them and open the copy

 

 

http://libs.mobi/s/2co3AWrsu

http://libs.mobi/s/zRXczyrhg

 

Ernst

Javier Peñas Fernández

unread,
Sep 15, 2023, 4:03:26 AM9/15/23
to mementodatabase
Hallo Ernst,

Beim Drücken des Schaltfelds in LIBROS erscheint eine Fehlermeldung aufgrund fehlender Zugriffsberechtigung für CONTROL. Ich kann keine Autorisierung durchführen, da der Zugriff auf die CONTROL-Konfiguration blockiert ist.

Dennoch bin ich nicht sicher, ob das Verfahren für mich nützlich wäre: Erscheint das Schaltfeld in LIBROS bei jedem neuen Eintrag in dieser Bibliothek, und muss es gedrückt werden, damit CONTROL den Eintrag zählt? Wenn ja, wäre es für mich nicht praktikabel, bei jedem einzelnen Eintrag in LIBROS das Schaltfeld zu drücken, da ich manchmal mehr als hundert Einträge auf einmal in LIBROS erfasse. Die ideale Lösung wäre, wenn ein Skript ausgeführt werden könnte, um die Gesamtberechnung einmalig an CONTROL zu senden, aber ich weiß nicht, ob das möglich ist.

Vielen Dank.

Mit freundlichen Grüßen,

Javier
----------------------------
Hello Ernst,

When pressing the button field in LIBROS, an error message appears due to a lack of authorization for CONTROL access. I can't authorize it because access to the CONTROL settings is blocked.

Nevertheless, I'm not sure if the procedure would be useful for me: Does the button field in LIBROS appear with each new entry in this library, and is it necessary to press it for CONTROL to count it? If so, it wouldn't work for me, as sometimes I add more than a hundred entries to LIBROS at once, and it wouldn't be practical to press the button field for each of them. The ideal solution would be if a script could be executed to send the total computation to CONTROL all at once, but I'm not sure if that's possible.

Thank you very much.

Regards,

Javier

Bill Crews

unread,
Sep 15, 2023, 10:16:11 AM9/15/23
to Javier Peñas Fernández, mementodatabase
Javier, didn't see a response from you to what I thought was my last email, so I looked and don't see that I ever sent that email. Sigh. Here it is now...

So, as I said, I pared down the script to the minimum (no author or genre inputs & no links for outputs, only the count).

Here's the resulting script...

let e = entry();

let ah = libByName("Javier Libros 0-H");
let im = libByName("Javier Libros I-M");
let nz = libByName("Javier Libros N-Z");
let ahentries = ah.entries();
let imentries = im.entries();
let nzentries = nz.entries();

let nbooks = 0;
for (x in ahentries) {
    let ebook = ahentries[x];
    if (ebook.field("EPUB") == true) {
    nbooks += 1;
//      e.link("0-H matches", ebook);
    }
}
for (x in imentries) {
    let ebook = imentries[x];
    if (ebook.field("EPUB") == true) {
    nbooks += 1;
//      e.link("I-M matches", ebook);
    }
}
for (x in nzentries) {
    let ebook = nzentries[x];
    if (ebook.field("EPUB") == true) {
    nbooks += 1;
//      e.link("N-Z matches", ebook);
    }
}

// message(nbooks + " books");
e.set("#Books", nbooks);

In my test libraries, I deleted the Author & Genre fields and the "matches" link fields in CONTROL (actually called Javier Queries on my tablet). I also deleted Author & Genre in my Libros libraries. I hope to add the link fields back to CONTROL, but only if you have initial success at getting the above script to run. In the code above, I deleted all the other code, but I left those link() statements in as comments, so they could easily be re-added.

I hope you'll give the centralized control desk another try with the script above, and if it doesn't work, I'll sadly stop bothering you with that. If it does work, the next step in incremental increased complexity would be to uncomment those link() lines, add the link-to-entry fields back in (if you had deleted them), and try that. If that works, maybe we stop there, at least for a bit while I try one more time to rework the author & genre if statements to get rid of those extra parentheses it apparently wants but which screw up the proper functioning of the ifs.

In the meantime, I'm watching your work with Ernst, and if I have any insights, I'll send them. I wonder if we should keep voting the forum. Maybe someone out there is interested & reading ask this?

Javier Peñas Fernández

unread,
Sep 15, 2023, 11:21:51 AM9/15/23
to mementodatabase
Hello, Bill:

I've copied and pasted your latest script as a Trigger script in the CONTROL library. Then, I changed the library names in LIBROS to remove "Javier." Finally, I added a field called #Books to the CONTROL library.

I ran the script, but it didn't yield any results. It brought me back to the home screen of the CONTROL library without adding any entries from the calculation.

To rule out the possibility of it being an issue with a high number of records, I ran the script again, this time on three libraries with structures identical to LIBROS but with only a few records. The script worked correctly in this case. So, I concluded that the problem lies with the large number of entries, which had already prompted me to split the original LIBROS library.

Yesterday, I received a response from MementoDB Inc confirming that Memento has issues when libraries have more than 20,000 entries, and they are working on resolving this in future updates. I asked them about my difficulty exporting one of the LIBROS libraries to CSV. Therefore, it's reasonable to assume that the problem of working with more than 20,000 entries affects Memento, both for CSV export and other functions.

Because of this, I've decided to further divide the LIBROS libraries so that each of them has fewer than 20,000 entries and test your script to see if it works. If it does, I would be delighted if you continued to devote time to adding conditions to the query (such as "author," "genre," "date of reading," etc.). However, if it doesn't work, I prefer you not to invest more time so that I don't feel bad about it. I'll tell you the result.

I want to take this opportunity to let you know that whether this last attempt succeeds or not, I am very grateful for everything I am learning about programming, especially with the three excellent "Bill's mementos" you have posted on the forum.

Thank you once again.

Best regards,

Javier
---------------------------------
Hola, Bill:

He copiado y pegado tu último script como un Trigger script en la librería CONTROL; después he cambiado los nombres de las librerías de LIBROS para quitar “Javier”; finalmente, he añadido un campo llamado #Books en la librería CONTROL.
He ejecutado el script y no ha dado ningún resultado: me ha devuelto a la pantalla de inicio de la librería CONTROL sin añadir ninguna entrada por la suma realizada.

Por si fuera un problema del elevado número de registro he vuelto a ejecutar el script pero esta vez sobre tres librerías con estructuras idénticas a LIBROS, pero con unos pocos registros: el script ha funcionado correctamente, por lo que he deducido que el problema es el elevado número de entradas, que ya me obligó a trocear la librería original LIBROS.

Ayer recibí respuesta de MementoDB Inc en el que me confirmaban que Memento daba problemas cuando las librerías tenían más de 20.000 entradas y que estaban trabajando para solucionarlo en futuras actualizaciones. Les pregunté porque no conseguía exportar a CSV uno de las librerías de LIBROS. Por tanto, es razonable pensar que el problema para trabajar con más de 20.000 entradas lo tiene Memento tanto para exportar CSV como para otras funciones.

Por ello, he pensado que voy a dividir aún más las librerías LIBROS de forma que tenga cada una de ellas menos de 20.000 entradas y probar tu script para ver si funciona. Si funciona, estaría encantado que siguieras dedicándole tiempo a añadir condiciones a la consulta (“autor”, “género”, “fecha de lectura”, etc.), pero si no es así, prefiero que no dediques más tiempo para no sentirme mal por ello. Te diré el resultado.
Aprovecho para decirte que, funcione bien o no este último intento, estoy muy agradecido por todo lo que estoy aprendiendo de programación, con el añadido de las tres  excelentes “Bill’s mementos” que has publicado en el foro.

Gracias, de nuevo.

Saludos,

Javier

Er Mo

unread,
Sep 15, 2023, 2:03:29 PM9/15/23
to mementodatabase
Hallo Javier
Vielleicht ist die Große Anzahl der Einträge auch für das Skript ein Problem . Versuche mal nur eine  LIBROS zu verwenden . Bill´s Skript holt von allen 3 Bibliotheken die Einträge , das könnte den Speicher überlasten .Schreibe das Skript so um das nur ein Bibliothek verwendet wird , aber die Ganze Anzahl er Einträge . Wenn das funktionirt kann man das 3 mal machen und die Summe bielden .

Hello Javier
Perhaps the large number of entries is also a problem for the script. Try using just one LIBROS. Bill's script gets the entries from all 3 libraries, which could overload the memory. Write the script so that only one library is used, but the whole number of entries. If that works, you can do it 3 times and calculate the total.

Ernst

Er Mo

unread,
Sep 15, 2023, 2:16:49 PM9/15/23
to mementodatabase
Hallo Javier
Zu meine Vorschlag:
Wenn du die Bibliothek kopierst , kannst du in der Kopie die Einstellungen machen . Auf die Namen achten . Muss am Ende der gleiche Name sein und er tarff nicht 2 mal vorhanden sein.
Wie bekommst du 100 Einträge auf einemal eingestellt . Skript ?

Hello Javier
To my suggestion:
If you copy the library, you can make the settings in the copy. Pay attention to the names. It has to be the same name at the end and it shouldn't be present twice.
How do you get 100 entries posted at once? Script?

Ernst

Bill Crews

unread,
Sep 15, 2023, 6:42:25 PM9/15/23
to Er Mo, mementodatabase
Ernst is right. I used 3 arrays, one for each library, but I only loops through one at a time, so one array could be used for all of them.

Here's the bare bones script using only one array. I think it's worth a try...

let e = entry();

let ah = libByName("Libros 0-H");
let im = libByName("Libros I-M");
let nz = libByName("Libros N-Z");

let nbooks = 0;

let entries = ah.entries();
for (x in entries) {
    let ebook = ahentries[x];
    if (ebook.field("EPUB") == true) {
    nbooks += 1;
//      e.link("0-H matches", ebook);
    }
}

let entries = im.entries();

for (x in entries) {
    let ebook = imentries[x];
    if (ebook.field("EPUB") == true) {
    nbooks += 1;
//      e.link("I-M matches", ebook);
    }
}

let entries = nz.entries();
for (x in nzentries) {
    let ebook = nzentries[x];
    if (ebook.field("EPUB") == true) {
    nbooks += 1;
//      e.link("N-Z matches", ebook);
    }
}

// message(nbooks + " books");
e.set("#Books", nbooks);

Javier Peñas Fernández

unread,
Sep 16, 2023, 1:53:25 AM9/16/23
to mementodatabase
I'm sorry, Bill and Ernst, I give up.
 
I've tried dividing the LIBROS libraries into 6 smaller libraries, but the script still doesn't work, even the last script you sent, Bill. It doesn't show any error messages, but it doesn't produce any results either. It just goes back to the previous screen, as if it hadn't done anything.

The solution you suggested, Ernst, of running the script library by library is not suitable, as I would ultimately have to manually add up each of the three totals, just as I do now after grouping the LIBROS libraries by the EPUB field and seeing how many entries have it activated, without the need for scripts or calculated fields.

That said, thank you very much to both of you for your interest and your time, but I'm leaving it here.

Best regards,

Javier

Bill Crews

unread,
Sep 16, 2023, 7:08:16 AM9/16/23
to Javier Peñas Fernández, mementodatabase
Spanish, English, then German below...

Lamento escuchar esto, Javier.  Supongo que, con 6 bibliotecas de Libros, agregaste 3 llamadas adicionales a libByName() creando 3 objetos de biblioteca más, pero aún así reutilizaste la matriz de entries 6 veces con 6 bucles for.

Tengo preguntas sobre cómo funciona Java de Memento con el motor JavaScript de Rhino.  Si Vasiliy simplemente dice "Rhino, ejecuta este script" o si Vasiliy puede involucrarse en la ejecución del script diciendo "Rhino, envía el uso previo de la matriz de entries (o de las matrices en general) al "recolector de basura" (  para liberar la memoria utilizada por la matriz de entries anterior) antes de crear una nueva matriz de entries para la siguiente biblioteca".  Si es lo primero, Vasiliy no tiene control sobre esas cosas.  Si es lo último, es posible que se le pueda persuadir para que tome alguna medida en Java para garantizar que esta recolección de basura se realice cada vez.  Le interesa manejar bases de datos que sean lo más grandes posible, y tal vez usted sea su mejor caso de prueba para eso.

En cuanto a mí y mi script, dado que no tengo control sobre la reutilización de matrices más que el uso de un nombre de matriz común para cada biblioteca, no creo que haya nada significativo que pueda hacer para mejorar las cosas.

Todavía no he pensado mucho en el uso separado de secuencias de comandos por biblioteca, dejo ese pensamiento a usted y a Ernst.  Antes de que terminemos de intentar ayudarte, lo pensaré un poco.  ¿Quizás la interfaz de usuario no tiene por qué ser tan engorrosa?

Más allá de todo esto, sé muy poco sobre alternativas a Memento para estas cosas.  Para las aplicaciones móviles, la considero una de las más poderosas, pero hay otras.  Por supuesto, existe Microsoft Access, ya sea en PC o en dispositivos móviles.  Airtable es la otra aplicación de base de datos de Android más importante de la que he oído hablar.  Lo instalé hace años y jugué brevemente con él, pero no estoy seguro de qué tan flexible es su versión más moderna cuando las cosas se vuelven grandes y/o complejas.  Quizás pueda intentarlo de nuevo para ver qué flexibilidad puede tener.  Hay un par de aplicaciones interesantes de estilo árbol, al menos en PC, que posiblemente podrían manejar grandes conjuntos de datos: Treeline y TreeTag.  A diferencia de otras aplicaciones orientadas a árboles, admiten datos de campo (como los que usamos en Memento) para los datos, por lo que, ya sea que uses sus funciones de árbol o no, puede que valga la pena echarles un vistazo.

En Linux y probablemente también en macOS o incluso en Windows, existen varios DBMS relacionales, como MongoDB, MySQL, Postgres, SQLite, Microsoft SQL Server, Oracle y otros.  De ellos, sólo he usado MySQL en Linux (que me gusta), pero no he enfatizado su manejo de grandes conjuntos de datos, aunque como la mayor parte de la Web usa MySQL, lo más probable es que esos límites hayan sido probados por personas de más de  tiempo.
_________

I'm sorry to hear this, Javier. I assume that, with 6 Libros libraries, you added an additional 3 calls to libByName() making 3 more Library objects, but still reuse the entries array 6 times with 6 for loops.

There are questions I have about how Memento's Java works with Rhino's JavaScript engine. If Vasiliy merely says "Rhino, run this script" or if Vasiliy can get involved in the execution of the script by saying "Rhino, send the previous use of the entries array (or of arrays in general) to the "garbage collector" (to free up the memory used by the previous entries array) before creating a new entries array for the next library". If the former, Vasiliy has no control over such things. If the latter, he might be able to be persuaded to take some action in Java to ensure this garbage collection is done each time. It's in his interest to handle databases that are as large as they can be, and maybe you're his latest best test case for that.

As for me & my script, given that I have no control over array reuse other than the use of a common array name for each library, I don't think there's anything significant I can do to make things better.

I haven't yet given significant thought to the separate use of scripting per library, leaving that thinking to you & Ernst. Before we are all done trying to help you, I'll give that some real thought. Maybe the user interface of that doesn't have to be so burdensome?

Beyond all this, I know very little about alternatives to Memento for these things. For mobile apps, I think of it as being one of the most powerful apps, but there are others. There is, of course, Microsoft Access, either on PC or mobile. Airtable is the main other Android database app I've heard of. I installed it years ago and played briefly with it, but I'm not sure how flexible its most modern version is when things get large and/or complex. Maybe I can give it another try to see what flexibility it may have. There are a couple of interesting tree-style apps, at least on PC, that could possibly handle large datasets -- Treeline & TreeTag. Unlike other tree-oriented apps, they support fielded data (like we use in Memento) for the data, so whether you use their tree features or not, they might be worth a look.

On Linux and probably also macOS or even Windows, there are several relational DBMSes, like MongoDB, MySQL, Postgres, SQLite, Microsoft SQL Server, Oracle, and others. Of those, I've used only MySQL on Linux (which I like), but I haven't stressed its handling of large datasets, though since most of the Web uses MySQL, the chances are that those limits have been tested by people over time.
__________

Es tut mir leid, das zu hören, Javier.  Ich gehe davon aus, dass Sie bei 6 Libros-Bibliotheken weitere 3 Aufrufe von libByName() hinzugefügt haben, wodurch 3 weitere Bibliotheksobjekte entstanden sind, das entries-Array aber immer noch 6-mal mit 6 for-Schleifen wiederverwendet wird.

Ich habe Fragen dazu, wie Mementos Java mit der JavaScript-Engine von Rhino funktioniert.  Wenn Vasiliy lediglich sagt: „Rhino, führe dieses Skript aus“ oder wenn Vasiliy sich an der Ausführung des Skripts beteiligen kann, indem er sagt: „Rhino, sende die vorherige Verwendung des entries-Arrays (oder von Arrays im Allgemeinen) an den „Garbage Collector“ (um den vom vorherigen Array mit Einträgen verwendeten Speicher freizugeben, bevor ein neues Array mit Einträgen für die nächste Bibliothek erstellt wird.  Im ersten Fall hat Vasiliy keine Kontrolle über solche Dinge.  Im letzteren Fall kann er möglicherweise dazu überredet werden, in Java Maßnahmen zu ergreifen, um sicherzustellen, dass diese Speicherbereinigung jedes Mal durchgeführt wird.  Es liegt in seinem Interesse, möglichst große Datenbanken zu verwalten, und vielleicht sind Sie sein aktueller bester Testfall dafür.

Was mich und mein Skript betrifft: Da ich außer der Verwendung eines gemeinsamen Array-Namens für jede Bibliothek keine Kontrolle über die Wiederverwendung von Arrays habe, glaube ich nicht, dass ich etwas Wesentliches tun kann, um die Dinge zu verbessern.

Ich habe mir noch keine wesentlichen Gedanken über die getrennte Verwendung von Skripten pro Bibliothek gemacht und überlasse diese Überlegung Ihnen und Ernst.  Bevor wir mit dem Versuch fertig sind, Ihnen zu helfen, werde ich noch einmal gründlich darüber nachdenken.  Vielleicht muss die Benutzeroberfläche dafür nicht so umständlich sein?

Darüber hinaus weiß ich sehr wenig über Alternativen zu Memento für diese Dinge.  Was mobile Apps betrifft, halte ich sie für eine der leistungsstärksten Apps, aber es gibt noch andere.  Natürlich gibt es Microsoft Access, entweder auf dem PC oder auf dem Mobilgerät.  Airtable ist die wichtigste andere Android-Datenbank-App, von der ich gehört habe.  Ich habe es vor Jahren installiert und kurz damit gespielt, bin mir aber nicht sicher, wie flexibel die modernste Version ist, wenn die Dinge groß und/oder komplex werden.  Vielleicht kann ich es noch einmal versuchen, um zu sehen, welche Flexibilität es bietet.  Zumindest auf dem PC gibt es einige interessante Apps im Baumstil, die möglicherweise große Datenmengen verarbeiten könnten – Treeline und TreeTag.  Im Gegensatz zu anderen baumorientierten Apps unterstützen sie Felddaten (wie wir sie in Memento verwenden). Unabhängig davon, ob Sie ihre Baumfunktionen nutzen oder nicht, sind sie möglicherweise einen Blick wert.

Unter Linux und wahrscheinlich auch macOS oder sogar Windows gibt es mehrere relationale DBMS, wie MongoDB, MySQL, Postgres, SQLite, Microsoft SQL Server, Oracle und andere.  Von diesen habe ich nur MySQL unter Linux verwendet (was mir gefällt), aber ich habe die Handhabung großer Datenmengen nicht betont. Da der größte Teil des Webs jedoch MySQL verwendet, ist die Wahrscheinlichkeit groß, dass diese Einschränkungen von Leuten getestet wurden  Zeit.

Er Mo

unread,
Sep 16, 2023, 2:01:37 PM9/16/23
to mementodatabase
Hallo Javier
Du hast mich wieder Falsch verstanden . Wenn das Skript von Bill für nur 1 Bibliothek funktionirt , dann kann man es 3 Mal laufenlassen und Zusammenzählen . Das mach dan auch ein Skript . Zur fehler suche : Du sagst das Skript lauft und hört auf ohne etwas zu machen . Um sicher zu gehen das das Skript bis zum Ende läuft , füger einen message("Ende") als lezte Zeile ein. Wenn du die dann Siehst lauft das Skript und Arbeitet .

Hello Javier
You misunderstood me again. If Bill's script works for just 1 library, then you can run it 3 times and add it up. Make a script for that too. To troubleshoot: You say the script runs and stops without doing anything. To make sure the script runs to the end, add a message ("End") as the last line. When you see it, the script is running and working.

Ernst

Javier Peñas Fernández

unread,
Sep 17, 2023, 5:22:41 AM9/17/23
to mementodatabase
Hallo Ernst,

wie du mir geraten hast, habe ich das Skript von Bill nur für eine Bibliothek ausgeführt, und das Ergebnis war wieder dasselbe: Die Bibliothek wurde geschlossen, ohne einen Eintrag mit der Summe hinzuzufügen noch irgendeine Fehlermeldung. Ich habe eine Nachricht in die Schleife "for" eingefügt, um den Fortschritt des Zählers "x" anzuzeigen. Es hat sich gut bewegt, wenn auch sehr langsam, bis es etwa 2.000 erreicht hat; zu diesem Zeitpunkt hat es angehalten und die Bibliothek geschlossen. Erneut bestätigt sich, dass das Skript korrekt ist, aber Memento kann offensichtlich keine große Anzahl von Einträgen verarbeiten, zumindest nicht in dem für mich akzeptablen Tempo.

Vielen Dank für dein Interesse.

Mit freundlichen Grüßen,

Javier
---------------------------------------------
Hello Ernst,

As you advised me, I have executed Bill's script for just one library, and the result was the same: it closed the library without adding any entry with the sum nor any error message. I inserted a message inside the 'for' loop to display the progress of the counter 'x'. It progressed well, albeit very slowly, until it reached about 2,000; at that point, it stopped and closed the library. Once again, it confirms that the script is correct, but Memento evidently cannot handle a large number of entries, at least not at an acceptable pace for me.

Thank you for your interest.

Best regards,

Javier
--------------------------------------------
Hola, Ernst:

Como me aconsejabas, he ejecutado el script de Bill solo para una librería y el resultado ha vuelto a ser el mismo: se cerraba la librería sin añadir ninguna entrada con la suma ni ningún mensaje de error. He puesto un mensaje dentro del bucle “for” para mostrar el avance del contado “x”. Avanzaba bien, aunque muy lento, hasta llegar a unos 2.000; en ese momento se paraba y se cerraba la librería. Nuevamente, se confirma que el script es correcto pero Memento no soporta procesar un elevado número de entradas, sin embargo mínimamente aceptable para mí.

Gracias por tu interés.
Saludos,

Javier


Javier Peñas Fernández

unread,
Sep 17, 2023, 5:32:10 AM9/17/23
to mementodatabase
Hello Bill,

I will take a look at the alternatives to Memento that you've mentioned when I have some time.

However, I have to say that unless they are better than Memento, I don't think I'll switch. Despite not being able to add a large number of library entries even with scripts, I'm satisfied with Memento about 99%. It's true that it can't handle libraries with more than 50,000 entries without crashing, but I've solved that by dividing them. It's also true that to get an aggregated result from the three libraries, I need to manually enter each of them and note down the aggregation results because scripts don't work. But it's a minor inconvenience considering how functional and flexible data management is on such a portable device like a mobile phone.

Thank you very much, Bill.

Best regards,

Javier
---------------------------------------------
Hallo Bill,

Ich werde mir die von dir erwähnten Alternativen zu Memento ansehen, wenn ich etwas Zeit habe.

Allerdings muss ich sagen, dass ich, es sei denn, sie sind besser als Memento, nicht denke, dass ich wechseln werde. Trotz der Tatsache, dass ich selbst mit Skripten keine große Anzahl von Bibliothekseinträgen hinzufügen kann, bin ich mit Memento zu etwa 99% zufrieden. Es stimmt, dass es Bibliotheken mit mehr als 50.000 Einträgen nicht ohne Absturz verarbeiten kann, aber ich habe das Problem gelöst, indem ich sie aufgeteilt habe. Es ist auch wahr, dass ich, um ein aggregiertes Ergebnis aus den drei Bibliotheken zu erhalten, jeden von ihnen manuell betreten und die Aggregationsresultate notieren muss, da Skripte nicht funktionieren. Aber das ist eine geringfügige Unannehmlichkeit, wenn man bedenkt, wie funktional und flexibel die Datenverwaltung auf einem so tragbaren Gerät wie einem Mobiltelefon ist.

Vielen Dank, Bill.

Mit freundlichen Grüßen,

Javier
--------------------------------------------
Hola, Bill:

Con tiempo echaré un vistazo a las alternativas a Memento que me indicas.

No obstante, tengo que decir que, salvo que sean mejores que Memento, no creo que me cambie. A pesar de que no pueda agregar el número de entradas de librerías ni aun con scripts, digamos que estoy satisfecho con Memento en un 99%. Es verdad que no soporta librerías de más de 50.000 entradas sin fallar, pero lo he resuelto dividiéndola; es verdad que para obtener un resultado agregado de las tres librerías necesito entrar en cada una de ellas y anotar a mano lo que resulte de la agregación correspondiente, porque no funcionan los scripts, pero es un mal menor considerando lo funcional y flexible que es el tratamiento de los datos en un dispositivo tan portátil como un teléfono móvil.

Muchas gracias, Bill.

Saludos cordiales,

Javie

Er Mo

unread,
Sep 17, 2023, 6:54:46 AM9/17/23
to mementodatabase
Hallo
So ein Gedanke von Mir . Ob nicht in der Kostenlosen Version einen Mengenbegrenzung eingebaut ist . So das bei den 2000 Einträgen schluss ist .

Hola
Qué pensamiento mío. Si hay un límite de cantidad integrado en la versión gratuita. Así que ese es el final de las 2000 entradas.

Hello
Such a thought from me. Whether there is a quantity limit built into the free version. So that's the end of the 2000 entries.

Ernst

Bill Crews

unread,
Sep 17, 2023, 7:43:58 AM9/17/23
to Javier Peñas Fernández, mementodatabase
Es muy interesante para mí que no se haya agregado ninguna entrada cuando se ejecutó mi script o el suyo.  Eso parece muy significativo porque, si lo está ejecutando como comentamos, el script estaba en un disparador después de guardar la entrada.  El guión nunca debería haber comenzado hasta que se guardó la entrada.  Me parece como si el script se ejecutara de otra manera (como una acción, ¿donde no se crearía ninguna entrada?).  El hecho de que haya regresado a la pantalla de lista de entradas sugiere que la aplicación Memento en realidad no falló, sino que tuvo lugar algún otro evento dentro de Memento que no emitió un mensaje de error o que se perdió el mensaje de error porque tal vez  No lo notaste antes de que se desvaneciera segundos después.

 De hecho, me alegra que no estés muy interesado en dejar Memento, seguirás con nosotros.  Quizás exista la posibilidad de que haya una solución en el futuro.

 Realmente desearía que pudiéramos terminar esto con una nota diferente.
__________

Es ist für mich sehr interessant, dass weder bei der Ausführung meines noch Ihres Skripts ein Eintrag hinzugefügt wurde.  Das erscheint sehr bedeutsam, denn wenn Sie es wie besprochen ausführen, befand sich das Skript nach dem Speichern des Eintrags in einem Trigger.  Das Skript sollte erst nach dem Speichern des Eintrags überhaupt begonnen haben.  Für mich klingt es so, als ob das Skript auf andere Weise ausgeführt wurde (als Aktion, bei der kein Eintrag erstellt würde?).  Die Tatsache, dass Sie zum Bildschirm mit der Eintragsliste zurückgekehrt sind, deutet darauf hin, dass die Memento-App nicht tatsächlich abgestürzt ist, sondern dass ein anderes Ereignis in Memento stattgefunden hat, das entweder keine Fehlermeldung ausgegeben hat oder dass Sie die Fehlermeldung möglicherweise verpasst haben  Sie haben es nicht bemerkt, bevor es Sekunden später verschwand.

 Eigentlich bin ich froh, dass du kein großes Interesse daran hast, Memento zu verlassen, du wirst immer noch bei uns sein.  Vielleicht besteht die Chance, dass es in Zukunft eine Lösung gibt.

 Ich wünschte wirklich, wir könnten das mit einem anderen Ton beenden.
__________

It's very interesting to me that no entry was added when either my script or yours was run. That seems very significant, because, if you're running it as we discussed, the script was in a trigger after saving the entry. The script should never even have even begun until after the entry was saved. It sounds to me as if the script was run some other way (as an action, where there would be no entry created?). The fact that you were returned to the entries list screen suggests that the Memento app didn't actually crash, but rather that some other event took place within Memento that either didn't issue an error message or that you missed the error message because maybe you didn't notice it before it faded away seconds later.

I'm actually happy you are not much interested in moving from Memento, you'll still be with us. Maybe there's a chance there will be a solution in the future.

I really wish we could end this on a different note.


Bill Crews

unread,
Sep 18, 2023, 2:21:22 AM9/18/23
to memento...@googlegroups.com
Javier, se me acaba de ocurrir una idea.  Mientras que el método Entradas de la biblioteca() devuelve todas las entradas en una matriz, el método Buscar() de la biblioteca devuelve sólo las entradas encontradas, que pueden ser un número mucho menor y ocupar mucho menos espacio en la memoria.  Si nuestro problema ha estado en Memento, lo que propongo ahora no ayudará, pero si el problema está en el script, el script al final de este mensaje puede ser la solución, después de todo.

 En las bibliotecas de Libros, en lugar de un campo EPUB de casilla de verificación, utilice un campo de lista de opción única donde "aún no leído" se indica mediante el valor del elemento de la lista NotYetRead.  Ese es el valor que utilicé en mi script y en mis bibliotecas de prueba.  En realidad, el valor puede ser cualquier cosa que desee, siempre y cuando la cadena nunca aparezca en ninguna entrada excepto en estos campos de estas entradas.  Del mismo modo, otro elemento se llamó HasBeenRead en mi script y datos de prueba, pero puede ser cualquier cosa excepto NotYetRead o cualquier otro valor en cualquier otro campo en cualquier entrada de su biblioteca.

 Modificar sus bibliotecas puede ser una tarea tan grande que no querrá hacerlo.  Pero la edición masiva puede ayudar en este sentido, ya que puede mantener presionada una entrada en la lista y luego presionar otras hasta que todas las que deberían tener el mismo valor estén resaltadas.  Luego presione el ícono de Lápiz en la parte superior para editar estas entradas en una sola edición.  Seleccione el campo EPUB e ingrese NotYetRead, HasBeenRead o cualquier valor que haya elegido para representar esos 2 estados.  Hay una opción Seleccionar todo en caso de que sea más rápido seleccionarlos todos y luego anular la selección de los que no se van a editar.

 El script se ejecuta correctamente en mis bibliotecas de prueba.  Aquí lo tienes...
__________

Javier, ich hatte gerade eine Idee.  Während die Library-Entries()-Methode alle Einträge in einem Array zurückgibt, gibt die Library-find()-Methode nur die gefundenen Einträge zurück, bei denen es sich möglicherweise um eine weitaus kleinere Anzahl handelt, die viel weniger Speicherplatz beansprucht.  Wenn unser Problem in Memento selbst lag, hilft das, was ich jetzt vorschlage, nicht, aber wenn das Problem im Skript liegt, kann das Skript am Ende dieser Nachricht vielleicht doch den Zweck erfüllen.

 Verwenden Sie in den Libros-Bibliotheken anstelle eines Checkbox-EPUB-Felds ein Single-Choice-Listenfeld, in dem „noch nicht gelesen“ durch den Listenelementwert NotYetRead angezeigt wird.  Das ist der Wert, den ich in meinem Skript und in meinen Testbibliotheken verwendet habe.  Der Wert kann eigentlich beliebig sein, solange die Zeichenfolge in keinem Eintrag außer in diesen Feldern in diesen Einträgen vorkommt.  Ebenso hieß in meinen Skript- und Testdaten ein anderes Element „HasBeenRead“, aber es kann alles außer „NotYetRead“ oder ein beliebiger anderer Wert in einem anderen Feld in einem beliebigen Eintrag in Ihrer Bibliothek sein.

 Das Ändern Ihrer Bibliotheken kann eine so große Aufgabe sein, dass Sie es nicht tun möchten.  Aber die Massenbearbeitung kann in dieser Hinsicht hilfreich sein, da Sie einen Eintrag in der Liste gedrückt halten und dann auf andere drücken können, bis alle hervorgehoben sind, die denselben Wert haben sollten.  Drücken Sie dann oben auf das Stiftsymbol, um diese Einträge in einer Bearbeitung zu bearbeiten.  Wählen Sie das EPUB-Feld aus und geben Sie „NotYetRead“, „HasBeenRead“ oder andere Werte ein, die Sie zur Darstellung dieser beiden Zustände ausgewählt haben.  Für den Fall, dass es schneller geht, alle auszuwählen und dann diejenigen abzuwählen, die nicht bearbeitet werden sollen, gibt es die Option „Alle auswählen“.

 Das Skript läuft in meinen Testbibliotheken korrekt.  Hier ist es...
_________

Javier, I just had an idea. While the Library entries() method returns all the entries into an array, the Library find() method returns only the entries that are found, which may be a far smaller number, taking up much less space in memory. If our problem has been in Memento itself, what I'm now proposing won't help, but if the problem is in the script, the script at the bottom of this message may do the trick, after all.

In the Libros libraries, instead of a Checkbox EPUB field, use a single-choice list field where "not yet read" is indicated by the list item value NotYetRead. That's the value I used in my script and in my test libraries. The value can actually be anything you want, so long as the string never appears in any entry except for these fields in these entries. Likewise another item was called HasBeenRead in my script & test data, but it can be anything except NotYetRead or any other value in any other field in any entry in your library.

Modifying your libraries may be so big a task that you won't want to do it. But bulk edit can help in this regard, as you can press & hold on one entry in the list and then press others until all that should have the same value are highlighted. Then press the Pencil icon at the top to edit these entries in one edit. Select the EPUB field and enter NotYetRead, HasBeenRead, or whatever values you've chosen to represent those 2 states. There's a Select All option in case it's quicker to select them all and then deselect the ones not to be edited.

The script runs correctly on my test libraries. Here it is...
_________

let e = entry();

let ah = libByName("Libros 0-H");
let im = libByName("Libros I-M");
let nz = libByName("Libros N-Z");

let nbooks = 0;

let found = ah.find("NotYetRead");
for (x in found) {
    let ebook = found[x];
    e.link("0-H matches", ebook);
}
nbooks += found.length;
message("After 0-H, nbooks = " + nbooks);

found = im.find("NotYetRead");
for (x in found) {
    let ebook = found[x];
    e.link("I-M matches", ebook);
}
nbooks += found.length;
message("After I-M, nbooks = " + nbooks);

found = nz.find("NotYetRead");
for (x in found) {
    let ebook = found[x];
    e.link("N-Z matches", ebook);
}
nbooks += found.length;
message("After N-Z, nbooks = " + nbooks);

e.set("#Books", nbooks);
message("After all, #Books set to " + nbooks);

On Sun, Sep 17, 2023, 09:00 Bill Crews <bill....@gmail.com> wrote:
Hi, Vasya. This is a very long forum message thread that documents Javier's efforts to get centralized control of libraries he has broken into pieces to try (unsuccessfully) get Memento to handle the large dataset. I direct you to the final 2 messages -- one from him and a final one from me.

If he's doing what I asked him to do, he put my code (or code of mine converted somehow by him) into an AfterSavingTheEntry trigger that results in 2,000 iterations of a loop (according to a message() call, I believe), but nevertheless does not create the entry! How would that be possible in an AfterSavingTheEntry trigger on CreatingTheEntry trigger? He says he lands back in the entries list, so Memento hasn't crashed. I didn't think that would be possible.

Anyway, something to mull over, as I see it.

No reply expected. FYI.

Er Mo

unread,
Sep 18, 2023, 2:23:43 PM9/18/23
to mementodatabase
Hallo
Ich habe heute nachgesehen wie viele Einträge ich in einer Bibliothek habe . Die Größte hat über 3500 Einträge . In diese lasse ich ein Skript Laufen die Doppelte Einträge sucht . Also eine for Schleife in einer for Schleife . Das läuft auf den PC ohne Probleme . Das Ergebnis wird in eine andere Bibliothek geschrieben .

Hello
Today I checked how many entries I have in a library. The largest has over 3500 entries. In this I run a script that looks for duplicate entries. So a for loop within a for loop. This runs on the PC without any problems. The result is written to another library.

Ernst
Message has been deleted

mementodatabase

unread,
Sep 18, 2023, 3:52:21 PM9/18/23
to mementodatabase
Hallo Javier
Da würde ich nochmal auf meine Methode zurück kommen . Ich glaube das Änderungen in Feld EPUB selten sind , müssen wir und auf die Eingabe konsentriren . Beschreibe mal wie du die jetzt machst  .

Hola javier
Luego volvería a mi método nuevamente. Creo que los cambios en el campo EPUB son raros, por lo que tenemos que concentrarnos en los aportes. Describe cómo lo haces ahora.

Hello Javier
Then I would come back to my method again. I believe that changes in the EPUB field are rare, so we have to concentrate on the input. Describe how you do it now.

Ernst

javie...@gmail.com schrieb am Montag, 18. September 2023 um 21:39:08 UTC+2:
Hello, Bill and Ernst:

I understand, Bill, the intention of your proposal to modify the EPUB field format and the script to process only the EPUB field, as there will be fewer entries than the total. However, I prefer not to pursue this approach. The LIBROS libraries have approximately 100,000 entries, with around 33,000 entries in each library. Out of the total entries, approximately 94,000 have the EPUB field activated, which is 95%. Therefore, I believe that narrowing the process down to only the EPUB fields would have little effect, not to mention that it would require a massive modification that I am not comfortable with, as it might end up causing more problems than it solves. Each LIBROS library has 31 fields of various types.

I will wait for Memento to optimize the Android app in the future, as Vasily mentioned to me.

Thank you both for your interest.

Best regards,

Javier
----------------------------------------
Hallo Bill und Ernst,

Ich verstehe, Bill, die Absicht deines Vorschlags zur Änderung des Formats des EPUB-Felds und des Skripts, um nur das EPUB-Feld zu verarbeiten, da es weniger Einträge als insgesamt geben wird. Dennoch ziehe ich es vor, diesen Ansatz nicht zu verfolgen. Die LIBROS-Bibliotheken haben insgesamt etwa 100.000 Einträge, mit ungefähr 33.000 Einträgen in jeder Bibliothek. Von den Gesamteinträgen haben etwa 94.000 das EPUB-Feld aktiviert, was 95% entspricht. Daher glaube ich, dass es wenig Effekt hätte, den Prozess nur auf die EPUB-Felder zu beschränken, abgesehen davon, dass eine umfangreiche Änderung erforderlich wäre, bei der ich mich nicht wohl fühle, da sie möglicherweise mehr Probleme verursacht, als sie löst. Jede LIBROS-Bibliothek verfügt über 31 Felder unterschiedlicher Art.

Ich werde auf die Optimierung der Android-App durch Memento in der Zukunft warten, wie es mir Vasily angekündigt hat.

Vielen Dank euch beiden für euer Interesse.

Mit freundlichen Grüßen,

Javier
------------------------------------------
Hola, Bill y Ernst:

Entiendo, Bill, la intención de tu propuesta modificando el formato del campo EPUB además del script para que solo procese el campo EPUB dado que serán menos entradas que las totales. Sin embargo, prefiero no atenderla. Las librerías de LIBROS suman cerca de 100.000 entradas, a razón de unas 33.000 entradas en cada librería. Del total de entradas las que tienen el campo EPUB activado son unas 94.000, es decir, un 95%. Por ello, entiendo que no tendría casi efecto reducir el proceso solo a los campos EPUB, sin contar que tendría que hacer una modificación masiva que, la verdad, no me atrevo, ya que puede que para arreglar una cosa estropee diez: cada biblioteca de LIBROS tiene 31 campos de todo tipo.

Esperaré a que Memento optimice la app en Android en el futuro, tal y como me anticipó Vasily.

Muchas gracias a ambos a vuestro interés.

Saludos cordiales,

Javier

mementodatabase

unread,
Sep 19, 2023, 2:15:30 AM9/19/23
to mementodatabase
Hallo, Ernst:
Als ich nur eine Bibliothek für alle Bücher hatte, habe ich die Bibliothek geöffnet und nach dem EPUB-Feld gruppiert, so dass die Anzahl der Einträge mit diesem Feldwert 1 und 0 angezeigt wurde. Diejenigen mit dem Wert 1 waren die EPUB-Bücher.
Als die Größe der Bibliothek zu einem Problem wurde (ich konnte die Bibliothek nicht öffnen, konnte nicht in CSV exportieren, usw.), habe ich die Bibliothek in drei Teile aufgeteilt: LIBROS 0-H für Autoren von A bis H, das Gleiche für LIBROS I-M und LIBROS N-Z. Um das gleiche Ergebnis wie früher zu sehen, öffne ich jetzt LIBROS 0-H, gruppiere nach dem EPUB-Feld und notiere die Anzahl der Einträge mit diesem Feldwert 1 auf Papier; dann mache ich dasselbe mit LIBROS I-M und LIBROS N-Z. Schließlich addiere ich von Hand die drei erhaltenen Zahlen und habe die Gesamtanzahl der Einträge in den drei Büchern, bei denen das EPUB-Feld den Wert 1 hat.
Was ich mit dem Skript erreichen wollte, war, dieses letzte manuelle Summierungsverfahren durch eine automatische Berechnung zu ersetzen.
Danke, Ernst.
Mit freundlichen Grüßen,
Javier
------------------------------------
Hello, Ernst:
When I had a single library for all the books, what I used to do was open the library and group by the EPUB field, so that it would simply display the number of entries with that field having a value of 1 and with a value of 0. Those with a value of 1 were the EPUB ones.
When the size of the library started to become a problem (I couldn't open the library, couldn't export to CSV, etc.), I divided the library into three: LIBROS 0-H for authors starting from A to H, and the same for LIBROS I-M and LIBROS N-Z. To achieve the same result as when I had a single library, what I do now is open LIBROS 0-H, group by the EPUB field, and jot down on paper the number of entries with that field having a value of 1; then I do the same with LIBROS I-M and LIBROS N-Z. Finally, I manually add up the three figures obtained, and I have the total number of entries among the three books with the EPUB field equal to 1.
What I intended with the script was to replace this last manual summation procedure with an automatic calculation.
Thank you, Ernst.
Best regards,
Javier
------------------------------------
Hola, Ernst:
Cuando tenía una única librería para todos los libros, lo que hacía era abrir la librería y agrupar por el campo EPUB, de forma que aparecía sin más el número de entradas con dicho campo con valor 1 y con valor 0. Las que tenían valor 1 eran las que eran EPUB.
Cuando el tamaño de la librería empezó a ser un problema (no conseguía abrir la librería, no podía exportar a CSV, etc.) dividí la librería en tres: LIBROS 0-H con los autores que empiezan desde la A hasta la H, y lo mismo para LIBROS I-M y LIBROS N-Z. Para ver el mismo resultado como cuando tenía una única librería lo que hago ahora es abrir LIBROS 0-H, agrupar por el campo EPUB y anotar en un papel el número de entradas con dicho campo con valor 1; después hago lo mismo con LIBROS I-M y LIBROS N-Z. Finalmente sumo a mano las tres cifras obtenidas y tengo el total de entradas entre los tres libros que tienen el campo EPUB igual a 1.
Lo que pretendía con el script era sustituir este último procedimiento de suma manual por un cálculo automático.
Gracias, Ernst.
Saludos cordiales,
Javier

Bill Crews

unread,
Sep 19, 2023, 7:40:34 AM9/19/23
to Javier Peñas Fernández, mementodatabase
Ahora entiendo que el 95% tendrá EPUB = 1, y ya sabía que la edición sería una tarea grande.  Gracias por tu consideración.  Buena suerte a medida que avanzas.
__________

Ich verstehe jetzt, dass 95 % EPUB = 1 haben werden, und ich wusste bereits, dass die Bearbeitung ein großes Unterfangen sein würde.  Vielen Dank dass Sie darüber nachdenken.  Viel Glück beim weiteren Vorankommen.
__________

I understand now that 95% will have EPUB = 1, and I knew already that the editing would be a large undertaking. Thanks for your consideration. Good luck as you move forward.


On Mon, Sep 18, 2023, 15:39 Javier Peñas Fernández <javie...@gmail.com> wrote:
Hello, Bill and Ernst:

I understand, Bill, the intention of your proposal to modify the EPUB field format and the script to process only the EPUB field, as there will be fewer entries than the total. However, I prefer not to pursue this approach. The LIBROS libraries have approximately 100,000 entries, with around 33,000 entries in each library. Out of the total entries, approximately 94,000 have the EPUB field activated, which is 95%. Therefore, I believe that narrowing the process down to only the EPUB fields would have little effect, not to mention that it would require a massive modification that I am not comfortable with, as it might end up causing more problems than it solves. Each LIBROS library has 31 fields of various types.

I will wait for Memento to optimize the Android app in the future, as Vasily mentioned to me.

Thank you both for your interest.

Best regards,

Javier
----------------------------------------
Hallo Bill und Ernst,

Ich verstehe, Bill, die Absicht deines Vorschlags zur Änderung des Formats des EPUB-Felds und des Skripts, um nur das EPUB-Feld zu verarbeiten, da es weniger Einträge als insgesamt geben wird. Dennoch ziehe ich es vor, diesen Ansatz nicht zu verfolgen. Die LIBROS-Bibliotheken haben insgesamt etwa 100.000 Einträge, mit ungefähr 33.000 Einträgen in jeder Bibliothek. Von den Gesamteinträgen haben etwa 94.000 das EPUB-Feld aktiviert, was 95% entspricht. Daher glaube ich, dass es wenig Effekt hätte, den Prozess nur auf die EPUB-Felder zu beschränken, abgesehen davon, dass eine umfangreiche Änderung erforderlich wäre, bei der ich mich nicht wohl fühle, da sie möglicherweise mehr Probleme verursacht, als sie löst. Jede LIBROS-Bibliothek verfügt über 31 Felder unterschiedlicher Art.

Ich werde auf die Optimierung der Android-App durch Memento in der Zukunft warten, wie es mir Vasily angekündigt hat.

Vielen Dank euch beiden für euer Interesse.

Mit freundlichen Grüßen,

Javier
------------------------------------------
Hola, Bill y Ernst:

Entiendo, Bill, la intención de tu propuesta modificando el formato del campo EPUB además del script para que solo procese el campo EPUB dado que serán menos entradas que las totales. Sin embargo, prefiero no atenderla. Las librerías de LIBROS suman cerca de 100.000 entradas, a razón de unas 33.000 entradas en cada librería. Del total de entradas las que tienen el campo EPUB activado son unas 94.000, es decir, un 95%. Por ello, entiendo que no tendría casi efecto reducir el proceso solo a los campos EPUB, sin contar que tendría que hacer una modificación masiva que, la verdad, no me atrevo, ya que puede que para arreglar una cosa estropee diez: cada biblioteca de LIBROS tiene 31 campos de todo tipo.

Esperaré a que Memento optimice la app en Android en el futuro, tal y como me anticipó Vasily.

Muchas gracias a ambos a vuestro interés.

Saludos cordiales,

Javier
El lunes, 18 de septiembre de 2023 a las 20:23:43 UTC+2, ernst...@gmail.com escribió:

mementodatabase

unread,
Sep 19, 2023, 12:57:44 PM9/19/23
to mementodatabase
Hallo Javier
Die Methode von Bill durchläuft die Bibliothek und kontroliert jeden Eintrag nach den EPUB Feld . Die Summe wird in den Eintrag geschrieben . Um Änderungen festzustellen muss das Programm erneut ausgefürt werden . Bei meine Methode wird 1 Mal die Gesamtzahl ermittelt und ein Skript schreibt die Änderungen mit . Wie off und wie wird der Wert im EPUB Feld geändert . Wie wird der Wert bei Neuen Einträgen erstellt . Bitte beschreibe wie du Neue Einträge aufnimmst und die bestähenden Änderst . So kann ich einen Weg finden der die Änderungen mitschreibt.

Hola javier
El método de Bill recorre la biblioteca y verifica cada entrada del campo EPUB. El total está escrito en la entrada. Para detectar cambios, el programa debe ejecutarse nuevamente. Con mi método, el número total se determina una vez y un script escribe los cambios. Cómo desactivar y cómo cambiar el valor en el campo EPUB. ¿Cómo se crea el valor para las nuevas entradas? Describa cómo agrega nuevas entradas y cambia las existentes. Entonces puedo encontrar una manera de registrar los cambios.

Hello Javier
Bill's method goes through the library and checks each entry for the EPUB field. The total is written into the entry. To detect changes, the program must be run again. With my method, the total number is determined once and a script writes the changes. How off and how to change the value in the EPUB field. How is the value created for new entries? Please describe how you add new entries and change existing ones. So I can find a way to record the changes.

Ernst

Javier Peñas Fernández

unread,
Sep 20, 2023, 3:00:39 AM9/20/23
to mementodatabase
Hallo Ernst,

Entschuldigen Sie, wenn ich Ihre Nachricht nicht richtig verstanden habe.

Meine Arbeitsweise mit Memento ist folgende: Jedes Mal, wenn ich ein Buch kaufe, trage ich es in die Bibliothek LIBROS in Memento unter dem Autor ein. Die Eintragung umfasst viele Felder wie TITEL, AUTOR, VERÖFFENTLICHUNGSDATUM, SEITENZAHL, REGALSTANDORT usw., und sogar das EINTRAGUNGSDATUM IN MEMENTO (durch ein von Bill bereitgestelltes automatisches Skript). Über mehrere Tage oder Wochen hinweg folge ich diesem Verfahren für jedes Buch, das ich kaufe. Wenn ich ein Buch lese, ändere ich in den entsprechenden Feldern den EINTRAGUNGDATUM auf das Datum des LESENS und füge meine BEWERTUNG hinzu.

Nach mehreren Wochen oder sogar Monaten, wenn ich es benötige, mache ich gerne statistische Abfragen in der Memento-Datenbank, um beispielsweise die Anzahl der E-Books, die ich habe (im EPUB- oder PDF-Format), die Anzahl der gedruckten Bücher, die ich habe, die Anzahl der Bücher, die ich im letzten Jahr gelesen habe, die Bücher, die mir am besten gefallen haben, usw., herauszufinden. Diese Abfragen führe ich regelmäßig durch, unabhängig davon, wann ich die Bücher eingetragen habe. Daher benötige ich keine Aktualisierung der Anzahl der EPUB-Bücher, wenn ein Buch eingetragen wird. Stattdessen würde ich gerne, wenn ich eine Abfrage durchführen muss, normalerweise alle paar Wochen, in einer anderen Bibliothek, wie z.B. CONTROL, die benötigten statistischen Daten sehen.

Früher konnte ich all diese statistischen Abfragen nur in der Bibliothek LIBROS durchführen, dank der Gruppierungen und Filter von Memento. Doch da ich LIBROS in drei Bibliotheken aufteilen musste, muss ich nun in jeder von ihnen diese Gruppierungen und Filter durchführen und die Daten dann manuell zusammenzählen. Dieses manuelle Arbeiten wollte ich eigentlich durch Skripte ersetzen.

Ich hoffe, ich habe das richtig verstanden und mich klar ausgedrückt.

Vielen Dank für Ihr Interesse.

Mit freundlichen Grüßen,

Javier
---------------------------------
Hello Ernst,

I apologize if I haven't understood your message correctly.

My way of working with Memento is as follows: Every time I purchase a book, I register it in the LIBROS library of Memento under the author's name. The registration includes many fields, such as TITLE, AUTHOR, PUBLICATION DATE, PAGES, SHELF LOCATION, and even the DATE OF REGISTRATION IN MEMENTO (via an automatic script provided by Bill). Over several days or weeks, I follow this procedure for each book I buy. When I read a book, I modify the entry in the corresponding fields with the READ DATE and my RATING.

After several weeks or even months, when I need it, I like to perform statistical queries in the Memento database to find out, for example, the number of ebooks I have (in EPUB or PDF format), the number of physical books I have, the number of books I read last year, the books I liked the most, and so on. But these are queries I do periodically, independently of when I register the books. Therefore, I don't need the count of EPUB books to update every time a book is registered. Instead, when I need to make a query, typically every few weeks, I would like the required statistical data to appear in a different library, for example, CONTROL.

When I had only one LIBROS library, I could perform all these statistical queries thanks to the groupings and filters in Memento. However, since I had to split LIBROS into three libraries, I now need to perform these groupings and filters in each of them and then manually add up the data. This manual work is what I intended to replace with scripts.

I hope I have understood you correctly and explained myself clearly.


Thank you for your interest.

Best regards,

Javier
-------------------------------------
Hola, Ernst:

Perdona si no he entendido correctamente tu mensaje.

Mi forma de trabajar con Memento es la siguiente: cada vez que compro un libro, lo doy de alta en la librería LIBROS de Memento según el nombre del autor. El alta incluye muchos campos entre los que están TÍTULO, AUTOR, FECHA DE PUBLICACIÓN, PÁGINAS, UBICACIÓN EN LA ESTANTERÍA, etc. e incluso la FECHA DE ALTA EN MEMENTO (mediante un script automático que me facilitó Bill). Durante varios días o semanas, sigo este procedimiento para cada libro que compro. Cuando leo un libro, en los campos correspondientes, modifico la entrada con la FECHA DE LECTURA y mi VALORACIÓN.

Al cabo de varias semanas o, incluso meses, cuando lo necesito, me gusta hacer consultas estadísticas a la base de datos de Memento para saber, por ejemplo, el número de ebooks que tengo (en formato EPUB o PDF), el número de libros de papel que tengo, el número de libros que leí el año pasado, los libros que más me han gustado, etc. Pero son consultas que hago periódica e independientemente del momento en el que doy de alta los libros. Por eso, no necesito que se actualice la suma de libros EPUB cada vez que se da de alta un libro, sino que cuando necesito hacer una consulta, cada varias semanas, normalmente, me gustaría que en una librería diferente, por ejemplo CONTROL, aparecieran los datos estadísticos que preciso.

Cuando solo tenía una librería LIBROS todas estas consultas estadísticas las podía hacer gracias a las agrupaciones y los filtros de Memento, pero al tener que dividir LIBROS en tres librerías necesito hacer en cada una de ellas dichas agrupaciones y filtros y después sumar los datos a mano. Este último trabajo manual era el que pretendía sustituir con scripts.

Espero haberte entendido bien y haberme explicado correctamente.

Gracias por tu interés.

Saludos cordiales,

Javier

Er Mo

unread,
Sep 20, 2023, 2:21:18 PM9/20/23
to mementodatabase
Hallo Javier
Das heißt : Du kaufst ein Buch --> erstellst einen Eintrag in der Bibliothek -->Du Ließt das Buch --> änderst den Eintrag von den Buch . Du machs jedes mal 1 Sache ( Erstellen oder Ändern ) für ein Buch . Mit dieser Sache ( Erstellen / Ändern ) wird gleichzeitig der Datenbestand in der CONTROL Bibliothek mit geändert . Du hast 100 Bücher , jetzt kaufst du ein Buch und trägst es in die Bibliothek ein . Beim Speichern von Eintrag wird die CONTROL von 100 auf 101 Überschriben . Wenn du das Buch gelesen hast , änderst du den Eintrag und makirst ihn als Gelesen . Dabei wird ebenfals die CONTROL geändern und die Gelesenen Bücher um 1 Stück erhöt . Wenn du deine Statistig machst , drauchs du nur in die CONTROL schauen und die Daten ablesen . Diese Daten könnte man auch als Widgets an Rand von den Bibliotheken Anzeigen lassen .
Kannst du eine Vorlage ( Die Struktur OHNE Daten ) hochladen , damit ich damit Arbeiten kann-

Hola javier
Eso significa: compras un libro --> creas una entrada en la biblioteca --> lees el libro --> cambias la entrada del libro. Haces 1 cosa (crear o cambiar) para un libro cada vez. Esto (crear/cambiar) también cambia los datos en la biblioteca CONTROL. Tienes 100 libros, ahora compras un libro y lo agregas a la biblioteca. Al guardar una entrada, el CONTROL se sobrescribe de 100 a 101. Una vez que haya leído el libro, cambie la entrada y márquela como Leída. También se cambia el CONTROL y se aumenta en 1 el número de libros leídos. Cuando haces tus estadísticas, todo lo que tienes que hacer es mirar el CONTROL y leer los datos. Estos datos también podrían mostrarse como widgets en el borde de las bibliotecas.
¿Puedes subir una plantilla (la estructura SIN datos) para que pueda trabajar con ella?

Hello Javier
That means: You buy a book --> create an entry in the library --> you read the book --> change the entry of the book. You do 1 thing (create or change) for a book each time. This thing (creating/changing) also changes the data in the CONTROL library. You have 100 books, now you buy a book and add it to the library. When saving an entry, the CONTROL is overwritten from 100 to 101. Once you have read the book, change the entry and mark it as Read. The CONTROL is also changed and the number of books read is increased by 1. When you do your statistics, all you have to do is look into the CONTROL and read the data. This data could also be displayed as widgets on the edge of the libraries.
Can you upload a template (the structure WITHOUT data) so that I can work with it-

Ernst

Javier Peñas Fernández

unread,
Sep 21, 2023, 5:41:55 AM9/21/23
to mementodatabase
Hallo Ernst,

ich habe in Memento eine Bibliothek mit der Struktur LIBROS auf meinem Android-Handy erstellt, weiß jedoch nicht, wie ich sie für dich sichtbar machen kann. Könntest du mir bitte erklären, wie das funktioniert? Entschuldige meine Unwissenheit.

Ich bin mir jedoch nicht sicher, ob es dir viel nützen wird, da die Feldnamen auf Spanisch sind. Wenn du Fragen hast, lass es mich bitte wissen.

Was das Verfahren betrifft, das du in deiner Nachricht erwähnt hast, das ist richtig. Es würde mir genügen, wenn die CONTROL-Bibliothek nur aktualisiert wird, wenn ich sie öffne, was alle paar Wochen der Fall wäre, da ich nicht regelmäßig überprüfen muss, wie viele Bücher ich habe. Aber natürlich wäre es noch besser, wenn sich die CONTROL-Bibliothek automatisch aktualisieren würde, wenn ich einen Eintrag in LIBROS hinzufüge oder ändere. Ich frage mich nur, wie CONTROL aktualisiert wird, wenn ich mehrere Einträge auf einmal erstelle, beispielsweise durch den Import einer CSV-Datei mit neuen Büchern.


Vielen Dank.

Mit freundlichen Grüßen,

Javier
----------------------------------------------------------
Hola, Ernst:

He creado en Memento una librería con la estructura de LIBROS en mi móvil Android, pero no sé cómo hacer para que puedas verla tú. ¿Me podrías indicar cómo hacerlo? Perdona mi ignorancia.

No obstante, no sé si te servirá de mucho porque los nombres de los campos están en español. Cualquier duda, me dices.
En cuanto al procedimiento que indicas en tu mensaje, es correcto. Yo me conformaba con que la librería CONTROL se actualizara solo cuando la abriera, que sería cada varios semanas, ya que no necesito consultar cuántos libros tengo con una frecuencia mayor. Pero, claro, sería aún mejor que, con tu procedimiento, se actualizase la librería CONTROL cada vez que diese de alta o modificara una entrada en LIBROS. Solo me queda la duda sobre cómo se actualizaría CONTROL cuando hiciera varias altas a la vez, por ejemplo, a través de la importación de un archivo CSV con los nuevos libros.

Muchas gracias.

Saludos cordiales,

Javier
---------------------------------------------------------
Hello Ernst,

I've created a library in Memento with the structure of LIBROS on my Android phone, but I don't know how to make it visible to you. Could you please guide me on how to do it? Please forgive my ignorance.

However, I'm not sure if it will be very useful to you because the field names are in Spanish. If you have any questions, please let me know.

Regarding the procedure you mentioned in your message, it's correct. I was fine with the CONTROL library updating only when I open it, which would be every few weeks, as I don't need to check how many books I have more frequently. But of course, it would be even better if, with your procedure, the CONTROL library updated every time I added or modified an entry in LIBROS. I just have a question about how CONTROL would update when I make multiple additions at once, for example, through the import of a CSV file with new books.

Thank you very much.

Best regards,

Javier

Bill Crews

unread,
Sep 21, 2023, 11:29:04 AM9/21/23
to Javier Peñas Fernández, mementodatabase
Para enviar una plantilla de sus bibliotecas, cree un archivo de plantilla (CONTROL.mlt2) ingresando a Editar biblioteca en su biblioteca que enlaza con las demás, probablemente su biblioteca CONTROL.  En el menú de 3 puntos en la esquina superior derecha, verá una opción Exportar.  Selecciónelo y marque la casilla para incluir bibliotecas subordinadas y cualquier otra casilla que considere apropiada.  Cuando se realice la exportación, el archivo .mlt2 aparecerá en su carpeta de Descargas.  Envíe un correo electrónico y adjunte el archivo de plantilla.  Los destinatarios podrán crear sus carpetas y ser dueños de ellas mismas, aunque no se incluirá ninguna de sus entradas.
__________

Um eine Vorlage Ihrer Bibliotheken zu senden, erstellen Sie eine Vorlagendatei (CONTROL.mlt2), indem Sie in Ihrer Bibliothek auf „Bibliothek bearbeiten“ gehen, die mit den anderen verknüpft ist – wahrscheinlich Ihrer CONTROL-Bibliothek.  Im 3-Punkte-Menü in der oberen rechten Ecke sehen Sie die Option „Exportieren“.  Wählen Sie es aus und aktivieren Sie das Kontrollkästchen, um untergeordnete Bibliotheken einzubeziehen, sowie alle anderen Kontrollkästchen, die Sie für angemessen halten.  Wenn der Export erfolgt, erscheint die .mlt2-Datei in Ihrem Download-Ordner.  Senden Sie eine E-Mail und hängen Sie die Vorlagendatei an.  Empfänger können Ihre Ordner erstellen und diese dann selbst verwalten, Ihre Einträge werden jedoch nicht berücksichtigt.
__________

To send a template of your libraries, create a template file (CONTROL.mlt2) by going into Edit Library on your library that links to the others -- probably your CONTROL library. In the 3-dot menu in the upper-right corner, you'll see an Export option. Select it and check the box to include subordinate libraries and any other checkboxes you deem appropriate. When the export takes place, the .mlt2 file will appear in your Download folder. Send an email and attach the template file to it. Recipients will be able to create your folders and own then themselves, though none of your entries will be included.

Er Mo

unread,
Sep 21, 2023, 2:01:14 PM9/21/23
to mementodatabase
Hallo Javier
Du kannst die Vorlage auch Online stellen . Die Bibliothek bearbeiten --> 3 Punkte menü --> Teilen . Die kannst du einen Namen vergeben , Katerlog auswählen , Beschreibeung einstellen . Nach den Hochladen bekom st du eine Web Adresse angezeigt, Die sendest du mir . Da kann ich die Vorlage herunter Laden und damit Arbeiten . Beim Importiren von Daten geht mein Vorschlag nicht , da ja kein Eintrag erstellt wirt . Dafür müssen wir einen Andere möglichkeit finden.

Hola javier
También puedes poner la plantilla en línea. Editar la biblioteca --> Menú de 3 puntos --> Compartir. Puede darle un nombre, seleccionar un registro de gato y establecer una descripción. Después de cargarlo, se te mostrará una dirección web que puedes enviarme. Puedo descargar la plantilla y trabajar con ella. Al importar datos, mi sugerencia no funciona porque no se crea ninguna entrada. Tenemos que encontrar otra opción para esto.

Hello Javier
You can also put the template online. Edit the library --> 3 point menu --> Share. You can give it a name, select a cat log, and set a description. After uploading you will be shown a web address, which you can send to me. I can download the template and work with it. When importing data, my suggestion doesn't work because no entry is created. We have to find another option for this.

Ernst

Bill Crews

unread,
Sep 21, 2023, 3:04:27 PM9/21/23
to Er Mo, mementodatabase
https://stackoverflow.com/questions/1293147/how-to-parse-csv-data

Requeriría algo de trabajo, pero un archivo CSV se puede analizar con JS y luego usarlo para completar una entrada en CONTROL.
__________

Es würde etwas Arbeit erfordern, aber eine CSV-Datei kann mit JS analysiert und dann zum Füllen eines Eintrags in CONTROL verwendet werden.
__________

It would require some work, but a CSV file can be parsed with JS, then used to populate an entry in CONTROL.


Javier Peñas Fernández

unread,
Sep 21, 2023, 3:11:24 PM9/21/23
to mementodatabase
Hallo Ernst,

Hier ist der Link, den ich gemäß deinen Anweisungen mit der Struktur einer der drei BIBLIOTHEKEN von Memento erhalten habe: http://libs.mobi/t/6649032064106496. Die entsprechende STRUKTUR für die STEUERUNG verstehe ich als beliebig und sollte an die Ergebnisse der Skripte angepasst werden.

Vielen Dank, Ernst,

Danke
------------------------------------------
Hello, Ernst:

This is the link I obtained from Memento following your instructions with the structure of one of the three LIBRARY BOOKS http://libs.mobi/t/6649032064106496. I understand that the corresponding CONTROL structure is indifferent and should be adapted to the results of the scripts.

Thank you very much, Ernst,

Thanks
------------------------------------------
Hola, Ernst:

Este es el link que he obtenido de Memento siguiendo tus indicaciones con la estructura de una de las tres librerías de LIBROS http://libs.mobi/t/6649032064106496. La estructura correspondiente de CONTROL entiendo que es indiferente y tendría que adaptarse a los resultados de los scripts.

Muchas gracias, Ernst,

Gracias

Javier Peñas Fernández

unread,
Sep 21, 2023, 3:15:44 PM9/21/23
to mementodatabase
Well, Bill, I see that there's a goldmine of possibilities for working with CSVs through scripting. This seems like an endless world. It's certainly a challenge for those who know about this.

Thank you very much.

Best regards,

Javier
----------------------------------------------------
Gut, Bill, ich sehe, dass es viele Möglichkeiten gibt, mit CSV-Dateien durch Skripting zu arbeiten. Das scheint wie eine endlose Welt. Es ist sicherlich eine Herausforderung für diejenigen, die sich damit auskennen.

Vielen Dank.

Herzliche Grüße,

Javier
--------------------------------------------------
Bien, Bill, veo que hay una mina de posibilidades para trabajar los CSV a través de script. Esto parece un mundo interminable. Desde luego es todo un reto para los que sabéis de esto.

Muchas gracias.

Saludos cordiales,

Javier

Er Mo

unread,
Sep 21, 2023, 3:25:09 PM9/21/23
to mementodatabase
Hallo Javier
Habe die Bibliothek erhalten . kannst du das mit der CONTROL auch noch machen

Hola javier
Conseguí la biblioteca. También puedes hacer eso con CONTROL.

Hello Javier
Got the library. you can also do that with CONTROL

Ernst

Bill Crews

unread,
Sep 21, 2023, 4:51:34 PM9/21/23
to Javier Peñas Fernández, mementodatabase
Sí, me temo que en realidad estaba dirigiendo ese mensaje a Ernst, quien podría estar familiarizado con algunas de esas soluciones.  Voy a molestarte con eso.
_________

Ja, ich fürchte, ich habe diese Nachricht wirklich an Ernst gerichtet, der möglicherweise mit einigen dieser Lösungen vertraut ist.  Es tut mir leid, Sie damit zu belästigen.
__________

Yes, I'm afraid I was really directing that message to Ernst, who might be familiar with some of those solutions. I'm soy to bother you with it.

Javier Peñas Fernández

unread,
Sep 22, 2023, 4:06:36 AM9/22/23
to mementodatabase
Guten Morgen, Ernst:

Ich sende Ihnen den Link zur CONTROL-Bibliothek. Wie Sie sehen, ist es sehr einfach: Es hat nur zwei Felder, FECHA (Datum der Erfassung der Summe) und EPUB (Summe der Einträge mit EPUB=1 in den drei  LIBROS-Bibliotheken). Aber seine Struktur könnte anders sein: Es würde jede andere Struktur funktionieren, die mir, wenn ich danach frage, den genannten EPUB-Summenwert geben könnte: http://libs.mobi/t/5054508476923904

Außerdem ist meine Idee, dass, wenn die EPUB-Summe funktioniert, ich weitere Abfragen hinzufüge, die mir bei der Anwendung des gleichen Verfahrens nützlich wären.

Vielen Dank, Ernst.

Mit freundlichen Grüßen,

Javier
-----------------------------------
Good morning, Ernst:

I'm sending you the link to the CONTROL library. As you can see, it's very simple: it only has two fields, DATE (date of the sum capture) and EPUB (sum of entries with EPUB=1 in the three LIBROS libraries). But its structure could be different: any other structure that could provide me with the mentioned EPUB sum value when requested would work: http://libs.mobi/t/5054508476923904

Furthermore, my idea is that if the EPUB sum ends up working, I'll add other queries that would be useful to me using the same procedure.

Thank you very much, Ernst.

Regards,

Javier
------------------------------------
Buenos días, Ernst:

Te envío el enlace de la librería CONTROL. Como ves es muy simple: solo tiene dos campos FECHA (fecha de la captura de la suma) y EPUB (suma de las entradas con EPUB=1 en las tres librerías LIBROS). Pero su estructura podría ser diferente: serviría cualquier otra que me apartase, cuando lo pidiera, el mencionado dado de suma de EPUB: http://libs.mobi/t/5054508476923904

Además, mi idea es que, si llega a funcionar la suma de EPUB, añadir otra consultas que me fueran de utilidad aplicando el mismo procedimiento.

Muchas gracias, Ernst.

Saludos,

Javier

Er Mo

unread,
Sep 22, 2023, 2:55:40 PM9/22/23
to mementodatabase
Hallo Javier
Habe mal einen Test vorbereitet . Habe 4 Bibliothekn mit dir geteilt . Du finde sie unter " Mit mir Geteilt " . Trage in der Libros 0-h , i-m , n-z Bücher ein mit den Feld " EPUB " . In der CONTROL ist nur 1 Eintrag der das Datum und das Feld EPUB enthält . Wenn du auf den Play Pfeil oben drückst werden die LIBROS durchlaufen bis zu den Eintrag bei den das Feld  "Ende" abgehackt ist und das Feld EPUB gezählt . Nach den Durchlauf wird beim Letzten Eintrag das Feld " Ende" angehackt . So weiß das Programm das es bis hirher schon mal gesucht hat . In CONTROL wird der Wert von Feld EPUB um das Ergebnis erhüht und das Datum geändert . Du kannst einige Date von CSV Inportiren und testen .

Hola javier
He preparado una prueba. Compartí 4 bibliotecas contigo. Puede encontrarlos en "Compartido conmigo". Ingrese libros en Libros 0-h, i-m, n-z usando el campo “EPUB”. Solo hay 1 entrada en el CONTROL que contiene la fecha y el campo EPUB. Si presiona la flecha de reproducción en la parte superior, los LIBROS se ejecutarán hasta la entrada donde el campo "Fin" está marcado y se cuenta el campo EPUB. Después de la ejecución, se marca el campo "Fin" para ver la última entrada. De esta forma el programa sabe que ya ha estado buscando algo. En CONTROL el valor del campo EPUB aumenta según el resultado y se cambia la fecha. Puede importar y probar algunos datos desde CSV.

Hello Javier
I have prepared a test. Shared 4 libraries with you. You can find them under “Shared with me”. Enter books in the Libros 0-h, i-m, n-z using the “EPUB” field. There is only 1 entry in the CONTROL which contains the date and the EPUB field. If you press the play arrow at the top, the LIBROS will run through up to the entry where the "End" field is checked off and the EPUB field is counted. After the run, the “End” field is checked for the last entry. This way the program knows that it has already been looking for something. In CONTROL the value of the EPUB field is increased by the result and the date is changed. You can import and test some data from CSV.

Ernst

Javier Peñas Fernández

unread,
Sep 22, 2023, 3:58:41 PM9/22/23
to mementodatabase
Hallo Ernst,
In der Version von Memento auf meinem Android-Handy finde ich nicht, wo der Abschnitt "Mit mir teilen" ist. Ich habe Memento auf meinem Windows-Computer installiert, und dort erscheinen die von dir erstellten Bibliotheken. Aber als ich versuchte, sie zu öffnen, hat das System mich gewarnt, dass sie Skripte enthalten. Ich habe es vorgezogen, sie nicht zu öffnen, um Risiken zu vermeiden. Ich habe Memento auf meinem Computer deinstalliert.
Es tut mir leid, Ernst, aber ich finde den Aufwand, um die Funktion zu erhalten, die ich suche, übertrieben. Ich hatte angenommen, dass es eine einfache und vor allem schnelle Lösung für Memento auf meinem Handy geben würde. Jetzt sehe ich, dass dies nicht der Fall ist, und es gefällt mir nicht, dass Sie weiterhin Zeit und Mühe in ein Thema investieren, das ich letztendlich leicht manuell lösen kann.
Vielen Dank, Ernst, für die Zeit und das Interesse, die Sie investiert haben.
Mit freundlichen Grüßen,
Javier
---------------------------------------
Hello Ernst,
In the Memento version on my Android phone, I can't find where the 'Share with me' section is located. I have installed Memento on my Windows computer, and there, the libraries you created do appear. However, when I tried to open them, the system warned me that they contain scripts. I preferred not to open them to avoid risks. I have uninstalled Memento on my computer.
I'm sorry, Ernst, but I find the effort to achieve the function I intend to be excessive. I assumed there would be an easy and, above all, quick solution for Memento on my mobile. Now I see that's not the case, and I don't think it's right for you to continue dedicating time and effort to an issue that I can easily resolve manually.
Thank you very much, Ernst, for the time and interest you have dedicated.
Best regards,
Javier
-------------------------------------
Hola, Ernst.
En la versión de Memento en mi móvil Android no encuentro dónde está el apartado de “Compartir conmigo”. He instalado Memento en mi ordenador con Windows y ahí, sí aparecen las librerías que has creado. Pero al intentar abrirlas el sistema me ha avisado de que contienen scripts. He preferido no abrirlas para evitar riesgos. He desinstalado Memento en mi ordenador.
Lo siento, Ernst, me parece desproporcionado el esfuerzo para conseguir la función que yo pretendo. Suponía que habría una solución fácil y, sobre todo, rápida para Memento en mi móvil. Ya veo que no es así y no me parece bien que sigáis dedicando tiempo y esfuerzo para un tema, que finalmente, puedo resolver fácilmente a mano.
Muchísimas gracias, Ernst por el tiempo y el interés que has dedicado.
Saludos cordiales,
Javier

Er Mo

unread,
Sep 22, 2023, 4:41:01 PM9/22/23
to mementodatabase
Hallo Javier
Du musst auf den Handy in den Cloud Speicher gehen .Von Linken Rand zur mitte Wischen --> Cloude Speicher auswählen --> Nach unten Scrollen . Ja das Programm enthält Skripte , Die ich geschriben habe .
Jetzt nicht Aufgeben . Das wäre für mich so als ob du ein GUTES Buch einfach in der Mitte aufhörst zu lesen und nie das Ende erfärst

Hola javier
Tienes que ir al almacenamiento en la nube de tu teléfono. Desliza el dedo desde el borde izquierdo hacia el centro --> selecciona almacenamiento en la nube --> desplázate hacia abajo. Sí, el programa contiene guiones que escribí.
No te rindas ahora. Para mí, eso sería como si dejaras de leer un BUEN libro a la mitad y nunca escucharas el final.

Hello Javier
You have to go to the cloud storage on your phone. Swipe from the left edge to the middle --> select cloud storage --> scroll down. Yes, the program contains scripts that I wrote.
Don't give up now. To me that would be like if you just stop reading a GOOD book in the middle and never hear the end.

Ernst

Er Mo

unread,
Sep 22, 2023, 5:18:57 PM9/22/23
to mementodatabase
Hallo Javier
Du musst in den Bibliotheken " Libros 0-H , I-M N-Z " Bucher eintragen ( zumintest das Feld EPUB  ) und dann das Sript in CONTROL ausfüren .

Hola javier
Hay que ingresar libros en las bibliotecas "Libros 0-H, I-M N-Z" (al menos el campo EPUB) y luego ejecutar el script en CONTROL.

ernst

Javier Peñas Fernández

unread,
Sep 23, 2023, 2:19:21 AM9/23/23
to mementodatabase
Hallo Ernst,
Vielen Dank für Ihr Interesse, aber ich kann nicht mehr Zeit mit diesem Thema verbringen. Vielleicht in der Zukunft.
Mit freundlichen Grüßen,
Javier
---------------------------------------
Hello Ernst,
Thank you very much for your interest, but I can't dedicate more time to this topic. Perhaps in the future.
Best regards,
Javier
----------------------------------------
Hola, Ernst:
Muchas gracias por tu interés, pero no puedo dedicar más tiempo a este tema. Quizás en el futuro.
Saludos cordiales,
Javier
Reply all
Reply to author
Forward
0 new messages