teleren/devto huggingface dataset:
functions on python
Published: 2021-05-14 07:55:02

In programming, a named section of a program![]![]performs a specific task. In this sense, a function is a type of procedure or routine. Some programming languages make a distinction between a function, which returns a value, and a procedure, which performs some operation but does not return a value.

A function is a block of code that only runs when it is called. You can pass data, known as parameters, into a function. A function can return data as a result.

Most programming languages come with a prewritten set of functions that are kept in a library. You can also write your own functions to perform specialized tasks.

The term function is also used synonymously with operation and command. For example, you execute the delete function to erase a word. A callable object is an object that can accept some arguments (also called parameters) and possibly return an object (often a tuple containing multiple objects).

A function is the simplest callable object in Python, but there are others, such as classes or certain class instances. In programming, a named section of a program performs a specific task. In this sense, a function is a type of procedure or routine. Some programming languages make a distinction between a function, which returns a value, and a procedure, which performs some operation but does not return a value.

Most programming languages come with a prewritten set of functions that are kept in a library. You can also write your own functions to perform specialized tasks.

We use function so we don’t need to repeat ourselves. Please watch the video below and remember the content. A function can define variables within the function body, which are considered ‘local’ to the function. The locals together with the arguments comprise all the variables within the scope of the function. Any names within the function are unbound when the function returns or reaches the end of the function body. Python is dynamically typed and garbage-collected. It supports multiple programming paradigms, including structured (particularly, procedural), object-oriented, and functional programming. Python is often described as a “batteries included” language due to its comprehensive standard library.
Do You Stack Overflow?
Tags: healthydebate, productivity, javascript, discuss
Published: 2021-05-14 07:45:48

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/df26g8ndi7dd4xvpjl07.png) 
 
**Quick survey:** You use Stack Overflow...

❤: Always - In all my projects
🦄: Often - When I have a bug / difficulty
🏷: Never - I'm smarter 

---
 
`Hello World!` We are back with the [#healthydebate](https://dev.to/devlorenzo/series/11376) series! It's time to get serious because today we're talking about Stack Overflow. It's very present in the developer's imagination, but in reality, how much do we use it? Let's discover together!

Also, by telling your experience, you have a chance to get featured in our [newsletter](https://worldindev.ck.page).

**The question of the week is:** *How much do you use StackOverflow in your developer life?*

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gatg6v71cx8g72vysdh6.png)
 
**Question time:** <-- To help you answer the big question above

* When did you first meet / use StackOverflow? How did you feel?

* How much do you use Stack Overflow on your daily basis? 

* How do you usually treat the answers, do you directly copy the code / just read and change yours / make a mix...

* How is Stack Overflow considered among your colleagues? What do you think of those who search for too much code there?

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

Use the comment section to reply!

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

---

You can receive the weekly discussion recap [directly in your email](https://worldindev.ck.page) for free!

---

Bonus: How to handle any exception

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cyswfd569og2nargvi6c.png)
 
{% collapsible Images Source: %} 
1. [Reddit](https://www.reddit.com/r/ProgrammerHumor/comments/avuwdu/i_dont_use_stackoverflow_either/)
2. [ahseeit](https://ahseeit.com/?qa=56049/i-heard-he-can-code-without-stack-overflow-meme)
3. [me.me](https://me.me/i/google-stackoverflow-you-tube-bugs-errors-developer-data-flair-39cb521a9b894da09fb42f80613f9362)
4. [GitHub](https://github.com/gautamkrishnar/tcso)
{% endcollapsible %}
Easily migrate your repositories from Bitbucket to Github with all branches and commits!
Tags: github, bitbucket, migration, nocode
Published: 2021-05-14 07:45:28

The standout reason to use **Bitbucket** was its ease to create a `private repository`, where we had to buy a GitHub subscription to do it - but as **GitHub** also provides this, it's time to move our base back to our favorite version control.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/swt4n2q33lu5aeiwyl8n.png)

> **Steps to migrate your repositories**

#### Step 1: Create a GitHub repository
Create a new private repository on Github. **Don’t fail to create an empty repository**, e.g. uncheck the option `Initialise this repository with a README` while creating.


#### Step 2: Clone Bitbucket project
Clone the existing project you wish to migrate. Don't forget to change the visibility to '**public**' in case it is a private repository.
You can do it by navigating to `Repository settings/repository details`
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/prx75vhx799uw408gxli.png)
and uncheck `'This is a private repository'``.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u0fctxt68kw15yg1yjc0.png)

#### Step 3: Import your repository
Once you are back to your newly created GitHub repository, navigate to `Quick setup in the <>Code` tab 

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wnawjpz8rldylh0v78r5.png)

and scroll down to locate `…or import code from another repository`

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d3k86nydfqvvrdjfsm33.png)

paste your HTTPS-URL and click `Begin import`

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8b12qpzyvq9ixz8bmpif.png)

#### Step 4: Delete your old repository
If all contents are migrated to your GitHub repository, double-check it, and after that delete the Bitbucket repository if not required.
	1. Go to the old Bitbucket repository
	2. Select menu option `Setting > Delete repository`

#####That's it, your repository is set up with GitHub!
TYPO3 vs Drupal - Which CMS Platform To Choose?
Published: 2021-05-14 07:36:10

TYPO3 and Drupal – indeed they both are very popular Open-Source Content Management Systems (CMS). Yes, all of these are built on PHP and MySQL. Do you think these can be used interchangeably? Well my friend, not really. There is a difference between these and depending on your business needs you need to choose the most appropriate one.

In this short microblog post, check out the key differences and trends between TYPO3 VS Drupal. You are still here and reading this article, it means you are a very curious person to explore something exciting ;) Let’s go! Click here to read a blog, https://t3terminal.com/blog/typo3-vs-drupal/
TYPO3 Talk with Karen: Data Protection Officer
Published: 2021-05-14 07:33:13

We have Karen Falkenberg with us for an interesting TYPO3 Talk! Karen has been with TYPO3 since 2006 and is data Protection Officer of the TYPO3 Association and TYPO3 GmbH.
The TYPO3 Talk with Karen is interesting, so grab that cup of coffee to explore Karen's insights into her views, the history and potential of TYPO3 and the open-source community, and how we can build a better TYPO3 ecosystem together!

Interviewee :Karen Falkenberg
Company :Computer-Zauber
Designation: Data Protection Officer of the TYPO3 Association and TYPO3 GmbH
Topic: Together Building a Better TYPO3 Eco-system

Let's explore her journey with TYPO3 from then to now, and much more!
Check it out https://t3terminal.com/blog/typo3-talk-with-karen-data-protection-officer/.
Automatic Release TYPO3 Extensions to TER
Published: 2021-05-14 07:27:38

TYPO3 community loves Github; Most of the developer’s TYPO3 Opensource extensions are developed and maintained at Github. One pain for the developer to manually release their TYPO3 extension to TER (TYPO3 Extension Repository) at https://extensions.typo3.org/ In this guide, you will learn how to release and deploy your TYPO3 extension to TER automatically.

Most of the Open Source community uses Github to develop and maintain their projects. In late 2019, Github launched their great CI/CD approach with Github actions. Now the Open Source community does not require third-party deployment tools like Travis.

TYPO3 community also primarily uses Github to maintain TYPO3 core and extensions projects. To save time and effort, every TYPO3 developer who uses Github should use Github actions to automatically deploy their TYPO3 extensions project to TER (TYPO3 Extensions Repository).

Are you a TYPO3 Github lover? And, Are you looking for automatic release TYPO3 extensions to TER? You landed in the correct place; In this micro TYPO3 blog, you will learn how to set up TYPO3 Github Actions.https://t3terminal.com/blog/release-typo3-extensions-github-actions/.
TYPO3 Backend Access, User Roles & Permissions
Tags: typo3
Published: 2021-05-14 07:22:36

If you’re not the only person running your TYPO3 website, you’ve probably needed to think about TYPO3 user roles. TYPO3 comes with a user role management system that defines what a specific user can and cannot do on your website. Knowing these TYPO3 user roles and TYPO3 permissions are essential as your TYPO3 site grows.

TYPO3 Backend Access user roles are essential for controlling what actions the various users at your site are permitted to take. By smartly assigning TYPO3 user roles, you ensure that no one has more “power” than they need. And this helps make your site more secure and streamline your workflow.

Read on to this guide that explains what TYPO3 Access, User roles, and permissions are, why they matter and how to assign them. https://t3terminal.com/blog/typo3-user-roles/
Laravel 8 Dropzone Image Upload Tutorial Example

Tags: laravel, php, programming, tutorial
Published: 2021-05-14 07:20:12

<p>Here, I will give you full example for simply Laravel 8 image upload utilizing dropzone as bellow.</p>

<strong class="step">Step 1: Add Route</strong>
<p>Now,Let's get commenced first step, we will integrate two incipient route one for exhibit view and second one is store image in our routes.php file. So, open your route file and integrate bellow two incipient routes.</p>

<pre class="preetyprint">
<?php

use Illuminate\Support\Facades\Route;
use App\Http\Controllers\DropzoneController;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('drop_zone', [DropzoneController::class,'dropzone']);
Route::post('drop_zone/store', [DropzoneController::class,'dropzoneStore'])->name('dropzone.store');
</pre>

<strong class="step">Step 2: Create Controller</strong>

if you want to see full example follow bellow link...

https://codingtracker.blogspot.com/2021/05/laravel-8-dropzone-image-upload.html
Attempted import error: 'MDBStep' is not exported from 'mdbreact'.
Published: 2021-05-14 06:32:43

Excuse me!!
I need helper.

my import :
import { MDBContainer, MDBRow, MDBCol, MDBStepper, MDBStep, MDBBtn, MDBCard, MDBCardBody, MDBInput } from "mdbreact";

and code anwser me is:
Attempted import error: 'MDBStep' is not exported from 'mdbreact'.

#react
I just heard about golang
Tags: go, inspiration
Published: 2021-05-14 04:16:33

I have a lot of experience being an average engineer building frontend applications for a long time. I still spend a lot of time reading hacker news and opinions of other people in conference talks about topics about engineering and managing web apps across the stack. I heard repeatedly that golang is easy to learn, and when I looked deeper I found the makers of golang emphasize on the idea that they don't believe in adding features to the language to stay upto date. An example being there isn't a need of while loop when a for loop is present. They have a general opinion that by keeping the language robust and finite, it is possible to learn it quick and build abstractions in the language to handle concerns. This is of course possible in every language by selecting a subset of features to code in and build right abstractions to progress well. I somehow vibe with the idea and using this constraint as a guiding principle. Using a few things well is so far more important than having plenty of options at disposal. Alright, easy to learn is good. So I looked more, and I heard too many new things and it makes me curious to learn more.
Queues not running in laravel 
Tags: laravel, php, webdev
Published: 2021-05-14 06:21:07

Hi, Recently when i tried to run queues on localhost, i encountered very strange problem. the command for running a queue in laravel 

`php artisan queue:listen` 

stopped working for me. i tried `QUEUE_CONNECTION=SYNC` which worked but any other connection would not. 

Later i realised it was because apparently my application was in maintenance mode or i had run `php artisan down` command and never did this up. So even my application was running, it was according to kernel was in down or maintenance mode. once i ran command `php artisan up`, it started working again. 

just wanted to write this down here, if anybody else encounter same problem. 

**UPDATE** 
 
upon investigation i realised down command creates a file  `storage/framework/down` which apparently tell application its in maintenance mode. `php artisan up` simply delete this file, which let the whole application know its up. 

**UPDATE**

Documentation says `--force` flag should make it work in maintenance mode but it does not seems to work for me.
Develop your full potential through UXCrush Resources
Tags: webdev, opensource, javascript
Published: 2021-05-14 06:17:38

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

### Presentation
Figma is an incredible tool as a frontend developer. You could see in detail the design before to code it. 

[UXCrush](https://www.uxcrush.com/) is a curated collection of Figma resources: UI kits, icons, website templates and all sorts of freebies created and shared by the Figma community.

![Dashboard Example](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mas7z9hkcb1s3nbws9pk.png)

### Interested no ?
You want to develop something but you have no idea to do ? 
You want to apply a technology on a new project but you have no idea to do ? 

Through multiple UXCrush resources, you don't need to think about the idea of the project. You just to select the project you enjoy and stay focus on what you really want to do : **learn & code** ❤️ ❤️

### UXCrush Resource
So simple to get a figma resource and open it :) 
I don't know how many page there is but you have the choice. 

You will probably want to download multiple projects and select one of them after. **Keep in mind, several selected projects is good but a completed project is better.**

Import them into your figma and you will get ready to start your new project :)
![Figma Import](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ajy482xpaiu75l1z02e0.png)

### Conclusion
It's probably an excellent resource if you want to start to create a project without idea. And there is something for every taste : desktop landing / mobile app / ...

All feedbacks are welcome ❤️ 
Maybe you have already try these resource ? Do not hesitate to tell me in the comments and get READY for the `first challenge` 🚀
Coding journey.
Published: 2021-05-14 02:41:22

**2020**
In 2020, one of my many New Year's resolutions was to learn to code. Of course, I waited until the last minute to try to accomplish this goal. At the end of October 2020, I began my first Web Development course to learn HTML and CSS online. This was my first time learning how to code. As a visual learner, I was particularly drawn to CSS and its capabilities. I love that I can immediately see my changes and there are a plethora of color options :) While taking this course, I was commuting to work as a teacher in NYC and would code before or after work on the subway. I found it therapeutic. It was my escape from reality. I felt like I was disappearing into a different world to solve problems (AKA trying to master all of CSS properties). I slowly began to fall in love with coding. I loved that I could create something powerful and impactful with code and wanted to learn more. 

**2021**
In February 2021, I was accepted into General Assembly's Software Engineering Immersive Flex program. It's a 6-month part-time program. For me, this program allows me to keep my job while I learn to code. I also like that it is a bit slower pace so that I have time to process the information.   

Reasons why I decided to delve deeper into programming:

**1.⌚Time** 
Every year I've been telling myself that I want to code. Now, that I am working from home I have the flexibility and time to learn. 

**2.🛠️ Going outside of my comfort zone skills**
I am a pro at soft skills. However, I need to strengthen my technical and analytical skills. Coding allows me to utilize different skills I normally don't get to practice such as technical, analytical, and being extra detail-oriented. 

**3.🐱‍💻Be a student and understand how it's like to learn online**
As a teacher, I know what it's like to teach online, but I don't know what it's like to be in my students' position- to be taught online. Now, I have a better understanding of how my students learn online.

**4.❤️📗Create impactful and useful projects related to education to help students, teachers, or both**
With my new technical skills, I want to help improve the education system and creating an equitable user experience for all learners.

**5.😃For fun**
For me, coding is fun and enjoyable. I like that there are various ways to solving a problem, just like a math problem. I've been treating coding like a hobby/sport it's fun to practice and the more I practice the more I get to level up and discover more things along the way. 

With that, this is the beginning phase of my coding journey and I'll be documenting as much as I can.
Cycle in Linked list
Tags: datastructures
Published: 2021-05-15 05:50:19

---
title: Cycle in Linked list
published: true
date: 2021-05-14 06:00:00 UTC
tags: datastructures,datastructures
canonical_url: https://jsedano.dev/data-structures/2021/05/14/cycle-on-linked-list.html
---

I’ll show three different ways in which we can detect if theres a loop in a Linked List.

First consider this the class we will be using for the linked list:

```
class Node<T> {
    public Node next;
    public T data;

    public Node(T data, Node<T> next) {
        this.next = next;
        this.data = data;
    }
}
```

- Using a set

A set is an abstract data type that stores unique values, in this approach we loop the linked list while storing the values on the set, the add operation for the HashSet returns false when we try to add an element that is already on the set.

```
    public boolean hasCycleUsingHashSet(Node<Integer> head) {
        Set<Node> set = new HashSet<Node>();
        while(head != null) {
            if(set.add(head)){
                head = head.next;
            } else {
                return true;
            }
        }
        return false;
    }
```

This should be in O(n) time complexity since the add operation on the set is suppose to be O(1). The space complexity is also O(n) since we need the extra space.

- Marking visited nodes

The idea is that each time we visit a node we mark it somehow as visited. Then as we are iterating the list if we find a node that is marked as visited we know theres a loop. In this approach we set the data for the visited nodes as null.

```
    public boolean hasCycleMarkingVisited(Node<Integer> head) {
        while(head != null) {
            if(head.data == null){
                return true;
            }
            head.data = null;
            head = head.next;
        }
        return false;
    }
```

This runs nicely in O(n) but if one of the constraints is that we can not modify the original linked list then this is no good.

- Floyd’s tortoise and hare algorithm.

A great algorithm that runs on O(n) and doesnt need extra space. The idea behind this is that we have a pointer that goes one by one (the tortoise) and another pointer that will move twice as fast (the hare) and if theres a loop on the list they will meet in a node eventually.

```
    public boolean floydTortoiseAndHare(Node<Integer> head) {
        if(head == null) {
            return false;
        }
        Node<Integer> tortoise = head;
        Node<Integer> hare = tortoise.next;

        while(tortoise != hare) {
            if(hare == null || hare.next == null) {
                return false;
            }
            tortoise = tortoise.next;
            hare = hare.next.next;
        }

        return true;
    }
```
LeetCode 875. Koko Eating Bananas (javascript solution)

Tags: algorithms, javascript
Published: 2021-05-14 05:13:30

###Description:
Koko loves to eat bananas. There are n piles of bananas, the ith pile has piles[i] bananas. The guards have gone and will come back in h hours.

Koko can decide her bananas-per-hour eating speed of k. Each hour, she chooses some pile of bananas and eats k bananas from that pile. If the pile has less than k bananas, she eats all of them instead and will not eat any more bananas during this hour.

Koko likes to eat slowly but still wants to finish eating all the bananas before the guards return.

Return the minimum integer k such that she can eat all the bananas within h hours.

###Solution:
Time Complexity : O(nlog(n))
Space Complexity: O(1)

```javascript
// Binary Search approach
var minEatingSpeed = function(piles, h) {
    // Check if koko can eat all the piles in h hours at his speed
    function checkCondition(speed) {
        let time = 0
        for(const pile of piles) {
            time += Math.ceil(pile / speed);
        }

        return time <= h
    }
    // Binary search
    let left = 1, right = Math.max(...piles)
    while(left < right) {
        const mid = left + Math.floor((right-left)/2)
        if(checkCondition(mid)) {
            right = mid
        } else {
            left = mid+1
        }
    }
    return left
};
```
How long lived is your Linux, before next clean install?
Tags: linux, discuss, devops, archlinux
Published: 2021-05-14 05:11:09

I mean, how often do you want to wipe everything away and clean install?

Even in macOS, I clean installed every once in a while.

But for Ubuntu, new version came out, and I might want to clean install.

Hopefully, for Arch, there would be no real need to clean install again.