teleren/devto huggingface dataset:
Grouping Anagram in Javascript
Tags: javascript, webdev, algorithms, tutorial
Published: 2022-04-18 05:31:07

An anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all the original letters exactly once,

These are the examples

```
car = arc	arc = car	brag = grab
bored = robed	cat = act	cider = cried
```

In the first example we have `eat = tea` , here tea can be formed by eat by rearranging,

So now the task is not to find anagram but grouping them together from a list of elements.


for example, if we are given this array which contains anagram

```["dusty", "night",'tea', "robed","ate","study","thing","eat"]```

Then after grouping it should be something like below

```
[
 ['dusty', 'study'],
 ['night', 'thing'],
 ['tea', 'ate', 'eat'],
 ['robed']
] 
```

So the idea is very simple,We keep an object and we sort each element and add as a key and value will be same as incoming element(without sorting),so if the sorted element is already present as key then we just push the element to existing array of elements 

So the object looks like below,
[![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ulz1abxix5ar5wnxa97r.png)]


here is the code for the same

``` javascript
<script>
    function groupAnagrams(array) {
       let reducedObject = array.reduce((acc, cur) => {
          let newcur=cur.split('').sort().join('');
          if (!acc[newcur]) {
             acc[newcur] = [cur]
          } else {
             acc[newcur] = [...acc[newcur], cur]
          }
          return acc;
       }, {});
       return Object.values(reducedObject);
    }
    console.log(groupAnagrams(["dusty", "night",'tea', "robed","ate","study","thing","eat"]));
 </script>
```
Why is WordPress the best CMS in 2022?
Tags: management, systems
Published: 2022-04-18 05:20:55

A CMS (Content Management System Platform) platform is software that allows you to manage content and create websites effortlessly. It is a web interface that allows users to create, manage, and modify web content websites without any code known. Today's most popular content management system (CMS) platforms often originated as blogging platforms like Wordpress as an early form of website building. You can build almost any type of website with three great CMS platforms, including WordPress, Joomla, and Drupal.

We've got some good news, whether you've been relying on your IT department, your "website," or running some incredibly complex and outdated CMS (content management system). It's easy to see why WordPress is the most popular CMS for creating a website or blog.

No list of the best [content management systems](https://aitglobalindia.com/digital-content-development/) would be complete without WordPress, the mother of all CMS. Up to 42% of the websites on the Internet are powered by WordPress, making it the best known and most used content management system in the world. The WordPress CMS powers over 32% of all websites on the Internet (including the Themeisle blog). In terms of the web (sites built with or without a CMS), 35.6% are WordPress sites.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/21c3rl8r1qlfst0rusbo.jpg)

WordPress.org is the most popular CMS globally, with over 60 million websites. WordPress powers everything from small personal blogs to the world's largest news sites. Since WordPress is open-source, WordPress is free to use and build your website.

The free and open-source CMS, WordPress, is almost limitless in terms of functionality. WordPress is beginner-friendly; you can easily create a website, blog, or online store with WordPress. Wordpress is great for static or information-rich websites and is usually the most intuitive CMS. Drupal is another free and open-source software that can be used to build websites.

WordPress is easy to use, has tons of resources, and is highly customizable. Although it was originally designed for bloggers, you can now use WordPress for your online store or brand-related web page. Open-source CMS systems allow you to customize everything using your website's HTML code.

So by knowing the functionalities of WordPress, we can conclude that WordPress is very user-friendly for learners and experts. It also has a robust API that users can utilize for advanced customization. WordPress backend is developed in PHP, but its front-end is customizable so that users can operate it with JavaScript platforms. Hope this clarification is enough to know why WordPress is the best CMS of 2022 for experts and learners both.

And now know [7 Big Data Trends of 2022](https://medium.com/@minaximinaxirathod080/7-big-data-trends-we-should-know-about-for-2022-7ae0dc0a520d)
Metadata about the workloads with Downward API
Tags: kubernetes, tip, beginners
Published: 2022-04-18 05:09:40

##### The need
There will be scenarios when the running `containter` needs information about the pod - namespace, pod-name, labels applied .. available from within the pod.
The container is not aware of it's runtime - if it is docker, mesos, kubernetes or something else

##### Alternative solutions
One can query the Kubernetes API server and get the data, but there are issues with this approach:
- requires intelligent scripting &/or client SDKs
- the pod itself should be self-aware to an extent to query the context => it is not really portable (or in easier terms there is some hardcoding or assumptions somewhere)

##### Downward API
Downward API allows 2 ways of exposing pod metadata to containers
a. as environment variables
```bash
❯ cat /tmp/pod-info.yaml
apiVersion: v1
kind: Pod
metadata:
  name: test-pod
spec:
  containers:
  - name: test-container
    image: busybox
    command: [ "/bin/sh", "-c", "env | grep MY_POD" ]
    env:
    - name: MY_POD_NAME
      valueFrom:
        fieldRef:
          fieldPath: metadata.name
    - name: MY_POD_NAMESPACE
      valueFrom:
        fieldRef:
          fieldPath: metadata.namespace
    - name: MY_POD_IP
      valueFrom:
        fieldRef:
          fieldPath: status.podIP

❯ kubectl logs pod/test-pod
MY_POD_NAMESPACE=default
MY_POD_IP=10.244.2.5
MY_POD_NAME=test-pod
```

2. as file contents
```bash
❯ cat /tmp/pod-info.yaml
apiVersion: v1
kind: Pod
metadata:
  name: test-pod-vol
  labels:
    env: stage
    team: acme
  annotations:
    build: "1.22"
    commitHash: "abcd1234"
spec:
  containers:
    - name: test-container
      image: busybox
      command: ["sh", "-c", "sleep 5; cat /var/tmp/pod-*.txt" ]
      volumeMounts:
        - name: podinfo
          mountPath: /var/tmp
          readOnly: false
  volumes:
    - name: podinfo
      downwardAPI:
        items:
          - path: "pod-labels.txt"
            fieldRef:
              fieldPath: metadata.labels
          - path: "pod-annotations.txt"
            fieldRef:
              fieldPath: metadata.annotations

❯ kubectl logs pod/test-pod-vol
build="1.22"
commitHash="abcd1234"
kubernetes.io/config.seen="2022-04-18T05:07:43.287165252Z"
kubernetes.io/config.source="api"env="stage"
team="acme"%
```

##### More info
- [Useful documentation](https://jamesdefabia.github.io/docs/user-guide/downward-api/)
Build a Chrome Extension in Next.js and Notion API
Tags: javascript, react, nextjs, webdev
Published: 2022-04-18 04:49:23

Chrome extensions are a great way to customize your browsing experience. Most of the time, Chrome extensions need to be reactive and this is where building the extension in vanilla JavaScript can be a painful experience. To overcome this shortcoming, you can use a JavaScript-based front-end framework like Next.js or Nuxt.js to build your Chrome extensions.

In this tutorial, you’ll learn to build a Chrome extension using Next.js. For this tutorial, you’ll build a Chrome extension that allows you to tag and save web links to a Notion database.

Read the full blog on [Bird Eats Bug](https://birdeatsbug.com/blog/build-a-chrome-extension-in-next-js-and-notion-api).

Thanks for reading 💜

---

I publish a [monthly newsletter](https://www.ravsam.in/newsletter/) in which I share personal stories, things that I am working on, what is happening in the world of tech, and some interesting dev-related posts which I come across while surfing on the web.

Connect with me through [Twitter](https://twitter.com/ravgeetdhillon) • [LinkedIn](https://linkedin.com/in/ravgeetdhillon) • [Github](https://github.com/ravgeetdhillon) or send me an [Email](mailto:ravgeetdhillon@gmail.com).

— [Ravgeet](https://www.ravgeet.in/), *Full Stack Developer and Technical Content Writer*
Happy wheels - interesting and attractive game
Tags: beginners, css, html, javascript
Published: 2022-04-18 04:26:04

[Happy Wheels](https://happywheels24.com/) is a physics-based game, this game is developed by Jim Bonacci. Your mission of this game is to find the exit. Happy Wheels full game is totally free and requires no registration!

Choose a character: Wheelchair Guy or Effective Shopper or Segway Guy or Irresponsible Dad,..and start controlling the vehicle to overcome obstacles.
Why Competitive Programming ?
Tags: computerscience, programming, career, opensource
Published: 2022-04-18 04:04:14

## What is Competitive Coding ?

• It is basically a mind Sport where you
are given some problem and you are
required to give an optimized solution
under various constraints by using your
programming skills.

• This sport basically tests your Logical
thinking, Analytical Thinking, Pattern
Recognition, Pressure Handling, and most
importantly your knowledge of Data
Structures and Algorithms.

## Why Competitive Coding ?

• You can structure your deliberate practice
routine around it
• It will prepare you well for technical interviews
• You'll get used to working on challenging problems
• It's a way to publicly demonstrate your skills
• It's guaranteed brain exercise
• It's a way to focus on the fundamentals
• It's fun
• It's a way to practice fast coding
• You'll really learn your chosen language
• Competitive programming has an active
community
• Bite-sized programs are convenient to work on
Reading (code) is educational.

## How to get started ?

• Determination / Dedication.
• Choosing your language. Which: The language
should be preferably C++ or Java, the last
preference should be Python.
• Learn the Language
• Understand the Concept of Time and Space
Complexity.
• Learn the Fundamentals of Data Structures and
Algorithms
• Choose a platform to practice (SPOJ, Codechef,
Codeforces, Topcoder, Project Euler.etc)
• Advanced Data Structures and Algorithms
• Practice and do it Regularly

## What you should not do ?

• Don't get Demotivated.
• Not Implementing yourself.
• Do not look into the solution without giving your
best. 
• Try to re-solve the problem which you were
unable to solve in the competetion.
• Only look at solutions after contest ends.
• Talk to people how they are approaching the
problem and learn from them.
• Don't stick to easy problems.

## Important Topics :

• Basic Combinatorial and Number theory
• Sort and Search algorithms
• Hashing
• Number Theory
• Greedy Technique
• Graph Theory
• Disjoint Set Union (Union-find)
• Minimum Spanning Tree
• Segment Tree
• Dynamic programming
• String Algorithms
• Tries, Suffix Tree, Suffix Array.
• Bit-Manipulation - Properties of and, or ,XOR ,
not gates.
• Geometrical and Network Flow Algorithms

## Top Competitions :

• The ACM International Collegiate Programming
Contest (ICPC)
• TopCoder
• Google Code Jam
• The International Conference on Functional
Programming
• Microsoft Imagine Cup
• Hewlett Packard (HP) Codewars
• Facebook Hacker Cup
• CodeChef
• Google Summer of Code
• The International Obfuscated C Code Contest
• International Problem Solving Contest
• Google Hash Code
• Google Kick Start
Công ty Nhà Xinh thiết kế biệt thự đẹp
Published: 2022-04-18 03:54:14

[Công ty Nhà Xinh](https://nhaxinhluxury.com.vn/) là một trong những thương hiệu nổi tiếng 25 năm dẫn đầu trong lĩnh vực thiết kế và thi công xây dựng các công trình biệt thự đẹp, nhà đẹp, nội thất cao cấp tại Hồ Chí Minh và các tỉnh miền Nam. Có nhiều yếu tố khiến Nhà Xinh nhận được sự thành công như ngày hôm nay:

- Tin cậy: Với nhiều năm thành công rực rỡ, Công Ty Nhà Xinh luôn là công ty thiết kế và là nhà thầu đáng được tin cậy tại TP. HCM và các tỉnh lân cận như Đồng Nai, Vũng Tàu, Bình Dương,… trong các hạng mục của hơn 900 công trình các loại Nhà Phố, Biệt thự, Trường học, Spa…
- Cam kết chất lượng: Chúng tôi cam kết không bán thầu, cam kết về chất lượng dịch vụ và thực hiện đúng là cách chúng tôi tạo lòng tin cho khách hàng, và cũng chính như là tạo uy tín cho doanh nghiệp,.
- Hợp Đồng Minh bạch: Giá trị minh bạch của Nhà Xinh không chỉ thể hiện ở sự trung thực và trong sạch trong hoạt động kinh doanh và quản lý tài chính mà còn thể rõ ở việc cung ứng vật tư đúng theo chất lượng tốt nhất.
- Xây Dựng An toàn: Đặt vấn đề an toàn lên hàng đầu, đặc biệt là an toàn lao động đúng theo tiêu chuẩn kỹ thuật thi công nhà cao tầng.
- Tôn trọng khách hàng: Tôn trọng pháp luật, khách hàng, đối tác, cộng đồng và chính các cán bộ công nhân viên của mình.

Website: [https://nhaxinhluxury.com.vn/](https://nhaxinhluxury.com.vn/)
Hotline: 0909 452 109
Email: nhaxinhpro@gmail.com
Địa Chỉ: 215 Nam Kỳ Khởi Nghĩa, Phường Võ Thị Sáu, Quận 3, HCM"
How to sort your package.json dependencies
Tags: npm, node, javascript
Published: 2022-04-18 03:32:34

```bash
npm r -S example; npm r -D example
```

is short hand for `npm remove --save anything` and `npm remove --save-dev whatever`. 
---

Thanks to this [question](https://stackoverflow.com/questions/34438465/is-there-a-way-to-alphabetize-package-json-without-installing-a-package) on Stack Overflow.
Jamie32bsh TikTok Trend, Real Name, Age, Family, Wiki, Biography
Published: 2022-04-18 03:24:43

Jamie32bsh is an American TikTok star and content creator known for his popular dance video to the song “Say it Right” by Nelly Furtado that he recorded in his bathroom mirror. That video gained more than 401 million views on TikTok. 

After going viral he began the TikTok dance trend, and other famous TikTok creators and social media personalities started dueting his dancing video, and this trend started to be sensational. He gained fame through his Jamie32bsh named TikTok account with more than 7.3 million followers. 

[Read more](https://www.howtodolive.com/[](url)2022/04/jamie32bsh-tiktok-trend-real-name-age-family-biography.html)

[For more](https://www.howtodolive.com/)
Quick looking into Dart - Dart Programming
Tags: dart, mobile, beginners, flutter
Published: 2022-04-18 03:21:41

Hello guys.I'm **FlutterWithMe**, this series is first chapter i want to write about Flutter, in the future i'll write more and more cool things about Dart and Flutter, so please let down a like and subcribe for help me have  In this article, we'll spend a little time to take a look into **Dart programming languages**.

So, **What is Dart ?**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v2ctgh8jaeplbt181j01.png)
 
Yeah. Dart is a client-optimized language for developing fast apps on any platform. Dart was created by Google and first time it appeared was October 10, 2011.

First stable version of Dart wasn't **1.0.0**, it was **0.8.10-rev.3.29803**.

In Dart SDK Tools contain these tools that necessary for development applications.

1. **DartVM** - Dart Virtual Machine
2. **dart2js**- Dart to javascript (web use only) for deployable Javascript
3. **dartdevc** - Dart to javascript(web use only) for testing purpose
4. **dartfmt** - Tools formatter dart code
5. **dartanalyzer** - Tools help analyze warning and error code that are specified in dart language. DartPad and IDEs such as Android Studio or VS Code are use the same analysis engine that **dartanalyzer** provide
6. **DartDoc** - The API documentation generator (using for write package mostly)
7. **pub** - Dart package manager (it's like npm). We can use pub tools for manage Dart packages.

But,what **fast apps** that dart mention ? I think what Google mention about "fast" here is dart's speed. The reason is that dart can compile at both **Run-Time (JIT)** and **Ahead-Of-Time (AOT)**.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sa1xrfg4xwhy5p8jwblj.png)
 
The difference between JIT and AOT: 
- In JIT (Just in time) or **development mode**, Flutter provide **hot-reload and hot-restart** that help you see UI changes when you change on code. With that is lots of tools that help you debug.
- In AOT (Ahead of time) or **release mode**, your code is **compiled to native code** for **better performance**, **minimum app size** and remove other stuff that useful in dev mode.

I think that's enough for a little quick looking. Thanks you guys for reading. And please let me know what you think about my series and this article. Hope my series will help you when learning Flutter.
Laravel whereMonth and whereYear Example
Tags: laravel, php, mysql, wheremonth
Published: 2022-04-18 03:12:52

In this tutorial, we will see laravel whereMonth and whereYear example. whereMonth and whereYear are used to get month and year data from specific date field columns. So, here we will use whereMonth() and whereYear() in laravel 8.

The whereMonth method is used to compare a column's value against a specific month. whereMonth() will help to get specific month records from date.

So, let's see laravel whereMonth and whereYear example, date function in laravel 8, whereMonth and whereYear in laravel 6, laravel 7 and laravel 8.
whereMonth()

Example :

```
$users = DB::table('users')
         ->whereMonth('created_at', '12')
         ->get();
```

In this example, we will get results from the created_at column which one has month is 12.

--- 

> **_[Read Also : Laravel whereDate and whereDay Example](https://techsolutionstuff.com/post/laravel-wheredate-and-whereday-example)_**

---
 
whereYear()

The whereYear method is used to compare a column's value against a specific year, whereYear() will help to get only specific year records from your timestamps fields

Example :

```
$users = DB::table('users')
         ->whereYear('created_at', '2021')
         ->get();
```

In this example, you will get data from the created_at column which contain 2021 year.

---

You might also like :

- **_[Read Also : How To Add Summernote Editor In Laravel 8](https://techsolutionstuff.com/post/how-to-add-summernote-editor-in-laravel-8)_**

- **_[Read Also : Copy To Clipboard JQuery Example](https://techsolutionstuff.com/post/copy-to-clipboard-jquery-example)_**

- **_[Read Also : Carbon Add Days To Date In Laravel](https://techsolutionstuff.com/post/carbon-add-days-to-date-in-laravel)_**
SNAKE GRID
Published: 2022-04-18 03:11:20


![css grid logo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cdhgikxj1zghayd9leqq.png)
As I continue to work on building out the snake game. I also get my first taste of using CSS Grid. 

## Why CSS grid?

![snake game logo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fw17uln935pu4z9o8mfc.png)
What makes grid work for this game is that. We can set the game board up with equal columns and rows.
I set my board up to have 21 equal columns and 21 rows.

## Mapping out the grid? 

![x y coordinates](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xdzwk80lp8nkw7q4cbzz.png)
Using X, Y coordinates to help track the movement of my snake but also set up random location for the food to pop up on the grid. 
X being the horizontal and Y being the vertical. 

While learning to play around with grid it also helps with building function to test user input for direction and other things. 

While I'm not master or expert the experience of using grid has opened up a door to try some new things. 

Hope you keep pushing into some new areas. If you haven’t played around with CSS grid I encourage you to try it and share you experience with others. 

Happy Coding 👨🏿‍💻👨🏻‍💻🧑🏾‍💻👩‍💻
How to get exact filename from a url in python ?
Tags: beginners, python
Published: 2022-04-18 03:03:41

I am trying to download a file from a direct download link to a image. 

How to get the filename from a url like this 
https://unsplash.com/photos/Qcefx5xENeA/download?ixid=MnwxMjA3fDB8MXxzZWFyY2h8MTZ8fGFuaW1lfGVufDB8fHx8MTY1MDE2NjYwOQ&force=true
Is it possible to have Editor's picks in Dev.to?
Tags: meta, devto
Published: 2022-04-18 02:46:10

This will be my first meta question. So I hope I can get some discussion going on.

So I would consider myself a beginner with respect to programming. I do understand the dynamics of a growing community like Dev.to. Been part of many communities with respect to Linux and OSS communities over the years. So I think I understand it partially at least. But in the last one year I have increased my presence here. So I was wondering if it possible to have editor's picks.

## Why?

- The quality vs quantity issue keeps coming up in dev.to. As a beginner I hope to reach the levels of experienced devs who write here. So getting familiar with the topics is a good idea for advanced topics. 
- Beginners and intermediate programmers could know what the advanced topics are to begin with. Learning the unknown unknowns before known unknowns. Currently I don't know what advanced topics should I focus or keep a tab on for the future. Editor's picks could help.
- To appeal to programmers with experience so that their advanced topics will be heard. I know that courses and materials on advanced topics are hard to find on tech industry in general. This could be a good solution which Dev.to can do.
- As a community grows it is harder to get noticed even when your material is amazing. Posts written by beginners/intermediate/experienced folks could be ignored. Editor's picks could make unique good posts from all levels more visible. So that they are NOT lost in the crowd.
- For posts on quantity vs quality issues, I have seen mods and dev.to folks acknowledging the problem. Partly at least. As per past discussions on similar topics - [Link1](https://dev.to/mindplay/its-impossible-to-get-a-voice-in-here-4aop), [Link2](https://dev.to/peerreynders/comment/1mb52).
- No more spam and promo posts could be a good byproduct that can come out of this.

## We already have weekly top posts
Top posts are based on **traffic** for the most part as I know it. Please do correct me if I am wrong. Removing the traffic metric completely is important. As the community grows, the share of beginner programmers (like me) will increase. This means the intermediate/experienced programmers are a minority. Or NOT the majority at least. So traffic kind of end up being irrelevant. Quality > quantity.

Google play store is a good example of editor's picks. Irrespective of how much algorithm does, I still look at editor's picks and find some gems. Maybe we can replicate it here?

## Backstage

I do understand this could mean heavy work on the dev.to team. Maybe over a period more intermediate/experienced devs can lend a hand? I am not sure how beginners can help with intermediate/advanced topics. This part is the most unclear part to me.

I do think this is better than missing good writers and dev.to members to other platforms. I don't know how hard it is. I guess I haven't thanked Dev.to folks until now. So thanks Dev.to team for the cool work and community. And if it not clear yet, this is not an angry post. :)
Swift Features: Static URL
Tags: swift, 100daysofcode, ios, tutorial
Published: 2022-04-18 02:44:30

Tired of using URL(string: "url")!  for static urls? 💡Make the URL match ExpressibleByStringLiteral and you can just use "url".

```
extension URL: ExpressibleByStringLiteral {
    // By using 'StaticString' we disable string interpolation, for safety
    public init(stringLiteral value: StaticString) {
        self = URL(string: "\(value)").require(hint: "Invalid URL string literal: \(value)")
    }
}
```

```
// We can now define URLs using static string literals 🎉
let url: URL = "https://www.apple.com"
let task = URLSession.shared.dataTask(with: "https://www.apple.com")`
```

```
// In Swift 3 or earlier, you also have to implement 2 additional initializers
extension URL {
    public init(extendedGraphemeClusterLiteral value: StaticString) {
        self.init(stringLiteral: value)
    }

public init(unicodeScalarLiteral value: StaticString) {
        self.init(stringLiteral: value)
    }
}
```