teleren/devto huggingface dataset:
Why Ruby app deploy is getting progressively slower
Tags: rails, ruby, bootsnap
Published: 2023-09-15 16:04:16

---
title: Why Ruby app deploy is getting progressively slower
published: true
description: Why rails app deploy via Capistrano may be getting slower by Bootsnap
tags: rails, ruby, bootsnap
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2023-09-15 15:56 +0000
---

I have a big and stable Rails application which has been running in production for 5 years. Each time I deploy the code using Capistrano and I've noticed that deploying time is getting slower. It takes 5 minutes longer than we are used to. Looking through the logs, I've noticed that the task `bundle exec rake db:migrate` takes 5 minutes. It was unusual!

I've done some manipulations with a deploy script. I noticed that due to the creation of new release, the first run `bundle exec <COMMAND>` is terribly slow. I was shocked. I had idea that there is something with code initializing or with caching.

I use [Bootsnap](https://github.com/Shopify/bootsnap) for each my Rails application and I've noticed one thing:

```
Note also that Bootsnap will never clean up its own cache: this is left up to you. 
Depending on your deployment strategy, you may need to periodically purge tmp/cache/bootsnap*. 
If you notice deploys getting progressively slower, this is almost certainly the cause.
```

Yes, it was the answer! After some years of using Bootsnap on the server it has written caches for 180 Mbs. I have deleted all cache files using `rm tmp/cache/bootsnap*` and It helps me. Be aware, if you are using `Bootsnap` and your application is getting slower on the boost, maybe there is a problem with a large amount of cache.
Demystifying React's Rendering and Reconciliation Mechanisms
Tags: webdev, javascript, programming, react
Published: 2023-09-15 15:51:00

Have you ever wondered how React handles rendering, optimization, and synchronization of state changes? In this article, we'll delve into React's internal mechanisms and explore concepts like batching, race conditions, and reconciliation.

## React Batching Mechanism

React's batching mechanism is a hidden gem that optimizes the rendering process. It cleverly groups state changes into a single update cycle known as a 'batch.' This batching strategy prevents frequent re-renders and repaints to the DOM, ultimately boosting performance.


![React Batching Mechanism](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x0eghalwbm8aisk55vjp.jpg) 

Imagine you have multiple state updates within a component. Without batching, React would re-render the component for each state change, leading to unnecessary performance overhead. With batching, React combines these updates into a single rendering pass, resulting in a smoother and more efficient user experience.

## Race Conditions in React

Race conditions in React occur when an application's behavior depends on the relative timing of events. In simpler terms, improper synchronization of asynchronous or concurrent events can lead to race conditions, resulting in unpredictable behavior.


![Race Conditions in React](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tul2aoruga8k2llasyiz.jpg)

Let's say you have multiple components or functions executing simultaneously, and their interactions aren't properly managed. This lack of synchronization can lead to race conditions, where the order of execution determines the outcome. Understanding and mitigating race conditions is crucial for maintaining application stability and reliability.

## React's Built-in Reconciliation Mechanism

React's built-in reconciliation mechanism is the engine that powers efficient UI updates in response to state changes. This process involves comparing the previous and current states of components and efficiently updating the DOM to reflect these changes. This mechanism is aptly named "reconciliation."

When you update the state of a React component, React doesn't immediately re-render the entire component tree. Instead, it performs a diffing process, identifying the specific changes in the virtual DOM and updating only those parts that require modification. This optimization minimizes unnecessary DOM manipulation, resulting in faster updates and a more responsive user interface.

In summary, React's batching mechanism streamlines state updates, race conditions require careful synchronization, and React's built-in reconciliation mechanism ensures efficient UI updates. Understanding these concepts empowers you to write more performant and reliable React applications, making you a more proficient React developer.

Stay tuned for more insights into React's inner workings and best practices in future articles. Happy coding! 🚀🔍
A notable day
Published: 2023-09-15 15:45:15

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a5f96wux6jglxdv279hd.jpeg)

---
title: A notable day
published: false
date: 2018-01-20 05:39:59 UTC
tags: quix,quixpagebuilder,joomla,bestjoomlapagebuilde
canonical_url: https://medium.com/@mazharul_islam/a-notable-day-630c6725702
---

Every person has a memorable moment, time, day and year. Why is that situation memorable? Because we never forget that. That moment stored in our mind, heart automatically. That moment motivates us. We feel better, we feel proud when we memorize that situation.

Last day was a memorable day for me. Do you know why? You can not imagine why that day is a memorable day.

At first, I could say the front of some audience on a stage. I took a session. The topic was “Introduction to Joomla and How to create [Quix](https://www.themexpert.com/quix-pagebuilder)Element from Scratch”. I don’t have any preparation for the session. My colleagues motivated me and said me:

> Don’t be scare, BE CONFIDENT. Just start to say.

I started to say, step by step I introduced to them about Joomla, what is it? why are we using it? About Joomla administrator panel, global configuration, how to create menus, articles, how to install Joomla template, extensions and how to use that and so on. Also, I teach them how to create a [Quix](https://www.themexpert.com/quix-pagebuilder)element from scratch.

After ending the session, I saw the time. How much time did I pass of the session? That session duration was 1.30 hours long.

> WOOAAAAAOOOWWWW

I was speechless completely. I could not believe how it is possible. But, I could speak in front of the audience. Because my beloved colleagues help me, they inspired me, they motivated me a lot. Thanks a lot to my colleagues.

Now I feel better. I can speak in front of others. I learned lots, I learned to give the answer to the questions of others.

Woom! I can give the answer to the question.

The end of the session, I came back to home.

Thanks for reading and also appreciate the valuable suggestion to improve my writing.
AntDB-Oracle Compatibility Developer’s Manual P3–65
Published: 2023-09-15 15:18:08

##### CASE

CASE expressions in SQL are a class of conditional expressions that function similarly to if/else statements in other languages.

CASE WHEN condition THEN result

\[ WHEN ... ]

\[ ELSE result ]

END

The CASE clause can be used anywhere the expression appears. condition is an expression that returns a result of type BOOLEAN. If the return result is true, then the value of the CASE expression is the result following the condition. If the result is false, then the WHEN clause after the CASE expression is searched in the same way. If the WHEN condition is not true, then the value of the CASE expression is the result in the ELSE clause. If no ELSE clause is used and no condition is matched, then the result is returned as null.

**Example:**

```
SELECT * FROM test;

a
---
1
2
3
(3 rows)

SELECT a,
CASE WHEN a=1 THEN 'one'
WHEN a=2 THEN 'two'
ELSE 'other'
END
FROM test;

a | case
---+-------
1 | one
2 | two
3 | other
(3 rows)
```

All data types of result expressions must be able to be converted to a single output type.

The following simplified CASE expression is another specific use of the above common type expression.

CASE expression

WHEN value THEN result

\[ WHEN ... ]

\[ ELSE result ]

END

The expression is first calculated and then compared with all the values specified in the WHEN clause until an equal condition is found. If no match is found, then the result (or a null value) in the ELSE clause is returned.

We can rewrite the above example using the simplified CASE syntax.

```
SELECT a,
CASE a WHEN 1 THEN 'one'
WHEN 2 THEN 'two'
ELSE 'other'
END
FROM test;

a | case
--+-------
1 | one
2 | two
3 | other
(3 rows)
```

CASE expressions do not compute sub-expressions that do not require a confirmed result. For example, here is an allowed method to avoid the divide by zero operation.

```
SELECT ... 	WHERE CASE WHEN x <> 0 THEN y/x > 1.5 ELSE false END;
```
Mastering Event Binding for Dynamically Created Elements in JavaScript
Tags: javascript, beginners, programming, webdev
Published: 2023-09-15 15:11:54

In modern web development, dynamically generated elements play a significant role in creating interactive and responsive user interfaces. However, managing events for these dynamically created elements requires a deep understanding of event binding techniques. In this comprehensive guide, we'll explore various strategies for effectively binding events to elements that are generated dynamically using JavaScript. Whether you're a beginner or an experienced developer, you'll find valuable insights and practical code examples to help you master this essential aspect of web development.

**Method 1: Using Event Delegation (Recommended):**

Event delegation is a popular and efficient way to handle events on dynamically created elements. It involves attaching an event handler to a parent element that already exists in the DOM and then using conditional statements to target the dynamically created elements.


![javascript](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vxghglj68yy7i4p7q1t7.png)

With event delegation, you can handle events for elements that don't exist at the time of initial page load.

**Method 2: Inline Event Listeners:**

Another approach is to attach event listeners directly when creating the element.


![javascript](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c4dwd2m1jebvaysjdbse.png)

This method is suitable when you have full control over the element creation process.

**Method 3: Using Event Libraries:**

Some JavaScript libraries, like jQuery, provide simplified methods for event binding on dynamically created elements.


![javascript](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l2zjte7giq1uinfjjwiy.png)

Conclusion:

Event binding on dynamically created elements is a fundamental concept in web development. Event delegation is generally recommended for its efficiency and versatility, especially when dealing with a large number of dynamically generated elements. However, the choice of method may depend on your specific project requirements.

By understanding these techniques and using them appropriately, you can create interactive web applications that respond to user interactions, even for elements generated on the fly.

`LinkedIn Account` : [LinkedIn](https://www.linkedin.com/in/matthew-odumosu/)
`Twitter Account `: [Twitter](https://twitter.com/iamcymentho)
**Credit**: Graphics sourced from [Youtube](https://www.youtube.com/watch?v=UkoJj9RFwh4)
AntDB-Oracle Compatibility Developer’s Manual P3–63
Published: 2023-09-15 15:09:57

##### VARIANCE

Calculates the variance of the specified column.

**Example:**

Calculates the variance of sa1.

```
SELECT empno, sal, VARIANCE(sal) OVER (ORDER BY hiredate) "Variance"
FROM emp ORDER BY ename, sal, "Variance";
 EMPNO |  SAL  |       Variance       
-------+-------+------------------------
  7876 |  8100 |              2999125
  7499 |  7600 |              2080000
  7698 | 11850 | 5697604.166666666667
  7782 |  7450 |  4749315.47619047619
  7902 |  8000 | 3630961.174242424242
  7900 |  5950 | 3630961.174242424242
  7566 |  7975 |              1564250
  7839 | 10000 | 4143673.611111111111
  7654 |  6250 |              3826250
  7934 |  6300 | 3430480.769230769231
  7788 |  8000 | 3195539.148351648352
  7469 |  4800 |              2000000
  7369 |  6800 |              2000000
  7844 |  6500 | 4204006.696428571429
  7521 |  6250 | 1392291.666666666667
(15 rows)
```

##### CORR

Calculate the correlation coefficient of a pair of expressions.

**Example:**

```
postgres=# select corr(t.num,test.num) from 
postgres-# (select id-1 as id, num from test) as t,test where t.id=test.id ;
 CORR(T.NUM,TEST.NUM)  
------------------------------
   -0.7802897838627655
(1 row)
```
AntDB-Oracle Compatibility Developer’s Manual P3–62
Published: 2023-09-15 15:03:00

##### VAR\_POP

This function returns the overall variance of the grouped series.

Example:

```
SELECT empno, sal, VAR_pop(sal) OVER (ORDER BY hiredate) as "var_pop"
FROM emp ORDER BY ename, sal, "var_pop" ;

EMPNO |  SAL  |       var_pop        
------------+----------+----------------------
  7876 |  8100 | 2799183.333333333333
  7499 |  7600 | 1386666.666666666667
  7698 | 11850 | 4748003.472222222222
  7782 |  7450 | 4070841.836734693878
  7902 |  8000 | 3328381.076388888889
  7900 |  5950 | 3328381.076388888889
  7566 |  7975 |              1251400
  7839 | 10000 |           3729306.25
  7654 |  6250 | 3401111.111111111111
  7934 |  6300 | 3166597.633136094675
  7788 |  8000 | 2967286.352040816327
  7469 |  4800 |              1000000
  7369 |  6800 |              1000000
  7844 |  6500 |       3678505.859375
  7521 |  6250 |           1044218.75
(15 rows)
```

##### VAR\_SAMP

This function returns the sample variance of the grouped series.

For example:

```
SELECT empno, sal, VAR_samp(sal)  OVER (ORDER BY hiredate) as "var_samp"
FROM emp ORDER BY ename, sal, "var_samp" ;

 EMPNO |  SAL  |       var_samp       
-------+-------+-----------------------
  7876 |  8100 |              2999125
  7499 |  7600 |              2080000
  7698 | 11850 | 5697604.166666666667
  7782 |  7450 |  4749315.47619047619
  7902 |  8000 | 3630961.174242424242
  7900 |  5950 | 3630961.174242424242
  7566 |  7975 |              1564250
  7839 | 10000 | 4143673.611111111111
  7654 |  6250 |              3826250
  7934 |  6300 | 3430480.769230769231
  7788 |  8000 | 3195539.148351648352
  7469 |  4800 |              2000000
  7369 |  6800 |              2000000
  7844 |  6500 | 4204006.696428571429
  7521 |  6250 | 1392291.666666666667
(15 rows)
```
Introducing the Modulo Project Dev Blog
Tags: javascript, webdev, opensource, discuss
Published: 2023-09-15 14:59:24

Hi Dev.to community!

I've been off of Dev.to for a minute, but I have been working on cool open source software and like a dozen side projects in the mean time that I'm super, super excited to begin sharing. They are *just* at that "alpha" stage where it's time to let my little "baby birds" fly out of the nest, so here goes!

This is the introduction to what's going to be a series of posts about a brand new free/libre open source HTML and JavaScript framework, a free/libre open source HTML, JS, CSS, and web/graphic design curriculum, and even some game engine and art projects, and so much more -- I've been really busy!

-----

What to expect:

- **Development log posts** - I intend to regularly post on [Modulo.js](https://modulojs.org/) development!

- **Curriculum releases** +  **content release announcements** - I have a bunch of curriculum. A lot of it is currently [free / open licensed HTML and CSS curriculum that you can start as early as right away to begin to learn to code](https://freecodinglessons.com/). Some of it is still under development, so *"stay tuned" for "free coding course drops"*, so to speak!

- **Discussions on development mode and approach** - I have some content that I hope is interesting to others on framework design, API design, documentation, and design of learning material. So, if you like deeper, thoughtful discussions on what makes good code, and maybe even engineering management, then definitely follow!

---------

**Into that sort of stuff?**

- Then follow along on Mastodon: [@modulojs@mastodon.social](https://mastodon.social/@modulojs)

- And of course here on Dev.to: [https://dev.to/michaelpb/](https://dev.to/michaelpb/)


Thanks for reading!

-- Michael
AntDB-Oracle Compatibility Developer’s Manual P3–61
Published: 2023-09-15 14:56:39



##### STDDEV\_SAMP

This function calculates the cumulative sample standard deviation and returns the square root of the overall variable with the same return value as the square root of the VAR\_POP function.

**Example:**

```
begin;
CREATE TABLE employees (manager_id INT,last_name varchar(50),hiredate varchar(50),SALARY INT);
INSERT INTO employees VALUES(100, 'Raphaely', '2017-07-01', 1700);
INSERT INTO employees VALUES(100, 'De Haan', '2018-05-01',11000);      
INSERT INTO employees VALUES(100, 'Errazuriz', '2017-07-21', 1400);
INSERT INTO employees VALUES(100, 'Hartstein', '2019-05-01',14000);     
INSERT INTO employees VALUES(100, 'Raphaely', '2017-07-22', 1700);
INSERT INTO employees VALUES(100, 'Weiss',  '2019-07-11',13500);     
INSERT INTO employees VALUES(100, 'Russell', '2019-10-05', 13000);
INSERT INTO employees VALUES(100, 'Partners',  '2018-12-01',14000);     
INSERT INTO employees VALUES(200, 'Ross',  '2019-06-11',13500);     
INSERT INTO employees VALUES(200, 'Bell', '2019-05-25', 13000);
INSERT INTO employees VALUES(200, 'Part',  '2018-08-11',14000);
COMMIT;
SELECT manager_id, last_name, hiredate, salary,STDDEV_SAMP(salary) OVER (PARTITION BY manager_id 
ORDER BY hiredate ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS cum_sdev FROM employees ORDER BY manager_id, last_name, hiredate, salary, cum_sdev;

 MANAGER_ID | LAST_NAME |  HIREDATE  | SALARY |     CUM_SDEV      
------------+-----------+------------+--------+--------------------
        100 | De Haan   | 2018-05-01 |  11000 | 4702.127178203499
        100 | Errazuriz | 2017-07-21 |   1400 |  212.132034355964
        100 | Hartstein | 2019-05-01 |  14000 | 6340.346993658943
        100 | Partners  | 2018-12-01 |  14000 | 6064.899009876422
        100 | Raphaely  | 2017-07-01 |   1700 |                  
        100 | Raphaely  | 2017-07-22 |   1700 |  173.205080756888
        100 | Russell   | 2019-10-05 |  13000 | 6026.474330580265
        100 | Weiss     | 2019-07-11 |  13500 |  6244.31169717116
        200 | Bell      | 2019-05-25 |  13000 |  707.106781186548
        200 | Part      | 2018-08-11 |  14000 |                  
        200 | Ross      | 2019-06-11 |  13500 |               500
(11 rows)
```
online digital marketing course
Published: 2023-09-15 14:25:18


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/477yydsndsw0u5dik5lq.png

*WHAT IS DIGITAL MARKETING ?

[Digital Marketing](https://www.skillshiksha.com/master-in-digital-marketing-course) is also known as online marketing. It is the process of online branding of their products using the internet and other electric sources of communication.This includes not only social media and email but also doing the branding of different products digitally.

BENEFITS OF DIGITAL MARKETING COURSE :

The first benefit of digital marketing course is to stay updated with new informations through social media.
2. The digital marketing course easy to understand.

3. There are different career options in this field.

4. Digital Marketing skills are high in demand because there are huge career opportunities.

WHAT WILL YOU LEARN IN DIGITAL MARKETING COURSE:

SEARCH ENGINE OPTIMISATION (SEO): Search engine optimisation is the most important module in digital marketing . it includes on-page seo , off-page seo and technical seo to ranking your website in google and other platforms.
CONTENT MARKETING : Content is the king in digital marketing . you will learn how to create high quality content that attracts and retains your target audience .
3. SOCIAL MEDIA MARKETING : Social media platforms are powerful tools for branding your products through social platforms like Facebook , Instagram and youtube.

4. EMAIL MARKETING : Email remains a highly effective marketing channel. It includes email campaigns to describe about your website.

5. Pay- Per- Click Advertising (PPC) : The paid advertising campaigns , includes Google Ads and social media advertising. This involves budget management , keyword targeting and ads creation.

6. Mobile Marketing : with the rise of mobile devices , mobile marketing is essential. You will discover how to optimize for mobile and create mobile friendly content.
Whataboutism
Tags: a11y, career, webdev, community
Published: 2023-09-15 14:24:52

> What about it? This doesn’t need accessibility. 

The amount of ego doesn’t surprise me when the conversation of accessible code arises. Code, in any stage, from alpha all the way to production needs to be, should be, and can be made accessible. But a subset of the developer community, a rather large subset seems to think otherwise. 

Thinking that there is no such thing as a disabled developer is on par with thinking we are the only living organism in the entire universe. That level of ego makes part of the reason why the Web and digital world is inaccessible. Those people would rather go to the grave thinking they are right, rather than be wrong. 

We don’t talk about it much these days. 

“This product uses AI and it will ship production-ready code!” but when challenged, they (the developer subset with egoism at the forefront) come out of the woodwork to attack people and argue with people that are pointing out the fact  that is in fact a falsity.

That’s just one example of why without education and research, the Web is doomed to be inaccessible even more than it already is. 

If those who egos aren’t checked at the door had their way, they’d ship their own computers and call it a day because, “It works on my machine!”. Hey Blaine, we’re not shipping YOUR machine. 

If there were less ego from those that would rather die on the cross they make for themselves then maybe, just perhaps there would be a little more accessibility in the digital world. Yet, here we are and here I am writing what I can imagine will ignite some kind of firestorm in some ecosystem of keyboard wunderkind who can’t see beyond their own screens.

“Oh, I agree there needs to be accessibility but…” You ended the hate with the key word in that sentence. “But”. A “but” is an underlying statement to prove to yourselves you are correct. The reassurance that you are right and the other side of the argument is wrong no matter what the facts are or what the data is. 

So when an accessibility professional says, “Hey, I just wanted to bring to your attention there are issues here. Accessibility concerns you want to address before making a a statement such as…” Stop going into a defensive posture and on the attack immediately.

That’s not an attack, it is someone telling you there are issues that need to be fixed to make your product, your brand, your app, your site, accessible to people with disabilities.

You created something more likely to make you money. That’s how tech works isn’t it? Then why would you shut out a subset of the population for whatever reasons because you didn’t want to make it accessible? Do a search for “disposable income of disabled persons”. You’d be surprised. 

And to devs that wonder why it matters so. Think of these times when and if you ever become disabled because it could happen at any time to any of us.