React ඉගෙන ගන්නේ

CorD SaC

Well-known member
  • Feb 4, 2015
    15,749
    28,110
    113
    sirawatama bn eka puluwanda. ape company ekema hadapu erp system ekak thiyenawa, okkoma wage logic yanne backend sp. program level eken kaloth performance adu wena nisalu sp gahala thiyenne. eka echchara wenna puluwanda bn? loku performance wenasak enawada db eke sp walin logic eka yana eka vs middleware eke logic eka yana eke?
    පිස්සුද බං. DB එකේ ලියනවට වඩා performance improvement එකක් කරන්න පුළුවන් app level එකෙන්
     

    elakiri_boy_22

    Well-known member
  • Oct 2, 2022
    1,866
    2,880
    113
    මමත් හුගක් වෙලාවට use කරනව SQL queries ලියවගන්න. සමහර වෙලාවට බුල කෙලිනව. But overall සෑහෙන්න ගොඩ දාල දෙනව. අපේ වෙලාව ඉතුරුකරගන්න පුලුවන් හරියට පාවිච්චි කලොත්
     

    Thilantdm

    Well-known member
  • Sep 15, 2010
    22,603
    5,861
    113
    අද නම් හදට ආවා
    oken mn react api tika deela node backend ekama (express.js) liyawa gatta kallen kalla.
    node knowledge eka mage 0 :lol:
    but eka karata passe deyak igana gtta.

    react ekath echchara thama.

    sp ehema optimize karawanna pluwan.
    bt welekata waradi ewa ghnwa.api itn bln krnna one.
     

    kolavari

    Well-known member
  • Aug 11, 2012
    33,746
    1
    25,656
    113
    කැළෑ පොජ්ජේ
    sirawatama bn eka puluwanda. ape company ekema hadapu erp system ekak thiyenawa, okkoma wage logic yanne backend sp. program level eken kaloth performance adu wena nisalu sp gahala thiyenne. eka echchara wenna puluwanda bn? loku performance wenasak enawada db eke sp walin logic eka yana eka vs middleware eke logic eka yana eke?

    Ow bn thiyenna puluwan ..depends...nathi wennath puluwan..

    Gahannam wale okkoma gahala hariyanne naha..

    Ape ekak thibuna db server eka 64gb ram server ekaka diwwe..eka samanyen 8g withara ekaka duwanna thibuna code eka backend eke liwwa nam..

    Oke wasi thiyenne query execution plan okkoma db side eke one go optimize karala uma gahagena run karanakota performance gain ekak wenna puluwan..anika network traffic eka adui..

    Api eken ekata db call kara kara data ganna onane nattham..ekath memory eke thiyagena okkoma karanna one ..ita wada samahara wita araka efficient wenna puluwan.. temporary views gahagena eka athulenma join karala queries run karala okkoma karala data tika witharai eliyata enne..

    Backend eka loosely coupled...eth db eka tight couple wenawa business logic ekata...

    Ehema unoth onema backend ekak use karanna puluwan sp ekak call karanna puluwan nam..e wage wasith thiynwa...

    Habai kohe hari kela wunoth sp ekak debug karana eka lesi na.. algorithm wage thadi ewa gahala thibune okkoma wage...pissu haduna eka nam
     
    • Like
    Reactions: Draco Malfoy

    a2mdb

    Well-known member
  • Sep 12, 2013
    3,938
    5,572
    113
    Plus user කෙනෙක් වෙන්න. කෝඩ්ස් ගොඩක් දුරට නිවැරදියි.
     
    • Like
    Reactions: siri_ayya

    MihiCherub

    Well-known member
  • Sep 14, 2009
    18,916
    1
    9,714
    113
    Gampaha
    මම recently implement කරපු code එකක්

    --------------------------------------------------------------------------------

    To add a progress bar to a Java table cell, you can create a custom cell renderer that displays a JProgressBar component instead of a plain text or other data. Here's an example code snippet that demonstrates how to do this:

    ```java
    Java:
    public class ProgressBarCellRenderer extends JProgressBar implements TableCellRenderer {
     
        public ProgressBarCellRenderer() {
            setOpaque(true);
            setMinimum(0);
            setMaximum(100);
        }
     
        @Override
        public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
            if (value instanceof Integer) {
                int progress = (Integer) value;
                setValue(progress);
                setStringPainted(true);
                setString(progress + "%");
            }
            if (isSelected) {
                setBackground(table.getSelectionBackground());
            } else {
                setBackground(table.getBackground());
            }
            return this;
        }
    }
    ```

    This class extends the JProgressBar class and implements the TableCellRenderer interface, which is used to customize the appearance of the cells in a JTable.

    In the constructor, the progress bar is initialized with a minimum value of 0 and a maximum value of 100.

    The `getTableCellRendererComponent()` method is called by the JTable to render each cell in the table. In this method, we check if the value of the cell is an integer (which is the expected value for a progress bar). If it is, we set the value of the progress bar to the integer value, and set the progress bar to display the value as a percentage with the `setStringPainted()` and `setString()` methods. If the cell is selected, we set the background color to the selection background color, otherwise, we set it to the default background color.

    Once you have created this custom cell renderer, you can use it to display progress bars in specific cells of your JTable by setting the cell renderer for that column using the `setCellRenderer()` method. For example, to set the progress bar cell renderer for the 5th column of your JTable, you can use this code:

    ```java
    Java:
    JTable table = new JTable();
    table.getColumnModel().getColumn(4).setCellRenderer(new ProgressBarCellRenderer());
    ```

    This code sets the cell renderer for the 5th column of the table to be an instance of the `ProgressBarCellRenderer` class, which will display progress bars in the cells of that column.

    DiRIPz4.png
     

    thriloka

    Well-known member
  • Apr 28, 2022
    885
    969
    93
    හෙමීට inbox දාන්නම් :D
    මටත් දාපන්කො. Laravel ගැන මොනවද ලියල තියෙන්නෙ කියල කියවන්න ආසයි.

    මම වැඩ කරන company එකෙත් Laravel වලින් තමා සීන් එක යන්නෙ. උන් ඒ උනාට හරියට ORM එක use කරන්නෙ නෑ, අතින්ම තමයි සමහර queries ලියන්නෙ. සමහර මඟුල් මට තේරෙන්නෙත් නෑ. ඒ වගේ query ChatGPT දාල මේ විදිහට modify කරල දෙන්න කීවම හුඟක් වෙලාවට හරියටම දෙනව. පට්ට ඒ අතින් නම්. 🔥
    ------ Post added on May 16, 2023 at 10:54 AM
     

    CorD SaC

    Well-known member
  • Feb 4, 2015
    15,749
    28,110
    113
    ඉතින් SP logic එක backend code level implementation එකක් කරන්න පුලුවන් නේද?
    පුළුවන් පුළුවන්. කොච්චර කලත් initial developer කරපු එක දන්නේ ඌනෙ බං. 2004 ලියපු project එකක්. Business requirement එක client වත් දන්නේ නෑ. කිසිම doc එකක් නෑ. අපි code base බලලම තේරුම් ගන්න ඕනෙ.
     
    • Like
    Reactions: siri_ayya