teleren/devto huggingface dataset:
A wonderful animated component for React-Native
Tags: reactnative, react, android, ios
Published: 2020-09-24 06:41:32

> [**Github仓库**](https://github.com/Voyzz/react-native-swiper-hooks): https://github.com/Voyzz/react-native-swiper-hooks  
[**NPM仓库**](https://www.npmjs.com/package/react-native-swiper-hooks): https://www.npmjs.com/package/react-native-swiper-hooks


<div align=center><img align="center" src="https://i.loli.net/2020/09/19/LYfW67IyjgZoNKq.png" width="250px"/></div>


# Hello, folks! 


> 🦄 This is a wonderful animated carsouel hooks component for React-Native    
>> ✨ 为React Native开发的轮播展示动画组件   
>    
> 👨🏻‍💻 Powered by Voyz Shen   
>> 🏫 Shanghai Jiao Tong University, Ctrip


## Catalog
> - [Demo](#demo)
> - [How to use](#howtouse)
> - [Properties](#properties)
> - [Versions](#versions)

---
<span id='demo'><span>
## Demo 
<div align=center><img align="center" src="https://i.loli.net/2020/09/18/UuDfZM3gpwoIs6P.gif" width="600px" /></div>

---

<span id='howtouse'><span>
## How to use

- install   
```
npm i react-native-animated-carousel --save
```

- import  
```
import AnimatedCarousel from 'react-native-animated-carousel'
```

- Demo  

```
const testData = [
  {
    title:'医疗',
    subTitle:'副标题1',
    bgImage:'https://i.loli.net/2020/09/17/qxoJu8G3fe97lrc.png',
    jumpUrl:''
  },
  ...
  {
    title:'生活',
    subTitle:'副标题12',
    bgImage:'https://i.loli.net/2020/09/17/rgiPpKRafObAQvN.png',
    jumpUrl:''
  }
]

...

<AnimatedCarousel cardList={testData} ></AnimatedCarousel>

```

---

<span id='properties'><span>
## Properties

|Prop|Default|Options|Type|Description|
|:---|:--:|:--:|:--:|:---|
| cardList |/|/|Array|data of cards|
|||||卡片数据|

### item properties ↓
|Prop|Default|Options|Type|Description|
|:---|:--:|:--:|:--:|:---|
| title |/|/|String|title of card|
| subTitle |/|/|String| subtitle of card|
| bgImage |/|/|String| background image of card|
| jumpUrl |/|/|String| jump URL of card|

<span id='versions'><span>
## Versions
> - v1.0.1 添加配置参数  
>   
> - v1.0.0 发布组件
If you love GitHub ❤️
Tags: watercooler, news, beginners
Published: 2020-09-24 06:41:13

#GitHub mobile app is a great tool for reviewing progress. And progress is good.

GitHub’s mobile applications have used GraphQL to power new features. We’ve now been able to move faster and get more done with less hassle and no over-fetching.

We were able to turn to the open source community and use Apollo for iOS and Android. By doing so, we moved at warp-speed. We also minimized ongoing engineering effort on what is a core part of our mobile applications.

GraphQL has allowed us to focus less on the tedium around networking, modeling, and API stability. It’s allowed us to focus on the things we’re really passionate about: building great experiences.




[Read more about it](https://github.blog/2020-09-23-github-mobile-and-graphql/)
Is Python better than R for data science?
Tags: python, datascience
Published: 2020-09-24 06:35:53

I recommend python for multiple reasons:

If data science is going to remain a main-stream in the next 5 years, it needs to add value not only in terms of proof of concept (as it is doing now) but also in terms of production (as it is failing in over 70% of cases, as Gartner recently surveyed). While R is an absolute winner in terms of classical pattern recognition libraries and statistical methods, python has a better ability to write production-ready codes.

Above point raises another important point, that is best practices of software engineering (e.g., uml architecture designs, unit testing, coding review, scrum) are going to be absolute requirements in near future for data scientists, in addition to the expected knowledge in machine learning and statistics. The reason is that proper software, production ready, codes require proper architecture design, with proper reviews and testing.

The future of data science is highly dependent on hardware availability, usually provided through clusters and clouds. Python integrates easier with cloud services from Amazon (AWS) and other clouds, comparing to R.

To remain in the market, you need to be ready for future as while you are studying data science today, it is going to be already old once you finished. I suggest proper training in languages like Scala (a potential alternative to python, while more software engineering friendly) and Java (as a basic programming language) at the same time while taking python seriously.

Note: data science is adding lots of values in the area of vision (through deep learning), however, vision is only a small portion of what it is expected from data science. Most problems require simple but robust solution designs that are able to work in a remote site for a long time in front of an operator.


One of the major downsides to Python is that many libraries are written by normal people without proper code reviews, not as a part of a research group, nor out of a properly peer-reviewed publication. This leads to a significant discrepancy between the output of libraries while they suppose to do the same.

Meet the Experts : https://nareshit.com/python-online-training/
CODE KARO YAARO
Tags: codingkids
Published: 2020-09-24 06:28:37

We at Code Karo Yaaro empowering every kid to become a Computer Science Expert by teaching them to develop mobile apps, gaming apps, websites, web applications, AI-Powered Mobile Apps, and Web Applications.

Your child is Just a Call away to become a Tech Leader of Tomorrow.
https://www.codekaroyaaro.com/
What about Phalcon?
Tags: php, phalcon, programming, framework
Published: 2020-09-24 05:43:03

I have worked with PHP for almost 20 years. Yes, it takes a lot of time. And in general I worked building my projects from scratch - or creating some kind of small custom framework to turn the work easier, more productive and less error prone. But when I first heard about Phalcon, I became really curious how it works.

> "A high-performance PHP framework, with a small memory footprint and a lot of cool features in it?"

Yes, it looks interesting. Maybe using Phalcon with other technologies, such as Swoole, Containers ( Docker and Kubernetes ), and Kafka, we could build solutions for high-load environments, like IoT, for example.

So, I started to play with it, and set a goal to build some applications, deploy and proceed with some benchmark tests. This is just the beginning. Anyone interested in joining me in this endeavour?


 

Credits:
Photo by <a href="/photographer/nazreth-43455">michael lorenzo</a> from <a href="https://freeimages.com/">FreeImages</a>
I made my website 28ms faster with content-visibility 🤓
Tags: website, html, css, speed
Published: 2020-09-24 05:42:25

You might think, what is 28ms? If you are a big advocate of speeding up the web and getting perfect scores on [Eleventy's speedlify dashboard](https://www.11ty.dev/speedlify/), it's a lot!

Not that I was doing bad, as you can see in the screenshot below. I just wanted to get full 100's and get the full potential out of my website.

![Speedlify score Daily Dev Tips](https://cdn.hashnode.com/res/hashnode/image/upload/v1600617117283/W32CWOIf5.png)

## Making use of content-visibility

I read about this CSS property a while ago. But never got round to implementing and testing it.
That is until today, so let's see what it actually does.

The content-visibility has three values we can use:

- `visible` (no effect, basically how it was before)
- `hidden` (a mix between display: none and visibility: hidden, it starts on display hidden, afterwords becomes visibility hidden)
- `auto` (This is the one we are looking at. It will only render this element once the browser needs it!)

So how can we add it to elements?

```css
.element {
    content-visibility:auto;
}
```

I've added this on my homepage to the article-list and footer elements.

## Before content-visibility

To give you a better understanding, I did a lighthouse test before these changes.

![Before content-visibility](https://cdn.hashnode.com/res/hashnode/image/upload/v1600617516594/DSO1L4EtX.png)

But more important is the actual trace where we can check the total time.

![Lighthouse trace](https://cdn.hashnode.com/res/hashnode/image/upload/v1600617553251/eXoyruH_a.png)

## After adding content-visibility

And then, after adding the content-visibility to those two elements, I've rerun the test.

![Before content-visibility](https://cdn.hashnode.com/res/hashnode/image/upload/v1600617608138/w0ibtiAgw.png)

And the trace:

![Lighthouse trace](https://cdn.hashnode.com/res/hashnode/image/upload/v1600617628097/TnFz-bqnQ.png)

That means it was 443ms and is now 415ms, which means + 28ms win!

Conclusion: There is no downside to not adding the `auto` one. It can only benefit your website, even the small numbers matter.

## Making sub-pages faster

I even added my `content-visibility` on the post pages, where the main content is set to `auto`.

The following screenshot is a before rendering:

![Before content-visibility](https://cdn.hashnode.com/res/hashnode/image/upload/v1600847657012/65P4MStWi.png)

And this is the after rendering:

![After content-visibility](https://cdn.hashnode.com/res/hashnode/image/upload/v1600847674875/ty0K10Fxl.png)

As you can see, it improved my score overall.
And adding `content-visibility` made the Time to Interactive 1.1s faster.

### Thank you for reading, and let's connect!

Thank you for reading my blog. Feel free to subscribe to my email newsletter and connect on [Facebook](https://www.facebook.com/DailyDevTipsBlog) or [Twitter](https://twitter.com/DailyDevTips1)
🐚 Install all your Atom packages 📦 from a file
Tags: atom, packages, dotfiles
Published: 2020-09-24 07:06:45

---
title: 🐚 Install all your Atom packages 📦 from a file
published: true
date: 2020-09-24 05:40:59 UTC
tags: atom,packages,dotfiles
cover_image: https://carloschac.in/public/images/atom-packages.png
canonical_url: https://carloschac.in/2020/09/24/backupinstall-atom-packages-tofrom-a-file/
---

Every time I have to set up a new computer, I have to remember the [Atom]((https://atom.io/))packages that I was using before and start installing them one by one.

Recently, I discovered that Atom comes with the Atom Package Manager or [apm]((https://github.com/atom/apm))that allows you to install Atom Packages from the terminal:

<!-- more -->

```
$ apm install asciidoc-preview

```

But the same tool also allows us to list the currently installed packages:

```
$ apm list


Built-in Atom Packages (93)
├── atom-dark-syntax@0.29.1
├── atom-dark-ui@0.53.3
├── atom-light-syntax@0.29.1
├── atom-light-ui@0.46.3
├── base16-tomorrow-dark-theme@1.6.0
├── base16-tomorrow-light-theme@1.6.0
├── one-dark-ui@1.12.5
.
.
.
├── language-xml@0.35.3
└── language-yaml@0.32.0

Community Packages (10) ~/.atom/packages
├── asciidoc-assistant@0.2.3
├── asciidoc-image-helper@1.0.1
├── asciidoc-preview@2.13.1
├── atom-beautify@0.33.4
├── atom-runner@2.7.1
├── autocomplete-asciidoc@0.1.2
├── intellij-idea-keymap@0.2.3
├── jekyll@2.1.0
├── language-asciidoc@1.11.0
└── platformio-ide-terminal@2.10.0

```

The output is vast since it includes all the built-in packages plus theinstalled ones. Let’s filter only the installed:

```
$ apm list --installed


Community Packages (10) ~/.atom/packages
├── asciidoc-assistant@0.2.3
├── asciidoc-image-helper@1.0.1
├── asciidoc-preview@2.13.1
├── atom-beautify@0.33.4
├── atom-runner@2.7.1
├── autocomplete-asciidoc@0.1.2
├── intellij-idea-keymap@0.2.3
├── jekyll@2.1.0
├── language-asciidoc@1.11.0
└── platformio-ide-terminal@2.10.0

```

A lot better, but we will also need to remove the noise from the output:

```
$ apm list --installed --bare


asciidoc-assistant@0.2.3
asciidoc-image-helper@1.0.1
asciidoc-preview@2.13.1
atom-beautify@0.33.4
atom-runner@2.7.1
autocomplete-asciidoc@0.1.2
intellij-idea-keymap@0.2.3
jekyll@2.1.0
language-asciidoc@1.11.0
platformio-ide-terminal@2.10.0

```

If we want to remove the specific versions to tell `apm` that we want the latestversions instead, we can filter the output with `grep`:

```
$ apm list --installed --bare | grep '^[^@]\+' -o


asciidoc-assistant
asciidoc-image-helper
asciidoc-preview
atom-beautify
atom-runner
autocomplete-asciidoc
intellij-idea-keymap
jekyll
language-asciidoc
platformio-ide-terminal

```

Now that we have a clean list of our installed packages, we can store it in atext file:

```
$ apm list --installed --bare | grep '^[^@]\+' -o > atom-packages.txt

```

We can store this file in dotfiles, Github, Gists, Gitlab, Dropbox, or evenemail and then run the following command to install all the packages i.e., fornew installations:

```
$ apm install --packages-file atom-packages.txt

```
Neumorphism Button
Tags: codepen, html, css, javascript
Published: 2020-09-24 05:32:56

---
title: Neumorphism Button
published: true
description: Neumorphism Button
tags: codepen, html, css, javascript
---


{%codepen https://codepen.io/ahmadbassamemran/pen/GRZwEOX %}

<hr/>
[Do Not Forget To Like & Subscribe In The Channel:](https://www.youtube.com/AhmadEmran?sub_confirmation=1)
<hr/>
GraphQL field names in Ruby
Tags: todayilearned, ruby, graphql
Published: 2020-09-28 12:41:08

---
title: GraphQL field names in Ruby
published: true
date: 2020-09-24 05:27:17 UTC
tags: TIL,Ruby,graphql
canonical_url: https://andreligne.io/graphql-field-names-in-ruby/
---

While building a GraphQL API, I noticed that many times the name of the field on the type didn’t match the name of the method on the object.

```rb
class Types::UserType < Types::BaseObject
  field :is_active, Boolean, null: false
  field :is_banned, Boolean, null: false
  
  def is_active
    object.active?
  end

  def is_banned
    object.banned?
  end
end
```

This caused me to have to write custom methods in the Object type that acts as a proxy for the calling the method.

It turns out there’s a [documented way](https://graphql-ruby.org/fields/introduction.html#field-resolution) in the `graphql-ruby` gem that basically does all of this for you - the `method` attribute.

And by using the `method:` attribute, we can rewrite our previous example like so:

```rb
class Types::UserType < Types::BaseObject
  field :is_active, Boolean, null: false, method: :active?
  field :is_banned, Boolean, null: false, method: :banned?
end
```

We can now keep writing methods using the usual Ruby conventions but expose them in the schema using names that make sense for the API consumer.
Intro to Logistic Regression with sklearn
Published: 2020-09-24 04:58:59

# What is Logistic Regression

Logistic regression is a method used for binary classification problems. In other words it classifies your data as 0 or 1. Some examples of cases where LR is used include detecting if an email is spam or not, if someone will vote, or even the risk of developing a disease.  To do this LR uses the Logistic Function, hence the name Logistic Regression. 

#Logistic Function

The Logistic function is an s-shaped curve with the equation 1/e^-x. As you can see below it can map out any real number to a value between 0 and 1 though not those limits itself. 
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/rxr1isuo54cp5gwdjgjw.png)

#Example

Download the dataset from Kaggle: https://www.kaggle.com/c/titanic/data?select=train.csv

Then import the needed libraries as well as the dataset.

```
import pandas as pd
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import train_test_split
from sklearn.metrics import mean_squared_error, mean_squared_log_error

df = pd.read_csv('../../Downloads/train.csv')
df.head()
```
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/vd57906tui1chtbtjluu.png)

Next we are going to change the categorial data into indicator variables and get rid of the features that we don't need such as the peoples names.

```
x_feats = ['Pclass', 'Sex', 'Age', 'SibSp', 'Fare', 'Cabin', 'Embarked']
X = pd.get_dummies(df[x_feats], drop_first=True)
y = df['Survived']
X.head()
```
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/ejw203hien3l84qmwns7.png)

Lastly before we get to building our model, we are going to fill any missing values as well as normalize our data, this helps our model run faster, though it is not required for logistic regression. 

```
# Fill missing values
X = X.fillna(value=0) 
for col in X.columns:
    # Subtract the minimum and divide by the range forcing a scale of 0 to 1 for each feature
    X[col] = (X[col] - min(X[col]))/ (max(X[col]) - min(X[col])) 
```

Now we can actually split our data and add our model.

```

X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=0)

logreg = LogisticRegression(fit_intercept=False, C=100, solver='liblinear')
model_log = logreg.fit(X_train, y_train)
model_log
```

Then finally we can check out how our model performed.

```
print('Training r^2:', logreg.score(X_train, y_train))
print('Test r^2:', logreg.score(X_test, y_test))
print('Training MSE:', mean_squared_error(y_train, logreg.predict(X_train)))
print('Test MSE:', mean_squared_error(y_test, logreg.predict(X_test)))
```
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/jqg3jbhkf4x4v8azfkw4.png)

78% on the testing, not too shabby for predicting if someone survived from the titanic or not. As you can see from the step I created the model I increased C from it's default 1 to 1000, by increasing this value it becomes more likely that the parameters will be increased in magnitude simply to adjust for small perturbations in the data. I would suggest playing with this value and seeing how it changes your predictions.
How to increase wordpress speed on FireFox
Tags: wordpress, swift
Published: 2020-09-24 04:23:32

I have this client who have a WordPress website, his is facing this weird issue where he is getting good website speed on Google chrome but when he try to open this website in FireFox then it takes too much time to load. Also I tried it on my computer and I am facing the same issue, this is the first time I have seen this kind of issue, can anyone please tell me that could be the possible reason of it?
[Pagination- Laravel 8] Web Artisans (CLI) Step By Step Example
Tags: laravel, react, angular
Published: 2020-09-24 04:15:30

Are you looking for an example of laravel 8 pagination example? laravel 8 pagination with Product table then I will give a simple example with a solution laravel pagination. I explained step by step laravel 8 pagination tutorial. let’s discuss pagination in laravel 8.

```
<?php
  
namespace App\Http\Controllers;
  
use Illuminate\Http\Request;
use App\Models\User;
  
class UserController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function index()
    {
        $data = User::paginate(5);
        return view('users',compact('data'));
    }
}
```

[[Pagination- Laravel 8] Web Artisans (CLI) Step By Step Example](https://www.phpcodingstuff.com/blog/laravel-8-pagination-example-tutorial.html)
Como Trocar a Senha de um Usuário no Linux Ubuntu?
Tags: tecnologia, linux, ubuntu
Published: 2022-03-31 20:57:00

---
title: Como Trocar a Senha de um Usuário no Linux Ubuntu?
published: true
date: 2020-09-24 04:01:14 UTC
tags: Tecnologia,linux,ubuntu
canonical_url: https://marquesfernandes.com/tecnologia/como-trocar-a-senha-de-um-usuario-no-linux-ubuntu/
---

 ![](https://marquesfernandes.com/wp-content/uploads/2020/09/Linux-Wallpaper-42-150x150.jpg)

Você precisa alterar a senha de uma conta de usuário no Linux, talvez para acessar um sftp ou ssh no Ubuntu. Como alterar a senha de um usuário no Ubuntu Linux?

As informações da sua conta Ubuntu Linux são armazenadas em um arquivo com o nome <kbd><strong>/etc/passwd</strong></kbd>e a senha criptografada em <kbd><strong>/etc/shadow</strong></kbd>. Felizmente, para sua segurança, não é possível ter acesso a senhas já armazenadas em texto limpo. 

## Como Alterar uma Senha de Usuário no Ubuntu

1. Abra o terminal pressionando <kbd>Ctrl</kbd>+ <kbd>Alt</kbd>+<kbd>T</kbd>
2. Para alterar a senha de um usuário chamado _henrique_ no Ubuntu, digite:  
<kbd><strong>sudo passwd henrique</strong></kbd>
3. Para alterar a senha do usuário root no Ubuntu Linux, execute:  
<kbd><strong>sudo passwd root</strong></kbd>
4. E para alterar sua própria senha para o Ubuntu, execute:  
<kbd><strong>passwd</strong></kbd>

## Como altero a senha da conta do usuário no Ubuntu?

Abra novamente uma janela de terminal. Digite o seguinte comando para alterar a senha de uma conta de usuário regular do Ubuntu chamada _henrique_:

`sudo passwd {nomeDoUsuario}sudo passwd henriquesudo passwd marques`

## Conclusão

Este é um tutorial rápido ensinando como alterar a senha de qualquer usuário no Linux Ubuntu, lembrando que você sempre precisará ter acesso elevado e executar os comandos usando o `sudo`.

O post [Como Trocar a Senha de um Usuário no Linux Ubuntu?](https://marquesfernandes.com/tecnologia/como-trocar-a-senha-de-um-usuario-no-linux-ubuntu/) apareceu primeiro em [Henrique Marques Fernandes](https://marquesfernandes.com).
Set Class Fields Using 'out' Parameters
Tags: csharp, dotnet, syntax, tips
Published: 2020-09-24 03:20:43

---
title: "Set Class Fields Using 'out' Parameters"
published: true
description: "A creative way that you can leverage 'out' parameters on your class methods."
tags: csharp,dotnet,syntax,tips
author: "Casey McQuillan"
canonical_url: https://quill.codes/tips/set-class-fields-with-out-parameters/
---

## Did You Know?

### You can set class fields with 'out' method parameters

Whether you like `out` parameters or not in C#, they are here to stay. They decorate a number of common patterns in the .NET ecosystem.

* The `TryParse` pattern where the return is a `bool` that indicates success and your parse result comes from the `out` parameter.


However, very often you want to set your class field with the parse result. At first you would assume that you need to declare a temporary variable to hold the value and then assign the field.

```csharp
public class MyClass
{
  private int _parsedIntField;

  public MyClass(string strToParse)
  {
    if (!Int32.TryParse(strToParse, out int result))
    {
      throw new ArgumentException("Please provide a valid numerical string.", nameof(strToParse));
    }

    _parsedIntField = result;
  }
}
```

However, this isn't necessary. Turns out you can just set the field directly.

```csharp
public class MyClass
{
  private int _parsedIntField;

  public MyClass(string strToParse)
  {
    if (!Int32.TryParse(strToParse, out _parsedIntField))
    {
      throw new ArgumentException("Please provide a valid numerical string.", nameof(strToParse));
    }
  }
}
```
How to convert your name to Japanese Katakana.
Tags: kana, japanese, translate, katakana
Published: 2020-09-24 02:15:52

If you want to convert your name to Japanese Katakana ( same meaning as Kana, カタカナ, カナ ), you can use the Google translate.


Input your name on the Google translate, and then check the pronounce by the Speaker icon.


i.g. ) John Smith -> ジョン スミス
https://translate.google.com/#view=home&op=translate&sl=auto&tl=ja&text=John%0ASmith

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