teleren/devto huggingface dataset:
How to clear all problems in last shelter setting
Published: 2019-12-13 08:02:37

For the glory of the Last Shelter, for the Revenge of justice, for cleaning up the "virus" of in Last Shelter game, for obtaining the living space for the country All these crazy behaviors come from "looking at problems like a country", and there is a perfect theoretical support behind them, but the final result is only one, which is to create a continent full of corpses, which is also our mentality when playing Last Shelter survival: because of the game settings, we have to look down on problems, which makes us subconsciously focus on a few "genera" In terms of sex and indicators, such as economic efficiency and moral level, other equally important things are ignored. What's more, the connection between these games and daily life is very loose - it makes you feel that everything is right, and you will not be aware of the harm caused by the above behaviors at all. Of course, in reality, restricted by various factors, few people have been so reckless. Many Last Shelter game versions also include moral options to prevent players from going astray. However, this does not explain the question: as a Last Shelter player, why do we give up thinking like ordinary people? There is an explanation for this, which needs us to give up the perspective of ordinary people to understand. Similar problems plague people at the peak of power. Because they represent the state machine, their decisions are closely related to the fate of millions of people. In the face of all kinds of contradictions, the most simple and clear solution is to give up the original position, stand on the national perspective, and make the vision more professional (or narrow). When you do this with [Last Shelter Survival hack](http://lastsheltercheat.club/), you will find that many problems in game will disappear. Not only that, as the most influential political theory works of the 20th century, people, country and war also put forward another explanation: Although the personality and cultural factors of political figures can help us understand the origin of many events, to truly understand "international politics" (or the "system" of real-time strategic games), you must jump out of personal perspective and turn to Look at everything from a national perspective.
Day 13 of the Visual Studio Tips Advent Calendar is now live
Tags: visualstudio
Published: 2019-12-13 07:52:40

Day 13 of the Visual Studio Tips Advent Calendar is now live. Enjoy! 

Friday 13th, unlucky for some, but not you or I!

https://visualstudiotips.co.uk/calendar/

#VisualStudio #DevDecember #VsTipsAdvent #Advent
How to access views directly with ViewPager2
Tags: android, viewpager2, kotlin, androidx
Published: 2019-12-13 07:05:00


## TL;DR:

You can use 

```kotlin
(viewPager2.getChildAt(0) as RecyclerView)
```

to access the internal `RecyclerView` used inside the `ViewPager2` for now, and you can call [`findViewHolderForAdapterPosition()`](https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.html#findViewHolderForAdapterPosition(int)) or [`findViewHolderForItemId()`](https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.html#findViewHolderForItemId(long)) as usual.

## Explanation:

I had a custom view implementing a `ViewPager` which could, in some cases, modify the inner views without having to recompute all of them for a small change.

This is not possible to do as such anymore, as the internal implementation is a bit different. As you know, `ViewPager2` now uses a [`RecyclerView.Adapter`](https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.Adapter.html) to handle the paged views, but how is it used internally?

#### Internals:

If we look at the children of an initialized `ViewPager2`, we can see there is only one, a `RecyclerViewImpl`. [`RecyclerViewImpl`](https://github.com/aosp-mirror/platform_frameworks_support/blob/androidx-master-dev/viewpager2/src/main/java/androidx/viewpager2/widget/ViewPager2.java#L927) is a new internal class used to manage the `ViewPager2` internally, bringing a lot of benefits that [`ReyclerView`s](https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.html) have to `ViewPager`. Unfortunately, this class is private and therefore inaccessible outside of `ViewPager2`. So we're stuck?

Nope! `RecyclerViewImpl` inherits from `RecyclerView`, and it should be enough in most cases, and thankfully in ours, to use.

##### Solution:

So then we can use:

```kotlin
(viewPager2.getChildAt(0) as RecyclerView)
```

to access the internal `RecyclerView`.

We can quickly wrap that in a Kotlin extension function to hide the complexity and simplify the use:

```kotlin
fun ViewPager2.findViewHolderForAdapterPosition(position: Int): RecyclerView.ViewHolder? {
    return (getChildAt(0) as RecyclerView).findViewHolderForAdapterPosition(position)
}
```

You can adapt to something that suits your needs better of course, like for example directly returning the `ViewHolder.itemView`.

**:warning: Warning :** This relies on internal implementation, which could change at any time without warning. For now this is the only way that I found to access the underlying views, but a feature request is open [here](https://issuetracker.google.com/issues/146101900).
Optimize Redux before it kills your Application
Tags: react, redux, productivity, javascript
Published: 2019-12-13 06:28:42

First of all, let’s take a look at how a React-Redux application works. What Redux does internally, It provide us with a store for our app’s state and with ways to communicate with the store. One of these ways is the connect() function. After calling connect() on a custom component you get a wrapper that passes state from a store as props to your component. This happens by means of mapStateToProps() function which is called on every state change.

After mapStateToProps() yields recalculated props, the new props are shallow compared to the old ones and if they differ, component gets rerendered. Again, reference equality (===) is used to compare the props.

**React and Redux** compliment each other well. React Components subscribe to Redux store due to which the child components re renders when the state (Redux state) is changed every time. So any component which is subscribed to Redux re renders when there is a state change (unless and until we mention not to do so). 

This is a prime reason for which there is a need for optimizing React Redux applications in order to avoid unnecessary re renders.

To avoid all such conflicts, there are certain ways which are described below :

1) Using React’s PureComponent, React shallow compares previous props and current props and avoid re rendering if there is no change.
2) Using shouldComponentUpdate lifecycle we can selectively avoid re rendering of a React Component.
3) Using functional components when there is no use of internal state.

This can help in avoiding re rendering unless and until there is a prop change which is consumed by the component.

To handle this problem we have reselect library which works flawlessly in this case:

##Reselect Concept
According to the library’s homepage
Selectors can compute derived data, allowing Redux to store the minimal possible state. Which can be considered as keep the store as minimal as possible. Compute any derived data through the selectors.
Selectors are efficient. A selector is not recomputed unless one of its arguments change.

For code Example and full article please check on [https://medium.com/javascript-in-plain-english/optimize-redux-before-it-kills-your-application-6b73cf5f520b]
Bash Prompt snip for IBM Cloud
Tags: bash, ibmcloud, ps1
Published: 2019-12-11 23:19:53

The below script will add a pleasing visual queue of which account and region your are targeted at with IBM Cloud. Turn off color by setting `$IBMCLOUD_PS1_COLOR_NO` to any value. `set_prompt` and `PROMPT_COMMAND` example below is just an example and you can use the `__ibmcloud_ps1` function anywhere you'd configure your prompt.

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/ihw157695ddji3cw4yaf.png)

```bash
# From Arch Wiki

txtblk='\e[0;30m' # Black - Regular
txtred='\e[0;31m' # Red
txtgrn='\e[0;32m' # Green
txtylw='\e[0;33m' # Yellow
txtblu='\e[0;34m' # Blue
txtpur='\e[0;35m' # Purple
txtcyn='\e[0;36m' # Cyan
txtwht='\e[0;37m' # White
bldblk='\e[1;30m' # Black - Bold
bldred='\e[1;31m' # Red
bldgrn='\e[1;32m' # Green
bldylw='\e[1;33m' # Yellow
bldblu='\e[1;34m' # Blue
bldpur='\e[1;35m' # Purple
bldcyn='\e[1;36m' # Cyan
bldwht='\e[1;37m' # White
unkblk='\e[4;30m' # Black - Underline
undred='\e[4;31m' # Red
undgrn='\e[4;32m' # Green
undylw='\e[4;33m' # Yellow
undblu='\e[4;34m' # Blue
undpur='\e[4;35m' # Purple
undcyn='\e[4;36m' # Cyan
undwht='\e[4;37m' # White
bakblk='\e[40m'   # Black - Background
bakred='\e[41m'   # Red
bakgrn='\e[42m'   # Green
bakylw='\e[43m'   # Yellow
bakblu='\e[44m'   # Blue
bakpur='\e[45m'   # Purple
bakcyn='\e[46m'   # Cyan
bakwht='\e[47m'   # White
txtrst='\e[0m'    # Text Reset


# Prompt snippet to show ibmcloud account status 
__ibmcloud_ps1() {
    if [ -f ~/.bluemix/config.json ]; then
        ibm_user=$(cat ~/.bluemix/config.json  | jq '.Account.Owner' | tr -d '"')
        region=$(cat ~/.bluemix/config.json  | jq '.Region' | tr -d '"')
        if [ ! -z "${IBMCLOUD_PS1_COLOR_NO}" ]; then
            echo "${ibm_user}@${region}"
        else
            echo "\[${bldpur}\]${ibm_user}\[${txtrst}\]@\[${bldylw}\]${region}\[${txtrst}\]"
        fi
    fi

}


# Just an example of where this goes
set_prompt() {
    PS1="[$(__ibmcloud_ps1)]"
    PS1+="\[${bldgrn}\]\u@\h\[${txtrst}\]:\[${bldblu}\]\w\[${txtrst}\]$ "
}

PROMPT_COMMAND=set_prompt

```
Where should I begin and what steps should I follow to make simple app that fetches data from a website or displays on app?
Tags: webdev, javascript, reactnative, database
Published: 2019-12-13 06:20:51

Where should I begin and what steps should I follow to make simple app that fetches data (music notes of songs) from a website (without api) and then displays in a app (react native) ?

I'm trying to create a simple react native app that will fetch musical notes from a website for songs and display it on the app.

Link to website : http://www.keylessonline.com/list/tamil

I have basic knowledge of HTML,CSS, Javascript ..

But I don't know where to begin now. I found that you need to an API to fetch data...but that website doesn't have an API .

Can you guys help me with what I should be doing and how to proceed.

I'm doing this as my personal project.

I want it to look something like this , but more styled .

![One](https://lh3.googleusercontent.com/VCeZctfExcnxU6AjPqlIToDijHE_0-JhSlAT38DbaQR5rI9Nv1J0u1mB5Ga4VF-HZ_Q=w1920-h861-rw)
![2](https://lh3.googleusercontent.com/KEbkGAe9Y3Zqz_L6wmGBsL0rB7zfV--XrF-a4Z8CKV7_bpIamnrCMDijhUcPMN1X_Oc=w1920-h861-rw)
![3](https://lh3.googleusercontent.com/QR8VT2wEeiu10qdcdtcaY3dcSkYOwB0m8IP11hF7J_Sq96SDPKagFw2NKcgUXv4yN9wJ=w1920-h861-rw)
![4](https://lh3.googleusercontent.com/yBeAMdd-DztN1WV9WcGlg5CCflYzfwNo-DdW62whQGBa2_8LbRKfhZgQ87iKL3az_SA=w1920-h861-rw)

TLDR : Basically , I want to create an app that fetches data from the website (or offline, if I have to scrape the data before hand) and displays it on the app.
Advent of Code 2019 Solution Megathread - Day 13: Care Package
Tags: adventofcode, challenge, adventofcode2019, spoilers
Published: 2019-12-13 06:06:29

---
title: Advent of Code 2019 Solution Megathread - Day 13: Care Package
published: True
description: Video games! My ouevre!
tags: adventofcode,challenge, adventofcode2019, spoilers
series: Advent of Code 2019 Solutions
cover_image: https://i.imgur.com/fXZWjtL.png
---

It's time to break out our IntCode interpreter and do something useful for once: play breakout.

### [Day 13 - The Problem](https://adventofcode.com/2019/day/13)
Man, flying through the void is really boring. Good thing those elves are looking out for us and sent us some in-flight entertainment. It seems to be a rudimentary breakout clone. Bounce the ball off your paddle to break all the bricks.

In order to check the status of the code, Part 1 asks us to verify that we see the proper number of blocks on the screen when the game starts.

Part 2 is to actually play the game and report our high score!

### Ongoing Meta

#### Dev.to List of Leaderboards

* `120635-5c140b9a` - provided by [Linda Thompson](https://dev.to/lindakatcodes) 

 If you were part of [Ryan Palo](https://dev.to/rpalo)'s leaderboard last year, you're still a member of that! 

If you want me to add your leaderboard code to this page, reply to one of these posts and/or send me a DM containing your  code and any theming or notes you’d like me to add. (You can find your private leaderboard code on your "[Private Leaderboard](https://adventofcode.com/2019/leaderboard/private)" page.)

I'll edit in any leaderboards that people want to post, along with any description for the kinds of people you want to have on it. (My leaderboard is being used as my office's leaderboard.) And if I get something wrong, please call me out or message me and I’ll fix it ASAP.

There's no limit to the number of leaderboards you can join, so there's no problem belonging to a "Beginner" *and* a language specific one if you want.

#### Neat Statistics

I'm planning on adding some statistics, but other than "what languages did we see yesterday" does anyone have any ideas?

##### Languages Seen On Day 12

> Under construction
Basic HTML Page
Tags: html, beginners
Published: 2019-12-13 05:59:30

The basic HTML page looks as shown below:

    < !doctype html >

    < html >

    < head >

        < title>Basic web page < /title>

    < /head>

    < body>

    < /body>
    < /html>

1. < !doctype html> : This is used to tell the browser about the version of HTML used in the document. 
2. < html> : This defines the root of html and wraps the code inside it.
3. < head> : This tag conatins tags like < style> tag, < title> tag, Inpage css etc.
4. < body> : This tag contains the actual data that is to be displayed on a web page.
    Body tag contains other tags like < div> tag, < span> tag,< p> etc.These tags are used to form the structure of the web page.

    HTML Heading Tags:
    1. < h1> < /h1>
    2. < h2> < /h2>
    3. < h3> < /h3>
    4. < h4> < /h4>
    5. < h5> < /h5>
    6. < h6> < /h6>

    Every tag has opening tag and closing tag and within them is the text to be displayed. 
    These heading tags are used to define the headings of the web page according to their requirements.

    Paragraph Tag:

    Paragraph tag is denoted by < p>(opening tag) < /p>(closing tag) and within these tags we can write the text to be displayed.

    HTML Images:

    In order to insert images into the webpage we can use < img> tag.
    < img src="source-of-the-image" alt="alternative-text">
    
    List tags:

    We have three types of lists:
    1. Ordered List.
    2. Unordered List.
    3. Definition List.



    ORDERED LIST:
    
    The tags used for ordered list is < ol> < /ol> and inside these tags comes list item tag denoted by < li> </ li>.

        < ol>

        < li>One < /li>

        < li>Two < /li>

        < li>Three < /li>

        < /ol>


     UN-ORDERED LIST:
    
    The tags used for ordered list is < ul> < /ul> and inside these tags comes list item tag denoted by < li> </ li>.

        < ul>

        < li>One < /li>

        < li>Two < /li>

        < li>Three < /li>

        < /ul>

     DEFINITION LIST:

    Definition list is used to display description list.
         
    Tags used are:

        < dl> 

        <dt>Item-1</dt>

        <dd>Definition-1</dd>

        <dt>Item-2</dt>

        <dd>Definition-2</dd>

        < /dl>

    < dt> : It is used to define the item to be described.

    < dd> : It is used to give description about the item. 

    Both of these tags are wrapped inside the < dl> tag.

    We will continue to understand more tags in future posts.
The real difference between let, const and var
Tags: javascripttips, javascript
Published: 2019-12-13 05:30:01

The real difference between let, const and var:

let {👫 } = 💔;

const {👪 } = ❤️;

var {👬👭} = 💖

#JavaScriptTips #LetvsConstvsVar
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/prd8jk3haelvsl10rtzz.png)
Dec. 13, 2019: What did you learn this week?
Tags: weeklylearn, discuss, weeklyretro
Published: 2019-12-13 05:00:05

It's that time of the week again. So wonderful devs, what did you learn this week? It could be programming tips, career advice etc.

![Claymation owl teacher helping a student owl](https://media.giphy.com/media/3ohzdU2IVgD2goFS3S/giphy.gif)

Feel free to comment with what you learnt and/or reference your TIL post to give it some more exposure.

{%tag todayilearned %}

And remember, if something you learnt was a big win for you, then you know where to drop it as well.👇👇🏻👇🏼👇🏽👇🏾👇🏿

{% link https://dev.to/jess/what-was-your-win-this-week-51cn %}

![Winning!](https://media.giphy.com/media/OHZ1gSUThmEso/giphy.gif)
Who am I? Me, the name of the currently executing method in C# (Part 2)
Tags: csharp, todayilearned
Published: 2019-12-13 04:40:36

It seems that thinking about `Me` all the time is problematic *outside* of personal relationships as well as within them. In [part 1](https://dev.to/bugmagnet/who-am-i-the-name-of-the-currently-executing-method-in-c-bai) I discussed my JavaScript and C# implementation of `Me`. 

A couple of exceptionally helpful people have pointed out that my approach is rather expensive in terms of run-time speed. Being curious (and desiring to be distracted), I cooked up a quick benchmark of the two approaches (mine and the one suggested by [Matt Eland](https://dev.to/integerman)).

The benchmarking code is derived from a [Stackoverflow](https://stackoverflow.com/questions/16376191/measuring-code-execution-time) solution provided by one [Alex Erygin](https://stackoverflow.com/users/1549113/alex-erygin).

First the benchmarking code:
```csharp
using System;
using System.Diagnostics;

namespace dotnets
{
    public class Benchmark : IDisposable
    {
        private readonly Stopwatch timer = new Stopwatch();
        private readonly string benchmarkName;

        public Benchmark(string benchmarkName)
        {
            this.benchmarkName = benchmarkName;
            timer.Start();
        }

        public void Dispose()
        {
            timer.Stop();
            Console.WriteLine($"{benchmarkName} {timer.Elapsed}");
        }
    }
}
```
Then the Main
```csharp
using System;
using System.Diagnostics;

namespace dotnets
{
    class Program
    {
        private static string Me => new StackTrace().GetFrame(1).GetMethod().Name;

        static void Main(string[] args)
        {
            using (var bench = new Benchmark("Using Me"))  {
                for(var i = 0; i < 1000; i++) foo1();
            }
            using (var bench = new Benchmark("Using nameof"))  {
                for(var i = 0; i < 1000; i++) foo2();
            }
        }

        static string foo1()
        {
            var me = Me;
            return me;
        }
        static string foo2()
        {
            var me = nameof(foo2);
            return me;
        }
    }
}
```
Then a copy of a Debug run
```cmd
>dotnet run
Using Me 00:00:00.0122772
Using nameof 00:00:00.0001258
```
and a Release run
```cmd
>dotnet run -c Release
Using Me 00:00:00.0164321
Using nameof 00:00:00.0000010
```
`nameof` being resolved at compile-time is clearly the winner. So if run-time speed is an issue for you, use `nameof`.
Angular 8 Httpclient Post Request Example
Published: 2019-12-13 07:15:52

---
title: Angular 8 Httpclient Post Request Example
published: true
date: 2019-12-13 04:24:24 UTC
tags: 
canonical_url: https://www.itsolutionstuff.com/post/angular-8-httpclient-for-sending-http-request-exampleexample.html
---

Todays topic is how to send http post request using HttpClient module in angular 8 i want to share with you examples of sending http request with HttpClient in angular 8 for post request get request put request delete request you will easily understand how you can send angular 8 httpclient get
(BF Heroes and BFPF4) Looking for Delevopers and staff 
Published: 2019-12-13 03:33:22

I'm looking for people interested in working on a project to create a BFHeroes and BfPF4 private server.
both games already have ways to create a private server
but it's not close to complete
the limitations at the moment is the old server available (2010)
preventing complete server functionality
would need to create an emulator for the latest version server (2015)

At the moment we have Launcher and website for BFH (not one of the best but a good base)

for BFP4F we have the backend and launcher made by Warranty voider (you can easy find this in youtube)
At the moment we have Launcher and website for BFH (not one of the best but a good base)

for BFP4F we have the backend and launcher made by Warranty voider (you can easy find this in youtube)

we need good people in:
C # (launcher and backend of BFP4F)
WebDev (for Website and Menu of BFP4F)
Golang (to work in the BFH backend)
cracker/reverse enginner(To reverse functions and packages of both games to create a server emulator)

You can talk to me directly By my Discord(Peach#6997)
What’s making you laugh these days?
Tags: watercooler
Published: 2019-12-13 03:12:46

I watched the movie Hot Rod with Andy Samberg around the time it came out (2007), but it popped in the Netflix catalog yesterday. I gave it a watch again and I was dying. 😂

Here’s a preview

{%youtube TOUrLn1FFCA %}

What’s been making you laugh recently?
CSS SpongeBob
Tags: codepen
Published: 2019-12-13 02:37:35

As a kid, I was _obsessed_ with SpongeBob SquarePants. Sometimes a little nostalgia can cure my periods of whatdoiwantocodetoday indecisiveness. So here's to the little dude that lives in a pineapple. And to nostalgia. 

{% codepen https://codepen.io/cedavis12/pen/KjZyBP %}
Create an NPM Package from a React component
Tags: react, javascript, npm, tutorial
Published: 2019-12-13 02:25:57


{% youtube esyS87NfBOw%}

I've made the video tutorial on how to create an NPM Package from your React Component. And in this article, I'd like to illustrate it with code. All details you can find in the [GitHub repo](https://github.com/guandjoy/create-npm-package-from-react-component) of this tutorial.

Package setup `./package.json`:
```json
{
  "name": "super-lemon",
  "version": "1.0.0",
  "description": "",
  "main": "./build/index.js",
  "scripts": {
    "build": "webpack"
  },
  "author": "guandjoy",
  "license": "ISC",
  "devDependencies": {
    "@babel/core": "^7.7.5",
    "@babel/preset-env": "^7.7.6",
    "@babel/preset-react": "^7.7.4",
    "babel-loader": "^8.0.6",
    "css-loader": "^3.3.0",
    "style-loader": "^1.0.1",
    "webpack": "^4.41.2",
    "webpack-cli": "^3.3.10"
  },
  "dependencies": {
    "@material/react-button": "^0.15.0",
    "prop-types": "^15.7.2",
    "react": "^16.12.0"
  }
}
```
Babel presets `./.babelrc`:
```json
{
  "presets": ["@babel/preset-react", "@babel/preset-env"]
}
```
Webpack configurations `./webpack.config.js`:
```js
var path = require("path");

module.exports = {
  mode: "production",
  entry: "./src/index.js",
  output: {
    path: path.resolve("build"),
    filename: "index.js",
    libraryTarget: "commonjs2"
  },
  module: {
    rules: [
      { test: /\.js$/, exclude: /node_modules/, loader: "babel-loader" },
      {
        test: /\.css$/,
        loader: "style-loader!css-loader"
      }
    ]
  },
  externals: {
    react: "react"
  }
};
```
Our React Component `./src/index.js`:
```react
import React from 'react'

function Component() {
  return <div>Our package</div>
}

export default Component
```

Once you created all the files, you can build a bundle:
```shell
npm run build
```

Create a link to test it locally, before publishing:
```shell
npm link
```

And don't forget to use the instance of React from the environment you were going to test it:
```shell
npm link ../path/to/application/node_modules/react
```
Publish, once it works:
```shell
npm publish
```

Thanks for watching! Hope it helped you to develop your own not a lemon library :blush: