teleren/devto huggingface dataset:
🔥Building Array Data Structure in python
Tags: tutorial, computerscience
Published: 2023-02-14 07:52:03

###What is list?
- A list in Python is a built-in(comes with python itself) data structure that stores a collection of values of any data type.
- Lists are ordered, mutable (i.e., can be changed), and can contain elements of different data types.

for example:-
```
grocery = ["Sugar:1kg", "Tooth paste : 1", "masala:1kg"]
person = ["Ritik", "patna", 8, 56.32]
```

Here are some common operations and examples of how to use lists in Python:

###How to use?
###Creating a list:

```
numbers = [10, 20, 30]
# index =  0   1    2
```
###Accessing list elements using an index:
```
print(numbers[0]) # Output: 10
print(numbers[1]) # Output: 20
```
###Accessing list elements using an -ve index:
```
print(numbers[-1]) # Output: 30
print(numbers[-2]) # Output: 10
```
How to verify an object is empty object with Jest (extended)
Tags: jest, javascript, testing, codever
Published: 2023-02-14 07:46:18

First install [**jest-extended**](https://jest-extended.jestcommunity.dev) with the `npm install --save-dev jest-extended` command and use the `toBeEmpty` assertion as in the following example:

```javascript
const { toBeEmpty } = require('jest-extended');
expect.extend({ toBeEmpty });

describe('setFulltextSearchTermsFilter', () => {
  test('returns filter without $text when fulltextSearchTerms is empty', () => {
    const fulltextSearchTerms = [];
    const filter = {};
    const searchInclude = 'any';
    expect(searchUtils.setFulltextSearchTermsFilter(fulltextSearchTerms, filter, searchInclude)).toBeEmpty();
  });
});
```

Use `.toBeEmpty` when checking if a `String` `''`, `Array` `[]`, `Object` `{}`, or `Iterable` is empty. Because `toBeEmpty` supports checking for emptiness of Iterables, you can use it to check whether a `Map`, or `Set` is empty, as well as checking that a generator yields no values.

<hr/>
**Project**: [`codever`](https://github.com/CodeverDotDev/codever) - **File**:  `search.utils.spec.js`
<hr/>

<span style="font-size: 0.9rem">
  <strong>Reference - </strong>
  <a href="https://jest-extended.jestcommunity.dev/docs/matchers/tobeempty" target="_blank" style="font-weight: lighter">
     https://jest-extended.jestcommunity.dev/docs/matchers/tobeempty
  </a>
</span>

<hr/>

> Shared with :heart: from [**Codever**](https://www.codever.dev/snippets/63eb2e2488deee44f7554290/details). Use :point_right: [**copy to mine**](https://www.codever.dev/snippets/63eb2e2488deee44f7554290/details) functionality to add it to your personal snippets collection. 
> 
> **Codever** is open source on [Github](https://github.com/CodeverDotDev)⭐🙏
neovim: the basics
Published: 2023-02-14 07:45:56


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

**introduction**
welcome to neovim! It is a super-set of vim and makes a handy editor for any project. I use neovim because of the fact my operating system is linux. This means most of the code i run is in a terminal and neovim is perfect for that!

**entering**
first of all we need to enter the editor. We can enter vim with: `vim` and neovim: `nvim`. you will be greeted with this lovely text editor:

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


**insert mode**
once you have entered the editor typing will not do anything. You can type by pressing the key i. To leave insert mode (so you can run commands) press esc.

**exiting**
then once we've typed code we need to exit the editor. We can do this by doing: `:q` however this will only work if you have not typed anything. To leave neovim without saving do: `:q!`. To save and exit vim you can do: `:wq` and you can save it without exiting by doing: `:w`

**running code directly inside of vim**
here i have some code written in neovim:

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

and i can run it without leaving neovim. What allows me to do this is the fact by doing `:!` you can run bash code inside neovim. this means to run my c++ code i can just do: `:! g++ main.cpp` and run it with: `:! ./a.out` You can do this with any programming language as long as you have it installed on your computer.

**goodbye**
enjoy your knowledge and have a good day
Strong and Weak typing
Tags: webdev, programming, beginners, computerscience
Published: 2023-02-14 07:44:21

Programming language terminology can be confusing and difficult to understand, especially for those new to the field. The terms "strong" and "weak" are among the most commonly used and yet are also some of the most ambiguous and ill-defined. This is because they are often used to describe different aspects of a language, ranging from the language's behavior to its syntax.

For instance, "strong" can refer to a language's static behavior, where the type of a variable is determined at compile-time rather than runtime. This means that the type of a variable cannot be changed once it has been declared. "Weak" typing, on the other hand, allows for more flexibility, as the type of a variable can be changed at any time.

Alternatively, "strong" can also refer to a language's adherence to type rules, meaning that it has strict rules about what types can be used in specific situations. In contrast, "weak" typing allows for more implicit conversions, where the language automatically converts one data type to another without any explicit code from the programmer.

"Strong" and "weak" can also be used to describe a language's memory safety. A language that is "strong" in this sense is one that ensures that the programmer cannot access memory that has not been explicitly allocated, whereas a "weak" language may allow for such access, leading to memory leaks and other issues.

While all of these definitions are valid, the problem with "strong" and "weak" is that they are often used without clear context or definition. For example, someone might describe a language as "weak" without specifying whether they are referring to the language's type rules or its memory safety, leading to confusion and misunderstanding.

As a result, it is better to avoid using "strong" and "weak" altogether and instead describe the exact behavior in question. This can help to ensure that everyone involved in a project is on the same page and understands exactly what is meant by a particular piece of code or feature. By avoiding ambiguous terminology and focusing on clear, precise language, programmers can work together more efficiently and effectively.
My Love Affair with Tailwind: A UI Dev's Perspective
Tags: tailwindcss, webdev, programming, firstpost
Published: 2023-02-14 07:39:36

👋 Hi there! I'm a UI developer with a passion for creating beautiful and responsive designs. And I've got a short story to share with you all about how I discovered the magic of Tailwind CSS at work.

💡 So, here I was in a meeting with JD, who's an AI enthusiast, and Sanjay. JD asked us if we were ready to create a quick prototype to showcase the abilities of GPT to our organization. Without hesitation, we eagerly said yes!

💻 So, we hit the ground running and started coding. But, as a UI dev, I didn't want to skimp on design just because it was a prototype. So, I reached for my trusty SCSS... until Sanjay suggested we try Tailwind instead.

🤯 And let me tell you, that was a game-changer. The setup was a breeze, and before we knew it, we had a stunning UI up and running in just 10 minutes! I was blown away by the power of creating applications with Tailwind.

😍 Now, whether it's a prototype, a fully-fledged project, or an open-source project, Tailwind has a special place in my project folder. It's just that good.

🔥 Not only does Tailwind have powerful CSS capabilities, but it also includes UI components that can significantly speed up a developer's workflow. When combined with React, the possibilities are endless.

🤩 Tailwind is not just a tool for aesthetics, it's also designed for performance. Its features like speed, efficiency, customizability, responsiveness, consistency, and accessibility make it a must-have for any developer looking to streamline their development process.

💥 Give Tailwind a try. Trust me, you won't regret it!

🔗 Check out Tailwind CSS at [tailwindcss.com](https://tailwindcss.com/) and Tailwind UI at [tailwindui.com](https://tailwindui.com/) for more information.
'==' vs '===' in JavaScript
Published: 2023-02-14 07:36:30

<p>As a developer many times, we see other developers using <strong>Strict Equality Operator(===)</strong> instead of <strong>Abstract Equality Operator(==)</strong> and wonder if there is really any major difference between the two? Let's deep dive in to see what's beneath them.</p>
<p>Strict Equality Operator(===) behaves similarly to Abstract Equality Operator(==) except no type conversion is done and the types must be the same to be considered equal.</p>
<p>Abstract Equality Operator(==) will compare for equality after doing any necessary type conversions. </p>
<p>The "===" operator will <strong>NOT</strong> do any type conversions, so if the two values are not of the Same Type "===" will simply return false.</p>
<pre><code>
<span class="hljs-string">'23'</span> <span class="hljs-operator">=</span><span class="hljs-operator">=</span> <span class="hljs-number">23</span>       <span class="hljs-comment">// true</span>
<span class="hljs-string">'23'</span> <span class="hljs-operator">=</span><span class="hljs-operator">=</span><span class="hljs-operator">=</span> <span class="hljs-number">23</span>      <span class="hljs-comment">// false</span>

<span class="hljs-string">" "</span> <span class="hljs-operator">=</span><span class="hljs-operator">=</span> <span class="hljs-number">0</span>            <span class="hljs-comment">// true</span>
<span class="hljs-string">" "</span> <span class="hljs-operator">=</span><span class="hljs-operator">=</span><span class="hljs-operator">=</span> <span class="hljs-number">0</span>            <span class="hljs-comment">// false</span>

<span class="hljs-number">0</span> <span class="hljs-operator">=</span><span class="hljs-operator">=</span> <span class="hljs-literal">false</span>        <span class="hljs-comment">// true</span>
<span class="hljs-number">0</span> <span class="hljs-operator">=</span><span class="hljs-operator">=</span><span class="hljs-operator">=</span> <span class="hljs-literal">false</span>       <span class="hljs-comment">// false</span>

null <span class="hljs-operator">=</span><span class="hljs-operator">=</span> undefined  <span class="hljs-comment">// true</span>
null <span class="hljs-operator">=</span><span class="hljs-operator">=</span><span class="hljs-operator">=</span> undefined  <span class="hljs-comment">// false</span>
</code></pre><blockquote>
<p>Remember devs, if you want to compare equality between two values without any unnecessary type conversion, use Strict Equality Operator(===).</p>
</blockquote>
<p>I hope now you know the difference between the two operators.</p>
<p>Happy Coding!</p>
<p>Sources: </p>
<ol>
<li>MDN Web Docs</li>
<li>StackOverflow</li>
</ol>
</br><p style="color:#757CF9;">This article is published w/ <a target="_blank" href="https://scattr.io?ref=dev">Scattr  ↗️</a></p>
OOP, OOD, and OOA in Python Intro
Tags: python, oop, ood
Published: 2023-02-14 07:32:58

The definition of an object is no different from an object in real life: a tangible thing one can touch, feel, sense, and manipulate.
Things are different in programming. Objects might not be tangible, and cannot be sensed or felt, but they are models that can do certain things and vice-versa.
Short of it, __An object is a collection of data__.

Now that we know what an object is, what about _object-oriented?_
Breaking it down (because that's what we mostly do), _oriented_, according to the dictionary means _direct towards_. Piecing both the definitions of an _object_ and _oriented_, we can say that **Object-oriented programming means writing code directed towards moving objects**

<iframe src='https://gfycat.com/ifr/EllipticalFluidLemur' frameborder='0' scrolling='no' allowfullscreen width='640' height='432'></iframe><p><a href="https://gfycat.com/discover/confused-gifs"></a> <a href="https://gfycat.com/ellipticalfluidlemur-angry-birds-2-hatchlings-confused-observe">via Gfycat</a></p>

Yeah... doesn't make sense, I get it.
The less confusing definition is below;

**Object-oriented programming (OOP) is seen as the process of converting a design into a
working program or application that does what it is told to do.**

There are more concepts to Object-oriented, like _object-oriented design_ and _object-oriented analysis_. Don't worry, they are still object-oriented.

## Object-oriented Paradigms
**Object-oriented analysis(OOA)**:
This is the process of looking at a problem and identifying the objects and the interactions between the said objects.
This stage is about what needs to be done.

Example;
> As a food scientist, I need a website to help users know how much to eat without it becoming a health risk to themselves.

As a visitor, here is what I would like or think is essential for visitors.
Each necessity a visitor wants is highlighted in **bold** text to signify that it is an **object**, and the actions of the visitors are in *italics*:
- *browse* **food choice**
- *upload* **food decisions for the day/week**
- *see* **recommended foods**

You get the idea...
Once analysis/research has been carried out, we move on to the next stage.

**Object-oriented design (OOD)**:
This is the process of taking the results of the analysis above and implementing them. It's at this point does the programmer comes up with wicked-looking names for the objects, defines their expected behavior, and specifies certain behaviors of the objects. Kinda like them team meetings I hear about, starts good, but never end well. Ah well, moving on.

Last is __Object-oriented Programming__ (scroll up for the definition if you missed it)... aaand we are done (not) with this bit. It looks confusing (trust me, I got lost learning for the first time) but over time, you'll get over it. On that note, look out for the next part!
Improving Performance of Multidimensional Arrays in C#
Tags: csharp, dotnet, array, performance
Published: 2023-02-14 07:31:39

C# has support for multidimensional arrays, which are useful for representing elements in a 2D or 3D grid:

```csharp
int[,] twoDimensions = new int[20, 20];
int[,,] threeDimensions = new int[20, 20, 20];
```

Under the covers, these arrays are allocated as a single-dimensional array:

```csharp
// Your code
int[,] twoDimensions = new int[20, 20];

// Under the covers:
int[] actualArray = new int[20 * 20];
```

When accessing a multidimensional array, C# performs bounds checks on each dimension, then converts each separate access value (x, y, z, etc) into a single access value. [Reference source](https://referencesource.microsoft.com/#mscorlib/system/array.cs).

```csharp
T[] data = new T[];
int[] lengths = new int[3];

T Get(int x, int y, int z)
{
    // Bounds checks
    if (x < 0 || x >= lengths[0])
        throw new OutOfRangeException(...);
        
    if (y < 0 || y >= lengths[1])
        throw new OutOfRangeException(...);
        
    if (z < 0 || z >= lengths[2])
        throw new OutOfRangeException(...);
        
    // Convert 3D access to a 1D access
    var access = x + y * lengths[0] + z * lengths[0] * lengths[1];    
    return data[access];
}
```

Converting to a single-dimensional array is straightforward and can reduce access speeds by 37-47% (see the the benchmarks below).

```csharp
// 2D array example
int[,] twoDimensions = new int[20, 20];
int randomValue = twoDimensions[6, 6];

// 1D array example
int[] oneDimension = new int[20 * 20];
int randomValue = oneDimension[6 + 6 * 20];
```

Arrays with dimensions that are a power of 2 can be optimised further by replacing additions and multiplications with bitwise operators and bit-shifts:
```csharp
int[] oneDimension = new int[32 * 32];
int randomValue = oneDimension[6 | (6 << 5)];
```

Here are the results of accessing 1,000,000 random items inside a 256x256x256 array:

![Benchmark results of accessing 1,000,000 random items inside a 256x256x256 array](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9legtzc2sa102ddli7eg.png)



For more information on the faster unsafe approach using unmanaged memory, check out [this article](https://dev.to/vercidium/using-nativememory-in-net-1o2j).
A Guide for Aspiring Developers: How to Prepare, Apply and Find Opportunities
Tags: hiring, jobs, dev, placement
Published: 2023-02-14 07:30:23



```
The one who is best fit in eyes of a recruiter, isn't a tailor made persona, but a more than enough of an asset to teams/company.
```
As a recently graduated student, entering the job market can be an intimidating and daunting task, especially for aspiring developers. With the rapidly evolving tech industry and fierce competition for jobs, it is essential to develop a positive mindset and a proactive approach to stand out and secure opportunities.

Here are some tips on how to prepare, apply and find opportunities to help kick-start your career as an aspiring developer.

## 1. Develop a growth mindset

   The first step to success as an aspiring developer is to adopt a growth mindset. This means believing that your abilities and talents can be developed through hard work, dedication and continuous learning. Embrace failure as a learning opportunity, and always seek to improve and expand your skill set.

## 2. Focus on building a strong portfolio
   In the tech industry, a strong portfolio is critical to showcase your skills and expertise to potential employers. Build a robust portfolio of projects that demonstrate your technical proficiency and creativity. Collaborate with peers, participate in hackathons and open-source projects, and build your own projects to add to your portfolio.

## 3. Stay updated with industry trends and technologies
   The tech industry is constantly evolving, and it is essential to stay up-to-date with emerging technologies, tools and practices. Attend tech conferences, meetups and webinars, and follow industry leaders and blogs to stay informed about the latest developments in the field.

## 4. Network and collaborate
   Networking is crucial in the tech industry to gain visibility and build connections. Attend job fairs, meetups, and networking events to connect with potential employers and peers. Collaborate with others on projects and contribute to open-source communities to gain visibility and build your reputation.

## 5. Proactively apply and seek opportunities
   When it comes to job hunting, don't wait for opportunities to come to you. Be proactive and seek out job opportunities through job boards, LinkedIn and other job search platforms. Build your resume and tailor your applications to the specific job requirements to stand out. Reach out to recruiters, peers and mentors for advice and guidance.

In conclusion, the tech industry offers immense opportunities for aspiring developers, but it requires a proactive approach and a positive mindset to succeed. Focus on building a strong portfolio, staying updated with industry trends, networking and collaborating with others, and proactively seeking opportunities. With dedication, hard work, and continuous learning, you can kick-start your career as an aspiring developer and achieve your goals.

Feel free to reach out for help at [IG/@csesingh](https://www.instagram.com/csesingh/), 
and follow for more similar articles :)

Peace and Good Vibes! :D
Clipping Path Services
Tags: clippingpath, photoedit
Published: 2023-02-14 07:16:34

Clipping path, also known as deep etch or cut-out, is a photo editing technique used to isolate a specific part of an image from its background. It involves creating a closed path or shape around the object in an image that needs to be separated, essentially creating a mask that can be used to hide the background or replace it with a different one. Clipping paths are commonly used in e-commerce and product photography, as well as in graphic design to remove the background of an image and make it more versatile for use in various contexts. This technique is typically performed using image editing software like Adobe Photoshop and requires a high level of skill and attention to detail.
LIBA Weight Loss - Fat Loss Results, Ingredients, Uses, Price, Scam Or Legit?
Tags: webdev, javascript, beginners, programming
Published: 2023-02-14 07:11:27

Fat burner reviews in LIBA Weight Loss many cases are sparse on results because the writer hasn't actually used the process. I've been on it for month now and also have lost an entire inch associated with my hips. This is incredible because I typically lose in the rate of a half inch per week which to become good. So fat may doubling final results of weight reducing that I am accustomed to! So far so good but I've 11more weeks to go and then my 3 months will be one within the best fat burning capacity reviews anyone could have ever article.
https://www.exposedmagazine.co.uk/features/liba-weight-loss-dragons-den-pills-uk-scam-or-legit-liba-vs-figur-which-one-should-you-buy/
https://www.scoop.it/topic/liba-weight-loss-pills-by-liba-weight-loss-6
https://www.facebook.com/events/581238390686674
https://twitter.com/libaweightinfo
https://www.sportsblog.com/libaweightinfo/
https://tautaruna.nra.lv/forums/tema/49522-liba-weight-loss-fat-loss-reviews-price-results-benefits-where-to-buy/
ConversAI - Your Personal AI Chat Assistant
Tags: socialmedia, chat, ai
Published: 2023-02-14 07:08:29

{% embed https://www.youtube.com/watch?v=v4VOsyWRfC4 %}

🧠 Introducing the ConversAI Chrome Extension: the ultimate tool for streamlining your online communication!

💬 Say goodbye to time-consuming email and tweet replies, and hello to lightning-fast, AI-assisted responses.

🤖 With advanced AI technology, ConversAI quickly generates intelligent and eloquent answers to your messages.

👍 Set the tone of your response and choose from a variety of options, from positive and negative, to curious or witty!

💻 Effortlessly respond to emails and tweets with just a few clicks – right from your browser!

💡 Save time and increase your productivity, so you can focus on engaging in meaningful conversations.

✅ Start using ConversAI now and experience the power of AI in your online communication!

To sign up or learn more about ConversAI visit out website https://conversai.co
DSA - Binary Search
Tags: java, algorithms
Published: 2023-02-14 06:54:15

**Binary search**
It's an algorithm which is optimized way to find a element in array.
let's take an example array which is sorted.
`arr[] = {1,2,3,4,5,6};`

Here target is to find 5.

first it will take no of index here 5 after it will take half of the index = 2 the element in 2 index is 3. 3 is lesser then 5 again from index 3 to 5 it will take the half. If the element 4 is greater than target it will search from index 0 to 2. Now index is 4 and element is 5. and 5 is equal to target and it prints the output.

**Example**

`arr[] = {1,5,7,9,10,15};  target = 10;`

1st - index = 5 
Start = 0 end= 5
binary search = 0+5/2 -> 2(index)

Value in index 2 is 7 and 7 is lesser than target.

2nd - `{9,10,15}`
Start = 3 end = 5
binary = 3+5/2 -> 4(index)

Value in index 4 is 10 and its equal to target.

Now output is index 4.

Time complexity -

Best case - O(1)  //size does not matter if element is found in first index 
Worst Case - logN.

```
public class BinarySearch {
	public static void main(String[] args) {
		int arr[] = {1,2,3,5,6,7,9,10};
		int target = 6;
		int ans =binarySearch(arr,target);
		System.out.println(ans);
	}

	static int binarySearch(int[] arr, int target) {
		int start =0;
		int end = arr.length-1;
		while(start <= end) {
			int mid = start+(end-start)/2;
		if(target < arr[mid]) {
			end = mid-1;
		}else if(target > arr[mid]) {
			start = mid+1;
		}else {
			return mid;
		}
		}
		return -1;
	}
}
```
Output - 4