teleren/devto huggingface dataset:
Getting Started with Caching (Redis + NodeJS)
Tags: redis, node, javascript, cache
Published: 2020-02-04 14:19:03

This post is a basic introduction to caching and how it works. We will be using Redis for caching with Nodejs to show you how we can take advantage of caching to improve the speed and performance of the application and to reduce the overhead from server resources.

![NodeJS + Caching](https://dev-to-uploads.s3.amazonaws.com/i/r9f1r0kv3p2n3jvncb23.png)

**What is Caching ?**
Caching (pronounced “cashing”) is the process of storing data in a cache. A cache is a temporary storage area. A cache as a data store is easier for the client (or server) to reach, as opposed to a permanent data store that might be located on a different service, which takes more time and resources to reach (a database or an external API endpoint).

**For example:** The files you automatically request by looking at a Web page are stored on your hard disk in a cache subdirectory under the directory for your browser.

Now let’s take a look on Redis. (Source: Redis Official)

**What is Redis ?**
Redis is an open source (BSD licensed), in-memory data structure store, used as a database, cache and message broker. It supports data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs, geospatial indexes with radius queries and streams. Redis has built-in replication, Lua scripting, LRU eviction, transactions and different levels of on-disk persistence, and provides high availability via Redis Sentinel and automatic partitioning with Redis Cluster.

Let’s build very basic project to implement caching using redis:


{% medium https://medium.com/@iCPSoni/getting-started-with-caching-redis-nodejs-9f90bc002c7c %}
Python requests module and web data
Tags: python, beginners
Published: 2020-02-04 14:17:51

The requests module lets you make HTTP requests in <a href="https://python.org">Python</a>. <a href="https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol">HTTP</a> is the protocol of the web. The HTTP protocol has different type of requests, like the get request.

## Examples

So how to use the HTTP protocol directly in Python? Here are some examples. As the name indicates, the GET requests received data from a website:

```python
>>> import requests
>>> requests.get('https://youtube.com')
<Response [200]>
>>> 
```

It returns a response. The HTTP protocol has many predefined responses:

* A response of 200 means it has successfully received the data. 
* The response 404 means the data is not found. 

You can store the output of the get function like this:

```python
>>> response = requests.get('https://youtube.com')
>>> response.status_code
200
>>> 
```

To get the content you can use this:

```python
>>> response.content
```

## Parsing data

All content is in <a href="https://en.wikipedia.org/wiki/HTML">HTML</a> format and maybe some JavaScript. This means that by eye it's hard to read, but a web browser converts HTML to what you see on the screen. 

You can <a href="https://pythonspot.com/http-parse-html-and-xhtml/">parse HTML</a> in Python, but if you need a web browser there are pre-made components you can use.

Data on the web is not always HTML either, sometimes you'll load an image or text file. 

Sometimes the data is in <a href="https://pythonbasics.org/json/">JSON format</a>, in that case you want to use the json module. JSON is often used on the web, its a format that lets you define objects. These objects can be converted to Python object and from Python objects to JSON.

You can get more data on the request here:

```
>>> response.headers
```

This gives many variables like format, cookies, content encoding etc.

## Download files

If you don't want to parse data, but just download it, you have several options.

You can use the requests module. The example below downloads an image file using requests.

```python
import requests
import shutil

image_url = "https://cdn.pixabay.com/photo/2020/01/31/19/21/ural-owl-4808774__340.jpg"
resp = requests.get(image_url, stream=True)
local_file = open('image.jpg', 'wb')
resp.raw.decode_content = True
shutil.copyfileobj(resp.raw, local_file)
```

To download files, you can use <a href="https://pythonprogramminglanguage.com/download-file/">urllib2</a>.

Its possible to use system tools too (wget, curl).

**Related links:**
* <a href="https://2.python-requests.org/en/master/">Requests module for Python</a>
* <a href="https://pythonbasics.org/">Learn Python</a>
Programming Script Kiddies
Tags: dev, javascript, programming, opensource
Published: 2020-02-04 14:13:20

Anyone can download snippets of codes and piece them together to create a program. In the cyber space(hacking), a Script Kiddie is an unskilled individual who uses scripts or programs developed by others to accomplish a task. However in programming, Script kiddies use open source projects and edit them to look like theirs. These individuals lack the skills required to create original programs and therefor turn to using other peoples code in their programs. 

It's not totally wrong to use other people's code in your project, senior developers do it all the time but what is not right is using completely codes or projects from other people and presenting as your own.

Everybody is encourage to write write of their own and by so doing will master the at of coding and problem solving.

Javascript is a good way to start.


*Cover Photo by Kobu Agency on Unsplash*
*Body Photo by Kevin Ku on Unsplash*
[Video] Super Useful (lesser known) Terminal Command
Tags: linux, tutorial, terminal, bash
Published: 2020-02-04 14:09:57

## Any Terminal users out there?

Hey Folks,
So just want to keep this short as the content of this post is really the video and the explanation/tutorial...

To avoid people getting annoyed by the "click-baity" title of the video and post Ill tell you right now the command in question is:

*(SPOILERS)*
*(SPOILERS)*
*(SPOILERS)*

...

**fc**




## fc (fix command)

I found recently that many of the people I know that use the Terminal didn't know about this incredible (often life/time saving) command. Which lets you basically load the last command you entered into an EDITOR in the Terminal and edit it before saving and closing the editor to automatically trigger the "tweaked" command.

I mess up my commands on such a regular basis that this fc command is a life saver and my workflow would heavily suffer without it!

Feel free to watch the video (below) to find out more...

## Tutorial starts at...

I thought I would just add this timestamp as there is a little pre-video fluff for my subs before the content, so if you want to skip ahead to the actual tutorial bits then this is the timestamp

01:24 - https://youtu.be/vKQkg7Mt4jg?t=84


## The Video
{% youtube vKQkg7Mt4jg %}

## Links discussed in the video

Bash Builtin:
https://www.gnu.org/software/bash/manual/html_node/Bash-Builtins.html
https://en.wikipedia.org/wiki/Shell_builtin

fc command:
https://www.systutorials.com/docs/linux/man/1p-fc/
https://en.wikipedia.org/wiki/Fc_(Unix)
https://www.computerhope.com/unix/uhistory.htm

## Onwards

If you have ANY feedback or questions at all please let me know in the comments below or reach out to me on twitter:

[My Twitter (@ben_kadel)](https://twitter.com/ben_kadel)

Thanks for reading and possibly watching!
Um estudo sobre Flutter Expanded
Tags: flutter, dart, google, mobile
Published: 2020-02-04 14:09:41

Esse artigo faz parte de uma série chamada "Widgets da Semana", para saber mais sobre essa ela leia nossa [introdução](https://dev.to/flutter/flutter-um-estudo-semanal-sobre-widgets-56g3).

## Expaned
O [video](https://www.youtube.com/watch?v=_rnZaagadyo&list=PLjxrf2q8roU23XGwz3Km7sQZFTdB996iG&index=3) do Widget da semana postado no dia 21 de agosto de 2018, fala sobre Expanded.

Esse widget é usado para organizar o espaço ocupado por itens em Rows, Columns e Flex. Ele faz com que esse item ocupe o espaço vago dentro do seu pai. 

Quando a renderização acontece, primeiro é construido os filhos que não são flexiveis e depois os que são flexíveis vão ser calculados com o espaço restante. 

Você pode pensar como se fosse um display flex no CSS, onde essa caixa vai se expandir ocupando o todo espaço restate ou então em uma proporção indicada.

Como um exemplo de uso temos o código:
```dart
 Column(
    children: <Widget>[
       Container(
           color: Colors.black,
               height: 100,
           ),
       Expanded(
           child: Container(color: Colors.indigo),
       ),
       Expanded(
           child: Container(color: Colors.pinkAccent),
       )
    ],
),
``` 

Que produz o segunte resultado:

![Aplicativo com 3 retangulos, o primeiro sendo preto e menor e os restantes do mesmo tamanho, um azul e o outro rosa](https://thepracticaldev.s3.amazonaws.com/i/8rrnmvux8f4e4dimft57.jpg)

Você pode ver que sem indicar o tamanho ocupado pelos retangulos azul e rosa eles se organizaram baseado nas regras de expanded.
Mas e se eu quiser que um seja de um tamanho diferente do outro?

É so usar o atributo de flex e indicar a proporção de espaço a ser ocupado:
```dart
Column(
    children: <Widget>[
       Container(
           color: Colors.black,
               height: 100,
           ),
       Expanded(
           child: Container(color: Colors.indigo),
           flex: 2,
       ),
       Expanded(
           child: Container(color: Colors.pinkAccent),
       )
    ],
),
```
Assim obtemos o seginte resultado


![Aplicativo com 3 retangulos, o primeiro sendo preto e menor, os outros dois sendo de tamanhos diferentes, o segundo sendo o dobro de tamanho do terceiro, o maior tem cor azul e o menor tem cor rosa](https://thepracticaldev.s3.amazonaws.com/i/7rdtpz9gjgmfyp4f02pv.jpg)

O retângulo azul com o flex de 2 esta tomando o dobro de espaço que o rosa (o valor default/padrão do flex é 1).

##


## Sobre Nós

Eu e o pessoal da Flutter Nation estamos em uma [página](https://www.facebook.com/FlutterNationBr/) e um [grupo](https://www.facebook.com/groups/FlutterNation/) no Facebook. 
Também estamos no [Meetup](https://www.meetup.com/pt-BR/FlutterNation/) e no [GitHub](https://github.com/Flutter-Nation)!
How do you find and apply to speak at conferences?
Tags: discuss, techtalks, speaking
Published: 2020-02-04 14:08:14

---
title: How do you find and apply to speak at conferences?
published: true
description: How do folks find out about conferences they'd like to attend or speak at?
tags: #discuss #techtalks #speaking
cover_image: https://i.imgur.com/9OAmIX3.jpg
---

Howdy y’all, I’m wondering how y’all find out about conferences you’d like to attend. And more specifically, how would you find ones that are accepting speaker proposals.

I have a handful of topics I’ve given talks about, but am struggling to find conferences that are looking for speakers or soliciting CFPs (call for proposals).

For conference goers and speakers alike, how do you find them?
Tomar ScreenShots de nuestra web con Google Dev Tools
Tags: screenshot, chrome, devtools, webdev
Published: 2020-02-04 13:54:44

##Una más de las infinitas utilidades de "Herramientas para desarrolladores" de Chrome.

Por si no lo sabías, google Chrome pone a tu disposición muchas utilidades para este área y una que te ayudará a presentar tus proyectos se llama **screenshot**.

Es tan sencillo como presionar `CTRL + MAYUS + P` esto abrirá la pestaña de `run command`, teclea la palabra **screenshot** y te aparecerán las diferentes posibilidades.

![Multiples posibilidades de ScreenShot](https://dev-to-uploads.s3.amazonaws.com/i/7v5vezqi3hadzzwq5rf6.jpg)

1. Capturar el área que selecciones. (Este cambiará tu puntero del mouse y podrás seleccionar el área que quieras).
2. Capturar el full size. (Abarca toda tu web).
3. Capturar el node. (Lo que ve tu pantalla)
4. Capturar la pantalla. (Es como el típico screenshot, pero sin ver el browser).

*Saquenle provecho a todas las utilidades!*

[Vean aquí el resultado del full size](https://dev-to-uploads.s3.amazonaws.com/i/9975tm9edi3somn8xzpe.png)

Espero que les ayude.
Shortly about.. criticism, code reviews, comments
Tags: communication, team, collaboration, codereview
Published: 2020-02-04 13:46:53

You wrote some code, you're about to push.. wait a sec, please.

<h3>Working together</h3>
Most of the time developers work in teams. There is a lot of collaboration, hopefully, appreciation of the effort and, also hopefully, criticism. Yes, criticism. It should NOT be about making comments on someone's ability to do their job. It should NOT be directed at a person at all. It's about the shared code, making sure everyone understands how to work with it, how to make modifications when needed. It's about the trust that the code will do its job and not fail easily.

<h3>Hello, my name is...</h3>
When you name your variables, files, write commit messages, name tests, state your point in a meeting, writing a bug report... think about this: you are working in a team and the goal is for what you create to work in a bigger context.

Once you write your code, take a break, then read through it without going through how exactly it works.. think about:
<ul>
<li>Would it make sense for other people in your team?<br>
You know your colleagues, think of what kind of changes they usually ask for, what are their usual comments and aim for cleaning up the code in such a way that it will not require updates you know they will request.</li>
<li>Are the variables, functions, class names, etc. clear and accurate? Are you naming things by what they are/do?</li>
<li>Are you following conventions the team agreed to?</li>
<li>Think of what you would be commenting on when reading through another person's code.</li>
<li>Be critical of your own work.</li>
</ul>

<h3>Let's all be nice</h3>
As for commenting on other people's work, stay away from a passive-aggressive tone, which creeps in at times. Read your comments before submitting them. Be clear, be concise, be polite. Write about the changes in code you propose and explain why, shortly. Be open to discussion about your comments.

<h3>It's not about you</h3>
One thing I want to make clear. None of the criticism coming from others or yourself(!) is to make you feel bad, it is about getting the code in a state where it will work well for the client, the end-users, and make your colleagues happy and efficient when working with it. They WILL appreciate it and you for it.

Even if you feel a particular comment <i>is</i> directed at you, think if it should. Then ignore the personal part of it, think if there is something actionable and useful about it. Use that part. Only then you can decide to ask politely for the person to comment on the code, not you. But that's a topic for another time...

<hr>Author's note:
Let's practice positive critic here :)
I gave myself about 30 minutes to write it and then another few minutes to correct it, so that I don't keep procrastinating on my first post!
<hr>
How to store data in SharedPreferences
Tags: android, sharedpreferences, mobile
Published: 2020-02-04 13:24:36

I will be showing a simple but very useful way to store simple data for preferences on your Android app.
For that i'll be using [SharedPreferences](https://developer.android.com/reference/android/content/SharedPreferences), which is in Android since the API v1, so there're no restrictions of versions for using it.
SharedPreferences lets you store key-value pairs of primitive data types, and read them in any place of your app, being stored in persistent XML files.

# Storing preferences
First, of course, we have to import the interface:
```java
import android.content.SharedPreferences;
```
Then, we can use it:

```java
SharedPreferences prefs = this.getSharedPreferences("MyPrefs", Context.MODE_PRIVATE);
SharedPreferences.Editor editor = prefs.edit();
editor.putString("folder", folder);
editor.putString("route", route);
editor.putString("name", name);
editor.putLong("modified", modified);
editor.apply();
```

Here what i'm doing is starting a new preference store under the key "MyPrefs", if i don't have one already its created.
On the second line i'm initializing a [SharedPreferences editor](https://developer.android.com/reference/android/content/SharedPreferences.Editor.html), which allow us to modify the prefs object using the methods `putString()`, `putLong()`, `putInt()`, `putFloat()`, `putBoolean()` or `putStringSet()`. According, obviously, to the type of values you want to store. In my example i only need to store a few strings and a long value.

After adding the values i needed, i call the `apply()` method, which store the modified SharedPreference objects in the persistent XML files.
The Editor provides two methods to commit the changes, one is the used above, and the other one is `commit()`, the main differences are that `apply()` is asynchronous and don't return any value. If you need to know the result of the transaction you can use `commit()` that returns a boolean with the status of the write in the persistent storage.

# Reading preferences
The reading process is even easier:

```java
SharedPreferences prefs = this.getSharedPreferences("MyPrefs", Context.MODE_PRIVATE);
String folder = prefs.getString("folder", null);
String route = prefs.getString("route", null);
String name = prefs.getString("name", null);
long modifiedDate = prefs.getLong("modified", 0);
```

Here the only new methods are the getters, that correspond to each `put` that i enumerate before. The only difference is in the second argument, that is a default value for the variable to take if the key is empty in the stored preferences.

# Conclusion
This is a very straight forward way to store some persistent data like user preferences or some state of the app without having to manage a database or something more complex.
How To Create Custom Artisan Command In Laravel 5
Tags: laravel, php
Published: 2020-02-04 13:22:59

This laravel tutorial help to create new artisan command into laravel 5.Artisan is awesome feature of laravel. Artisan is the command-line interface of laravel.Laravel provides a number of helpful artisan commands for your use while developing your application.

https://www.phpflow.com/php/create-custom-artisan-command-in-laravel-5/
Unpopular opinion: Junior devs bring much more value to their employers than the market wants them to believe 
Tags: healthydebate, discuss, watercooler
Published: 2020-02-04 13:09:45

I'm currently in the process of writing something about how the market wants us - junior devs - to feel we're a burden to our employers, and how I realized how this is plain wrong (as in "not true", not as in "not moral"). 

After reviewing the work I had done during my first nine months as a developer, I realized that the value created by my work was paying my own salary by an order of magnitude. I replayed every interview I had and realized how common this fallacy is.

How do you feel about this? What is your experience with it?


Value created == growing_revenues OR cutting_costs
Survey on hiring and working with freelance developers
Tags: help, discuss
Published: 2020-02-04 13:03:13

Hey guys!

We're developing research on hiring and working with freelance developers and reaching out to companies/business owners/startup founders/entrepreneurs in San Francisco to give their input. 

Any chance someone would be up for answering the questions?

It shouldn't take more than 8 minutes of your time. If you're willing, you can add your voice here: https://www.surveymonkey.com/r/lemon_io


Thank you in advance! We really appreciate it :)


P.S. If you know the right person to send this survey, please, feel free to do it. We are trying all the channels to share this questionnaire, so don't be angry that I leave it here.
Memrize Technique for Problem Solving
Published: 2020-02-04 13:00:31

Memrize technique of problem solving approach involves following key stages. This happens to be one of the powerful way of problem solving.

__Divide & Conquer:__

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


The brain loves bit sized and everything can be learned when divided into little chunks, no matter how difficult it may first seem. So when you begin learning something, first chop it into digestible morsels. Your Brain will thank you later.


__Make Connections:__

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


Memories are connections, and every new memory must link to something already known. So when learning something new, always ask: what does this remind me of? What can i connect it to? How can i make that connection vivid?  

__Visualize:__

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/5b3a6hqi68jwqmdbx5ah.png)


"We are visual creatures" and most of our brains are devoted to sensing. So turn what you're learning into an image. The brighter more colorful and more fun the image, the more memorable - almost by definition. 


__Test Yourself:__

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

Recalling knowledge is the best way to strength it. So constantly test yourself as you learn, which helps beef up your memories, and makes them faster and more reliable. 


__Create Stories:__

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/58ekyc55dagj42yk903l.png)

Of all the ways of connecting knowledge together in our minds, stories are the most powerful. So if you have a collection of ideas to learn, try  linking them into an entertaining narrative. And don't forget to practice saying the narrative out loud. That's the best way to strength it.
Daily Developer Jokes - Tuesday, Feb 4, 2020
Tags: jokes, dailydeveloperjokes
Published: 2020-02-04 13:00:28

---
title: "Daily Developer Jokes - Tuesday, Feb 4, 2020"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
cover_image: "https://private.xtrp.io/projects/DailyDeveloperJokes/thumbnail_generator/?date=Tuesday%2C%20Feb%204%2C%202020"
published: true
tags: #jokes, #dailydeveloperjokes
---

Generated by Daily Developer Jokes, a project by [Fred Adams](https://xtrp.io/) ([@xtrp](https://dev.to/xtrp) on DEV)

___Read about Daily Developer Jokes on [this blog post](https://xtrp.io/blog/2020/01/12/daily-jokes-bot-release/), and check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/).___
### Today's Joke is...
![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e1258cecd22f.png)

---
*Have a joke idea for a future post? Email ___[xtrp@xtrp.io](mailto:xtrp@xtrp.io)___ with your suggestions!*

*This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit.*

<!-- 
Joke text:
___Q:___ Why did the computer squeak?

___A:___ Because someone stepped on its mouse!
 -->
Angular Js
Tags: angular, functional
Published: 2020-02-04 12:58:20


AngularJS is a javascript framework based on open-source released by Google in 2009. Referring to the official website AngularJS   http://angularjs.org, We would refer below Tag Line:

“Enhanced HTML for Web apps!”

 

The purpose of this tagline AngularJS HTML enhanced the functionality to build a web apps. Looking at the history of appearance of HTML, HTML initially only used to create a static document (website) is not to create a web app. Well, now imagine that since the beginning of HTML was developed to create a web app, that’s the concept AngularJS.

[website development company](https://www.zeksta.com) uses Angular & AngularJS is not a library (library) javascript but a solid framework to build a web app, at such as javascript framework generally AngularJS adopt the concept of MVC (Model, View, Controller), although it uses a different implementation with the original concept of MVC. For the purpose of MVC is achieved, namely the separation of duties of each component, AngularJS own Model, View and Controller interacting.
Plagiarized for Greater Good... Don't judge me
Tags: webdev, machinelearning, java, python
Published: 2020-02-04 12:48:01

[![Dev.to](https://dev-to-uploads.s3.amazonaws.com/i/kz40qm2b2hbslw8vzu1w.jpg)](https://www.decipherzone.com/blog)

Your Suggestions Please