teleren/devto huggingface dataset:
C’de For Döngüsü

Tags: c, loop, programming, beginners
Published: 2021-12-23 07:37:23

For döngüsünü genelde bir şeyleri tekrar tekrar yazmak istediğimiz zaman ya da bir kod bloğunu belirli bir sayıda çalıştırmak için kullanırız. Örneğin;

```C
for(i=0;i<5;i++)
{
   printf("Hello World!\n");
}
```

For döngüsünde ki ‘i=0’ başlangıç değerini, ‘i<5’ bitiş değerini, i++ ise bize artış değerini gösterir. i++ ifadesini i=i+1 şeklinde de yazabilirsiniz. Kodu açıklayacak olursak, i=0 da ekrana Hello World! yazdırılır ve i değeri bir arttırılır. i=1 olur ve ekrana bir daha Hello World! yazdırılır. En son i=4 olur ve ekrana tekrar yazdırılır i bir arttırılır ve i =5 olur fakat bitiş ifademiz i<5 olduğu için döngüden çıkar ve bir şey yazdırmaz.

Çıktısı;
```
Hello World!
Hello World!
Hello World!
Hello World!
Hello World!
```
### İç İçe For Döngüsü(Nested For Loop)
İç içe for döngüsünü adından da anlaşılacağı gibi bir for döngüsünün içinde başka bir for döngüsü çalıştırmaktır. Çarpım tablosunda, üçgen oluşturmada kullanabilirsiniz.
```C
int main()
{
    int i,j;
for(i=0;i<3;i++)
    {
        for(j=0;j<6;j++)
        {
            printf("Hello\n");
        }
        printf("\n");
    }
    return 0;
}
```
Biz bu kısımda ekrana 3 bloktan oluşan 6 tane alt alta Hello yazdıran bir program yazdık. En başta i ve j değişkenleri tanımladık. İlk döngümüzde i < 3 yaptık ki 0 dan başlayıp 2 dahil toplamda 3 kez içindeki for döngüsünü tekrarlasın. İkinci olarak ise içerideki for döngüsüne j < 6 yazdık bu da 0 dan başlayarak 5 dahil olmak üzere 6 kez bu döngüyü tekrarla. Ve çıktısı;
```
Hello
Hello
Hello
Hello
Hello
Hello

Hello
Hello
Hello
Hello
Hello
Hello

Hello
Hello
Hello
Hello
Hello
Hello
```
şeklindedir. Bir diğer örneğimiz ise üçgen oluşturmadır. Bunun içinde ufak değişikliklerle aynı yapıyı kullanacağız aslında.
```C
int main()
{
    int i,j;
for(i=0;i<6;i++)
    {
        for(j=0;j<i;j++)
        {
            printf("*");
        }
        printf("\n");
    }
    return 0;
}
```
Burada diğer koddan farklı olarak j’nin bitiş değerini i’ye eşitledik ki j i kadar yazılsın ekrana. Bu da şu demek oluyor, i =2 olduğunda j 3 kez ekrana basılmış oluyor. Ve çıktı;
```
*
**
***
****
*****
```
Bu postumuzda for döngüsünün birkaç formunu inceledik.
Mapbox Map with Animated Marker Icons
Tags: codepen
Published: 2021-12-23 11:03:49

<p>A Mapbox map with custom, animated SVG Icons. This is a prototype for a 'visual-storytelling-through-maps' app, aka locations and pretty pictures. </p>

{% codepen https://codepen.io/harunpehlivan/pen/powYNbm %}
React JS Interview(Part-2)
Tags: javascript, react, interview, webdev
Published: 2021-12-23 10:45:32

So this is the `second blog post` where I'm sharing some more important questions that you may stumble upon while giving a `React JS or just a JS interview.` Even if you don't encounter any of these questions in your interview it will be good to check them out just for finding out how many of them you know well. Let's start.

- `What is a pure function?`
- `What is a HOC?`
- `Give some examples of HOC you have used.`
- `What is render props?`
- `Custom Hooks?`
- `Difference between Custom Hooks and Functions and Component?`
- `Explain the working of Virtual DOM in detail.`
- `What is reconciliation in react?`
- `What are controlled and Uncontrolled components?`
- `Which one is better-controlled or uncontrolled components?`
- `What is Memoization and how it can be achieved in React?`
- `Do you know what is a toolchain?`
- `What is code splitting in React and how we can achieve it?`
- `What is hoisting in JavaScript?`
- `What is the difference between Array.forEach() and Array.map()?`
- `Explain event loop?`
- `Name one JS engine.`
- `Is Javascript Object Oriented? If not then what type it is?`

> **Some JS snippets to try:**
```
Snippet1

let a = [1,2,3,4,5]
let b = a
b[3] = 10
let c = b
console.log(a,b,c)
//Output: ??
```

```
Snippet2


let obj1= {name:"atul", age:24, 
           hobbies:['reading books', 
           'writing blogs','exercising', 'poetry']}
let obj2 = obj1
delete obj2['hobbies']
console.log(obj1, obj2)
```

```
Snippet3


const aa  = 5
const bb = [12,23,543,56]
const cc = {name: "atul", age:24}
ac= 10 //What will happen? Is this Ok.
bb[3] = 9
bb[4] = 12
cc['Age'] = 'greater than 18'
```

```
Snippet4


let myself = {
  name: "atul",
  age: 24,
  hobbies: ["reading books", "writing blogs", "exercising", "poetry"],
  favourites: {
    movies: ["Iron Man", "End Game", "Spiderman"],
    Sports: ["Cricket", "Football", "Basketball", "Badminton"],
    song: ["Legends Never Die", "Chidiya: Vilen", "etc", "etc..."]
  }
};

let yourself = { ...myself };
yourself["hobbies"] = ["Guitar playing", "playing football", "Dancing"];

let newSelf = {
  ...myself
};
newSelf.favourites.movies = ["Star Wars", "Ice Age", "Batman", "Flash"];

console.log("myself:", myself);
console.log("yourself:", yourself);
console.log("newself", newSelf);
```

> **Here is link to all the questions asked above with implementation, so that you don't feel slacking off with what will happen in each case.**

{% replit @AtulBhatt/JSInterview2 %}

`I will be ending this article here for now. I'll continue it in the next part with more questions that will cover more in-depth questions. So see you around here next time.👋
Have an insightful day 😄.`
Pelemay Backend (Aspirations for 2022)
Tags: elixir
Published: 2021-12-23 10:40:52

[Nx](https://github.com/elixir-nx/nx) is "Numerical Elixir," which realizes multi-dimensional arrays (tensors) and numerical definitions for Elixir. Nx can have a backend. The default backend is the binary backend written in pure Elixir. EXLA, Elixir client for Google's XLA (Accelerated Linear Algebra), and Torchx, Elixir client for LibTorch (from PyTorch), have each backend. Such a backend can be implemented the behavior defined by `Nx.Backend`. 

We researched and developed [Pelemay](https://github.com/zeam-vm/pelemay), a native compiler for Elixir. We made presentations about it at [Lonestar ElixirConf 2019](https://youtu.be/lypqlGlK1So) and [ElixirConf US 2019](https://youtu.be/uCkPyfFhPxI). It can compile Elixir code with pipelined `Enum.map` into native code with SIMD instruction, **just in time**.

So, we propose to apply the Pelemay technology to Nx, **Pelemay Backend**: ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5c29nzwhvkjoms33yu2t.png)

To be continued...
Day 99/100 Scope
Tags: 100daysofcode, programming, javascript, motivation
Published: 2021-12-23 10:40:17


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

**The scope is defined as a specific portion of the code. There are three types of scope in Javascript:**

- Global scope -  When a particular variable is visible (can be used) anywhere in the code. Such a variable is generally called as Global variable.

- Function scope -  When a particular variable is visible (can be used) within a particular function only. Such a variable is generally called as Local variable.

- Block scope - When a particular variable is visible (can be used) within a pair of { . . . } only.

The JavaScript language is constantly improving. One of these updates introduces a new type of scope, called Block scope.

```
var a = 1;
function x() {
var b = 2;
function y() {
    var c = 3;
    function z() {
    var d = 4;
    }
    z();
}
y();
}

x();
```
The variable c is defined inside function y(), so it's accessible only inside function y(). This means it can be printed anywhere inside function y(), as well as inside any functions declared inside function y().The inner functions y() and z() have access to their own local variables, the variables defined inside the functions they were also defined in (x() and y() functions respectively), and any global variables.

##  Scope Recap

- If an identifier is declared in global scope, it's available everywhere.

- If an identifier is declared in function scope, it's available in the function it was declared in (even in functions declared inside the function).

- When trying to access an identifier, the JavaScript Engine will first look in the current function. If it doesn't find anything, it will continue to the next outer function to see if it can find the identifier there. It will keep doing this until it reaches the global scope.

- Global identifiers are a bad idea. They can lead to bad variable names, conflicting variable names, and messy code.


## Code Snippets

```
var row = 0;  // initial value of the row
var seat = 0; // initial value of the seat within a row

for (row = 0; row <= 25; row++){
    for(seat = 0; seat <= 99; seat++){
        console.log(row+"-"+seat);
    }
}
```

## Summary

Happy Hacking!

[![Resource](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k0pfilsd7xp5xvwbzf8i.png)](https://link.springer.com/article/10.1007/BF01405730)
Premium Cloud ELT and Reverse-ETL Features are Now Available in RudderStack Cloud Free
Tags: reverseetl, etl, cloud, cloudetl
Published: 2021-12-23 10:34:35

Data stacks are becoming more complex as both the volume and use cases for data proliferate across companies. That's one significant reason we believe that engineering should own the customer data stack.

It's also why we are focused on building a unified pipeline---one place for data engineers and developers to manage all of their key customer data pipelines. There's still a huge amount of work to do to accomplish our mission, but we've made some big strides over the last six months.

Back in November, we [launched our free tier](https://rudderstack.com/blog/start-building-a-better-cdp-for-free-with-rudderstack-cloud-free/), RudderStack Cloud Free, which enabled users to send up to 500,000 events per month for free through our Event Stream pipeline. A lot of people liked it: over 1000 people have signed up and used the product.

We [introduced two additional pipelines](https://rudderstack.com/blog/introducing-rudderstack-cloud-extract-and-warehouse-actions/) in January: our reverse-ETL and cloud ELT pipeline features (Warehouse Actions and Cloud Extract).

These features were a huge step in unification, enabling data engineers to manage all three primary pipelines in the customer data stack through RudderStack.

Until now, though, only the Event Stream pipeline was available through the free tier. Now that many of our customers have activated on Warehouse Actions and Cloud Extract, we're excited to make them available to all free-tier users as well.

Here's a quick overview of the new features:

Warehouse Actions for Reverse-ETL
---------------------------------

RudderStack Warehouse Actions is our [reverse-ETL](https://rudderstack.com/blog/reverse-etl-is-just-another-data-pipeline/) feature. It turns your warehouse into a data source, translating rows into configurable JSON payloads that can be sent to hundreds of tools across your stack, from Salesforce to Zendesk to Kafka and even webhooks.

Our customers use Warehouse actions for all sorts of use cases, from enriching leads with product data to sending cleansed internal events (like transactional data). Best of all, because we translate each row into an event, you can use our Transformations feature to configure the payloads for each downstream destination.

![Play: Video](https://i.ytimg.com/vi/_h5unKkNNQg/hqdefault.jpg)

Cloud Extract for Cloud ELT Pipelines
-------------------------------------

RudderStack Cloud Extract is our cloud ELT feature. It gives you out-of-the-box integrations with popular cloud sources -- such as Salesforce, Customer.io, Google AdWords, and even Google Sheets -- that make it easy to build cloud-to-warehouse pipelines.

![Play: Video](https://i.ytimg.com/vi/F9dIv5Pp0EE/hqdefault.jpg)

Sign up for Free and Start Sending Data
---------------------------------------

Test out our event stream, ELT, and reverse-ETL pipelines. Use our HTTP source to send data in less than 5 minutes, or install one of our 12 SDKs in your website or app. [Get started](https://app.rudderlabs.com/signup?type=freetrial/).
Server concept
Published: 2021-12-23 10:19:24

In computer programming, create, read, update, and delete (CRUD) are the four basic operations of persistent storage.[1] CRUD is also sometimes used to describe user interface conventions that facilitate viewing, searching, and changing information using computer-based forms and reports. The term was likely first popularized by James Martin in his 1983 book Managing the Data-base environment.

JSON web token (JWT), pronounced "jot", is an open standard (RFC 7519) that defines a compact and self-contained way for securely transmitting information between parties as a JSON object. Again, JWT is a standard, meaning that all JWTs are tokens, but not all tokens are JWTs.

Because of its relatively small size, a JWT can be sent through a URL, through a POST parameter, or inside an HTTP header, and it is transmitted quickly. A JWT contains all the required information about an entity to avoid querying a database more than once. The recipient of a JWT also does not need to call a server to validate the token.

Mongoose provides a straight-forward, schema-based solution to model your application data. It includes built-in type casting, validation, query building, business logic hooks and more, out of the box.

MySQL relational database
MySQL (/ˌmaɪˌɛsˌkjuːˈɛl/) is an open-source relational database management system (RDBMS). ... A relational database organizes data into one or more data tables in which data types may be related to each other; these relations help structure the data.

Aggregation in DBMS
Aggregation refers to the process by which entities are combined to form a single meaningful entity. The specific entities are combined because they do not make sense on their own. To establish a single entity, aggregation creates a relationship that combines these entities.

Express, Inc. is an American fashion retailer that caters mainly to young men and women. The company is headquartered in Columbus, Ohio. Express operated 635 stores in the United States and Puerto Rico in 2017

What is Highcharts?
Highcharts JS is a JavaScript charting library based on SVG, with fallbacks to VML and canvas for old browsers. To avoid bloating the Highcharts core library, the Highcharts team deploy new chart types and features in a separate file called highcharts-more.js. In short, highcharts-more is extra functionality on top of Highcharts without modifying it's core code. It also allows you to use some charts types which don't exist in the "original" highcharts such as bubble, range, gauge and pollar charts.
Book Review - Learning React - 2nd Edition by Alex Banks and Eve Porcello
Tags: react, javascript, books, webdev
Published: 2021-12-23 10:14:52

### Book Review - Learning React - 2nd Edition by Alex Banks and Eve Porcello

I enjoyed learning from this book but overall I got the feeling that the authors lost steam towards the end and were trying to complete the book in a hurry before the deadline.

The 2nd chapter in this book that deals Javascript basics one needs to know for learning React is extremely good.

**Pros**

1. Based on latest React framework
2. Very well explained Javascript basics chapter
3. Covers all major parts of learning React 
4. Hooks and State management explained very well
5. _Suspense_ which is still experimental has been addressed
6. Code examples are very good

**Cons**

1. Would have preferred incremental single project approach. To some extent this has been addressed but not completely
2. Many files are missing in the github repo - Socket.io example, GraphQL files, Chapter 10 files, Parallel requests example etc.
3. Code examples should always mention which file they are referring to in github

**Overall**

A very good book to learn fundamentals of React, State management and Hooks. It can be a supplement to other streams of learning not a single source of learning.
`float:left` is not dead 🙇‍♂️
Tags: css, frontend, webdev, beginners
Published: 2021-12-23 10:11:03

In the Tech Community in the last few years there have been strong opinions on things. But some things are not opinions. Some things can simply be explained by facts.

One of it is the assumption that `display: flex` or `display: grid` are alternatives for floating. **They are not**. Period.

![Drake Dancing](https://media.giphy.com/media/l41lIsOThQpma23wA/giphy.gif)

---

At this point you _might_ think that I am crazy but let me elaborate before you agressively type comments destroying your keyboard.

`display: flex` is born out of a requirement that CSS hasn't solved before: Proper Layouting. In other words: Using `display: block; float: ...` for layouts always was a workaround. Same as in the old times when we used `<table ..>` for layouting.

## Okay but then why should I still use `float: ...` ?

As I said: It was never built for "layouting" in the sense of what we understand as "layouting" today. Such that we have to get back to what it's actually supposed to do.

As the term `float` already states it is supposed to let things `float` (no shit sherlock) as opposed to `display: flex` which **cannot** let things float. So it's an awesome helper to wrap text around any kind of `figure` which makes up for a very awesome reading experience if used correctly.

The pragmatic explanation will be done via my [CodePen](https://codepen.io/activenode/pen/XWeeZGe) where Drake will help you to understand better:

{% codepen https://codepen.io/activenode/pen/XWeeZGe %}

Reach out to me via Follow-Up Questions if you have any. 🔥
Host websites from mobile for free
Tags: firebase, webdev, android, javascript
Published: 2021-12-23 09:57:13

## Hosting from mobile
Hosting is most important step to make your website accessible for world.
there are some services which will help you to host from you Android mobile.

![GitHub pages banner](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j0gx7pg48d02pvwntx81.jpeg)
### GitHub pages
You can host your repository folder , branch or whole repo by enabling pages from repo settings. Get more information on [pages.github.com](http://pages.github.com)

![firebase hosting banner](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5zdrtbv1jxamu8yu5azn.png)
### Firebase hosting
Firebase hosting is better because it provides domain .web.dev
#### How you can host website on firebase via mobile.
You've to download app called [termux](https://play.google.com/store/apps/details?id=com.termux)
Once you download termux you've to enter firebase commands in termux and site will be live.
link [firebase commands](https://www.javatpoint.com/firebase-hosting)
if you've any Query about firebase hosting , [ask us](https://discord.gg/WMWM5eb2px).

![Netlify banner](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3lypx5qo6xcnz41gvy8x.png)
### Netlify
Netlify also offers you free hosting with domain .netlify.app.
You've to signup to Netlify and authenticate your gh/gl/bitbucket repo with site.

Thanks for reading
Written by [shubham](https://codebysgi.netlify.app) with `<3`.
AI & a quiet revolution
Tags: ai, deeplearning, robotics, future
Published: 2021-12-23 09:57:00

_"We're on a path to build AI that can interpret images as reliably as humans can,"_ [predicts](https://www.zdnet.com/article/2022-prediction-a-major-revolution-in-robotics) professor Pieter Abbeel, an expert in robotics and AI research from the University of California, Berkeley.

For the last 50-60 years, people completely got used to the fact that physically strong robots work in factories — e.g., making cars and electronics.

Artificial intelligence development had a breakthrough during 1990s-2000s, and today we confidently live in the age of big data and neural networks. 

Contemporary AI systems can see, learn, access situations, make decisions, and react. 

What fields are going to be the first to change in 2022 and the upcoming years?

_"The three big ones I anticipate are warehouse pick and pack operations, recycling sortation, and crop harvesting/care,"_ says professor Abbeel.

The capabilities of AI keep extending further, thanks to IT science areas like Computer Vision and Deep Learning. 

In other words, we are witnessing a quiet and mostly invisible revolution.

Good or bad, the future will tell. But one thing is certain: robotics and AI have been gradually changing our lives and will continue to do so.
android to mac file transfer
Tags: android
Published: 2021-12-23 09:52:37

I simply want to transfer file from android to mac. Initially I use [Android File Transfer](https://www.android.com/filetransfer/), however it stucks at 4GB.

By considering [this post](https://android.stackexchange.com/questions/48812/bypass-4gb-limitation-of-android-file-transfer), I install `android-platform-tools` for file transfer.

### step 1
on mac, install `android-platform-tools`.
```
brew install android-platform-tools
```
### step 2
connect the android device with USB-C to mac.
on the device, go to [settings > developer options > enable USB debugging](https://developer.android.com/studio/run/device)

NOTE: on xiaomi 9, tap **MIUI version** 7 times to enable developer options

### step 3
on mac, run `adb devices` to confirm that android is connected to mac.

### step 4
to copy file to mac, run:
```
adb pull <device_file_location> <mac_location>
```
to copy file to device, run:
```
adb push <mac_file_location> <device_location>
```




---
please let me know if there is any other way more straightforward! :grimacing:
React useNavigate faster than useContext
Tags: react, help
Published: 2021-12-23 09:45:04

I'm making a website using React, Nodejs, Expressjs and Mysql. It has a login, register and profile pages. When I logged in I'm redirecting users with useNavigate to the profile page. Profile page shows the user email.

But when I navigate users to Profile, in the first display, Profile page is not showing user email. I have to refresh to page to see email.

I'm using useContext and wrapped all application with Provider. There's no problem. But when i navigate to Profile, useContext working a little bit late and it's not changing state instantly. Is there a way to solve this?
Password Generator - #013 of #100Days100Projects
Tags: codepen
Published: 2021-12-23 09:30:55

<p>This project is part of the #100Days100Projects challenge.</p>

<p>Check it out here: <a href="https://www.florin-pop.com/blog/2019/09/100-days-100-projects" target="_blank">https://hpitgroup.glitch.me/</a></p>

{% codepen https://codepen.io/harunpehlivan/pen/eYRwmNW %}
Password generator
Tags: codepen
Published: 2021-12-23 09:29:58

<p>The world wide web is a dangerous place, the password you choose shall be strong.
Through this  generator,  I explore a graphic way to illustrate in real time the strengths and weaknesses while it is created.</p>

{% codepen https://codepen.io/harunpehlivan/pen/KKqjwom %}