teleren/devto huggingface dataset:
Use of Hash Functions in Blockchain
Tags: blockchain, security, beginners
Published: 2022-04-29 21:19:29

Hash functions are vital to protect the immutability of the digital ledger. If the hash function used by a blockchain is broken, then an attacker could find collisions for crucial hash values (such as the [blockchains](https://bpbonline.com/search?q=blockchain&type=product) or a Merkle tree’s values). This would enable malicious nodes to more easily rewrite the history of the blockchain network and cause a blockchain system to fall apart. For this reason, the security of hash functions is essential to the security of the blockchain.

The hash functions are used to protect the integrity of data. Given a trusted hash of the data, it is possible to calculate the hash of the data and compare the two values. If they match, then the data has likely not been modified since the original hash was created.

The digital ledger of the blockchain is designed to store valuable information that can benefit an attacker if modified in their favor. Additionally, this ledger is stored and transmitted by a network of mutually distrusting nodes. As a result, the blockchain has a number of different uses for hash functions and the integrity protection that they provide.

Some of the most common uses of the hash function in blockchain include:

- **Digital signatures**: Hash functions are a vital part of digital signature algorithms summarizing the data to a compact value while preserving its integrity. Digital signatures are used for preserving data integrity and authentication for blockchain transactions and blocks.

- **Merkle trees**: The Merkle tree uses hash functions to ensure that it is infeasible to find two Merkle trees with the same root hash summarized by a list of transactions contained within a block into a single value within a blockchain header. The integrity of the transactions contained within the block's body is protected as well by storing the root hash within a block header and protecting the integrity of the block header.

- **Proof-of-work (PoW) consensus**: The PoW consensus algorithm defines a valid block as one whose header has a hash value less than a given threshold. Hash function collision resistance is essential here since it ensures that finding a valid block is difficult.

- **The blockchain's "chains"**: The hash of the previous block header within its header is contained by each block in the blockchain, which ensures that changing a single block in the blockchain without detection is impossible. Modifying one block in the chain requires generating new versions of every following block as well, increasing the difficulty and helping to preserve the integrity of the blockchain's digital ledger.

Hope this was helpful.
Join the Star Wars Costume Contest on DEV 🌌
Tags: maythefourth, starwars, justforfun, announcements
Published: 2022-04-29 21:06:01

---
title: Join the Star Wars Costume Contest on DEV 🌌 
published: true
description: 
tags: maythefourth, starwars, justforfun, announcements
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/any2ds2lrmtr2tpcjxyb.png
---

_Greetings, members of the Rebel Alliance._ 

Star Wars Day is coming up on Wednesday, May 4th and the DEV team figured there was no better time for you to use the force in a creative and fun way.

### Your Mission: Assemble a Star Wars Costume & Win Prizes! 

In honor of [Star Wars Day](https://www.starwars.com/star-wars-day), we invite you to use the next few days to assemble a Star Wars-themed costume and share a photo  with us via the comments below. 

**Rules**
> - Your submission (i.e. comment below) must include a picture of you or a consenting family member wearing a Star Wars-themed costume that does not violate our Code of Conduct. 
> - The picture **_can_** be from previous years!
> - You must be willing to have us share your costume on social media so the world can celebrate with us! Leave your Twitter and Instagram handles in your comment if you'd like to be tagged.
> - Photos must be posted in this thread between now and Wednesday, May 4th @ 11:59 PM UTC.

**Prizes**

All participants who leave a comment in this thread will win a special Star Wars-themed DEV profile badge. **We'll also randomly select a lucky person to win [this](https://shop.forem.com/collections/2018-new-merch/products/unisex-sweatshirt) awesome sweatshirt on the Forem Shop:** 

![Star Wars Hoodie](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f5h5pnhg8fhx4w9vm5ox.png)

---

Post your snazziest Star Wars look below, have fun, and remember:

#### _“Your focus determines your reality.” – Qui-Gon Jinn_
EL RESUMEN DE MI HISTORIA
Tags: angular, ionic, node, javascript
Published: 2022-04-29 20:55:57

Para invitarles a ver mi perfil de linkedin, les comparto una actualización que acabo de realizarle:

**

## EL RESUMEN DE MI HISTORIA

**
Comencé en la informática a los 13 años, con blogs y publicaciones de contenido. Luego comencé a conocer CMS como Blogger, WordPress, PHPost y participé en la lógica de desarrollo de un juego para Android creado con Unity3D.

Inicie la ingeniería en informática, debido a que 1 año antes tuve una gran idea sobre un proyecto, pero con 17 años aun no poseía la experiencia y conocimiento robusto sobre el desarrollo de software.

En la universidad, durante el primer año, pude trabajar con lenguaje C++ para desarrollar mi lógica para algoritmos en mini-proyectos.

En los siguientes años, pude trabajar en instituciones gubernamentales de forma gratuita, debido a que el PNF en informática de la universidad permite tener esas experiencias, y al salir de la universidad, ya podía contar experiencia de trabajar con clientes.
**Entre esas experiencias universitarias, se encuentran:**

1. - El haber creado un proyecto de gestión de obras musicales para la "Escuela de niños cantores del Edo. Yaracuy - Venezuela".

2. - Proyecto de gestión de inventario, usos y otras gestiones del "Hospital Pediátrico Niño Jesús del Edo. Yaracuy - Venezuela", durante este tiempo también participe con una empresa en un proyecto FullStack con Geolocalización.

3. - Proyecto de Gestión de inventario y mantenimiento preventivo a equipos de la "UPTYAB".

Al concluir la universidad y conseguir la ingeniería, comencé el proyecto llamado UNEEVERSO el cual duro 6 meses cuando tenia 21 años de edad, luego, continúe consiguiendo experiencias laborales para seguir creciendo y creando proyectos personales.

Actualmente tengo 25 años y soy senior en diversas áreas de desarrollo de software, les invito a mi perfil para observar y les espero al privado para compartir intereses.
Actualmente estoy buscando oportunidades laborales.

[https://www.linkedin.com/in/opoinffrancisco/](https://www.linkedin.com/in/opoinffrancisco/)
Programming languages for Ethereum
Tags: blockchain, ethereum, programming
Published: 2022-04-29 20:48:14


Available in the public domain, the blockchain-based distributed ledger, which features smart contract (scripting) functionality, is Ethereum. The high availability of the Ethereum network can be leveraged by the developers to build [blockchain](https://bpbonline.com/search?q=blockchain&type=product) applications with their business’s logic, which gets executed in a trustless environment.

Developers are enabled to build and deploy decentralized applications using the open software platform, Ethereum, based on [blockchain technology](https://bpbonline.com/search?q=blockchain&type=product). To pay for transaction fees and services, the application developers use Ether on the Ethereum network as also it is used as a tradeable cryptocurrency.

The ownership of digital currency (bitcoins) is tracked by the [Bitcoin blockchain](https://bpbonline.com/search?q=bitcoin&type=product). Earning Ether, a crypto token fueling the network, is the focus of miners, whereas running the program code of any dApp is the focus of Ethereum blockchain.

Ethereum is a ledger technology used by companies to build new programs, whereas Bitcoin is a currency that differentiates them. In comparison, if Bitcoin was version 1.0, then Ethereum is version 2.0, which can be used to build decentralized applications on top of it.

Programmer and writer Vitalik Buterin, a Russian–Canadian, is the co-founder of Ethereum and co-founder of Bitcoin Magazine. In addition to Buterin, Mihai Alisie, Anthony Di Iorio, and Charles Hoskinson co-founded Ethereum. Buterin also announced that he was working with developers Dr. Gavin Wood and Joseph Lubin.

Let's take a look at the different programming languages available for Ethereum.

**List of programming languages for Ethereum**

A programming language used for writing programs (code) for smart contracts is called Solidity. Ethereum was mainly programmed in C++, [Python](https://bpbonline.com/search?q=Python&type=product), [GoLang](https://bpbonline.com/search?q=go+&type=product), and Solidity.

- LLL
It is the first high-level functional programming language used for writing Ethereum smart contracts.

- Serpent
It is a procedural programming language used to write functional code.

- Solidity
It is a procedural programming language used popularly to write [smart contracts for Ethereum](https://bpbonline.com/products/smart-contract-development-solidity-etherum-book-ebook?_pos=1&_sid=dbf00dff5&_ss=r).

- Vyper
It is a newly developed language having similarity to Serpent with Python-like syntax.

- Bamboo
It is a language without iterative flows and having explicit state transitions; the intention is to increase the auditability, in spite of its being new and yet to be widely adopted.

Hope this was helpful.
Put data from RTK Query to State Slice in Redux Toolkit
Tags: redux, reduxtoolkit, rtkquery, javascript
Published: 2022-04-29 20:44:35

In CreateApi for RTK Query

```
export const authApi = createApi({
    reducerPath: 'authApi',
    baseQuery: axiosBaseQuery({
        baseUrl: environment.base_url
    }),
    endpoints: (builder) => ({
        user: builder.query<any,void>({
            query: () => ({
                url: API.GET_USER_URL,
                method: 'GET'
            }),
            transformResponse: (response: any) => response.data ?? []
        })
    })
})

export const { useUserQuery } = authApi;
export default authApi;
```

In CreateSlice

Inside extrareducers

```
 builder.addMatcher(authApi.endpoints.user.matchFulfilled, (state, { payload }) => {
      state.user = payload;
    })
```

we can put data from RTK Query into user state via addMacher
Announcing the Latest XLS-20 Release to Enhance NFT Functionality on the XRPL
Published: 2022-04-29 20:41:28

Earlier this month, version 1.9.0 of rippled was released with key contributions from RippleX, including XLS-20 and performance improvements to enhance network stability. 

**XRPL’s Built-In NFT Functionality**
First publicly put forward last May, XLS-20 is a standard proposed to enhance NFT support on the XRP Ledger (XRPL). XLS-20 provides developers access to essential NFT functionality, such as minting, trading, and burning. Along with operations to enumerate, transfer and hold these tokens, other advanced features like automatic royalties (which enable more sophisticated royalty structures for creators) and co-ownership of assets are also built into the proposal. 

Enhancing NFT functionality on the XRPL will likely bring a significant increase in transaction volume. As a responsible participant in the XRPL community, Ripple validators have been configured to vote “no” on the XLS-20 amendment until we feel confident in understanding the impact of NFTs on XRP Ledger Mainnet. In the meantime, we are conducting rigorous performance testing to assess the implications of additional transaction load on the XRPL and eliminate potential bottlenecks. Our team will share our results with the broader community once completed. 

The XRPL is a public decentralized blockchain, and proposed amendments to the network require 80% of validators to vote in favor of the amendment before new code can be implemented on the mainnet. Though Ripple validators will vote “no” for now on the XLS-20 amendment, RippleX engineers have proposed it in the meantime to present it to the community, enabling developers to test NFT functionality and ensure a seamless user experience long-term by reducing the probability of merge conflicts later on.

**Release Highlights: Performance and Stability Improvements**

As part of our ongoing commitment to helping maintain the health of the XRPL, a number of performance improvements were included in XRPL 1.9 including: reduced memory usage for pathfinding, optimized trust line caching, and increased network efficiency and stability. 

Also introduced were improvements to ledger-fetching logic, lock decongestion, and limited lock-free programming capabilities.

**The Road Ahead**

The features in this latest release are proposed and operated by XRPL server operators which demonstrates a shared commitment to improving the XRPL’s performance and innovation. 

We remain committed to developing best-in-class functionalities, tools and open protocols that help developers scale and build utility on the XRP Ledger.

To learn more about improvements and new functionality in XRPL 1.9, visit www.xrpl.org.
بررسی پشتیبانی bidi در dev.to - left
Tags: bidi, bidirectional
Published: 2022-04-29 20:30:43

This is a post to test bidirectional text support on dev.to.

---

این یک text ساده است که شما easily و بدون problem می‌توانید آن را بخوانید. درست می‌گویم؟ 

This is some متن that you can read به راحتی without any مشکل. Am I right?
BookstackApp css fixes
Tags: bookstackapp
Published: 2022-04-29 20:25:41

Frustrated with their dark theme, and dark reader wasnt doing it. I moved over some of my dokuwiki theme i was using over and moved some other settings around like the opacity hovers were annoying me, the banner on top was annoying, the small content area was annoying with the two side bars way out there (large screen), this seems tweaks those things. Enjoy.

`
<style>
html.dark-mode {
    background: #000 !important;
    color: #eee;
}
html.dark-mode body {
    color: #eee;
}
html.dark-mode .card {
    border: 1px solid #444;
    box-shadow: 0 0 0.5em #ddd;
    border-radius: 2px;
}
html.dark-mode header {
    filter: none !important;
    background-color: #000 !important;
    border-bottom: 1px solid #f90;
}

html.dark-mode h1,
html.dark-mode h2,
html.dark-mode h3,
html.dark-mode h4,
html.dark-mode h5,
html.dark-mode h6 {
    color: #eee;
}
.breadcrumbs {
    opacity: 1;
}
@media screen and (min-width: 1000px) html.dark-mode .tri-layout-left-contents>*, html.dark-mode .tri-layout-right-contents>* {
    opacity: 1;
}
html.dark-mode .tri-layout-left-contents > *,
html.dark-mode .tri-layout-right-contents > * {
    opacity: 1;
}
.cm-s-darcula.CodeMirror {
    background: #000;
}
.table > table > tbody {
    background-color: #000;
}
.page-content {
    max-width: 100%;
}
.tri-layout-middle-contents {
    max-width: 100%;
}
.tri-layout-container {
    max-width: 80%;
    margin: 0 auto;
}

</style>`
Ruby Style Guide 💻💎
Tags: ruby, backend, programming, webdev
Published: 2022-04-29 20:15:53

## What is Ruby Style Guide?
Ruby is the main language at Shopify. We are primarily a Ruby shop and we are probably one of the largest out there. Ruby is the go-to language for new web projects and scripting.

This Style Guide is the result of over a decade of Ruby development at Shopify. Much of its content is based on Bozhidar Batsov's Ruby Style Guide, adapted to Shopify by many contributors.

— **Installing Rubocop to Your Project**

`$ gem install rubocop`

_Now let’s create a program that can be linted better_

```
name = "Karthik"
puts "Hello #{name}"
```

Now we save it and run Rubocop on it as shown:

`$ rubocop rubocop_example.rb`

rubocop spits out some errors as shown

Inspecting 1 file
C

Offenses:

```
rubocop_example.rb:1:1: C: [Correctable] Style/FrozenStringLiteralComment: Missing frozen string literal comment.
name = "Karthik"
^
rubocop_example.rb:1:8: C: [Correctable] Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
name = "Karthik"
       ^^^^^^^^^

1 file inspected, 2 offenses detected, 2 offenses auto-correctable
```

**- Create a .yml file in the root and paste this:**

```
AllCops:
  NewCops: enable
  Exclude:
    - 'db/migrate/*.rb'
    - 'config/**/*.rb'
    - 'bin/*'
    - 'spec/rails_helper.rb'
    - 'lib/**/*.rb' #it should be fixed later
    - 'spec/lib/**/*.rb' #it should be fixed later
    - 'spec/requests/**/*.rb' #it should be fixed later
Metrics/BlockLength:
  Exclude:
    - 'Rakefile'
    - '**/*.rake'
    - 'spec/**/*.rb'
    - 'app/admin/**/*.rb'
    - 'db/**/*.rb'
    - 'db/migrate/*.rb'
    - 'config/*.rb'
Documentation:
  Include:
    - 'app/models/**/*.rb'
  Exclude:
    - 'app/models/ability.rb'
    - 'app/models/application_record.rb'
    - 'app/models/concerns/**'
    - 'app/models/filter_client.rb'
    - 'app/models/filter_warehouse.rb'
Metrics/MethodLength:
  Max: 12
Metrics/ClassLength:
  Max: 1000

```



**_That's all; Rubocop is now ready to work on your project!_** 🥳 🎉

**_Thank you for reading!_📒**

**Guarapo Labs** creates digital products that assist people in developing their ideas. Our staff has all of the necessary skills to work on your web and virtual reality game projects. Our commitment to educating our clients on how to provide the finest customer experience with their solutions is reflected in the high quality of our software.

Contact us *edwin.nunez@guarapo.dev*
Guarapo Labs
edwin-nunez - Overview
The Brilliance of `nil` in Objective-C
Tags: programming, languages, mobile
Published: 2022-04-29 20:10:03

I don’t code much in [Objective-C](https://en.wikipedia.org/wiki/Objective-C) these days[^obj-c] but one thing I miss about it compared to Swift is how `nil` works.

[^obj-c]: Although a lot more than *none*, and I still think it’s important to know if you’re writing software for Apple Platforms.

To be fair to Swift, the concept of “nothing” in Objective-C is kind of a mess, since there’s four different versions of it compared to two in Swift.

<table>
<tr>
	<td><code>nil</code</td>
	<td>An empty Objective-C object.</td>
</tr>
<tr>
	<td><code>Nil</code></td>
	<td>An empty Objective-C class.</td>
</tr>
<tr>
	<td><code>NULL</code></td>
	<td>Nothing in C.</td>
</tr>
<tr>
	<td><code>NSNull</code></td>
	<td>Mostly used to represent null in Objective-C collections.</td>
</tr>
</table>
The reason `NSNull` exists is that Objective-C collections (`NSArray`, `NSDictionary`) use `nil` in other ways. `NSArray` is `nil` terminated, so if you did this:

```objc
NSArray *array = @[@"a", @"b", nil, @"c"];
// array = [@"a", @"b"] 
```

You'd only have the first two elements available. In `NSDictionary`, setting a key to `nil` removes it from the dictionary, so `NSNull` is used to say “this exists in the dictionary, and it is nothing.”

The main thing to remember is that if you have a pointer assigned to `NSNull` or `NULL` and you try to do something with them, your app will crash. `nil` on the other hand is kind of magic. `nil` evaluates to `NO` (`false`), and `nil` as an object always returns `nil`. That means that because whatever you sent to `nil` will return `nil` and that will evaluate to false instead of crashing your app that this:

```objc
if (dict != nil &amp;&amp; dict.containsObjectForKey[@"a"]) { ... } 
```

Can become this:

```objc
if (dict.containsObjectForKey[@"a"]) { ... } 
```

This is probably the least-Swift thing ever, but, if you're used to coding in this style, it's fantastic. In a lot (most?) cases where there's a possibility that `dict` could be `nil`, the thing you want is for nothing to happen. Way back when Swift was first released, and [Brent said](https://inessential.com/2014/08/12/carlfish) switching to Swift “feels like a Jedi who’s trying to switch from a lightsaber to a blaster,” this is what I thought of.

[_Originally posted on collindonnell.com_](https://collindonnell.com/2022/04/28/the-brilliance-of-nil-in-objective-c/)
Fully Responsive Agency Landing Page Template
Tags: nextjs, tailwindcss, opensource, webdev
Published: 2022-04-29 19:56:22


Hey guys Check out I have just added A New Fully Responsive Agency Landing Page Template to [DEV.UI](https://dev-ui.vercel.app/)
Check out this [Agency Landing Page Template](https://dev-ui.vercel.app/templates/landingpage)

[Github Link](https://github.com/kumard3/dev-ui-templates/tree/main/template-10)
Top 3 Coding Tutorials of the Week
Tags: javascript, elixir, cybersecurity, tutorial
Published: 2022-04-29 19:35:44

TGIF! 🙌🏻 

Every Friday at [CodeCast](codecast.io) we give love to our Top 3 Casts of the week. We're always so excited to review the content by our incredible creators. This week, we're featuring Casts on Cyber Security, JavaScript and, Phoenix! So let's dive into it.

![Diving Gif](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5inau9t946lq2yrbcdtw.gif)

## [Intro to Phoenix: Ecto - Migrations and Schemas Basics](https://www.codecast.io/casts/2aX5ZYWALlJ3-intro-to-phoenix-ecto-migrations-and-schemas-basics) by [@tam](https://www.codecast.io/users/tam)

![Phoenix Cover](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yeh83th75yhx9ad08knx.png)
 
Tam is the founder of CodeCast and a lover of the Elixir language. We use Elixir and the Phoenix framework extensively in CodeCast. Tam has previously created a [7-hour introductory course on Elixir](https://www.codecast.io/series/58-intro-to-elixir) and is now currently working on a course for Phoenix. This Cast is one of the videos that will be included in the Series, and it's a great introduction to working with migrations.

## [Stored XSS using SVG](https://www.codecast.io/casts/gDrpM4J95z4R-stored-xss-using-svg) by [@jesusvilla](https://www.codecast.io/users/jesusvilla)

![SVG Cover](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1uv7c31d877azx33azlj.png)
 
Jesus is a security engineer and is passionate about showcasing weak spots and flaws so you can write stronger, more secure code. This Cast focuses on using SVGs (or as he calls them "Something" Vector Graphics 😆) to run some simple JS code, and how these can be used in XXS attacks. He shows you how to prevent this in your SVGs!

## [Spread Operator in JavaScript](https://www.codecast.io/casts/9Vopvzy2pOda-spread-operator-in-javascript) by [@kauress](https://www.codecast.io/users/kauress)

![Spread Operator Cover](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8y5ukil81ppkouvmxi17.png)
 
Any fan of JavaScript knows how amazing the spread operator can be. Jannat goes over varying use cases of the `...` operator in this Cast so you can become an even better JS dev!

Want even more videos on JavaScript? We have over [120 video tutorials](https://www.codecast.io/topics/javascript) on JavaScript, ranging from specific topics to course on building out entire applications like a [trivia game](https://www.codecast.io/series/61-learn-api-s-building-a-trivia-game-w-javascript)!