teleren/devto huggingface dataset:
The Numpy
Published: 2022-11-21 17:33:49

**What we do with Numpy?**

The biggest reason behind the popularity of Python programming language is the huge number of built-in libraries it has. Now the question comes to your mind, what is a library? In computer programming a library refers to a collection of some pre-written functionalities which can be reused in any Python code. Python has around 137000 built-in libraries. Numpy(can be written also as NumPy or numpy)is one of the most popular library of Python. Python programmers mainly use this library to work with array,linear algebra, fourier transform and many more mathematical operations.


**How to use Numpy**

Before using, the Numpy library needs to be installed in the virtual environment we are working in. You can install numpy just by writing "pip install numpy" in the terminal/console.
Then you have to import numpy by writing "import numpy" on the top of your Python code.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0c7tzt1hy3ttrkv7ixmx.jpg)
Or you can import this library as another name(programmers are too lazy to type this five letter word so they import numpy as np).


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


**How to work with Arrays using Numpy**

An array is a Data structure where large number of data can be stored inside a single named space. Arrays can be both one and multidimensional. We can create and panipulate arrays using Numpy library. "numpy.array()" or "np.array()" can be used to create an array.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/22r2zntddugdrcbxum6s.jpg)
This is a one dimensional array. A one dimensional array can be considered as a Python list. You can do indexing,slicing, and assign a new value to the one dimensional array just the way you do it with a list.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/aav7w685ypto12j6uw6e.jpg)
You can check the shape(how many rows and columns are there), the size(how many elements does the array have) or reshape a multinational array with the shape,size attribute and reshape() method.

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




**random.choice and random.randint**

The random.randint(lower limit,upper limit) is used(random and randint are methods) to generate random integers between the given range.

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

On the otherhand random.choice(sequence)
generates a random value from a given sequence(list,tuple,string etc.).

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5y9wlotd5c6nx0nxh1dv.jpg)
Understanding Project Management
Tags: react, ruby, flatiron
Published: 2022-11-21 17:23:14

I, like most people, love the feeling of coming up with a project idea. Whether it be the project as a whole or the process of creating an idea chart with all the deliverables being written out, being able to plan out everything can be extremely satisfying. What's not as fun is the execution of the plan, especially when you're working with a group. Once the planning phase of the project is done, it can be difficult to determine what gets done first and (if you're in a group) who is doing what. In my phase 3 project, we encountered several of these types of issues. 
 
  Just like in most group projects, coding projects take lots of time and communication so it's important to be honest to other group members about what your capability is in regards to the deliverables required for that project. Additionally, it is even MORE important to have patience and respect with other members of the project, even when things are not going according to plan. Communicating frustrations or confusions effectively is the key to a healthy team dynamic. Take this block of code for example:

```
require 'pry'
class ApplicationController < Sinatra::Base
  set :default_content_type, 'application/json'
  
  # Add your routes here
  get "/post" do
    post = Post.all
    post.to_json
  end

 get '/posts/:id' do
  post = Post.find_by(id: params[:id])
  post.to_json
 end


  patch  "/posts/:id" do
    post = Post.find(params[:id])
  post.update(
    like_button: params[:like_button]
  )
  post.to_json
  end 

  delete  "/posts/:id" do 
      post = Post.find(params[:id])
      post.destroy
      post.to_json
    end

  post '/posts' do
    post = Post.create(
      phase: params[:phase],
      topic: params[:topic],
      location: params[:location],
      thread_post: params[:thread_post]
    )
    post.to_json
  end

  private
  # def post_params

  # end
end
```
 This is the controller file we used to connect our back and front end together. While it really isn't a lot of code, the logic behind understanding how this sends and receives responses to and from the front end was essential to get our project running. Because of this, it was just as essential to make sure I knew exactly what my group member who was in charge of the back end was doing so I could adjust the front end accordingly. While we did not experience any huge merge conflicts, other groups around us did even some resulting in a deletion of important code. Simple solutions, such as being in the same room as your group while working, could have prevented these merge conflicts. Learning from mistakes is a necessary step in becoming successful in any career path, but proper and effective communication is what will truly set one apart from the rest.
React Props
Tags: react, props, beginners, tutorial
Published: 2022-11-21 17:16:06

Now, coming into React I was super excited to see what it had in store for me but that excitement quickly fell apart when I found out about the FIRST topic, props. Props is just short for properties and props in React are used as a way to pass information from an object between React components. An example of how this is done is as follows: 
```
COMPONENT 1:
function Name() {
const Name = "Calvin"
  return <Introduction name={Name} />;
}

COMPONENT 2:
function Introduction( {name} )
return <div>Hello, my name is {name}!</div>;
```
This method is pretty cool because you can pass the props down from component to component, changing it along the way to fit your needs. This is just one method of passing props that requires specific pieces of information to be passed which means it isn't flexible. To do that you'd have to write props as such:
```
COMPONENT 1:
function Person() {
const Name = {userInput}
  return <Introduction name={Name} />;
COMPONENT 2:
function Introduction( {name} ) {
  return <div>Hello, my name is {name}!</div>;
```
As you can see, you'd have to make the prop a variable of some sort and find way to have it show user input with something such as a search bar. Now, the name that you give the prop after you refer to the component you want to pass it to doesn't matter, all that matters is that in the curly brackets you have the name of the data that you want to pass to it.

One thing that actually took me a long time to understand for some reason is that props DON'T have to have the word props, they can be whatever word you want. You just have to refer to them as that set name. I'm not sure why it took me so long to figure this out but no amount of Googling helped me figure that out until I saw one example that didn't have the word props and used a relevant word instead. I specifically hope that this cleared up any confusions with the naming of props.
Video: Accelerate Transformer inference on GPU with Optimum and Better Transformer
Tags: pytorch, transformers, optimization, mlops
Published: 2022-11-28 18:34:46

---
title: Video: Accelerate Transformer inference on GPU with Optimum and Better Transformer
published: true
date: 2022-11-21 17:08:35 UTC
tags: pytorch,transformers,optimization,mlops
canonical_url: https://julsimon.medium.com/video-accelerate-transformer-inference-on-gpu-with-optimum-and-better-transformer-89f76f150337
---

In this video, I show you how to accelerate Transformer inference with Optimum, an open-source library by Hugging Face, and Better Transformer, a PyTorch extension available since PyTorch 1.12.

{% youtube APok0qcWYyY %}

Using an AWS instance equipped with an NVIDIA V100 GPU, I start from a couple of models that I previously fine-tuned: a DistilBERT model for text classification and a Vision Transformer model for image classification. I first benchmark the original models, then I use Optimum and Better Transformer to optimize them with a single line of code, and I benchmark them again. This simple process delivers a 20–30% percent speedup with no accuracy drop!
[EASY] How to center an object or Image using HTML and CSS flex | IT Rebels
Tags: html, css, codenewbie, beginners
Published: 2022-11-21 17:03:52

{% embed https://youtu.be/p1-aiCWHW4Y %}

## How to center an element horizontally and vertically
Flexbox method
```css
    display: -webkit-flexbox;
    display: -ms-flexbox;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-align: center;
    -ms-flex-align: center;
    -webkit-align-items: center;
    align-items: center;
    justify-content: center;
```
Dockerized React & Django - Free Sample Project
Tags: webdev, docker, react, django
Published: 2022-11-21 16:48:02

---
title: Dockerized React & Django - Free Sample Project
published: true
description: Open-Source sample that Dockerize Django and React together. The design used is Horizon, a popular design styled with Chakra.
tags: webdev, docker, react, django
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zlo6eyt1qassodcrjdeb.jpg
canonical_url: https://blog.appseed.us/dockerize-react-django-free-sample/
---
Hello Coders!

This article presents an open-source full-stack app built with [React & Django](https://blog.appseed.us/dockerize-react-django-free-sample/) bundled together under the same **Docker** setup. Once the sources are downloaded locally, if Docker is present, the product can be started with minimal effort, and all changes made on the sources for both components (`React & Django`) are pushed to the Docker container instantly. `Thanks for reading!`

- 👉 [Django & Docker Sample](https://github.com/app-generator/sample-docker-django-react) - `sources` published on GitHub
- 👉 [LIVE Demo](https://react-horizon-ui-chakra.appseed-srv1.com/#/auth/sign-in/default) - of the mentioned product

Being released the `MIT License`, the **Docker** scripts provided in this sample can be used or incorporated into other projects or simply used for eLearning activities. 

![Django & React - Open-Source Dockerized Sample ](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h4fa5wo1by8v7st124u3.png)

---

## ✨ How to use the project

Before using the project, we need to have Docker properly installed and usable. If we're not sure about this fact, we can easily check by typing `docker --version` in the terminal. In my case, the output is this:

```bash
$ docker --version
>>> Docker version 20.10.14, build a224086
```

If the output looks good, we can move on and start the mentioned project using `Docker`.

> 👉 **Step 1** - `Download the code`

```bash
$ git clone https://github.com/app-generator/sample-docker-django-react.git
$ cd sample-docker-django-react
```

---

> 👉 **Step 2** - Start the `APP` in Docker 

```bash
$ docker-compose up --build 
```

At this point, the app runs, but the database is not migrated yet.

---

> 👉 **Step 3** - `Migrate DB`

```bash
$ docker-compose run --rm appseed-app python manage.py makemigrations
$ docker-compose run --rm appseed-app python manage.py migrate
``` 

---

> 👉 **Step 4** - `Access the APP`

Here, the app is fully usable, we can register new users, authenticate and access the private pages just like in this [LIVE Demo](https://react-horizon-ui-chakra.appseed-srv1.com/#/auth/sign-in/default). 

![Dokerized Django & React - Dashboard Page.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yya070ruar5bx4zqyfec.png)

---

> `Thanks for reading!` For more resources, please access:

- 🚀 Free [support](https://appseed.us/support/) provided by AppSeed (email & Discord)
- 👉 More [free apps](https://appseed.us/apps/open-source/) crafted in Flask, Django, and [React](https://appseed.us/apps/react/)
Discord vs. Slack: Which is right for your team?
Tags: opensource, microservices, luos, discord
Published: 2022-11-21 16:42:40

🎉  The New Stack published an article by Nicolas Lorenzi on the comparison of Discord vs. Slack!

⏩ [Read the full article](https://thenewstack.io/discord-vs-slack-which-is-right-for-your-team/) 

“We’ve built this community by making sure it looks and feels like a good place for embedded and edge developers” 

Thank you to the team at The New Stack for supporting Luos!
3 ways Sundar Pichai inspires me in my professional life - especially due to his accent.
Tags: career
Published: 2022-11-21 16:37:31

It took 𝐒𝐮𝐧𝐝𝐚𝐫 𝐏𝐢𝐜𝐡𝐚𝐢 becoming the CEO of Google to make me "own" my 𝐦𝐢𝐱𝐞𝐝-𝐮𝐩 𝐀𝐦𝐞𝐫𝐢𝐜𝐚𝐧𝐢𝐳𝐞𝐝 𝐒𝐨𝐮𝐭𝐡 𝐀𝐬𝐢𝐚𝐧 accent.

Growing up in Mumbai and then working in Bengaluru and Eastern US for a while - my accent evolved considerably. It was always reflective of who I am/was. {Own: To wear clothing, accessories, or physical features with confidence.}

Don't get me wrong, I was always comfortable with how I sounded.

𝐁𝐮𝐭 𝐢𝐧 𝐀𝐮𝐠𝐮𝐬𝐭 𝟐𝟎𝟏𝟓, 𝐒𝐮𝐧𝐝𝐚𝐫 𝐰𝐚𝐥𝐤𝐞𝐝 𝐨𝐧𝐭𝐨 𝐭𝐡𝐞 𝐬𝐭𝐚𝐠𝐞 and in front of the world spoke with an Americanized accent with deep Tamil intonations. He looked like any other techie you will meet in Chennai. Always humble on stage and full of energy while answering any questions.

These public appearances from Sundar pivoted the internal perception of a mixed-up accent in my head: from something I was conscious about to something that I started celebrating.

As I reflect on my professional journey, these are the 3 key changes that Sundar Pichai inspired in me:

𝐚) 𝐁𝐨𝐨𝐬𝐭𝐢𝐧𝐠 𝐜𝐨𝐧𝐟𝐢𝐝𝐞𝐧𝐜𝐞
Despite always being in roles that required active public speaking, I always have had stage fright. However, once the inhibitions about my uniquely sounding accent were out of the way, I could focus on prepping my presentation and script better. This mindset shift was the biggest contributor to my confidence in the last 5 years.

𝐛) 𝐋𝐨𝐬𝐢𝐧𝐠 𝐭𝐡𝐞 𝐚𝐜𝐜𝐞𝐧𝐭 𝐬𝐰𝐢𝐭𝐜𝐡 
During my initial few years in the US, I used to switch my accent based on the audience. Now, I do not try to hide my South Asian intonations but neither do I try hard to lose my Americanized pronunciations. If anyone (American, European, South Asian, Middle-Eastern, Chinese etc) does not understand me, I am approachable enough for them to interrupt me and say "Pardon".

𝐜) 𝐌𝐨𝐝𝐞𝐫𝐚𝐭𝐢𝐧𝐠 𝐭𝐡𝐞 𝐬𝐩𝐞𝐞𝐝 𝐨𝐟 𝐜𝐨𝐦𝐦𝐮𝐧𝐢𝐜𝐚𝐭𝐢𝐨𝐧
Especially for webinars, presentations and recorded events - I have paced my speaking. Not only does it make it simple for my listeners but it also gives me the time required to actively think while speaking.

𝐏𝐒:
As I was writing this piece, I was worried about my current or future colleagues not liking these opinions on how accent affects communication OR even doubting my communication skills. But that worry made me want to publish this piece even more. After all, there is only so much that leaders like Sundar can do for us. We have to fight this perception management (internal & external) battle in our style.
WaterNav Project Part 3 (21/11/2022)
Published: 2022-11-21 16:14:07

Today I was working on Sorting out the byte array and making sure that when the client receives this unsorted array of bytes that they could then sort it out into something meaningful to the application.


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

it works mainly all in this Corutine function at the moment all though later down the line I should split up this functionality.

but the basic idea behind it is for each Map section ID that the player has on their map I run a webrequest to get the associated Base 64 string from the Database, that is then turned back in to a byte array.

each block of bytes is stored away in a pre-cached byte array. this is done by a buffer.blockcopy call where I pass in the source which is each instance of the pulled data from the database and the destination array which is the pre-cached array.

this big byte array is then sent to be sorted.


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

We can visualize a whole map like this with each individual square representing a map section. each map section contains 50 x 50 worth of tiles. which can be boiled down to a value between 0 - 255 meaning in the entire game there will only ever be 255 different tiles.

2500 bytes essentially as 50 x 50 is 2500.

however the way unity handles tile maps being set from a flat array is from bottom-up.

so all the bottom tiles must be lined up together in the array which is to say in the case of a 3 x 3 map the first 150 values of the byte array will be the most bottom tiles.

however at this stage they would only be in the format of all 2500 tiles of the first tile map would be inserted first then concatenated with the next 2500.. etc. which would mean some undesirable results.

to fix this I developed a sorting algorithm.

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

in short what it does is it takes the unsorted byte array and sorts into the format my application requires.

in a future post I will go into more detail on this algorithm and how I convert the byte array into something on screen.
Expand your Android app beyond the phone [Slides]
Tags: droidcon, amazonappstore, amazon, android
Published: 2022-11-21 16:08:48

I had the opportunity to present a talk at [Droidcon London 2022](https://london.droidcon.com/) with @giolaq on how to expand your Android app beyond the phone with the Amazon Appstore. I'm sharing the deck slides here for the dev.to community - please let me know if you have additional questions in the comments below.

##Talk overview
We all know Android Apps are expanding beyond the phone screen, so join us to learn how Amazon Appstore is helping you bring your Android apps to a variety of form factors. We will explore the latest developer tools available to you, the different SDKs and services you can use to enhance your app, best practices to follow and testing services you can utilise to build an app that reaches millions of customers worldwide via our Fire Devices.
We will also look at how you can use Windows Subsystem for Android to bring your Android Apps to desktop using the Amazon Appstore on Windows 11 devices. 

{% speakerdeck 90249d425f0446ae96a941b9a36c8e19 %}

**Stay updated**
Get the most up to date Amazon Appstore developer news, product releases, tutorials, and more:

📣 Follow [@AmazonAppDev](https://twitter.com/AmazonAppDev) and our [team](https://twitter.com/i/lists/1580293569897984000) on [Twitter](https://twitter.com/AmazonAppDev)
📺 Subscribe to our [Youtube channel](https://www.youtube.com/amazonappstoredevelopers)
📧 Sign up for the [Developer Newsletter]
(https://m.amazonappservices.com/devto-newsletter-subscribe)
Python Programming Bootcamp #1 - Introduction
Tags: python, beginners, tutorial
Published: 2022-11-21 16:07:50

---
title: Python Programming Bootcamp #1 - Introduction
published: true
description: A Python course for people with no programming background. It is given to MSc and Phd Students of Biology, Chemistry, and Earth Sciences.
tags: python, beginners, tutorial, beginners
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2022-11-21 15:59 +0000
canonical_url: https://code-maven.com/programming-bootcamp-for-scientists-1
series: bootcamp
---


{% youtube gkPzMVi-_fc %}


00:00 Introduction to the Bootcamp.
01:37 [Nóra Doleschall](https://www.linkedin.com/in/nora-doleschall/) introduces herself and her background in programming.
02:47 Overview of the Bootcamp. (Programming Python, Computer architecture, Version Control System)
08:04 About [Code-Maven](https://code-maven.com/), all the [slides](https://code-maven.com/slides), the [Python slides](https://code-maven.com/slides/python).
09:38 Showing the Windows command line and the file explorer
15:20 Keyboard shortcuts for the slides
16:48 Keyboard shortcuts on YouTube
17:37 Start talking about the slides
17:55 What is Python?
20:14 What is needed to write a program?
24:08 The source code of Python
26:00 Open Source
MongoDB Atlas Hackathon 2022 on DEV
Tags: atlashackathon22, react, node, mongodb
Published: 2022-11-21 16:05:17



## What I built
I built a **Book search app** using ReactJS on the front-end and NodeJS(ExpressJS) on the back-end. 


### Category Submission:
**Search No More**


### App Link
https://book-app-bice.vercel.app/


### Screenshots
_Landing page_
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eriw3qzef87u29xl2eck.png)

_Search and Explore page_

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

_Best selling_

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

_Upload a book section_

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




### Description
All Users can view and search for books (Search by genre, title etc)
Authenticated users can upload books cover, URL and images

### Link to Source Code
https://github.com/drsimplegraffiti/book-app


### Permissive License
MIT


## Background
(What made you decide to build this particular app? What inspired you?)
I had always wanted to build a full stack application 



### How I built it
(How did you utilize MongoDB Atlas? Did you learn something new along the way? Pick up a new skill?)
I built the backend and the api fisrt using NodeJs, Express and MongoDB as the database.
Yes, I learnt how to use the Atlas full text search


### Additional Resources/Info
[catalog seearch](https://www.mongodb.com/developer/products/atlas/building-e-commerce-content-catalog-atlas-search/)
Responsibilities of an Entry-Level UX Designer
Tags: ux, design, product, writing
Published: 2022-11-21 15:30:00

The job of an entry-level UX/UI designer is to improve the user interface and user experience for an application or website. This involves finding ways to improve usability while still meeting design requirements and ensuring the website or application functions as necessary.

**1. User research**
User research is about understanding the people who use your product.

**2. Information architecture:**
Information architecture, or IA for short, involves deciding how your product is organized and structured.

**3. Wireframing:**
A wireframe is a basic outline or sketch of a product or a screen, like an app or website.

**4. Prototyping:**
A prototype is an early model of a product that demonstrates its functionality.

**5. Visual design:**
Visual design focuses on how the product or technology looks.

**6. Effective communication:**
Effective communication as a UX designer means connecting with your colleagues through emails, meetings, presentations, and design software.

---

{% user moazamdev %}