teleren/devto huggingface dataset:
Kube or Fake: A Kubernetes Minigame
Tags: kubernetes, gpt3, ai, devops
Published: 2023-07-26 12:15:02

Raftt is excited to announce the launch of _Kube or Fake?_, our latest web mini-game. In this game, you will be presented with a series of Kubernetes terms generated in real-time by ChatGPT, and will need to determine whether they are real or AI hallucinations. Be warned, the descriptions accompanying each term may be tricky.

We built _Kube or Fake?_ with ChatGPT API, AWS Lambda, and some JavaScript. Our goal was to create a fun and interactive way to test your knowledge of Kubernetes terminology. This game is perfect for Kubernetes enthusiasts and newcomers alike.

So, how do you play? Simply visit [the game](https://kube-or-fake.raftt.io) and start playing! Try to correctly identify each of the terms as either “Kube” or “Fake”. Challenge your friends and see who can get the highest score!

We hope you enjoy playing *Kube or Fake?* as much as we enjoyed building it. Let us know what you think, and stay tuned for the Making Of, where we dig into how we built this and why :).
Update product price quick and fast in Wordpress(Python), alternative method for woocommerce rest api
Published: 2023-07-26 12:00:09

```python
        regular_price_query = "UPDATE yourwordpressdb.wp_postmeta SET meta_value = %s WHERE post_id = %s AND meta_key = '_regular_price'"
        price_query = "UPDATE yourwordpressdb.wp_postmeta SET meta_value = %s WHERE post_id = %s AND meta_key = '_price'"
        cursor.execute(regular_price_query, (new_price, product_id))
        cursor.execute(price_query, (new_price, product_id))
```
Please help me with my Javascript
Tags: webdev, javascript, beginners, programming
Published: 2023-07-26 11:41:35

This is my calculator and I have put my highest effort in CSS, HTML and JS. But my JS code is'nt working, please help me with it
function getSelectedItem() {
  const selectElement = document.getElementById('symbol');
  const selectedIndex = selectElement.selectedIndex;
  const selectedItem = selectElement.options[selectedIndex].value;
  return selectedItem;
}
function c() {
  const n1 = parseFloat(document.getElementById('n1').value);
  const n2 = parseFloat(document.getElementById('n2').value);
  var symbol = getSelectedItem();
  const n3 = document.getElementById('n3').value;

  if (symbol === 'add') {
    n3 = n1 + n2;
  } else if (symbol === 'sub') {
    n3 = n1 - n2;
  } else if (symbol === 'div') {
    n3 = n1 / n2;
  } else if (symbol === 'mul') {
    n3 = n1 * n2;
  }

  document.getElementById('n3').value = n3;
}
The XRPL Token Market: An Enthralling Week in the Crypto Jungle
Tags: xrp, xrpl, cryptocurrency, analytics
Published: 2023-07-26 11:41:33

Venture with me into the dense, vibrant jungle of the XRPL token market during the week of July 17 to July 23, 2023. Much like the wild, the market was alive and pulsating with change and adventure at every turn.

Let's go on a safari through this thrilling week.

## Market Capitalization: The Mighty Elephant

Picture the market capitalization as the mighty elephant of our jungle, its size symbolizing the market's vastness. On July 19, our elephant grew by a remarkable 5.66%, stretching its presence across the landscape.

But in the jungle, change is the only constant. On July 23, our elephant seemed to shrink by 7.01%, reminding us of the market's inherent volatility.

## Dex Volume: The Jungle's Heartbeat

![XRPL DEX Volume](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7t636wh71iu9v2htavca.png)
The Dex volume, the beating heart of our market, echoed the jungle's rhythm. On July 19, it drummed up an impressive increase of 104.56%, its rhythm resonating throughout the jungle.

But the rhythm of the jungle is ever-changing. On July 20, the Dex volume fell by 50.59%, the heartbeat slowing to a more relaxed tempo.

## Cex Volume: The Flowing River

The Cex volume, like a river, is a central part of our jungle, guiding its flow. On July 19, it surged by 33.36%, like a river in full spate, shaping the landscape around it.

Yet, every river has its calm. The next day, the volume decreased by 6.32%, the river flowing at a gentle pace, reflecting the tranquility of the jungle.

## Total Volume: The Jungle's Roar

The total volume, encompassing all the activity in our market, was like the jungle's roar. On July 19, it amplified by a significant 57.81%, a mighty roar that echoed across the crypto landscape.

But even the loudest roar has its silence. On July 20, the total volume receded by 26.02%, the roar fading into the tranquil sounds of the jungle.

## Into the Wild

Our expedition through the jungle of the [XRPL token](https://xpmarket.com) market was an experience filled with thrills and surprises. With significant changes in market capitalization, Dex volume, Cex volume, and total volume, it was a week that kept us alert and on our toes.

As we prepare to venture deeper into the jungle, we are reminded that in the world of crypto, each day is a new adventure. So, we strap on our boots, ready to explore the exciting wilderness of the XRPL token market once more.

This journey is narrated in straightforward language and vibrant metaphors, making the intricate world of cryptocurrencies a bit more accessible to everyone, regardless of their language proficiency or familiarity with crypto. After all, the thrilling world of crypto is not just for the seasoned explorers but also for the bold and curious adventurers ready to delve into these fascinating wilds.

The data source guiding us through this thrilling exploration is [xpmarket](https://xpmarket.com).
Logto Cloud is officially launched!
Tags: webdev, beginners, programming, opensource
Published: 2023-07-26 11:31:42

👋 Today, we are more than happy to announce that Logto Cloud is officially launched!

> Logto is an Auth0 alternative for building modern customer identity infrastructure with minimal effort, for both your customers and their organizations.

🎉 Join our launch on [Product Hunt](https://www.producthunt.com/posts/logto-cloud) and support us! We'd love for you to leave us a review as well.

We'd like also invite you to take a look at our [new website](https://logto.io/) and explore the features of Logto Cloud.
Make your code developer-friendly with these 7 tips
Tags: programming, writing, coding, documentation
Published: 2023-07-26 11:30:08

Code documentation is the unsung hero of software development. It's not just about writing code; it's about making it understandable for others (and for yourself in the future). Here's a breakdown of best practices:

:one: **Purpose Over Process**: Always start by explaining *why* a piece of code exists, not just how it works. This gives context and makes it easier for others to understand its relevance.
:two: **Consistency is Key**: Whether you're using JSDoc for JavaScript, JavaDoc for Java, or any other tool, maintain a consistent style. This makes your documentation predictable and easier to follow.
:three: **Avoid Redundancy**: If it's obvious from the code, you don't need to document it. For instance, **`int add(int a, int b)`** doesn't need a comment saying it adds two numbers.
:four: **Document Assumptions**: If your code assumes certain conditions (e.g., an input list is already sorted), document it. This can prevent future bugs.
:five: **Keep It Updated**: Outdated documentation can be more harmful than no documentation. Whenever you update your code, ensure the associated documentation reflects those changes.
:six: **Use Code Examples**: Sometimes, the best way to explain a function or a class is to show a small example of it in action.
:seven: **Document Edge Cases and Limitations**: If a function doesn't handle certain inputs or has known limitations, document them. This can save hours of debugging later on.
**BONUS TIP** :star::eight: **Link to External Resources**: If there's a blog post, paper, or any other resource that provides more context or a deeper dive into a concept, link to it.

Remember, the goal of documentation is to make code more accessible and maintainable. It's an investment in the long run.

Follow me on X, [@daryllukas](x.com/daryllukas) for more tips like this.
PHP is dead
Tags: php, laravel, coding, programming
Published: 2023-07-26 11:28:13

PHP is not dead. It is still a popular programming language, especially for web development. However, its popularity has been declining in recent years, as other languages such as JavaScript and Python have become more popular.
Sure, here are some statistics for most websites using PHP:

* According to W3Techs, PHP is used by **77.4%** of all websites whose server-side programming language we know.
* This means that over 77% of all websites on the internet are powered by PHP.
* PHP is also the most popular server-side programming language for WordPress, which powers over 40% of all websites.
* Other popular PHP-based platforms include Drupal, Joomla, and Magento.
* PHP is a mature and well-supported language, with a large community of developers.
* It is also relatively easy to learn, making it a good choice for beginners.

However, PHP is not without its drawbacks. For example, PHP can be slow for some applications, and it has some security vulnerabilities.

Overall, PHP is a powerful and versatile language that is still widely used for web development. However, it is important to be aware of its limitations before using it.

Here are some additional statistics about PHP:

* The most popular version of PHP is PHP 7.4, which is used by over 50% of all websites that use PHP.
* PHP is used by a wide range of websites, including social media platforms, e-commerce sites, and news websites.
* PHP is a free and open-source language, which means that it is available to anyone to use and modify.
Devops is not a job title! Devops is a mindset!
Tags: devops, cloud, azure, aws
Published: 2023-07-26 11:24:13

DevOps is not a job title, and here's why:

First of all, to understand what DevOps is and what it's not, we have to take a step back and remind ourselves how the SDLC (Software Development Life Cycle) worked in the past.

In short, there was a Development team that, after successfully implementing and running a project in local development environments, would "throw the code over the wall" to the operations team, consisting of IT admins and network engineers, responsible for delivering the product to the market with the help of other departments.

The real challenge was that the developers weren't held accountable for what they delivered and the reliability and scalability of the solution. This led to infinite tension between the development and operations teams, often resulting in shipping delays and financial losses.

Around 2009, this problem, along with the complexity of applications and infrastructure, was addressed with the creation of a DevOps culture. Developers were encouraged to closely cooperate with the operations team and take full responsibility for the delivered solution/software. This meant ensuring that the code was reliable, thoroughly tested, and that the solution was scalable. On the other hand, the operations team had to ensure a robust infrastructure and a smooth deployment/shipping process.

As you can probably already tell, DevOps is not merely a job title or a specially created team. Thinking about DevOps as just a distinction between developers and some special DevOps role is detrimental, just as it was in the past.

DevOps is a way of creating an organizational culture – a culture of cooperation and communication. It's about taking responsibility for what you build and cultivating the right mindset. Working together as one team towards a common goal will lead to great success.

Moreover, DevOps influences the application lifecycle throughout its plan, develop, deliver, and operate phases. Each phase relies on the others, and the phases are not role-specific. In a true DevOps culture, each role is involved in each phase to some extent.

*** Because of huge system complexity and wide range of tools needed to deliver software to the end users the separate DevOps and SRE roles started to be introduced alongisde DevOps concept and overall culture. 

*** I recommend the book "The Phoenix Project: A Novel about IT, DevOps, and Helping Your Business Win" by Gene Kim, Kevin Behr, and George Spafford. It provides great insights into how the DevOps culture and mindset work within an organization.
Exploring Relevant Accounting PhD Topics
Tags: beginners
Published: 2023-07-26 11:19:51

Phd is a research-based postgraduate program and a journey to higher academic levels. [Accounting PhD topics](https://www.payfordissertation.uk/dissertation-topics/accounting-topics-for-dissertation/) include the study of financial planning, taxation, accounting operations, auditing, financial management, accounting systems and processes, and corporate financial reporting. These topics are highly relevant to the growing field of accounting and are important to develop theories and techniques for the betterment of the accounting discipline. With the research undertaken in these areas, new and innovative ways of managing and analyzing financial information can be developed, leading to a more efficient and effective operation of accounting practices.
Accept Suspend and Non-Suspend as Parameter in Kotlin
Tags: kotlin, mobile, androiddev, beginners
Published: 2023-07-26 11:18:07

**Kotlin as always comes with a smart and simple solution. 😀 Check out this tip!**

Instead of creating two analogous functions just to be able to provide both suspend and regular functions as parameters, like so:
﻿
```kotlin
fun doSomethingBeforeAndAfter(
 nonSuspendAction: () -> Unit
) {
  somethingBeforeAction()
  nonSuspendAction()
  somethingAfterAction()
}
﻿
suspend fun doSomethingBeforeAndAfterForSuspendableActions(
 suspendAction: suspend () -> Unit
) {
  somethingBeforeAction()
  suspendAction()
  somethingAfterAction()
}
```
﻿
If you can define your function as ‘inline’, it will also make it accept both suspend and non-suspend functions as parameters:
﻿
```kotlin
inline fun doSomethingBeforeAndAfter(
 action: () -> Unit
) {
  somethingBeforeAction()
  action()
  somethingAfterAction()
}
```
﻿
Check out our [repo](https://github.com/bright/dev-tips/blob/main/kotlin/AcceptSuspendAndNonSuspendAsParameter.kt)! Hope you enjoyed this Kotlin tip. 🙂

---
By Łukasz Reszetow, Android Developer @ [Bright Inventions](https://brightinventions.pl/)
Wednesday Links - Edition: 2023-07-26
Tags: jvm, java, jpa, teams
Published: 2023-07-26 11:17:19

Java Energy: Are JVMs Environmentally Friendly? 🌱 (⏱️ 8 mins)
https://ionutbalosin.com/2023/07/analyzing-jvm-energy-consumption-for-jdk-17-an-empirical-study/

Deleting Data with Class: The Soft Way 😴 (⏱️ 5 mins)
https://vladmihalcea.com/soft-delete-jpa-version/

Building A Dream Team: Team Topologies Unveiled 🏆 (⏱️ 7 mins)
https://martinfowler.com/bliki/TeamTopologies.html

Supercharge Your Projects: Harnessing the Power of Python and Java Together 🐍 (⏱️ 53 mins)
https://www.youtube.com/watch?v=PH4wvi_co1M/
Top Reasons Why Your Oil & Gas Company Needs SAP Solutions
Tags: sapforoilandgas, sapforoilandgasindustry, erpsolutioninindia, sapbusinessone
Published: 2023-07-26 11:16:04

The Oil & Gas (O&G) sector is one of the biggest contributor in the country’s GDP. It thrives amid many challenges and regulatory pressure. As an owner of an O&G company, you face these challenges and intense competition also. Here, SAP for oil and gas lends a helping hand. In this article, we are going to see the top features and benefits of a SAP solution for oil and gas sector.

SAP for oil, gas, and energy (OG&E) industry can help your company to get an edge over competitors while paving the way toward a sustainable future of renewable energy. You can reduce operational costs from your existing business and grab new business opportunities with SAP oil and gas solutions.

## Solutions for the oil and gas industry from SAP Business One
Out of several solutions available from SAP, we will mention two major ERP software solutions for oil and gas industry.

 **SAP S/4HANA Cloud for Oil and Gas**
This cloud-based ERP solution is useful for hydrocarbon accounting and management. It can increase upstream productivity and enhance asset usage by unifying production processes. SAP S/4HANA Cloud can work wonders across engineering, planning, and asset management departments of your oil and gas industry.

 **SAP S/4HANA Oil & Gas**
Useful for hydrocarbon management, this solution can provide accurate inventory information in real-time. You can get better visibility into your business and make insightful decisions efficiently with the help of SAP S/4HANA oil & gas solution.

## Top Features of SAP for Oil & Gas Industry
SAP for oil and gas industry has many features that can benefit the industry in multiple ways. Some of its top features are-

 **Equipment Maintenance**
The SAP ERP solution is designed to monitor functioning of various equipment on a 24x7 basis. It is essential for reducing maintenance and repair costs significantly.

 **Procurement Management**
SAP Business One and other SAP ERP software offers a functionality to manage procurement based on available stock in the warehouse. It brings continuity in the process.

 **Single Platform**
As an integrated software solution, SAP for oil and gas offers a single platform for handling multiple processes.It does not require technical knowledge to access the important information.

 **Inventory Management**
It facilitates the oil and gas industry to handle raw materials effectively and manage production planning accordingly. It also tracks stock reconciliation for ensuring more efficiency.

 **Budgeting and Planning**
It enables users to make a budget as per the estimated production plan and assists you to maintain quality to add value to your oil and gas company.

For a Free Demo Contact us-
[https://sap.silvertouch.com/](https://sap.silvertouch.com/)
Contact: +91 9712939159
Email: sap@silvertouch.com
Simplify Your .gitignore Generation with Git Aliases
Tags: programming, tutorial, git, bash
Published: 2023-07-26 11:07:08


Hey fellow developers,

Today, I want to share with you a nifty Git alias I created that simplifies the process of generating a .gitignore file for your projects. If you often find yourself manually searching for the right .gitignore template for different programming languages, this alias will save you time and effort.

The alias leverages a small shell script, which I've placed in the "~/.gitScripts" directory, aptly named "ignore.sh". This script takes a single argument - the name of the programming language you want to generate the .gitignore file for.

Here's what the script looks like:

```bash
#!/bin/bash

lang=$1

if [ ! -n "${lang##+([[:space:]])}" ]; then
    echo 'Please add a programming language'
fi

langUpperCase=$(echo $lang | sed 's/./\u&/')

curl -s "https://raw.githubusercontent.com/github/gitignore/main/${langUpperCase}.gitignore" --output .gitignore
```

Let's break down what the script does:

It checks whether an argument (programming language) has been provided. If not, it displays a friendly message prompting you to add a programming language.
It converts the first letter of the provided language to uppercase, as that's how GitHub organizes their .gitignore templates.
It uses curl to download the appropriate .gitignore template from GitHub's official repository for gitignore files, based on the given programming language.
With this script in place, you can easily generate a .gitignore file for your project by simply running the ignore alias, followed by the name of the programming language you're using. No need to hunt down the right template manually!

To set up the alias, just add the following lines to your ".gitconfig" file:

```bash
[alias]
    ignore = "!sh ~/.gitScripts/ignore.sh"
```

Now, you can use the git ignore command to generate the .gitignore file quickly. Here's an example of how you can use it:

```sh
$> git ignore python
```
This command will fetch the appropriate Python .gitignore template and create a .gitignore file in your project directory.

I hope you find this Git alias as useful as I do. Happy coding and may your version control journey be smooth and efficient! 🚀

Feel free to share any other Git aliases or productivity tips that you find helpful in your development workflow. Let's make coding even more enjoyable and productive together! 😊


"Computers are fast, programmers keep it slow."

[Linkedin](https://www.linkedin.com/pulse/simplify-your-gitignore-generation-git-aliases-aissaoui-ahmed%3FtrackingId=kfVSFIyOTcK4dJ1mjzBBSg%253D%253D/?trackingId=kfVSFIyOTcK4dJ1mjzBBSg%3D%3D)
Golang 101
Published: 2023-07-26 11:00:04

**What it is:**
- Developed by Google
- Is compiled
- Is a procedural language
- Statically typed (so it ensures type safety at compile time)
- Uses pointers, like C / C++
- Has a garbage collector


**What it isn’t:**
- Object oriented although it has polymorphism
- A functional language

**The surprising bit:**
- There are a lot of features that high level languages have that simply don’t appear in golang.
    - while loops
- Where you put your braces matters

```
func stuff() {
} // is ok

func stuff2 
{
} // is not ok
```
**Commands you need to know:**
- go mod init
- go mod tidy
- go build
- go run

**Install go:**
Visit the golang website (https://golang.org/) and follow the installation instructions for your operating system.

**First app:**

```
package main

import "fmt"

func main() {
    fmt.Println("Yup it's Hello, World!")
}
```
```
$go mod init hello.go
$go build
$go run hello.go
```
WebRTC Help!!
Tags: webrtc, webdev, websocket, javascript
Published: 2023-07-26 08:40:07

I just started learning WebRTC and successfully created peer-to-peer videocall app , but then I wanted to connect more then 2 users So I searched and found I can achieve it through MESH architecture and I know there are better ways to do it like SFU and using any library but I just wanted to make it raw So I spend some time ( very much time ) and was able to understand how to do it , When a new User joins he get's the array of all the existing users and then he create a peer connection for every user and create offer for them and send ( signaling is handled by socket.io ) so every peer connection then get's Ans for there offer , and like this all of the users are now connected to the new user joined the room ,
Then there are two buttons one for sending my stream all the users ( it also enable to see my local stream to me) , and the 2nd button is for getting all the streams from other users , I see my stream but not the other user Streams , The problem is when i see chrome://wetrtc-internals after clicking sendStreams there it 'show negotiation needed and more stuff like added[0] and added[1] in the events , I am completely stuck , If anyone can please Help me it would be great help
here are link of my repo
frontend React - https://github.com/code-er7/Collab__-Frontend
backend - https://github.com/code-er7/Collab-signalling-backend

There is not good looking or a good frontend I am just trying to achieve the functionality of conference call here.
A little help would be great
Fetch Excel files and convert to JSON with SheetJS
Tags: javascript
Published: 2023-07-26 10:55:42

```html
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script lang="javascript" src="https://cdn.sheetjs.com/xlsx-0.20.0/package/dist/xlsx.full.min.js"></script>
    <title>Document</title>
</head>
<body>
    <script src="fetchdata.js"></script>
</body>
</html>
```

fetchdata.js

```js
async function FetchExcelData(url) {
  const resp = await fetch(url);
  const bytes = await resp.arrayBuffer();
  const workbook = XLSX.read(new Uint8Array(bytes), {
    type: "array",
  });
  const first_sheet_name = workbook.SheetNames[0];
  const worksheet = workbook.Sheets[first_sheet_name];
  const data = XLSX.utils.sheet_to_json(worksheet, {
    raw: true,
  });
  console.log(data);
}

FetchExcelData("contacts.xlsx");


```