teleren/devto huggingface dataset:
How to Install Composer on Linux - Debian
Published: 2023-04-13 18:18:22

To install Composer on Ubuntu, you can follow these steps:

Update the package list on your system:

```
sudo apt update
```
Install some required packages using the following command:

```
sudo apt install curl php-cli php-mbstring git unzip
```
Download the Composer installer using the following command:

```
curl -sS https://getcomposer.org/installer -o composer-setup.php
```
Verify the downloaded installer:
```
HASH=`curl -sS https://composer.github.io/installer.sig`
echo $HASH
php -r "if (hash_file('SHA384', 'composer-setup.php') === '$HASH') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
```
You should see the message "Installer verified" if everything is okay.

Run the installer:
```
sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer
```
Verify the installation:

```
composer
```

You should see the Composer version number and usage instructions.

That's it!Congratulation, You have successfully installed Composer on Linux - Debian.
jq - Json Query Tool in bash
Published: 2023-04-14 04:10:00

Cheatsheet (with explanation on what the params do):
https://stedolan.github.io/jq/manual/

**Common Operations**

**Iterate all elements (and override some) within a JSON object**

```

          echo $temp > json-override.json

          for key in $(jq '. | keys' json-override.json); do

              # remove starting and trailing quotes
              ref_key=`echo $key | tr -d '"'`
              ref_key=`echo $ref_key | tr -d ','`
              if [ $key != '[' ] && [ $key != ']' ]
              then
                  ref_val=`jq \
                  --arg target_key $ref_key \
                  '.[$target_key]' json-override.json`
                  ref_val=`echo $ref_val | tr -d '"'`
                  # echo $ref_key = $ref_val

                  case $ref_val in
                    OLD VALUE)
                      ref_val='NEW VALUE'
                      ;;
                    *)
                      echo -n "Unknown secret"
                      exit 1
                      ;;
                  esac

                  temp=`echo $temp | \
                  jq \
                  --arg target_key $ref_key \
                  --arg target_val "$ref_val" \
                  '.[$target_key] |= $target_val'`
              fi
          done
          echo $temp
```
Business Appraisal Support
Tags: businessvaluation
Published: 2023-04-14 11:55:10

Don’t have the bandwidth to model out the comparative quantitative analysis that often accompanies the guideline public company method? Would you like another appraiser to provide a “second look” at your conclusions? No problem! Let us help you with maintaining compliance with professional standards, providing independent analytical corroboration to your processes, and further supporting your valuation conclusions. [ValuAnalytics](https://valuanalytics.com) can help to increase the efficiency of your process by reducing the time spent on modeling nuances, so you can focus on issuing your conclusion and developing more business!

For your convenience, we provide our narrative deliverable in word processor format and the exhibits in spreadsheet format so that you can adjust formatting to align with your existing templates and reports. Every engagement includes a 30-minute consultation to review the deliverable and answer any questions you may have regarding the analytics. Please contact us to request a redacted sample deliverable.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/004rq1rxjx56167g8sri.JPG)
Working with the OpenAI API
Tags: chatgpt, webdev
Published: 2023-04-14 20:21:17

In this blog post, we'll explore the intricacies of working with the OpenAI API. We'll dive into the API request structure, state management, token limits, temperature settings, and crafting effective prompts for the Chat API to help you, as a developer, get the most out of your interactions with ChatGPT.

1. API Request Structure: The Building Blocks
For developers familiar with API calls, the OpenAI API is relatively straightforward. It's a POST request sent to `https://api.openai.com/v1/completions`. The real power lies in the parameters you include with each request, which can significantly impact the API's behavior.
2. State Management: The Key to Coherent Conversations
A critical aspect to remember when working with the OpenAI API is that it doesn't maintain conversation states. As a developer, it's essential to implement state tracking in your application to ensure contextually relevant responses from ChatGPT. Make sure to include the entire conversation history in each API call.
3. Token Limits: Striking the Right Balance
Token limits are a crucial constraint in the OpenAI API, as they dictate the maximum number of tokens processed or generated in a single API call. To maintain performance and ensure system stability, you must balance input and output tokens to avoid errors or truncated responses. As a developer, you should design your application to incorporate token counters and limiters for improved stability and user experience.
4. Temperature Parameter: Fine-Tuning Your AI's Creativity
The temperature setting in the OpenAI API is a powerful tool to control the creativity or randomness of the generated text. A higher value increases diversity, while a lower value leads to more deterministic responses. As a developer, you can harness the temperature parameter to strike the perfect balance between creativity and consistency for your specific use case.
5. Crafting Effective Prompts: Guiding the AI with Precision
Prompts play a pivotal role in the Chat API, guiding the AI model and setting the stage for the conversation. As a developer, you'll want to structure prompts as a list of message objects, each containing a 'role' and 'content.' Start with a system message to set the context, followed by alternating user and assistant messages.

Designing effective prompts is both an art and a science. It involves striking a balance between being descriptive enough to establish the desired personality and response structure while minimizing word count to optimize the user experience and control costs. With your development skills, you can craft the perfect prompts to get the most context-aware and accurate responses from the AI model.

Conclusion:
Working with the OpenAI API requires a deep understanding of its various aspects. By mastering the API request structure, state management, token limits, temperature settings, and crafting effective prompts, you can unlock the full potential of ChatGPT and deliver an unparalleled user experience in your applications. Happy coding!
Open Source to Break the Routine 💡
Tags: opensource, programming, coding
Published: 2023-04-15 03:31:50

Even if we love our work, it's natural to go through phases where we feel like we've fallen into a rut. However, it's important to keep challenging ourselves. That's where open source contributions come in - they provide a way to expand our skills, try out new technologies, and connect with others in the community. In this blog post, we'll explore how open source can be a powerful tool for refreshing your mind and breaking out of the everyday tasks of your job.

### Open Source is all about collaboration and transparency 🤝

Open source is a philosophy that encourages creativity, innovation, and problem-solving, which can be incredibly refreshing when we're caught up in daily work routines. By contributing to open source projects, you can challenge yourself, learn new skills, and expand your professional network. The best part? You don't have to be a coding wizard to get involved.


### Benefits of Contributing to Open Source 🌐

In your job, you probably code with the same tech stack every day. Sometimes it can get a little monotonous. That's why I turn to open source to mix things up and work with a different tech stack. It's a great way to keep things fresh and exciting.

But it's not just technical skills that you can develop, contributing to open source can also be a great way to improve your communication skills. 🗣️💬

When you're contributing to an open source project, probably the only way to communicate with others is through Github issues. This means that you need to be able to read and interpret the requirements in order to contribute effectively (or ask if it's not clear enough). It's a skill that takes practice, but it's one that is incredibly valuable in any programming job. Also, as a non-native English speaker, I've found that open source contributions are a great way to practice my English skills. By communicating with other contributors and maintainers in English, I'm constantly learning new slangs, words, phrases, and expressions while understanding technical stuffs.


### Give it a try - it's really rewarding 🎉

It's a chance to be part of a community that's working together to create something meaningful and useful. It's an opportunity to give back to the tech community and make a difference. 

Your technical and communication skills will improve a lot by collaborating with people from different backgrounds and skill sets.

It could be a great way to refresh your mind and develop new skills. So why not give it a try? You might just discover a new passion and make some great connections along the way (as I've done).

And what if you don't know anything about open source? Learning about it can be your way to break the routine and keep you fresh and creative. 💡

Thanks for reading. 🙌

---
GitHub: https://github.com/miguelnietoa
LinkedIn: https://www.linkedin.com/in/miguelnietoa
Global CSS Art: Community
Tags: community, css, opensource, contributorswanted
Published: 2023-04-15 18:35:11

I'm creating a project called Global CSS Art where people can **share their CSS Art and others can view it, see the source code, and learn from it**.

The whole project will be open source and it will run if people keep on sharing their CSS Art.
The way it'll work is that there the GitHub repo will contain a folder called `/art`. This folder will have subdirectories with a user's username and within that subdirectory will be all the user's CSS art, in the format of HTML files with `<style>` tags.
People will then be able to add their own CSS art within their unique folders in the `/art` directory and make pull requests in the GitHub repo.
All the artwork will be randomly selected on each page load and will be shown on the main page.

**I need really big help!**
For me to create and then test out the project, I need some CSS art from different users on the GitHub repo.
It would be really nice to have cool artwork on the website.

To contribute and see your artwork on the home page (with your username and portfolio for people to see), add a html file to the directory: `/art/[username]`
*(Make sure your CSS code only affects the div the art is in, and not the whole page)*
and create a pull request on this GitHub repository:
{% embed https://github.com/VulcanWM/global-css-art %}

Thanks for reading and I hope you contribute!
Jumping into the deep end.
Tags: beginners, webdev, programming
Published: 2023-04-15 20:28:15

-One day, I woke up and went to work. Halfway through my day, it struck me: I love computers, and want to know them inside and out. When I got home, I started looking into programming. I was looking up YouTube video tutorials, trying to figure out where the heck I should start. Every blog and video I watched said there is no specific language one should start on, and me being the indecisive person I am, gave up. Here I am, years later. My brother offered me a job in his IT help desk position, and said I would be perfect for it. I was practically guaranteed the job, he had pull. I didn't need any previous experience, and I was good with computers already, everyone always comes to me with tech help, it's a no brainer, right? I was so excited, I told all my coworkers that I'd have a foot in the door to starting my programmer life. A week later, my brother told me that they chose someone else, someone even less qualified. You would think I'd be devastated, but I think the thought of getting that job flipped a switch in my brain. All I could think about was that the thought of starting programming made me so happy. I came home, and started researching again, reading everything and watching everything I had already seen, but with this new mindset. I finally decided to start my journey learning the mother language of coding, C. I downloaded an app on my phone called Programming Hero, and at work, at home, any free time I got, I spent it studying the workings of C and playing around in a sandbox compiler. The euphoria I got when my first difficult code actually ran after debugging it a bunch, is indescribable. I wanted to learn it all at this point. C, C++, Java, Python, EVERYTHING. Today, I enrolled in a coding boot camp, and start in a month. I'm so excited at the aspect of finally learning what I've always wanted to learn, and getting a start on my future.
-I guess the point of this post is: It's never too late. It took me years to finally work up the courage to just jump into the deep end, and I'm not disappointed in the slightest. However long it takes, however frustrated you get, if you have the same love for coding deep down like I do, you'll get where you need to go eventually. Don't give up!
A STEP BY STEP GUIDE ON HOW TO CREATE YOUR FIRST MICROSOFT AZURE STATIC WEB APP
Tags: azure, staticwebapps, github, beginners
Published: 2023-04-16 05:28:07

### Hey there, Welcome to my latest post, today we are going to exploring how you can create a static web app using a GitHub repository in Microsoft Azure - all with a free account! 

Now, you might be wondering - what is a static web app? 
In a nutshell, it's a simple website that doesn't require database. Instead, it's made up of static files, like HTML,CSS, and JavaScript, which can be hosted on a server or in the cloud. 

So, how do you create a static web app using a GitHub repo in Azure? It's actually pretty simple - just follow these easy steps with my snapshots:


###1. Sign up for a free Azure account

FREE TIP: Ensure to use a virtual card, I used payday not an advert though, lol. Sign up for a free Azure account at https://azure.microsoft.com/free/.

![Azure portal](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0zpn9qg9571iy2smqkdt.PNG)

###2. Create a resource

 Go to the Azure portal and click ,'Create a resource' in the upper left-hand corner and search for "static web app" in the search bar.


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

###3.  Click "Create" to start setting up your app. 
 Enter a name for your app and select your 
subscription and resource group(click "create new resource group if you don't have one ").

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


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

###4. Click "Sign in with GitHub"
 You need to link your GitHub with your Microsoft Azure account and select the repo you want to use for your app.

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


###5. Choose your build settings
Yes, we need to let azure know some details (like your branch and framework), then click "Review + Create".



![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5vvqifr2uvk65omuf9ur.PNG)


###6. Review your app's settings
 Review your app's settings then click "Create" to deploy your app. 


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


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


###7. And that's it! 
Your static web app is now up and running in Azure, all thanks to your GitHub repo.

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

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



######So, whether you're building a simple portfolio site or a small business website, creating a static web app using a GitHub repo in Azure is a fantastic way to get started - all for free!

######Please remember to leave your comment, like, share and follow me for more great contents. 

Thanks for reading!
Represent a directory tree in a Github README.md
Tags: github, tree, ubuntu, tutorial
Published: 2023-04-16 05:47:59

Do you want to add your project structure tree in your .readme file?

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

Install tree
```bash
sudo apt install tree
```

Just type tree inside of your project directory
```bash 
tree
```

If you want to ignore a folder from your `tree` like **node_modules**, you can do this by 
```bash 
tree -I node_modules
```

How about you want to ignore multiple folder from your tree, you can do this by
```bash
tree -I "node_modules|venv|lib"
```
reading standalone.conf.bat contents while starting wildfly in eclipse
Published: 2023-04-24 05:11:20

Dear members,
We are setting environment variable in standalone.conf.bat and this variable is able to read properly if we are running wildfly using standalone.bat file. application is deployed successfully.
But if I am start wildfly server from eclipse then the property mentioned in standalone.conf.bat didn't read by standalone.bat file and application deployment was failing.
Need to understand how to read properties mentioned in standalone.conf.bat while starting the server in eclipse??
Performance Tuning-Analyzing Hardware Bottlenecks-I/O
Tags: opengauss
Published: 2023-04-24 09:30:03

You can run the **iostat** or **pidstat** command, or use openGauss heath check tools to check the I/O usage and throughput on each node in openGauss and analyze whether performance bottleneck caused by I/O exists.

Checking I/O Usage
Use one of the following methods to check the server I/O:

**·** Run the **iostat** command to check the I/O usage. This command focuses on the I/O usage and the amount of data read and written on a single hard disk per second.

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

**rMB/s** indicates the number of megabytes of data read per second, **wMB/s** indicates that of data written per second, and **%util** indicates the disk usage.

**·** Run the **pidstat** command to check the I/O usage. This command focuses on the amount of data read and written on a single process per second.

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

**kB_rd/s** indicates the number of kilobytes of data read per second, and **kB_wr/s** indicates that of data written per second.

Run the **gs_checkperf** command as user **omm** to check the I/O usage in openGauss.

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

The I/O usage, number of reads and writes, and time when data is read and written are displayed.

You can also run the **gs_checkperf –detail** command to query performance details of each node.

**Analyzing Performance Parameters**
1. Check whether the disk usage exceeds 60%. Disk usage exceeding 60% is called high.

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

2. Perform the following operations to reduce I/O usage if the I/O usage keeps high:

2.1 Reduce the number of concurrent tasks.

2.2 Do VACUUM FULL for related tables.

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

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/icvgtp9n4lghssqw2eu2.png)
Getting Started with .NET MAUI DataForm
Tags: dotnet, dotnetmaui, csharp
Published: 2023-04-24 11:08:59

Learn how easily you can create and configure Syncfusion .NET MAUI DataForm using Visual Studio 2022. The Syncfusion .NET MAUI DataForm control is used to facilitate the creation and editing of data forms for various business purposes, such as login, reservation, contact, and employee forms. I’ve also demonstrated how to change the form layout, editor type and apply validation. 

_Product overview_: https://www.syncfusion.com/maui-controls/maui-dataform

_Download an example from GitHub_: https://github.com/SyncfusionExamples/getting-started-with-the-dotnet-maui-dataform

_Refer to the following documentation_ : https://help.syncfusion.com/maui/dataform/getting-started

{% youtube c39fzkutfwU %}
The old MySQL bug (detective story)
Tags: sql, mysql, bug
Published: 2023-04-24 11:47:12

In this article I want to describe about one bug that I found in MySQL and aware you from mistakes what you can do.

Some guy from my Telegram chat asked me: "How can I view all foreign key references to a specific table?" I gave him a quick answer: "Look it up in `information_schema`", but after that I decided to check my answer.

Just created simple table `test` and table `ref1` with field referenced to `id` field:

```
create table test (
 id int primary key,
 first_name varchar(20), 
 last_name varchar(30)
);

create table ref1 (
 id int primary key,
 test_id int references test(id)
);
```

Looks simple because I like this short syntax. After that I looked into `information_schema` table `REFERENTIAL_CONSTRAINTS`

```
SELECT * FROM `information_schema`.`REFERENTIAL_CONSTRAINTS` WHERE REFERENCED_TABLE_NAME = 'test'; 
```

and checked again. After that I sowed records in `REFERENTIAL_CONSTRAINTS`. How is it possible? I was disappointed and decided to save my mind by next test case:

I created one more referenced table `ref2` with canonical syntax:

```
create table ref2 (
 id int primary key,
 test_id int,
 foreign key (test_id) references test(id)
);
```

and did check again. After that I sow record in `REFERENTIAL_CONSTRAINTS`. How it possible? I was disappointed and decided to save my mind by next test case:

```
-- add values to test case
insert into test values (1), (2);

-- add ref1 row referenced to first row in test table
insert into ref1(id, test_id) values (1, 1);

-- add ref2 row referenced to second row in test table
insert into ref2(id, test_id) values (1, 2);
```

Now, I think, I will try to delete first row from test and will get error (I still think it some feature, not bug) but MySQL drop this row without any warning

```
delete from test where id = 1;

```
but when I try to delete second one that referenced by second table I did not succeed

```
delete from test where id = 2;

```
So it is not a feature, it is a real BUG! MySQL allows creating tables using short syntax without warnings but constraints are not created and do not guard your data consistently OMG!

I looked in Google and found the bug has been open since 2004 [https://bugs.mysql.com/bug.php?id=4919](https://bugs.mysql.com/bug.php?id=4919) and it is still not fixed. Hey guys, what are you doing? Hey guys what you during?

I decided to run this test case over other databases and found all databases that I can test on [SQLize.online](https://sqlize.online/sql/mariadb/0295e1d928b15c3e54f5cadcda10a750/) allows short syntax and all of them (MariaDB, PostgreSQL, SQL Server, Oracle) created foreign key constraints in both of cases except MySQL and SQLite.
How To Learn Coding With ChatGPT? Explore now
Tags: webdev, javascript, beginners, programming
Published: 2023-04-24 12:42:15

Learn Coding with ChatGPT in Only a Few Steps! There are a few different ways you can start learning to code with the help of ChatGPT.

Here are a few options for ” ChatGPT“:-
Ask specific coding questions:–

You can ask me specific questions about programming concepts or code snippets, and ChatGPTwill does its best to provide an explanation or example.

For example, If you need to learn how to build ” social media icons code ”

In addition, You can ask for it and he automatically will build it. continue reading [coding with chatgpt ](https://hfnewss.com/how-to-learn-coding-with-chatgpt-explore-now/)