teleren/devto huggingface dataset:
Fix Raspberry Pi VNC Desktop Low Resolution (Small Screen)
Tags: raspberrypi, vnc, ssh
Published: 2022-07-15 05:25:57

When we want to work on a Raspberry Pi, it is usually complicated to connect it with a monitor itself and prepare a set of mouse and keyboard. Then, using SSH(Secure Shell) or using VNC(Virtual Network Computing) are good alternatives. However, when we first connect with a Raspberry Pi using VNC, it is likely that the resolution of the screen is too low, and only the top left corner of the screen is displayed. In this case, due to the limited space for operation, it is hard to directly change the resolution through the VNC connection, but there is one way to solve this through SSH connection.

![Raspberry Pi VNC connection with low resolution](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/to6obt5qh67c73nip081.png)

First, we connect our Raspberry Pi through SSH connection, and run the following command:
```
sudo nano /boot/config.txt
```
After that, a file should be opened using nano editor. 

![Opened File](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gnkncydcve927zigsza0.png)

First, we need to find the following five lines and if any of them are commented, **UNCOMMENT** these lines.
**Note:** set the `framebuffer_width` and `framebuffer_height` to your designed resolution and set `hdmi_group` and `hdmi_mode` the same as the value in the picture below.
 
![Target five lines](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1b9dbw3ty0cpfljt5tho.png)

Then, we scroll down and find the following two lines, and if  any of them are uncommented, **COMMENT** these two lines. 

![Target two lines](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/05s6bfusg5qhzb482hug.png)

After we complete all the changes, press `Ctrl + O` to write the changes, and then press `Ctrl + X` to exit.

Finally, we need to reboot the Raspberry Pi to make the changes take effects, run
```
sudo reboot
```
At this time, if you reconnect the Raspberry Pi via VNC, the resolution should be normal.

![Normal Desktop](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/asedx1fubh7mk4njceka.png)

**PROBLEM SOLVED!!**
How to Host your React App for Free. (Part 2)
Published: 2022-07-15 04:22:08

I had already wrote a blog about hosting your react app using github pages. Link : https://bit.ly/3aLFnG9

In this blog, we will see how to host your project using netlify.
There are two ways to host using netlify
1. By drag and drop
2. By authorizing github

Lets get started.

## Drag and Drop
Step 1:
Head over to netlify.com and create a free account.

Step 2:
After successfully creating your account, the following page will appear.

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

Step 3:
In your project folder, open git bash or terminal and run the following command
`npm run build`

This will create a folder named 'build' in your project directory

Simply drag and drop build folder into the above appeared screen.

and Done Netlify will host your project 💥💥

Imagine Let say You had build a project and later you tried to update the project UI then the changes are not gonna reflect in your netlify app.

To make above query to happen, we use method 2

## Importing from github
Step 1:
push your code onto github after committing all the changes.

Step 2:
In the following image you can see there is an option to import and existing project. Select it and authorize your github account.

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

Step 3:
Then you will see all your github repos, select your project repo
and done netlify will take care of hosting it and it will also observe the future changes to that repo.



## Project I created Recently

I started learning about material UI and created a small app which generates random quote using an API.
Link : https://fancy-starlight-16b468.netlify.app/
Code available on github : https://github.com/vamsi-tupakula/quote-generator-react

Thank You for reading 🌹🌹
Find path in given object
Tags: javascript, webdev, beginners, programming
Published: 2022-07-15 04:12:32

```javascript
// Problem:

/*
- Write method findPath
- Should take two params:
    - object
    - keys separated by dots as string
- Return value if it exists at that path inside the object, else return undefined
*/

var obj = {
    a: {
        b: {
            c: 12,
            j: false
        },
        k: null
    }
};
```
```javascript
// Solution:

const findPath = (object, path) => {
    let i=1;
    const pathList = path.split('.');
    let obj = object[pathList[0]];
    while(i<pathList.length) {
        if(typeof obj === 'object') {
            obj = obj[pathList[i]];
            i++;
        } else {
            return undefined;
        }
    }
    return obj;
};
```

```javascript
// cases
console.log(findPath(obj, 'a.b.c')); // 12
console.log(findPath(obj, 'a.b')); // {c: 12, j: false}
console.log(findPath(obj, 'a.b.d')); // undefined
console.log(findPath(obj, 'a.c')); // undefined
console.log(findPath(obj, 'a.b.c.d')); // undefined
console.log(findPath(obj, 'a.b.c.d.e')); // undefined
console.log(findPath(obj, 'a.b.j')); //false
console.log(findPath(obj, 'a.b.j.k')); //undefined
console.log(findPath(obj, 'a.k')); //null
```
thanks
Python Pattern Matching -Switch Case
Tags: python
Published: 2022-07-15 04:07:57

## Switch Statement from Python 3.10

In Python 3.10, A match statement and case statements of patterns with related actions have been added to provide structural pattern matching. Sequences, mappings, primitive data types, and class instances are examples of patterns. Programs can branch on data structures, execute specific actions based on distinct sorts of data, and extract information from complicated data types using pattern matching.


**Basic syntax**
```
match status:
    case pattern_1:
        action_1
    case pattern_2:
        action_2
    case _:
        action_wildcard
```
**Example 1 (Getting weekday with switch statement in Python)**
```python
def week_day_from_number(number):
    match number:
        case 1:
            return "Sunday"
        case 2:
            return "Monday"
        case 3:
            return "Tuesday"
        case 4:
            return "Wednesday"
        case 5:
            return "Thursday"
        case 6:
            return "Friday"
        case 7:
            return "Saturday"
        case _:
            return "Week has only 7 days"
```

**Example 2 (Getting HTTP error from HTTP status code with Switch statement)**

```python
def http_error(status):
    match status:
        case 200:
            return "OK"
        case 201:
            return "Created"
        case _:
            return "Error"
```
SSL with certbot on nginx/apache on Ubuntu Server
Tags: nginx, apache, ubuntu
Published: 2022-07-15 04:02:57

## First Thing first
```
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
``` 

### On Nginx Server


```
sudo apt-get install python3-certbot-nginx
sudo certbot --nginx
``` 

### On Apache Server


```
sudo apt-get install python3-certbot-apache
sudo certbot --apache
``` 


**Note [if using Cloudflare]: If you have used cloudflare as DNS hosting and have proxied your DNS record to this server, then automatic domain verification of while generating certificate will fail. In this case remove proxy from cloudflare DNS record and then try again else you can choose other methods for your domain verfication**
awesome cli that you didn't know, replacement of dbeaver
Tags: mysql, postgres, sqlite, programming
Published: 2022-07-15 03:39:59

Always I'm looking to replace my desktop apps with a terminal application. Now take time to search some sql clients to connect the most famous databases: mysql , postgresql and sqlite.

If you are tired about use the dbeaver, well I will showup 3 tools can be a replacement of database explorer.

## The history

It's very interesting the history of this 3 tools:

> Earlier this year I wrote pgcli to scratch my own itch. I realized that most of the work that went into that project was not specific to Postgres database. I received a few requests from MySQL users requesting a MySQL equivalent of pgcli. I kept procrastinating for a few months and finally decided to launch a kickstarter campaign to fund the development time. That's this project came into existence. But if you'd like to know why I bothered to write a auto-completing repl with syntax highlighting, here's the reason:
> I'm a huge fan of CLIs. Especially REPLs. When I first encountered BPython, I fell in love with it. BPython is a Python REPL that has auto-completion, syntax-highlighting and displays the docstring of functions as you type. Once you get used to that level of pampering, all other REPLs start to look like Dumb Terminals.
> When I started using psql for interacting with my Postgres database, I yearned for a BPython equivalent for psql.
> One fine day I got a twitter DM from Jonathan Slenders asking me if I'd be interested in trying a new Python library that he's working on called Python-Prompt-Toolkit. This library provided a way to write CLIs without having to deal with ncurses and had the requisite tools for doing auto-completion and syntax-highlighting. So I jumped at the opportunity to try it out. After I got myself familiarized, I started writing pgcli to scratch my own itch.
> So this app exists because Jonathan was kind enough to request my feedback. 

## Feature:

AutoCompletation

![AutoCompletation](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u7cqr8ife4mzvpjj7bou.png)
![AutoCompletation2](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sezi3yzbcf5phqchzxeq.png)
 
 highlight

![highlight](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4n19h61uniouqxvnfrnm.png)

## Install

`pip install mycli pgcli litecli`
  

## mycli

MyCLI is a command line interface for MySQL, MariaDB, and Percona with auto-completion and syntax highlighting. 


## pgcli

Pgcli is a command line interface for Postgres with auto-completion and syntax highlighting. 

## litecli

A command line interface for SQLite with auto-completion and syntax highlighting.


OK! now it's time to drop your dbeaver and look more hacker in the terminal
Introduce
Tags: git, beginners, devops
Published: 2022-07-15 03:28:57

- 👋 Hi, I’m @ed738
- 👀 I’m interested in ...
- 🌱 I’m currently learning ...
- 💞️ I’m looking to collaborate on ...
- 📫 How to reach me ...

<!---
ed738/ed738 is a ✨ special ✨ repository because its `README.md` (this file) appears on your GitHub profile.
You can click the Preview link to take a look at your changes.
--->
How To Send Email With Attachment In Laravel 8
Tags: laravel, email, attachment, php
Published: 2022-07-15 03:20:00

In this article, we will see how to send an email with an attachment in laravel 8. As we all know mail functionalities are common in all projects but if you want to send a mail with an attachment then this post is for you here we will see how to attach files in mail laravel 8.

So, let's see how to send attachments in the mail using laravel 8, how to attach files in the mail in laravel 8, send multiple attachments in mail laravel 8, laravel 8 send an email with PDF attachments, send multiple attachments in mail laravel 8, how to send image in the mail using laravel 8.

```
Step 1 : Set Configuration for Sending Email with Attachments

Step 2 : Add Routes

Step 3 : Add Controller

Step 4 : Create Blade File
```

---

**_[Read More: How To Send Email With Attachment In Laravel 8](https://techsolutionstuff.com/post/how-to-send-email-with-attachment-in-laravel-8)_**
How integrate jira with my git branches with python
Tags: github, git, jira, webdev
Published: 2022-07-15 03:18:50

At work I have some development ruls like:

Every change on code should be comes with a Pull request and the branch name should be named like ID of jira.

Then we have branches like this:

```
  $ git branch -a
  remotes/origin/DEV-118
  remotes/origin/DEV-120
  remotes/origin/DEV-123
  remotes/origin/DEV-130
  remotes/origin/DEV-133
  remotes/origin/DEV-137
  remotes/origin/DEV-141
....
```
with that you don't know each branch what is it ... then lets make some fun:


{% gist https://gist.github.com/zodman/91c85d60a8fd2484423993d0a324b927 %}

With this you will receive:

`DEV-XXX <Assigned Name> <Status> <Title> <url>`

Now you can lost between branches and jira issues :>

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


# is this the integration ? comeon zodman! show me more!

Ok ok Imagine you have assigned the ticket DEV-foo1

In git you do:

`git checkout -b DEV-foo1`

and start hacking .... when you finish and everything looks good. you should create the pull request then you type:

```

gh pr create -B dev --title "$(jira-list | grep $(git rev-parse --abbrev-ref HEAD))"

``` 

PUM! you created a pull request with ID and title from jira. 

if you don't know what is [gh its a github cli](https://cli.github.com/)
Curso de Python
Published: 2022-07-15 02:40:29

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

Olá, você já pensou em trabalhar ou já trabalhou com python e quer se aprofundar ainda mais nessa tecnologia que cresce cada dia mais no mercado? Agora você tem essa oportunidade com o lançamento do Curso de Python da codar.me.
[Faça parte da próxima turma clicando aqui!](https://go.hotmart.com/S72864605E?dp=1)
Palindrome Number
Tags: algorithms, csharp, leetcode, easy
Published: 2022-07-15 02:35:50

_#9.Palindrome Number_

### Problem statement
Given an integer `x`, return `true` if `x` is palindrome integer.

An integer is a **palindrome** when it reads the same backward as forward.

- For example, `121` is a palindrome while `123` is not.

**Example 1**
```
Input: x = 121
Output: true
Explanation: 121 reads as 121 from left to right and from right to left.
```

**Example 2**
```
Input: x = -121
Output: false
Explanation: From left to right, it reads -121. From right to left, it becomes 121-. Therefore it is not a palindrome.
```

**Example 3**
```
Input: x = 10
Output: false
Explanation: Reads 01 from right to left. Therefore it is not a palindrome.
```

### Explanation
給定一個 `x` 的整數，如果是回文則返回 `true`，否則 `false`

回文的定義是不論從頭或從尾開始，讀起來是一樣的，例如 `121` 和 `1221` 是回文，但 `123` 不是

### Solution
這題要考慮的地方是回文的長度，偶數長度的回文分割為左右兩等分時比較好判斷，奇數長度的回文最後會留下中間的數，它不需與其他數對應，且題目最後的 Follow up 還提到能否在不將數字轉換成字串的情況下來解，依照前述的分析及題意，此題可使用算術運算子（Arithmetic operators）來解。

一開始先過濾一些特定的條件
- 判斷 `x` 是否為 0，如果是 return true
- 判斷 `x` 是否小於 0 或者為 10 的倍數，如果是 return false

接著執行 `while` 迴圈直到條件成立，最後 return `x` 與擷取出的 `reverseNum` 是否相等。

```cs
public bool IsPalindrome(int x)
{
    if (x == 0)
        return true;

    if (x < 0 || x % 10 == 0)
        return false;

    int reverseNum = 0;

    while (x > reverseNum)
    {
        reverseNum = reverseNum * 10 + x % 10;
        x /= 10;
    }

    return x == reverseNum || x == reverseNum / 10;
}
```

---

### Reference
[LeetCode Solution](https://leetcode.com/problems/palindrome-number/discuss/1324585/C-Solution)

[GitHub Repository](https://github.com/FakeStandard/LeetCode-CSharp/tree/main/Solution/0009.Palindrome-number)

---

Thanks for reading the article :tulip: :sunflower: :blossom:

If you like it, please don't hesitate to click heart button :heart:
or click like on my Leetcode solution
or follow my [GitHub](https://github.com/FakeStandard) :star:
or buy me a coffee :arrow_down: I'd appreciate it.

[![Buy-me-a-coffee][1]][2]

[1]: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h077sxd0vx1hix4t7lw8.png
[2]: https://www.buymeacoffee.com/FakeStandard

---
UI/UX ডিজাইনিং সেন্স এর জন্য একটি বই
Tags: design
Published: 2022-09-15 20:26:37

---
title: UI/UX ডিজাইনিং সেন্স এর জন্য একটি বই
published: true
date: 2022-07-15 02:10:56 UTC
tags: Design
canonical_url: https://blog.aldinn.com/designing-sense-of-humor-book/?utm_source=rss&utm_medium=rss&utm_campaign=designing-sense-of-humor-book
---

UI/UX ডিজাইনে আমার রীতিমত আমার সেন্স অব হিউমার খুব বাজে তবুও এটাকে মানুষের কিছুটা চোখের সন্তুষ্টির জন্য কিছু ঘাটাঘাটি করছি । ঘাটাঘাটি করতে গিয়ে সব থেকে ভাল মনে হয়েছে এই বইটা । অন্তত এটা ফলো করলে বলা যায় বাজারে চলার মত ডিজাইন করা যাবে !

<iframe loading="lazy" src="https://drive.google.com/file/d/1EyasMg2_VcVnydLWcaSWc6JQ_gYUNFdC/preview" width="640" height="800" allow="autoplay"></iframe>
<object data="https://blog.aldinn.com/wp-content/uploads/2022/07/The-Design-of-Everyday-Things-Revised-and-Expanded-Edition.pdf" type="application/pdf" style="width:100%;height:890px" aria-label="Embed of The-Design-of-Everyday-Things-Revised-and-Expanded-Edition."></object>[The-Design-of-Everyday-Things-Revised-and-Expanded-Edition](https://blog.aldinn.com/wp-content/uploads/2022/07/The-Design-of-Everyday-Things-Revised-and-Expanded-Edition.pdf)[Download](https://blog.aldinn.com/wp-content/uploads/2022/07/The-Design-of-Everyday-Things-Revised-and-Expanded-Edition.pdf)
The post [UI/UX ডিজাইনিং সেন্স এর জন্য একটি বই](https://blog.aldinn.com/designing-sense-of-humor-book/) appeared first on [Aldinn Rocks](https://blog.aldinn.com).
How to reload express.js server with esbuild
Tags: esbuild, expressj, typescript, webdev
Published: 2022-07-15 02:08:48

Hello!!
I'm trying to develop web server made of express.js. And I want to use esbuild as bundler, but esbuild don't have feature to realod server. So I tried to add the feature.

Finally, I used nodemon. Like below.

```
{
    "watch": [
        "src"
    ],
    "ignore": [
        "dist",
        "node_modules"
    ],
    "ext": "ts,mjs,js,json,graphql",
    "exec": "yarn build && yarn start",
    "legacyWatch": true
}
```

But it isn't best way to reload because that code regenerate all code... ... If you have another solution, I want to know that!!
Feature update: Markdown Toolbar coming to Comment Editor!
Tags: changelog, product, meta, ux
Published: 2022-07-15 01:58:09

Hello, dear DEV community!

I have a quick and exciting update for you today: **we have brought the highly requested markdown toolbar to the comment editor.**

Many of you who have been following us know that we have been working on improving the editor experience. We first introduced [the markdown toolbar in the post editor](https://dev.to/devteam/feature-update-markdown-toolbar-2lma), and then we simplified [how to add a rich-content embed](https://dev.to/devteam/feature-update-rich-content-embeds-390e). These are both integral parts of the authoring experience we wanted to get right. We have come a long way and now the toolbar is ready to grace our comment editor. :tada:

I’d like to take the chance to thank my talented and incredibly supportive teammates. I can’t have done this without: 
- @s_aitchison bringing this cross the finish line 
- @aritdeveloper & Dwight simplifying the embed experience
- @pp & @anujbhavsar96 crafting sensible user experiences
- @ellativity & @michaeltharrington advocating for our users and creators
- @graciegregory making this post better
- @jennieocken's & @jeremyf's guidance and support
 
Have you tried it? Play with it and as always, let me know what you think in the _comment section_ below! :wink:
Extract month and year from Postgres DB
Tags: sql, php, java, python
Published: 2022-07-15 01:34:53


SELECT CAST(MONTH AS DECIMAL(6, 2)) + '-' + CAST(YEAR as DECIMAL(5, 2)) FROM `posts`

read also : [PhpMyAdmin vs MySQL](https://professional-writer0.blogspot.com/2022/07/phpmyadmin-vs-mysql-workbench-whats.html)

Extract Month and Year from a Postgres DB:
One of the most common queries that needs to be executed on a Postgres database is extracting the month and year from a particular record. It can be done using various SQL commands but below are some sql snippets that will show you how to do it.

SELECT MONTH(CURRENT_DATE) as Month, YEAR(CURRENT_DATE) as Year

FROM table_name;

Select Month from date

This will give you the month as a number between 1 and 12 and Year as a four digit number.

SELECT MONTH(CURRENT_DATE) as Month, YEAR(CURRENT_DATE) as Year

FROM table_name

SELECT DATE_FORMAT(CURRENT_DATE,'%Y') as Month, DATE_FORMAT(CURRENT_DATE,'%m') as Year

FROM table_name;

SELECT NOW() as Month, NOW() as Year

FROM table_name;

The Results of Extracting Month and Year from a Postgres DB:

Lets take a look at some of the results that will be generated by the preceding SQL commands.

SELECT MONTH(CURRENT_DATE) as Month, YEAR(CURRENT_DATE) as Year

FROM table_name;

SELECT Month from date

This will give you the month as a number between 1 and 12 and Year as a four digit number.

SELECT MONTH(CURRENT_DATE) as Month, YEAR(CURRENT_DATE) as Year

FROM table_name

SELECT DATE_FORMAT(CURRENT_DATE,'%Y') as Month, DATE_FORMAT(CURRENT_DATE,'%m') as Year

FROM table_name

SELECT NOW() as Month, NOW() as Year

FROM table_name;

The SELECT NOW() as Month, NOW() as Year from table_name will give you the current date and the corresponding month and year.

Extracting the month and year from a Postgres DB is a simple task that can be done using various SQL commands. The results of the commands will vary depending on the table that is being queried.
Poll 2 : Favorite blogging platform ?
Tags: discuss, community, poll
Published: 2022-07-15 01:04:17

## 📝 What's you favorite blogging platform as a developer ?

1. 🤍 Dev.to
2. 🖤 Medium
3. 💙 Hashnode
4. 💚 Hackernoon

Click here 👇 to answer ❗ and comment 💭 below why you think so ❓
[![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7zfm80uc1df549xl2bry.png)
](https://twitter.com/heydrdev/status/1547743116907597825)

---

Let's connect together 🤝, post your favorite dev article and tag me on twitter. I will retweet and give you my honest opinion 😇

[![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hi9jmkirwc9g9ppwbc1o.png)](https://twitter.com/heydrdev)
Dear developers, what do I have to do to work in your country?
Tags: discuss, career
Published: 2022-07-15 00:54:41

Having never left my country (professionally speaking), I was wondering about the different steps I would have to take to go and work in another country as a developer.

I know that every country is different. So explain to me, what do I have to do to work in your country?

*Do not hesitate to promote your country to me, and to other developers who would like to come 😛*

*Photo by [Eva Darron](https://unsplash.com/@evadarron?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText) on Unsplash*
Difference between “ == “ and “ === “ operators
Tags: javascript, html, css, php
Published: 2022-07-15 00:20:03

Both operate on comparisons. The distinction between the two operators is that while "==" compares values, " === compares both values and types.

read also : [A powerpoint presentation's encryption: adding it](https://professional-writer0.blogspot.com/2022/07/how-to-add-encryption-to-powerpoint.html)

Example:

```
var x = 2;
var y = "2";
(x == y)  // Returns true since the value of both x and y is the same
(x === y) // Returns false since the typeof x is "number" and typeof y is "string"
```
💾 Git Stash
Tags: gitstash, devtools
Published: 2024-02-21 12:38:56

---
title: 💾 Git Stash
published: true
date: 2022-07-15 00:00:00 UTC
tags: GitStash,DevTools
canonical_url: https://akamfoad.dev/blog/git-stash
---

Playing with half-baked ideas or writing code but not finished yet and need to switch to another branch? Here goes Git Stash

Read more on [Akam's Blog | 💾 Git Stash](https://akamfoad.dev/blog/git-stash)