Unfold Hierarchy number Tags Values

      Notebook
        1  Notebook Cover
            1.1  Notes are information pieces in html format.
Notebook is collection of notes and notebooks.
Notebooks are organized as a tree.
        2  Examples
            2.1  Web Address   Need supplementary
                2.1.1  Search   To be determined   Like   Important
                2.1.2  Life in Chinese   To be determined   Urgent
                2.1.3  Articles/Data in English   To be determined   Important
                2.1.4  Articles/Data in Chinese   To be determined   Important
                2.1.5  Study in English   Need supplementary
                2.1.6  Study in Chinese   Need supplementary   Important
                2.1.7  Novels in Chinese   Need supplementary   Like
                2.1.8  Entertainment in Chinese   Need supplementary   Like
            2.2  My Data   Need supplementary   Important
                2.2.1  My eyes

Radian: 84

Time Left eye RIght eye
2020.8 300 350
2019.7 300 350
2018.5 300 350
                2.2.2  My weight
Time Weight(kg)
2020.7 53.7
2019.3 55.2
2018.6 54.5
                2.2.3  My height
Time Height(cm)
2020.7 164
2019.3 165
2018.6 164
                2.2.4  My menstruation
Year/Month 1 2 3 4 5 6 7 8 9 10 11 12
2021 2,30 2
2020 28 27 23 21 19 7,26 19 15 12 8 9
2019 10 7 7 2,30 26 25 23 17 14 12 19 26
                2.2.5  My money
Time Total Bank A Bank B Bank C
2020.1 300 100 100 100
2019.1 300 100 100 100
2018.1 300 100 100 100
            2.3  Common knowledge
                2.3.1  Size of coat
Size Coat Length Shoulder Sleeve Chest Waist
160/76A(0) 69 37 80 88 86
160/84A(2) 69 38 81 90 88
160/88A(4) 70 39 82 93 91
165/88A(6) 70 39 83 95 93
165/92A(8) 71 40 83 98 96
165/96A(10) 72 41 84 100 98
165/100A(12) 73 42 84 104 102
170/100A(14) 74 43 85 108 106
170/104A(16) 75 43 86 112 110
            2.4  Contacts   Need supplementary
                2.4.1  Relative   Important
Relationship Phone Email Address Birthday Comments
papa 123456789 123@aa.com Beautiful Island 1960.1.1
mama 123456789 123@aa.com Beautiful Island 1961.3.1
sister 123456789 123@aa.com Beautiful Island 1984.3.8
                2.4.2  Work
Relationship Name Phone Email Address Comments
manager A 123456789 123@aa.com Hidden Peak
colleague B 123456789 123@aa.com Hidden Peak
colleague C 123456789 123@aa.com Hidden Peak
            2.5  Coding   Need supplementary
                2.5.1  Coding Address   To be determined
                2.5.2  sftp to sourceforge (to upload large files)

C:\Users\mara>sftp mararsh@frs.sourceforge.net
Password:
Connected to mararsh@frs.sourceforge.net.
sftp> cd /home/frs/project/mara-mybox
sftp> ls
sftp> cd v6.4.2
sftp> lcd  D:\releases\Mybox\2021-03-21-v6.4.2
sftp> put D:\releases\Mybox\2021-03-21-v6.4.2\MyBox-6.4.2-linux.tar.gz
Access the files: https://sourceforge.net/projects/mara-mybox/files/
                2.5.3  sftp to sourceforge (to upload website files)

C:\Users\mara>sftp mararsh@frs.sourceforge.net
Password:
Connected to mararsh@frs.sourceforge.net.
sftp> cd /home/project-web/mara-mybox/htdocs
sftp> ls
sftp> lcd  D:\GitHub\MyBox\docs
sftp> put *.*
Access the website: https://mara-mybox.sourceforge.io/index.html
                2.5.4  javafx
                    2.5.4.1  Items in one sentence about javafx   Need supplementary   Like
  1. Always assume user knows nothing about programming.
  2. Do not expect user will open user guide. Someone, including me, even will not look at nor think about prompts on the screen.
  3. Necessary prompts can help user understand intention of the program.
  4. Ambiguous prompt is worse than no prompt.
  5. Always response for user, like pop information, make sound, or update interface.
  6. Provide most options and set default choice.
  7. Remember user’s inputs or seletions and fill in or set values automatically in next time.
  8. Less inputs or selections meanwhile keep interfaces clean.
  9. Use radio or check buttons instead of drop-down list if there is enough place in interface.
  10. No more than 3 levels to select.
  11. When too many controls in interface, consider popular layout: Left-right areas like curtain, vertical accordion menus, tabs to switch targets
  12. User’ screen resolution may be from 1k to 4k, so the design size of most MyBox interfaces is smaller than 1100 * 720.
  13. Make use of auto-wrap container like FlowPane, to work for both small screen and large screen.
  14. Controls can be updated only in JavaFx thread. Use Platform.runLater to change control when handle event in its listener.
  15. Progress should be shown when operation costs much time.
  16. Time-consume operation should not be run in JavaFx thread to avoid blocking interface.
  17. Backgournd task should always check whether task is canceled, especially in loop or before/after long-run statements.
  18. When listen mouse events, event.getX() and event.getY() return the coordinate of event.getSource() which is the control owns the events. Example, when listen on ImageView, the coordinate is related to the image.
  19. Iterative calls may happen when listen both onMouseEntered and onMouseExited and change focus in handling of the events(like pop menu) or change control’s size.
  20. When double click mouse, single-click event is tiggerred at first and then double-click event is triggerred. So need avoid duplicated or conflicted handlings against same event.
  21. For table's multiple selections, use getSelectedIndices() to listen changes, Some changes may be missed if use selectedItemProperty().
                    2.5.4.2  Examples
                        2.5.4.2.1  ChangeListener

input.textProperty().addListener(new ChangeListener() {
     @Override
     public void changed(ObservableValue observable, String oldValue, String newValue) {
               checkInput();
     }
});
                        2.5.4.2.2  setOnMouseClicked

control.setOnMouseClicked(new EventHandler() {
     @Override
     public void handle(MouseEvent event) {
            controlPane();
     }
});
                        2.5.4.2.3  disableProperty().bind

startButton.disableProperty().bind(
       Bindings.isEmpty(targetPathInput.textProperty())
       .or(targetPathInput.styleProperty().isEqualTo(badStyle))
       .or(optionsValid.not())
);
                2.5.5  java
                    2.5.5.1  Items in one sentence about java   Need supplementary   Like
  1. Always assume most extreme inputs and most weird operations.
  2. Assume user’ hardware configuration(CPU/memory/disk) is lower than average level.
  3. Use BufferedInputStream and BufferedOutputStream for file I/O.
  4. Use try-with-resource for file I/O.
  5. Always consider out of memory when read/write file or data.
  6. Notice charset when read/write text file.
  7. Notice charset when convert between bytes and string.
  8. Condition to determine whether reach end of file should be "len > 0". If use "len != -1", endless loop may happen if zero byte is read.
  9. Call "System.gc()" before delete/move/rename file, to avoid failure due to cache.
  10. When handle information in tree, like files system, endless loop should be avoided. If the operation will change source node, the target node should not be the source node nor its descendants.
  11. If delete list by indices, delete items from the end index to the start index.
  12. When class has many parameters, do not write many constructors to initialized different sets of parameters. Better coding is static creator and chain assignment by return “this” in all “set” methods.
  13. Anonymous class is very useful for scenario like lots of duplicated codes with only difference that several methods have difference implements.
  14. Generic is very useful for scenario like lots of duplicated codes with only differernce of data type.
  15. Define as less instance variables/methods as possible in class if it generates lots of instance.
  16. As less float-point calculations as possible in loop. If can, change float-point calculations as integer calculations.
  17. When listen data changing, need judge whether change trully happens, and avoid too frequently manufactures by setting minimum threshold of changing.
  18. Reboot application when change JVM parameters or need clean env in simple way.
  19. Notice whether the index is 0-based or 1-based, especially for thrid-party codes. 0-based is default. If 1-based, should write comment for it.
  20. Generally, index in user interface starts from 1, while index in codes data starts from 0.
  21. Generally, range(start-end) in user interface includes end, while range(start-end) in codes data excludes end.
  22. Double.MIN_VALUE is the minimum positive double(almost zero). -Double.MAX_VALUE is the minimum double.
  23. When handle money, store integer numbers for each unit.
  24. BigDecimal is much slower than double. Double is enough for most situations.
  25. To determine value's broken, write if (abs(x - 7.3) < TOLERANCE) instead of if (x == 7.3).
  26. Value of final static constant should be determined at compling time.
  27. When JDBC read numbers, if SQL value is null, ResultSet.getDouble/getFloat/getInt/getShort returns 0. Use ResultSet.getObject instead if need distinct zero and null. ResultSet.html#getDouble
  28. From Java18, Charset.defaultCharset() is always UTF-8. This will affect commands and results of ProcessBuilder. Process JDK-8266075

* Links and controls may be unresponsive when html page is editable.