teleren/devto huggingface dataset:
Let's Talk About Var, Let and Const
Tags: javascript, beginners
Published: 2020-03-08 23:17:25

Javascript, originally known as Mocha, was famously created in only 10 days by Brandon Eich while working for Mosaic in 1995. In the beginning, there was `var`. It was the only way you could declare a variable. This was the case all the way up until 2015 when `let` and `const` were introduced with ES6. This is a post highlighting some of their differences!


###VAR###

`Var` is scoped to the current execution context. Which means they're scoped to their enclosing function if they're inside a function. If they're not, then they're part of the global scope.

Here's an example:

```js
  const echo = (num) => {
    for (var i = 0; i < num; i++) {
      console.log("Around the world.")
    }
  console.log(i)
  }

echo(3)

// Around the world.
// Around the world.
// Around the world.
// 3
```

The variable `i` is *not* scoped to the `for loop` but to the entire function. We know this is true because `console.log(i)` has access to that variable and returns the integer 3. 

Now let's replace the `var`s with `let`s:

```js
  const echo = (num) => {
    for (let i = 0; i < num; i++) {
      console.log("Around the world.")
    }
  console.log(i)
  }

echo(3)

// Around the world.
// Around the world.
// Around the world.
// Uncaught ReferenceError: i is not defined
```

In this situation, using `let`, we get an error when running `console.log(i)` this time. This is because `let` *is* scoped to only the `for loop` and not the entire function.


**`let` and `const` are block-scoped. `Var` is scoped to the current execution context.**

###CONST###

`const` stands for constant. The main idea behind it is that its value isn't supposed to change. This doesn't mean it's immutable and it cannot change at all. It means that the reference that the variable is pointing to cannot change.

Here are two examples:

```js
const dog = "Finn"
dog = "Tuck"

// Uncaught TypeError: Assignment to constant variable.
```

```js
const groceries = ["apples", "carrots", "phenylephrine"]
groceries = "nothing"

// Uncaught TypeError: Assignment to constant variable.
```

Pretty simple, right? You can, however, update the values inside of `groceries` even though it is a constant.

```js
const groceries = ["apples", "carrots", "phenylephrine"]

groceries.push("bananas")
// 4

groceries
// [ 'apples', 'carrots', 'phenylephrine', 'bananas' ]
```

You are still changing the groceries but you're not changing the reference. It's still *pointing* to the exact same array — the same object in memory.

Part 2 coming next week!
Automating Integration Tests
Tags: testing
Published: 2020-03-08 23:08:15

Automated testing is a liability. Manual checking functionality is a huge liability. I want to emphasize some concerns I have with the machine learning testing solutions.

If you are not familiar with testing vs checking here is my quick explanation. Computers perform checking, humans when they are not following a script perform ~~thinking~~ testing.

The primary issue I take with the machine learning automation is it tends to focus solely on web frontend verification. For certain websites this my be sufficient, however I think that is likely very few. In an earlier article I described a web UI testing setup I'm using. 

{% link https://dev.to/jessekphillips/wiremock-as-a-web-server-for-testing-3lkl %}

Machine learning would not allow me to use this method of control. It also does not focus on other validation like database reporting.

There are a lot of moving parts when it comes to a "working" application. If your test strategy could be replaced by the machine learning tools of today, then it I claim that wasn't the right strategy to begin with.

However machine learning is a valuable endeavor and could use some funding. Even though I don't view it as the right strategy, it is better than nothing and perpetuates the most common test strategy.
Nevertheless, JR Coded
Tags: wecoded
Published: 2020-03-08 22:46:07

<!-- ✨This template is only meant to get your ideas going, so please feel free to write your own title & narrative! ✨ -->

## Equality for women in any job is important. It’s an uphill battle in any industry. 
But in tech it’s a mountainous climb for women to thrive. 4% of the technology workforce are woman. The only way to survive is to stick together. We can be stronger together with a connected philosophy about what women want in tech and what we should change internally.


## I’m a Senior Frontend Software Engineer with a speciality in Frontend JavaScript libraries, HTML5, CSS, Sass, SCSS, etc

## My advice for allies to support self-identifying women and non-binary folks who code is be authentic. We can tell if your interest is a marketing effort.

<!-- Once your post is published, it will not appear on the /t/shecoded page until an admin approves it. This is an extra step to ensure there is no abuse on this important tag. -->
graphical apps with tkinter
Tags: python, beginners
Published: 2020-03-08 22:28:48

You can use the <a href="https://pythonbasics.org/tkinter/">tkinter</a> module to create graphical applications and desktop applications with Python

For example, the Python desktop program below creates two buttons and a label. Tkinter has many widgets you can add to a window, labels and buttons being just one of them.

```python
from tkinter import *

class OnOffButton(Button):
    def __init__(self,master=None,text=None):
        Button.__init__(self,master,text=text)
        self['command'] = self._onButtonClick
        
    def _onButtonClick(self):
        print('button clicked')


class App(Frame):
    def __init__(self,master=None):
        Frame.__init__(self,master)
        
        self.labelHello = Label(self,text="Hello World")
        self.labelHello['fg'] = "red"
        self.labelHello.grid()
        
        self.button1 = OnOffButton(self,text="Click Me")
        self.button1.grid()

        self.button2 = OnOffButton(self,text="Click me?")
        self.button2.grid()

def main():
    root = Tk()
    app = App(master=root)
    app.grid()
    root.mainloop()

if __name__ == '__main__':
    main()
```

In this example there are 3 widgets: a label and a button.
You can create a label by calling

```python
Label(self,text="Hello World")
```

To create a button, call (the class is subclassed)

```python
Button(self,text="Click me?")
```

![tkinter buttons and label](https://dev-to-uploads.s3.amazonaws.com/i/poill75yce5y3inzwn5m.png)

So you can make all kinds of desktop apps with tkinter.
But you can create "graphical apps", similar to Paint. (source: <a href="https://gitpress.io/u/1155/tkinter-example-PopupMenuDemo">canvas demo</a>)

![draw with tkinter](https://dev-to-uploads.s3.amazonaws.com/i/pnj3xz3y6cn5ht6krwyo.png)

These are just simple examples. You can create much more complex graphical user interfaces, as shown in the image below:

<img src="https://dev-to-uploads.s3.amazonaws.com/i/la9kndp9ow03eo7nsn8h.png" alt="tkinter gui"> 

More reading:
* <a href="https://gumroad.com/l/ErLc">Tkinter Video Course & Examples</a>
* <a href="https://wiki.python.org/moin/TkInter">tkinter in docs</a>
Vue.js and The Start Wars API
Tags: vue, javascript, html, css
Published: 2020-03-08 22:26:06

La forma más fácil de trabajar con una API y tu sitio de JAMStack es directamente accediendo desde JavaScript. En este ejemplo, simplemente harás una petición HTTP al recurso y este se desplegara en pantalla. Vamos a ver como consumir la API de Start Wars con ayuda de Vue.js

## Primeros pasos
Vamos a crear el template HTML que donde vamos a desplegar el contenido.

``` html
<div id="app">
   <h1>Star Wars Films</h1>
   <table> 
      <thead>
         <tr>
            <th>Título</th>            
            <th>Director</th>
            <th>Productor</th>
            <th>Fecha de lanzamiento</th>
         </tr>
      </thead>
      <tbody>              
         <tr v-for="film in films">         
            <td>Attack of the Clones</td>            
            <td>George Lucas</td>
            <td>Rick McCallum</td>
            <td>2002-05-16</td>
         </tr> 
      </tbody>
   </table>    
</div>
```

## Request HTTP
Para realizar la petición podriamos apoyarnos de axios pero en realidad no hace falta, vamos a usar fetch la API nativa del navegador que nos viene bien para hacer peticiones simples.

``` javascript

const app = new Vue({
    el:'#app',
    data: {
        films:[]
    },
    created() {
        fetch('https://swapi.co/api/films')
        .then(res => res.json())
        .then(res => {
            this.films = res.results;
        });
    }
});
```

## Render Response
Perfecto, ya que tenemos los datos con la directiva v-for vamos a iterar cada elemento dentro de la vista, puedes revisar la API y ver que nodos tenemos a nuestra disposición o bien puedes examinar en consola la respuesta.

``` html
<div id="app">
   <h1>Star Wars Films</h1>
   <table> 
      <thead>
         <tr>
            <th>Title</th>            
            <th>Director</th>
            <th>Producer</th>
            <th>Release date</th>
         </tr>
      </thead>
      <tbody>              
         <tr v-for="film in films">         
            <td>{{ film.title }}</td>            
            <td>{{ film.director}}</td>
            <td>{{ film.producer}} </td>
            <td>{{ film.release_date}} </td>            
         </tr> 
      </tbody>
   </table>    
</div>
```

De esta forma podemos traer datos a nuestras vistas de diferentes APIs.
Security study notes
Tags: security, firewall, network, studying
Published: 2020-03-08 22:11:26

What's an SDK- An SKD is a software development kit
What is an ACL- An ordered set of router rules that will permit or deny traffic based upon certain characteristics

Waterfall is big
Good for when security is needed

Agile is faster than waterfall
Agile uses sprints

DevOps
Development and Operation
Speed up
Good to have a security person involved

CIA triad- confidentiality, integrity, availability

Least privilege

Defense in depth- layered security
Don't trust user input- do input validation to protect against SQL injections, buffer overflows

Input validation is what I work on now!
Nevertheless, Ravi4755 Coded
Published: 2020-03-08 21:50:25

<!-- ✨This template is only meant to get your ideas going, so please feel free to write your own title & narrative! ✨ -->

## Equality in tech looks like… 

## I’m an expert at…

## My advice for allies to support self-identifying women and non-binary folks who code is...

<!-- Once your post is published, it will not appear on the /t/shecoded page until an admin approves it. This is an extra step to ensure there is no abuse on this important tag. -->
Zen-Balls, my latest side project
Tags: react, javascript, feathersjs, node
Published: 2020-03-08 21:35:36

---
title: Zen-Balls, my latest side project
published: true
description: After about one year I "finished" another side project. One day it might become an interactive screensaver.
tags: reactJS, JavaScript, FeathersJS, nodeJS
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/potr4u2f1wxojyrbrtvr.png
---

This is my first post, not just on DEV.to, but actually my first ever post.

And it won't even be long, it serves more to know if there is any interest in this so I would write more...

About one year ago I was almost sleeping on the couch when the windows bubble screensaver kicked in. I thought about the mechanics and was suddenly super in mood to write something like this by myself.

So I created the following [stackblitz](https://stackblitz.com/edit/bubbles-js)

This worked ok-ish but while working on it I thought that this could become a game. 

As I also was in mood to learn more about web sockets I and I also was curious about [feathersJS](https://feathersjs.com/) so I went with it on the backend and created the:

**[Zen-Balls](https://dev-ze.rocks/zen-balls)**

The last thing I added was the hourly ranking (hof) that includes custom links (github, twitter, or homepage) if the user inserts any. 
![Zen-Balls login screen](https://dev-to-uploads.s3.amazonaws.com/i/wugnu4wqxli72zuy1rmp.png)
For now I am satisfied, whereas I have a TODO list with more than 60 items and some more ideas but for now I won't work on this.


I am thinking about making the code open source but as this would require some code cleaning and some other changes I would love to get some feedback first to see if there is any interest...

So, if you have any feedback or want to see the source code, let me know in the comments.
Nevertheless, Greg Coded, too!
Tags: wecoded
Published: 2020-03-08 21:14:45

<!-- ✨This template is only meant to get your ideas going, so please feel free to write your own title & narrative! ✨ -->

## Equality in tech looks like… 
it get's better but there is still a long way to go!📈

## I’m an expert at…
trying to make the hiring market in tech more transparent and inclusive.🔎

## My advice for allies to support self-identifying women and non-binary folks who code is...
to focus on encouraging your friends to make the step into tech. Diversity programs won't help if there are not enough females that actually want to work in tech! Keep going! 👩‍💻 👩‍💻 👩‍💻 

<!-- Once your post is published, it will not appear on the /t/shecoded page until an admin approves it. This is an extra step to ensure there is no abuse on this important tag. -->
Nevertheless, Simone Coded. Part 2
Tags: wecoded, womenwhocode, learningjavascript, jsnation
Published: 2020-03-08 20:22:50

---
title: Nevertheless, Simone Coded. Part 2
published: true
tags: shecoded,  womenwhocode,  learningjavascript,  JSNation 
---
I cannot believe it’s already been a year since I wrote my first “Nevertheless, she coded" which was also my fist contribution here.   
This year, for my part 2, I chose to write a bit on where I am and where I (think) I'm going. I say this carefully because the last two years getting into coding have been quite a maze and a rollercoaster combined, learning wise. Surprising me along the way, the people at meetups, the community, what I have learned so far and where I am now.  
 

This year, I wanted to pave the learning road for myself a bit better, make a plan or at least choose a direction. On NYE I gave myself the goal to learn JavaScript in 2020 and along the way when I have more insight, I will decide on what JavaScript framework I want to learn for my website. React? Angular? Vue? Gatsby? There are so many routes to take, but first I am working on my basic knowledge. I want a good solid base of JavaScript.  

Starting this route, I got me Kyle Simpsons YDNJS books and Wes Bos’ beginner JS course. Both I am enjoying very much. What helps is that I made the decision to take my own time and do this my way. But I also needed a date to work towards. I applied for the Amsterdam JS Nation conference's diversity scholarship, being held from the 3d of June till the 5th of June. Super excited about this, because last week I got the e-mail that I got it! So that will be the date I work towards to learn as much as I can!

I don’t know if I am allowed to share this, but if you also want to apply: https://jsnation.com/#diversity  
Let me know if you are also going, maybe I'll see you there? 

 

Tomorrow is my birthday. I know it's a coincidence that it's the day after international women's day (or is it?) I feel sort of honored that my birthday is so close to this day, overthought that might not make sense. 
The last couple of years, (maybe also because I chose this line of work?) I became more aware of the need for this day, and what we are still fighting for or where we are going. That is why I wanted to participate again this year and share my story.
Sunday Summary #3
Tags: sundaysummary
Published: 2020-03-09 08:10:17

---
title: Sunday Summary #3
published: true
date: 2020-03-08 20:00:00 UTC
cover_image: https://s3-eu-central-1.amazonaws.com/mskog-cms/2020/03/u5ehB4Lg.png
canonical_url: https://www.mskog.com/posts/sunday-summary-3
---

## Tailwind UI

[Tailwind UI](https://tailwindui.com/components) has finally been released. Since the [Tailwind CSS framework](https://tailwindcss.com/) doesn't contain any actual components but rather just utility classes then this is the perfect companion. It is a commercial pack created by the creators of Tailwind itself. Essentially it is a library of beautiful components such as pricing pages, forms and cards.

I bought this day 1 and I am already working on an app that uses it. It looks great and the components are easy to use as well.

## Links

[Tina CMS](https://tinacms.org/)  
Real-time editing of your [Jamstack](https://jamstack.org/) site, all without using external tools to write.

[A half hour to learn Rust](https://fasterthanli.me/blog/2020/a-half-hour-to-learn-rust/)  
Whirlwind tour of some Rust concepts

[How a 2 person startup already uses 28 other tools](https://acrossapp.com/blog/how-a-2-person-startup-already-uses-28-other-tools)

[Top economists study what happens when you stop using Facebook](https://www.calnewport.com/blog/2020/02/29/top-economists-study-what-happens-when-you-stop-using-facebook/)

[Changes we've made to our process and work on thoughtbot.com](https://thoughtbot.com/blog/how-we-ve-been-using-basecamp-s-shape-up-process-to-inform-our-work-on-thoughtbot-com)  
Interesting use of Trello boards inspired by [Basecamps Shape Up](https://basecamp.com/shapeup/webbook)

[All the apps that I pay for](https://daily.patwalls.co/apps-services-that-i-pay-for)  
Everything this person uses to run their business. That is quite the list.

[Another criticism of using Kubernetes as the default deployment option for every single app](https://pythonspeed.com/articles/dont-need-kubernetes/)
Nevertheless, Julia Brazolim Coded
Tags: wecoded
Published: 2020-03-08 19:06:24

<!-- ✨This template is only meant to get your ideas going, so please feel free to write your own title & narrative! ✨ -->

## Equality in tech looks like… 
Equality in tech looks like... a utopia. But I see changes and initiatives that are turning into reality. Every day groups and women technological communities here in Brazil are creating movements, breaking barriers and taking knowledge to several women around the country. I did not see the importance of this until I felt how lonely the technological world is for women in a technology event for example.  I felt lonely. But today, I participate as a volunteer in two initiatives here in Brazil: the group Fatech Girls and the community Elas Programam. Both with the objective of bringing technology to girls and women. To help in the first job or to teach a programming language. I actively contribute with arts, texts and encouragement for women of all ages. I'm not alone anymore

## I’m an expert at…
Front-End. Actually I graduated in Technique in Informatics in 2016 and in the course I learned VB.Net, Java, MySQL, systems analysis, javaScript, HTML5, CSS, Android, Object Oriented Programming... A lot of things. But I feel like I'm kind of behind in JAVA, for example. Since then I work with Front-End focusing on Web Design which is my passion. And currently I'm studying Python! All this knowledge was necessary for me because today I am the creator and scientific disseminator of the Exoplanet Mission project, which aims to disseminate astronomy to society. So I created a desktop application with Electron with information about astrophysics. 💜💜💜

## My advice for allies to support self-identifying women and non-binary folks who code is...

Don't judge. Just listen. Create opportunities. Be welcoming. 

<!-- Once your post is published, it will not appear on the /t/shecoded page until an admin approves it. This is an extra step to ensure there is no abuse on this important tag. -->
How do you make something original when starting out?
Tags: help, career, webdev, beginners
Published: 2020-03-08 19:01:53

For years I fell into tutorial hell where I had made about 20 Todo Apps, over a hundred `"hello world"`'s, and my fair share of e-commerce sites filled with a myriad of garments no one would ever buy (compliments of the creepy instructor, of course).

After pussyfooting around in that arena for a while I decided I was finally going to try something original from beginning to end. The thing I was/am passionate about is movies. And not only movies but also the way they're received by critics. So I began to build this movie rating aggregator that would show the Rotten Tomatoes rating, the IMDb rating and also the Metacritic score right when you clicked the movie. At the time I had to go to three different sites to gather that information so I felt my idea solved a problem.

Unbeknownst to me, within a few mere months, I saw the exact same idea being touted around Reddit and the works. The name of the original was [Cinesift](https://flickmetrix.com/) and later renamed to FlickMetrix. I was crushed. Not only did they have my general functionality implemented but they were doing it much better. Features I hadn't thought of and an extraordinarily slick UI to top it off.

This is the pattern I am asking for everyone's help in breaking for up and comers. I browse Product Hunt and once a week or so I see another journal/todo/goals app get featured but don't we want more?

I do. And I'd love to hear any insight on this topic.

Thanks,

Andrew Truex

{% user ajtruex %}
Terminal Kullanarak USB Bellek Bağlamak
Tags: pardus, usb, temp
Published: 2020-03-08 18:48:32

Pardus bazı durumlarda(driver hatası vb.) GUI ile açılmayabilir. Böyle durumlarda driver yüklememiz gerekebilir. Ama GUI arayüzünden açılmadığı için USB belleğe tıklayıp mount etmek mümkün olmamaktadır. Mount etmenin çeşitli yöntemleri vardır. Ben sizlerle kullandığım ve kullanımı çok kolay olan mount etme yöntemini anlatacağım. Aşağıdaki komut ile bağlı depolama aygıtlarını listeleyebiliriz. 
<pre>
fdisk -l
</pre>
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/74pl81we0vu7rqgi4c8g.png)
<p>Görüldüğü gibi taktığımız belleğe ait yolu seçmeliyiz.
Seçtikten sonra ister istediğiniz yerde klasör oluşturup mount edebilir isterseniz geçici bir klasör oluşturup oraya mount edebilirsiniz. Klasör oluşturup mount etmek için aşağıdaki komutları girmek gerekecektir.</p>
<pre>
mkdir /home/mert/Desktop/USB
mount /dev/sdb1 /home/mert/Desktop/USB/
</pre>
<p>Ya da geçici klasör oluşturup oraya mount edebiliriz. Bunun için aşağıdaki komutları kullanabiliriz.</p>
<pre>
root@pardus:~# mktemp -d
/tmp/tmp.zDbR6rkoJz
root@pardus:~# mount /dev/sdb1 /tmp/tmp.zDbR6rkoJz
</pre>
Bilgisayarı yeniden başlattıktan sonra klasörün silindiği görülecektir.
Pardus Tarih ve Saat Ayarlama
Tags: pardus, time, date, debian
Published: 2020-03-08 18:46:38

<p>Bazen Pardus sistemlerde tarih ve saatin yanlış olduğu görülmektedir. Bu gibi durumlarda neler yapılması gerektiği aşağıdaki anlatılmaktadır.
Öncelikle ntpdate uygulamasını yükleyerek saat ve tarihin güncellenmesi beklenir.</p>
<pre>sudo apt install ntpdate</pre>
Eğer yukarıdaki uygulama otomatik getirmez ise aşağıdaki komut yazılır. 
<pre>
ntpdate NTP(Network Time Protocol)-Server-Address
hwclock --systohc</pre>
Eğer halen tarih ve saat güncellenmemiş ise aşağıdaki komut yazılarak manuel şekilde seçilir.
<pre>
dpkg-reconfigure tzdata 
</pre>
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/wvp3onqql6mpu2uncfgq.png)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/fa38dxy25da3parw2g8n.png)
<p>İstanbul seçildikten sonra terminal aşağıdaki gibi çıktı verecektir. Tarih ve zaman başarıyla güncellenecektir.</p>
<pre>
Current default time zone: 'Europe/Istanbul'
Local time is now:      Sun Mar  8 13:17:51 +03 2020.
Universal Time is now:  Sun Mar  8 10:17:51 UTC 2020.
</pre>