teleren/devto huggingface dataset:
Create a cool discord bot for your chat group
Published: 2022-09-30 02:56:31

## Overview
It's very common to see that some discord groups add a discord bot. What does discord bot can do for us？ It can reply to user depends on what they send。 Let's say when our users send some sad words the bot can encourage she/he by sending some words. Furthermore, when a new member joined our group, the bot can welcome the newcomers because the owner maybe not always online. The bot is scalable you can use it to create something awesome.

## library
After searching GitHub i found out several discord Api libraries.

- Cog-Creators/Red-DiscordBot(python)
- discordjs/discord.js(javascript)
- Rapptz/discord.py(python)
- bwmarrin/discordgo(golang)
I choose Rapptz/discord.py in this piece, because i damn love python。

## Install env
First and foremost, we need to install our python env. We need to install python 3.8 or higher version. If you don't wanna to install any local env, that'sthat's ok you can use some cloud env like replit.com or pythonanywhere whatever you want. But for me i installed env using anaconda software. It provides UI and it's quite easy to use。

## get a bot token
For sure we need a token。 Then how do we get it? Just click "https://discord.com/developers/applications" and then login your discord account. You will see the new application button near your avatar. After creating an application go to bot page and copy your token. You should be very careful not to leak it。

## invent bot to our chat group
I hope you have a free discord chat group already。 If not, you can create one for free。Go to our application page again, you will see  Oauth2/URL Generator。 Generate an invite link for your application by picking the scopes and permissions it needs to function。 Get the URL and open it in our browser。That's all。

## Some awesome python code
```python
import discord

class MyClient(discord.Client):
    async def on_ready(self):
        print('Logged on as', self.user)

    async def on_message(self, message):
        # don't respond to ourselves
        if message.author == self.user:
            return

        if message.content == 'ping':
            await message.channel.send('pong')


intents = discord.Intents.default()
intents.message_content = True
client = MyClient(intents=intents)
client.run('YOUR TOKEN HERE')
```
If you need a proxy you can attach some code like this
```python
client = MyClient(intents=intents, proxy="http://127.0.0.1:10809")
```
This proxy address is my local proxy address. You should replace it with your own address if you wanna use a proxy.

## result 
After you run python demo.py you will see
```shell
2022-09-30 10:15:48 INFO     discord.client logging in using static token
2022-09-30 10:15:50 INFO     discord.gateway Shard ID None has connected to Gateway (Session ID: xxxxxxx).
Logged on as xxxx-demo#4518
```
After all of above is done you will see your bot is online。
If you get any question about discord bot or discord application please feel free to connect me.
Reverse Odd Levels of Binary Tree
Tags: leetcode, java, problemsolving
Published: 2022-09-30 02:50:39

Given the root of a perfect binary tree, reverse the node values at each odd level of the tree.

For example, suppose the node values at level 3 are [2,1,3,4,7,11,29,18], then it should become [18,29,11,7,4,3,1,2].
Return the root of the reversed tree.

A binary tree is perfect if all parent nodes have two children and all leaves are on the same level.

The level of a node is the number of edges along the path between it and the root node.


```java
class Solution {
    
    public void revOdd(TreeNode root1, TreeNode root2, int level){
        if((root1.left == null && root1.right == null) || (root2.left == null && root2.right == null)) return;
        
        if(level % 2 == 0){
            int temp = root1.left.val;
            root1.left.val = root2.right.val;
            root2.right.val = temp;
        }
        
        revOdd(root1.left, root2.right, level+1);
        revOdd(root1.right, root2.left, level+1);
        
    }
    
    public TreeNode reverseOddLevels(TreeNode root) {
        revOdd(root, root, 0);
        return root;
    }
}


```
I finally launched my portfolio! 🥳
Tags: portfolio, javascript, threejs
Published: 2022-09-30 02:40:36

After planning for a long time, I decided to go with a simple one first and add more content step by step in the future. 

Let me know what you think. Any advice is welcomed! 🤗
[nicoleyry.com](https://www.nicoleyry.com/)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y5aoca7h7b71cjmz456o.png)
palpatine supports markdown - minor release
Tags: opensource, programming, cpp, showdev
Published: 2022-09-30 02:30:52


It has been almost 4 weeks since I started developing [palpatine](https://github.com/batunpc/palpatine). In this week I have added couple more features to support markdown files. If you missed the first post on palpatine, you can read it [here](https://dev.to/batunpc/palpatine-release10-350g). The static site generator I am building is a real world tool, so I want to make it efficient and my goal is to help users find information they need as quickly as possible. Palpatine now supports [horizontal rule](https://www.markdownguide.org/basic-syntax/#horizontal-rules) and [inline code](https://www.markdownguide.org/basic-syntax/#code) features to help you compose your interactive documentation with ease. See the [demo](https://emperor-palpatine.netlify.app/markdown-sample/palpatine.html) with the new `markdown features`.


## Creating Topic Branches

Regarding the features I stated above, I initially filed separate issues [Issue #9](https://github.com/batunpc/palpatine/issues/9) and [issue #10](https://github.com/batunpc/palpatine/issues/10) and created separate branches for each feature. There are couple ways I know to create branches through terminal. One of them is;
```sh
  git branch <branch-name> # creates a new branch
  git checkout <branch-name> # switches to the new branch
```
This is the way I used to create branches. But I found out that there is a better way to create branches and switch to them in one command. The command is;

```bash
  git checkout -b issue-10
```
This command little bit more efficient compared to the previous one. It creates a new branch and switches to it in one command. 
After I created the branches, I started working on developing the markdown features. Adding the features I stated was not hard after all, I am trying make my code efficient than ever and clean. 


## Merge Time 
After I finished  the features, I merged the branches to the  `main branch`. I used the following command to merge the branches to the master branch;
```bash
  git merge issue-10
```
The fun part was watching all changes from the different branches merge to the main branch. I achieved this smoothly without crashing any part of the code. I did not have any [merge conflicts](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/addressing-merge-conflicts/about-merge-conflicts) this time as I was careful about what I was changing and merging. 

### Links to my Issues and Merged commits
<!-- make table -->
| Issue | Closed by |
| --- | --- |
| [Issue #9](https://github.com/batunpc/palpatine/issues/9) | [2296034](https://github.com/batunpc/palpatine/commit/2296034db7ad36bb5bfeaeb53508b54c045a79ca) |
| [Issue #10](https://github.com/batunpc/palpatine/issues/10) | [37d8c11](https://github.com/batunpc/palpatine/commit/37d8c1144e1c59bc9b79c9f5d9140e006e248a4f) |
Earning a free SumoLogic Fundermentals certification in 2 hours
Tags: sumologic, certification, career, monitoring
Published: 2022-09-30 01:33:36

## TL;DR
- [Signup](https://www.sumologic.com/learn/training/) an account (3 minutes)
- Get a [training account](https://learn.sumologic.com/page/sumo-expert) for lab (5 minutes)
- Download [slides and lab guide](https://learn.sumologic.com/fundamentals-cert-jam/1359290) (2 minutes)
- Watch the training video, read slides and play around by following the lab guide (1 hour)
- Start the exam at [Fundamentals Exam page](https://learn.sumologic.com/fundamentals-exam). Trust me, most of the answers for questions can be found in the slides. (50 minutes)

## About SumoLogic
**Sumo Logic, Inc.** is a cloud-based machine data analytics company focusing on security, operations and BI usecases. It provides log management and analytics services that leverage machine-generated big data to deliver real-time IT insights.[1]

**Sumo Logic** provides best-in-class cloud monitoring, log management, Cloud SIEM tools, and real-time insights for web and SaaS based apps.[2]
Many big brands are using Sumo Logic:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0o7n2zftaxyer5rkl75v.png)

## SumoLogic Certifications
SumoLogic has various of certifications. The good thing is all of them are provided free (training materials and certifications).
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1m13rtw4njbwl5tfda45.png)

Once you've passed an exam, you will get a certification to show off in your CV and LinkedIn profile 😎 (not to mention you've learnt something new):
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/twfh177p39j0li8v2s4l.png)

Good luck! 

[1]: From [Wikipedia](https://en.wikipedia.org/wiki/Sumo_Logic)
[2]: From SumoLogic website
What are your favourite emoji to use in build pipelines?
Tags: ci, emoji
Published: 2022-09-30 00:00:08

I absolutely love using emojis in things like build pipelines or documentation.  I find a list like this: 

- Run Tests
- Lint
- Build artefact 

Is a whole lot easy to read when it has emojis:  

- 🧪 Run tests 
- 🔎 Lint
- 🏗 Build artefact 


The emojis give very quick identifiable reference points - in what otherwise might look like a wall of text. 


So what are your favourite emojis to use for common terms? 

Here's some of mine: 

| Emoji         | Meaning        | Notes |
| ------------- | -------------| -----|
| 🧪 👩🏾‍🔬         | Test         | It can be good to have different emojis for different test types  |
| 👷 🏗| Build      |  |
| ⚙️ 🔧 | Configure||
| 📦| Artefact|| 
| 🔎 🕵️‍♀️  | Inspect/Lint      |  |
| 👮🏼| Type Check | Or any other strict/grumpy check |
| 👩‍🦯 | Lint | 'Lets check for things that might trip us up'  |
| 👨‍🎤 | Formatting| 'They're an artist' |
| 🛃 | Security check on dependencies||
| 👩🏼‍🌾| User ||
| 🧙| Admin ||
| 🧛‍♂️| Manager||
VS Code Shortcuts
Tags: beginners, productivity
Published: 2022-09-29 23:35:48

When I first started learning code, I watched in awe as developers would seamlessly move around their code with out all the clicking that someone like I would do. What is weird to me is that while learning code in university and on Codeacademy, I was never taught shortcuts. They honestly make your experience while learning to code so much better so I would like to share what I have learned so far and will continue to edit this post as I learn more. Don't be shy to post in the comments some more shortcuts that you like to use because I am open to all I can get. And whoever sees this post would probably appreciate it as well. 

Shortcuts I know of in VS Code: 

- to comment use: ctrl + /

- to toggle your files tab use: ctrl + B 

- to click multiple lines use: alt + click

- to kill a terminal use: ctrl + c

- to easily move to either side of words use: ctrl + arrow keys

- to close tabs in an unordered fashion use: ctrl + w
Get A Dev Job # 2
Tags: journey, javascript, webdev, inspiration
Published: 2022-09-29 23:25:01

Image by <a href="https://pixabay.com/users/mediamodifier-1567646/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=5597527">Mediamodifier</a> from <a href="https://pixabay.com//?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=5597527">Pixabay</a>


Last month, I [posted](https://dev.to/jeffchavez_dev/my-web-dev-journey-1-1hjl) about restarting my web dev journey with a clear goal to get a full time front-end web developer job. 

With consistency and dedication, I was able to press on! Here's a screenshot of my Github contribution:

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

I faced challenges and trials that almost caused me to give up again. But hey! I overcame them all by the grace of God. I coded and labor to understand difficult concepts sometimes with little amount of time daily. 

I am inspired by difference posts here and from [daily.dev](https://daily.dev/). Most of all, my family is my motivation and my responsibility to provide for them by God's grace. 

There are still javaScript concepts that I am trying to get around my head. But I'll press on. I created projects, though not yet complete, based on the concepts that I learned from [Florin Pop's tutorial on YouTube](https://youtu.be/dtKciwk_si4). 


Here are some projects that I created. They are few and simple but I worked hard with the ability that I have and skills that I've learned. 


![My Event Timer](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3qgosj0u2w1rr1rry5mx.png)
View [here](https://my-event-timer.vercel.app/).
![Gospel-quiz](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/32pagyuj4quvjdlzet1y.png)
View [here](https://gospel-quiz.netlify.app/).

![Vocabulary app](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/auscjavnacldpgtu623b.png)
View [here](https://lovegreek.vercel.app/).

++++++++

This coming month, I like to create more and improve the apps that I created. Please, be patient with my posts. And I would appreciate comments that would really help me improve as a web developer and programmer. 

As a Christian, I also write blogs about the goodnews. If you are interested, please read here: [The Glorious Gospel](https://theologycheck.wordpress.com/2021/03/04/the-glorious-gospel/)
First principles - Unix Philosophy
Tags: unix, programming, design, productivity
Published: 2022-09-29 22:47:15

### Language syntax is merely details. The foundation is learning to think in a different way. 

*Our job as Software Engineers is optimize for learning and handling complexity.*

That's the reason why I feel like reading about core principles and philosophy of design is important. 

Unix Principles are worth some meditation. 

### The Art of Unix Programming 

- Rule of Modularity: Write simple parts connected by clean interfaces.

- Rule of Clarity: Clarity is better than cleverness.

- Rule of Composition: Design programs to be connected to other programs.

- Rule of Separation: Separate policy from mechanism; separate interfaces from engines.

- Rule of Simplicity: Design for simplicity; add complexity only where you must.

- Rule of Parsimony: Write a big program only when it is clear by demonstration that nothing else will do.

- Rule of Transparency: Design for visibility to make inspection and debugging easier.

- Rule of Robustness: Robustness is the child of transparency and simplicity.

- Rule of Representation: Fold knowledge into data so program logic can be stupid and robust.

- Rule of Least Surprise: In interface design, always do the least surprising thing.

- Rule of Silence: When a program has nothing surprising to say, it should say nothing

- Rule of Repair: When you must fail, fail noisily and as soon as possible.

- Rule of Economy: Programmer time is expensive; conserve it in preference to machine time.

- Rule of Generation: Avoid hand-hacking; write programs to write programs when you can.

- Rule of Optimization: Prototype before polishing. Get it working before you optimize it.

- Rule of Diversity: Distrust all claims for “one true way”.

- Rule of Extensibility: Design for the future, because it will be here sooner than you think
10 LINKS to learn the basics of programming
Tags: beginners, webdev, react, javascript
Published: 2022-09-29 22:45:13

## I made a list of 10 sites where you can learn the basics of programming and boost your studies.


>*Bonus: [Computer Science - Crash Course](https://www.youtube.com/playlist?list=PL8dPuuaLjXtNlUrzyH5r6jN9ulIgZBpdo) by Carrie Anne Philbin*

ㅤ
![dev roadmap](https://i.imgur.com/VWQ035F.png )
**DEV ROADMAP** - https://roadmap.sh/ ㅤ`English`
Learning trails for those who don't know where to start! This one is REALLY good.
ㅤ

**Learn X in Y Minutes** - https://learnxinyminutes.com/ ㅤ`English | several languages`
It has the basics of dozens of programming languages, succinctly and directly.

ㅤ
**W3Schools** - https://www.w3schools.com/ ㅤ`English | Google translator on the website`
Everyone knows this one when researching how to do something with CSS, but did you know that it has tutorials and complete quizzes in it too? JS, SQL, Python and more.
W3Schools is simply legendary!
ㅤ

**FreeCodeCamp** - https://www.freecodecamp.org/ ㅤ`English`
Learn frontend and backend with exercises. It has a certificate and everything! I learned JS and responsive web design from them <3
ㅤ

**SoloLearn** - https://www.sololearn.com/home ㅤ`English`
Recommend for all beginners. Its like FreeCodeCamp.
ㅤ

**Codewars** - https://www.codewars.com/ ㅤ`English`
A lot of exercises, for you to code like a pro. You compete with other users of the platform. I recommend it to everyone, but for those who already know how to program, Codewars will be gold!
ㅤ


**Khanacademy** - https://www.khanacademy.org/computing/ ㅤ`English`
Computer Science subjects and learning paths to become a dev. All with impeccable teaching. Top notch.
ㅤ

**The Odin Project** - https://www.theodinproject.com/paths ㅤ`English`
Learn the fundamentals of programming and then choose to become a fullstack JavaScript or Ruby on Rails dev. Great course.
ㅤ

**React JS** - https://reactjs.org/community/courses.html ㅤ`English`
A list of free courses, made by the community, to get you absolutely PRO in ReactJS. It has a list of paid courses as well.
ㅤ

**SQLbolt** - https://sqlbolt.com/ ㅤ`English`
Study SQL without fuss, with practical and short exercises. The pinnacle of teaching databases, my confreres!

---

Send this post to your friend who is kinda lost 😉
-With Love, Lucas.
#10daysofcodechallenge by Ingressive for Good (#Day 9)
Tags: javascript, beginners
Published: 2022-09-29 22:14:05

I am close to the end of a 10-day coding challenge organized by Ingressive for Good and I'll be sharing my thoughts on Day 5 of the challenge.

Let me briefly describe how the challenge works before I share my experience with you. From September 21 through October 30, 2022, the challenge is to solve one common algorithm problem every day for ten days.

Today's algorithm problem was “Merge k Sorted Lists." It is the 23rd algorithm challenge on "Leetcode.com".

The algorithm for today involved sorting a linked list. The issue appeared straightforward at first glance because all you had to do to address it was take each element from each list, sort them, and then add them to a new list. But after trying numerous fruitless codes, I had to go look for linked list on Google. 
I then developed a solution based on my studies. The solution was to divide the list into the smallest possible unit, take two lists at a time and arrange the elements in each list in the appropriate order. Repeat this process for all the pairs of lists. 
The final list will be the necessary response.

This task was completed in javaScript, took 138 milliseconds to execute, and consumed 49 MB of memory.

I never believed I would make it this far thank you Ingressive for Good.
Atlassian’s Eye-Opening State of Teams Report
Tags: management, podcast, devops, productivity
Published: 2022-09-29 22:10:56

When you get the chance to geek out over the metrics behind happy dev teams, you take it.

As one of the companies shaping how the modern workforce, well… works, Atlassian is one of the foremost thought leaders in the space thanks to an amazing research and data team.

Case in point: [Atlassian’s State of Teams Report.](https://www.atlassian.com/blog/state-of-teams)

In this week’s episode, modern work evangelist Mark Cruth takes us through the most interesting, insightful and counterintuitive findings from their deep dive on what is separating healthy teams from unhealthy ones.

From whether hybrid or in-office is the best for modern teams to what work principles are the most important to keep in a remote world, this conversation about the State of Teams report is an eye-opener for anyone whose success depends on the work of others.

{% spotify spotify:episode:4j0sDx13vxB06C5bQYyMpX %}

## Episode Highlights Include:
* (4:38) What is the State of Teams Report?
* (7:55) Why where you work doesn't affect team health
* (10:48) Areas where teams struggle most
* (16:24) Biggest takeaways for leaders from the report
* (23:39) Building a human-centric team climate
* (36:00) Sneak peek at Mark's Interact presentation
* (44:11) How (and why) teams should celebrate achievements more often

## [You’re invited to Interact on October 25th!](https://devinterrupted.com/event/interact/?utm_source=dev.to&utm_medium=referral&utm_campaign=202210%20-%20Event%20-%20Interact%20-%20Referral%20-%20Distro%20-%20Podcast%20Blog)

*Want to know how engineers at Slack and Stripe connect their dev teams’ work to the business bottom line? Or how team leads at Shopify and CircleCI keep elite cycle time while minimizing dev burnout and maximizing retention?*

*These are just two of the topics we’ll tackle at [Interact](https://devinterrupted.com/event/interact/?utm_source=dev.to&utm_medium=referral&utm_campaign=202210%20-%20Event%20-%20Interact%20-%20Referral%20-%20Distro%20-%20Podcast%20Blog) on October 25th.* 

*A* ***free, virtual, community-driven engineering leadership conference,*** *[Interact](https://devinterrupted.com/event/interact/?utm_source=dev.to&utm_medium=referral&utm_campaign=202210%20-%20Event%20-%20Interact%20-%20Referral%20-%20Distro%20-%20Podcast%20Blog) is a one-day event featuring over 25 of the most respected minds in development, all selected by the thousands of engineering leaders in the Dev Interrupted community.* 

## [Register now!](https://devinterrupted.com/event/interact/?utm_source=dev.to&utm_medium=referral&utm_campaign=202210%20-%20Event%20-%20Interact%20-%20Referral%20-%20Distro%20-%20Podcast%20Blog)


![Register now!](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p9xpvwbw5xfawom98qga.jpg)
quick question about Terminals
Tags: programming, help, terminal, beginners
Published: 2022-09-29 22:05:43

hey, I have some questions about terminal portfolio/apps I have been seeing on the internet. if you're professional in this subject, please help me.:

## (i only ask this here because I couldn't find any answer on the web.)

first- what is this called?:
![some terminal shit](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0adjicdhf5an47ei53tw.jpg)
**and this:**

![some terminal shit](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g9zynnx7his7ffw5qngb.jpg)

here are my questions:

> -what is this? i know its ASCII, i measn the terminal<br>
> -how do I make one?<br>
> -what are the uses?<br>
> -how do I learn to make portfolio websites or apps like this? (on video or text. doesn't matter)<br>
> -what language or OS should I use to make this? I mean like Linux, windows?<br>

**if you can tell me more descriptions or things that I DIDNT ask or you think I could've asked, please go and comment :)**