teleren/devto huggingface dataset:
The Fascinating History of Java
Tags: java, oak, programming
Published: 2024-04-04 00:44:47

Java, the versatile and powerful programming language, has a captivating backstory that spans from its inception to its current global prominence. Let’s delve into the intriguing journey of Java:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xnkjfl1mbaslr91dxnq2.jpg)
##1. The Green Team and Digital Devices:

In June 1991, **James Gosling**, **Mike Sheridan**, and **Patrick Naughton** initiated the Java language project. Initially, Java was designed for **interactive television**, but it proved too advanced for the digital cable TV industry at the time.The project aimed to create a language for digital devices like set-top boxes and televisions.

##2. From “Greentalk” to “Oak”:

Initially, Java was called **“Greentalk”** by James Gosling, with the file extension `.gt`. It later evolved into **“Oak”** as part of the Green project. Why “Oak”? Oak symbolizes strength and is the national tree of several countries. However, it was already a trademark, leading to the next transformation.


##3. The Birth of "Java"

In 1995, Oak was renamed **“Java”** due to trademark conflicts. Why “Java”? Here’s the delightful story: The team brainstormed names like “dynamic,” “revolutionary,” and “Silk.” James Gosling, sipping coffee near his office, chose “Java.” Java, an Indonesian island where the first coffee was produced, resonated with the essence of the technology.


##4. Java’s Rise to Fame:

Released in 1995, Java quickly gained popularity. In 1995, **Time magazine** hailed it as one of the b of the year. JDK 1.0 arrived on January 23, 1996, marking the official birth of Java.


##5. Java Today:

Java’s evolution continued, governed by the **Java Community Process (JCP).** From **Windows applications** to **enterprise solutions,** Java powers diverse domains. Its name, unique and not an acronym, reflects its revolutionary, dynamic, and cool nature.


Java’s journey—from set-top boxes to internet programming—remains a testament to its enduring impact. Raise your coffee cup to the language that changed the tech world! ☕🚀📚
Basics of Cryptography in Java
Tags: java, webdev, beginners, programming
Published: 2024-04-04 00:30:24

## Introduction

Cryptography is the process of converting plain text into a coded format to ensure secure communication and data protection. In Java, cryptography is an essential tool for developers to create secure applications. It offers various features and algorithms that can be implemented to safeguard sensitive information.

## Advantages of Cryptography in Java

1. **Data Security:** One of the main advantages of cryptography in Java is data security. It provides a secure way to transmit information over untrusted networks, keeping it safe from hackers.

2. **Authentication:** Cryptography allows for authentication, which ensures that the sent and received data is from a trusted source.

3. **Tamper-proof data:** Cryptography ensures that the transmitted data remains unaltered during transmission, making it tamper-proof.

## Disadvantages of Cryptography in Java

1. **Performance overhead:** Implementing cryptography in Java can add a performance overhead, as it requires additional processing power.

2. **Difficulty in implementation:** Encryption and decryption of data can be complex, which can be challenging for novice programmers.

## Features of Cryptography in Java

1. **Encryption:** Java offers various encryption algorithms like AES, RSA, and DES that can be used to safeguard data.

    ```java
    // Example of AES encryption in Java
    KeyGenerator keyGenerator = KeyGenerator.getInstance("AES");
    keyGenerator.init(128);
    SecretKey secretKey = keyGenerator.generateKey();
    Cipher cipher = Cipher.getInstance("AES");
    cipher.init(Cipher.ENCRYPT_MODE, secretKey);
    byte[] encryptedBytes = cipher.doFinal("Hello, World!".getBytes());
    ```

2. **Digital signatures:** Cryptography in Java supports the creation and verification of digital signatures, providing data integrity and non-repudiation.

    ```java
    // Example of generating a digital signature in Java
    KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA");
    keyPairGenerator.initialize(2048);
    KeyPair keyPair = keyPairGenerator.generateKeyPair();
    Signature signature = Signature.getInstance("SHA256withRSA");
    signature.initSign(keyPair.getPrivate());
    signature.update("Message to sign".getBytes());
    byte[] digitalSignature = signature.sign();
    ```

## Conclusion

Overall, cryptography in Java is an essential aspect of developing secure applications. It offers various benefits like data security, authentication, and tamper-proof data. However, it also has some disadvantages, such as a performance overhead and difficulty in implementation. By effectively implementing cryptography in Java, developers can ensure the confidentiality, integrity, and authenticity of their applications.
How to create an Embedding Model for Recipe Dataset Using Deep Metric Learning
Tags: nlp, deeplearning, pytorch, machinelearning
Published: 2024-04-03 23:48:19

 Hello everyone! I want to create an embedding model for my own dataset of recipes. The goal is to create a neural network that takes each recipe, represented by a list of its ingredients, a list of recipe tags, and its title, as input. 
The network should use deep metric learning to create an embedding model that represents recipes in a way that distinguishes them well.  I have considered using a triplet network with the triplet loss function, trained on a dataset of triplets. Each triplet would consist of an anchor (the recipe itself), a positive sample (a similar recipe), and a negative sample (a very different recipe). 
The objective would be to minimize the distances between the anchor and positive samples while maximizing the distances between the anchor and negative samples.  Since I'm relatively new to neural networks and natural language processing, I would greatly appreciate your thoughts and insights on this approach. 
Do you think this method is suitable for my task? Are there any potential pitfalls or challenges that I should be aware of? Additionally, I would be grateful if you could provide me with a guideline on how I can successfully execute this project.  
Thank you.
Pygmy Announcement
Published: 2024-04-03 23:31:46

If you’ve been using Lagoon for a little while, you’re probably familiar with pygmy. The original version was written in Ruby, and is now officially deprecated! If you’re still using it, we highly recommend you [install the latest version of pygmy](https://github.com/pygmystack/pygmy), which is now written in Go, or [use one of our other local development environments](https://dev.to/uselagoon/lagoon-local-development-environments-5a5j). 

Are you using pygmy? Let us know! Chime in on the [Lagoon Discord](https://discord.gg/te5hHe95JE)!

And don’t forget our [2024 Community Survey](https://dev.to/uselagoon/2024-community-hours-survey-50m5)! Let us know how we can best serve the Lagoon community.
Batect in a nutshell
Published: 2024-04-03 23:24:50

Batect is an alternative Docker Compose. For my own experience it is easier to use in terms of built-in features such as cross platform compatibility.

_**Unfortunately it is no longer maintained.**_

Its core is a yaml file that defines what containers to use and what tasks to execute. For example, I have one container called `run-env` and a task `test-local` which runs a line of command:

```
containers:
  run-env:
    build_directory: .
    volumes:
      - local: .
        container: /code
      - type: cache
        container: /code/node_modules
        name: node_modules
    working_directory: /workdir
tasks:
  test-local:
    description: Run Playwright e2e Tests
    run:
      container: run-env
      command: |
        npx playwright test
      environment:
        ENVIRONMENT: local
```

Quick command to run locally:
`./batect test-local`


## Troubleshooting

### Issue: permission denied: ./batect
Run
`chmod +x ./batect 
`
### Issue: Checksum unmatched for the download behind firewall
When running './batect <taskname>' for the first time, batect will download jar from remote server.
Downloading Batect version 0.84.0 from _https://updates.batect.dev/v1/files/0.84.0/batect-0.84.0.jar_
To
`/Users/{user}/.batect/cache/0.84.0/batect-0.84.0.jar`

You might run into an issue:

```
The downloaded version of Batect does not have the expected checksum. Delete '/Users/{user}/.batect/cache/0.84.0/batect-0.84.0.jar' and then re-run this script to download it again.
```

In this case, the solution is to paste the url of jar into Chrome to download directly, and overwrite the local jar file.
DO YOU LOST ANY MONEY WHILE TRADING ONLINE? THE ONLY SOLUTION IS => FOLKWIN EXPERT RECOVERY.
Tags: bitcoin
Published: 2024-04-03 23:16:58


Talk with a representative through:
Info:=> WEBSITE: WWW.FOLKWINEXPERTRECOVERY.COM
Info:=> TELEGRAM:   @FOLKWIN_EXPERT_RECOVERY
Info:=> FOLKWINEXPERTRECOVERY ( @ ) TECH-CENTER . COM 

Renowned bitcoin recovery specialist => FOLKWIN EXPERT RECOVERY explores the complex and enigmatic world of retrieving lost or stolen digital assets. => FOLKWIN EXPERT RECOVERY is an expert in the dark arts of bitcoin retrieval. It uses state-of-the-art methods, knowledge, and steadfast determination to help people and businesses get their money back. => FOLKWIN EXPERT RECOVERY is a front-runner in the field of bitcoin retrieval, with a focus on helping customers all over the world retrieve lost or stolen digital assets. Their team of professionals offers unparalleled services by fusing technological know-how with a profound comprehension of the dark arts of the digital realm. => FOLKWIN EXPERT RECOVERY was established by a collection of proficient with technology people with a strong foundation in cyber knowledge and a passion for deciphering the mysteries of the internet. Their goal is to assist persons who have been affected by cryptocurrency disasters. Their goal is to restore lost money to its rightful owners and use their abilities for good. => FOLKWIN EXPERT RECOVERY offers a range of services aimed at recovering lost or inaccessible cryptocurrencies, including Bitcoin, Ethereum, and more. Whether it's a compromised wallet, a phishing attack, or a technical glitch, their team is equipped to handle a variety of scenarios with precision and efficiency. => FOLKWIN EXPERT RECOVERY delves into the shadowy recesses of the internet, skillfully navigating the intricacies of bitcoin retrieval with specific procedures and tools that illuminate the web's darkest corners. Cryptocurrency retrieval is no easy feat, requiring a deep understanding of blockchain technology, digital forensics, and cybersecurity principles. => FOLKWIN EXPERT RECOVERY is well-versed in the intricacies of these areas, allowing them to tackle even the most challenging cases with skill and determination. With a fearless approach to exploring the hidden realms of the dark web, => FOLKWIN EXPERT RECOVERY uncovers valuable information and traces of lost cryptocurrencies that others may overlook. By harnessing the power of the dark arts, they bring hope to those who thought their digital assets were gone forever. => FOLKWIN EXPERT RECOVERY is a powerful force in the field of digital asset recovery since they recover lost cryptocurrency using a combination of cutting-edge methods and sophisticated equipment.=> FOLKWIN EXPERT RECOVERY carefully reviews blockchain transactions, wallet addresses, and digital footprints using advanced forensic tools and analytical techniques in order to precisely locate and retrieve misplaced money. The most brilliant Crypto Expert Recovery Ever.
Regards,
Mr Owen Aiden.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ev3xot58imu1tr2wog0h.jpg)
Day 941 : Instructions
Tags: hiphop, code, coding, lifelongdev
Published: 2024-04-03 23:11:15

_liner notes_:
- Professional : Pretty productive day. Responded to some community questions. I created a sample project to help show someone how to do something. Had a meeting. Spent the rest of the day working on some Web Components. I added a couple of new features to a component that I think will really make it more usable and versatile. Also worked on documentation for the Web Components. Thinking I'll be able to start publishing them tomorrow.

- Personal : Last night, I went through some tracks. I also worked on laying out the text for my side project. Added what I think is a pretty cool feature that when you click a certain link, the instructions will how up in a modal and change the URL to add #instructions. So if someone shares that link, it will automatically open the instructions modal for the person. Ran into a weird issue where an image got shifted somehow. Spent say too much time to realize that it was a CSS thing that I for text, that also shifted the image. Weird.

![A photo from above of palm trees on a beach with the ocean in the background. The water has a lot of white waves crashing on the shore.  The palm trees are green and lush. The sand is white and pristine. The sun is shining brightly.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7weuc42dlemdz1l7t7gk.jpg)

There was a thing I used in CSS before to get responsive text. I could not remember it for the life of me. I just found it. It's clamp(). I was trying to make it work with calc(). Thinking I'll be able to knock out the text stuff tonight and maybe get started on the authentication stuff. The wire transfer went through for the property so it's time to visit it and get a survey and soil test done. Going to check out some tracks for the radio show and get to coding.

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube R-CI8bjFFqc %}
Setting Up Kotlin for GraphQL: A Step-by-Step Guide
Tags: graphql, kotlin, beginners
Published: 2024-04-03 23:06:58

GraphQL is revolutionizing the way developers build APIs, offering more flexibility and efficiency compared to traditional REST APIs. Kotlin, with its concise syntax and powerful features, is the perfect companion for building GraphQL servers. In this guide, we’ll walk through setting up a Kotlin project to use GraphQL, ensuring you have a solid foundation to build your next API.

**Introduction**
Briefly introduce GraphQL and its advantages over REST. Explain why Kotlin is a great choice for developing GraphQL APIs, highlighting Kotlin's features that are particularly beneficial for this purpose.

**Prerequisites**
List everything the reader needs to get started, including:

- JDK (Java Development Kit) installation
- IntelliJ IDEA or another Kotlin IDE
- Basic understanding of Kotlin programming
- Familiarity with GraphQL concepts

**Setting Up Your Kotlin Project**
Guide the reader through the initial setup of a Kotlin project:

1. Creating a New Kotlin Project: Instructions on how to create a Kotlin project in IntelliJ IDEA or another preferred IDE.
2. Adding Dependencies: Detail how to add the necessary GraphQL and related dependencies to the project using Gradle or Maven.

```
// Example of adding GraphQL Kotlin dependencies in Gradle
dependencies {
    implementation("com.expediagroup:graphql-kotlin-spring-server:X.Y.Z")
}
```

**Building Your First GraphQL Schema**
Explain how to define a GraphQL schema in Kotlin:

- Defining Types: Show how to define GraphQL types using Kotlin classes.
- Creating Queries: Guide on writing functions that resolve queries and how to annotate them properly for GraphQL.

**Setting Up the GraphQL Server**
Provide steps on how to set up a basic GraphQL server using a popular Kotlin framework, such as Ktor or Spring Boot:

1. Configuration: Instructions on configuring the server to handle GraphQL requests.
2. Endpoint Creation: How to create GraphQL endpoints.
3. Testing the Server: Tips on testing the server with a GraphQL client or tool like Postman.

**Integrating Data Sources**
Discuss how to integrate data sources into the GraphQL server:

- Fetching Data: Best practices for fetching data from databases or other APIs.
- Error Handling: Tips on handling and returning errors in GraphQL queries.

**Conclusion**
Wrap up the post by summarizing what the reader has learned and encourage them to experiment further with GraphQL and Kotlin. Mention the potential for expanding their GraphQL server, such as adding mutations and subscriptions.
PWC 263.1 Don't Sort It, Be Happy
Tags: perl, perlweeklychallenge, pwc
Published: 2024-04-03 22:18:41

## [PWC 263, Task 1](https://theweeklychallenge.org/blog/perl-weekly-challenge-263/#TASK1) Target Index

[Here's a little blog I wrote.](https://www.youtube.com/watch?v=d-diB65scQU) You might want to read it note for note.

```text
You are given an array of integers, @ints, 
and a target element $k.

Write a script to return the list of indices
in the sorted array where the element is the
same as the given target element.
```
**Example 1**
- Input: `@ints = (1, 5, 3, 2, 4, 2)`, `$k = 2`
- Output: `(1, 2)`
    - Sorted array: `(1, 2, 2, 3, 4, 5)`
    - Target indices: `(1, 2)` as `$ints[1] = 2` and `$ints[2] = 2`

### Dive right in
Well, the example gives it away, doesn't it?  Sort the array and waddle up the list to the first index where `$k` exists. Then, because the array is sorted, all the other places where `$k` exists must be adjacent.

### Or not
But hold on. In every algorithm we have some trouble, but when you sort you make it double.

All the `$k` together means we've effectively partitioned the array into three sets: elements that are less than `$k`, elements equal to `$k`, and the rest.

We don't have to sort the array at all. We just have to traverse the array and count the elements in the first two partitions.

```perl
sub targetIndex($k, @ints)
{
    my ($below, $same) = (0, 0);
    foreach ( @ints )
    {
        if    ( $_ < $k )  { $below++ }
        elsif ( $_ == $k ) { $same++ }
    }
    return [] if $same == 0;
    return [ $below .. ($same + $below - 1) ];
}
```
If `$k` doesn't appear at all, we can bail out by returning an empty list. `$below` and `$same` tell us the range of numbers we need in the answer.

```text
$below = 1 # 1 element less than $k
$same  = 2 # 2 elements equal to $k
      {         } 
   1  {  2   2  }   3   4   5
  [0] { [1] [2] }  [3] [4] [5]
         ^   ^
         |   +---- $below + $same -1 = 1+2-1 = 2
  $below-+
```

The `..` range operator makes short work of creating the sequence of numbers we want.

Put that range of numbers into an array, and we have our answer.  This function is returning array references, not arrays, so the calling function will have to de-reference. In context, it might look like
```perl
say "(", join(",", targetIndex($Target, @ARGV)->@*), ")";
```
Now there is the blog I wrote. I hope you liked the way I code. Don't worry, be hacker.
HackerRank SQL preparation; Revising the Select Query II(MySQL)
Tags: sql, writeups, hackerrank
Published: 2024-04-03 21:59:56

**Problem Statement:**
Query the `NAME` field for American cities in the **CITY** table with populations larger than 120,000. The `CountryCode` for America is `USA`.

**Link:**[HackerRank - Revising the SELECT Query 2](https://www.hackerrank.com/challenges/revising-the-select-query-2/problem)

**Solution:**

```sql
SELECT NAME FROM CITY WHERE POPULATION > 120000 AND COUNTRYCODE = 'USA';
```

**Explanation:**

- `SELECT NAME`: This part of the query specifies that you want to retrieve the `NAME` field.
- `FROM CITY`: Indicates that you are selecting data from the **CITY** table.
- `WHERE POPULATION > 120000`: This condition filters the rows and includes only those cities where the population is larger than 120,000.
- `AND COUNTRYCODE = 'USA'`: This additional condition ensures that only American cities (USA) are included in the result, based on the `CountryCode` column.
JavaScript Basic Coding Challenges for Beginners part-2
Tags: webdev, javascript, beginners, programming
Published: 2024-04-03 20:53:22

**Coding Challenge #1**
Given an array of forecasted maximum temperatures, the thermometer displays a string with the given temperatures. Example: [17, 21, 23] will print "... 17ºC in 1
days ... 21ºC in 2 days ... 23ºC in 3 days ..."
**Your tasks:**
1. Create a function 'printForecast' which takes in an array 'arr' and logs a string like the above to the console. Try it with both test datasets.
2. Use the problem-solving framework: Understand the problem and break it up
into sub-problems!
**Test data:**
**Data 1:** [17, 21, 23]
**Data 2:** [12, 5, -5, 0, 4]



**Coding Challenge #2**
Implement a game rest functionality, so that the player can make a new guess!
**Your tasks:**
1. Select the element with the 'again' class and attach a click event handler
2. In the handler function, restore initial values of the 'score' and 'secretNumber' variables
3. Restore the initial conditions of the message, number, score and guess input fields
4. Also restore the original background color (#222) and number width (15rem)


**Coding Challenge #3**
We're building a football betting app (soccer for my American friends Suppose we get data from a web service about a certain game ('game' variable on next page). In this challenge we're gonna work with that data.
**Your tasks:**
1. Create one player array for each team (variables 'players1' and
'players2')
2. The first player in any player array is the goalkeeper and the others are field players. For Bayern Munich (team 1) create one variable ('gk') with the goalkeeper's name, and one array ('fieldPlayers') with all the remaining 10 field players
3. Create an array 'allPlayers' containing all players of both teams (22 players)
4. During the game, Bayern Munich (team 1) used 3 substitute players. So create a new array ('players1Final') containing all the original team1 players plus 'Thiago', 'Coutinho' and 'Perisic'
5. Based on the game.odds object, create one variable for each odd (called 'team1', 'draw' and 'team2')
6. Write a function ('printGoals') that receives an arbitrary number of player names (not an array) and prints each of them to the console, along with the number of goals that were scored in total (number of player names passed in)
7. The team with the lower odd is more likely to win. Print to the console which team is more likely to win, without using an if/else statement or the ternary operator.
Test data for 6.: First, use players 'Davies', 'Muller', 'Lewandowski' and 'Kimmich'.
Then, call the function again with players from game.scored

[John's best javascript course from udemy](https://www.udemy.com/course/the-complete-javascript-course/?couponCode=KEEPLEARNING)
Write an IT Business Analyst Cover Letter
Published: 2024-04-03 20:53:02

Don't let this opportunity slip through your fingers! Crafting an [IT Business Analyst cover letter](https://symbelsone.com/blog/how-to-write-an-effective-it-business-analyst-cover-letter/) that catches the attention of hiring managers is becoming increasingly important. It’s the gateway to your career opportunity showing off your skills in the ever changing technology marketplace. Our cover letter samples provide key insight into the skills necessary to land yourself an interview!
New book: Web API Cookbook
Tags: webdev, javascript, books
Published: 2024-04-03 20:50:48

Announcing my new book from O'Reilly Media, _Web API Cookbook_! 

It's now available from [Amazon](https://www.amazon.com/Web-API-Cookbook-JavaScript-Applications/dp/1098150694) and [O'Reilly](https://www.oreilly.com/library/view/web-api-cookbook/9781098150686/)

The book contains examples or "recipes" demonstrating how to accomplish specific tasks using only the APIs built in to modern web browsers.

Many things that once required third-party JavaScript libraries or browser plugins are now supported by the browser platform itself.

The book covers topics such as:

- Working with persisted data and local files
- Internationalization
- Speech synthesis and recognition
- Communciating with APIs and real-time data
- Reacting to changes in the DOM
- Custom elements
- Reading device information and sensors
- Performance statistics
- The Web Animations API


![Book cover](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ily2crdb3zumpcq65vza.png)