teleren/devto huggingface dataset:
How to Find the Page ID for a Wikipedia page (e.g. to use with the MediaWiki Action API)
Published: 2022-01-25 18:14:58

If you use WikiPedia's API to access pages, such as to print a summary like I do here on this [bell hooks quotes page](https://discoverquotes.com/bell-hooks/), you sometimes need to know the actual WikiPedia Page ID of the page to successfully get the right information.

To explain better -- when using the [MediaWiki Action API](https://www.mediawiki.org/wiki/API:Main_page) to access pages, you can search for a page and will often get an exact match, e.g. in Python code, the below call works:

`wikipage = wikipedia.page("bell hooks") `

(I am using the [excellent Python library that wraps the WikiMedia API by Jon Goldsmith](https://github.com/goldsmith/Wikipedia) above)

but some terms do not return an exact match, or not the one you meant, e.g.:

`wikipage = wikipedia.page("John Smith") `

So instead you should use a wikipedia page id.  Find this by going to wikipedia.org and finding your page, e.g: [https://en.wikipedia.org/wiki/Bell_hooks](https://en.wikipedia.org/wiki/Bell_hooks).  Then on that page -- in the left sidebar -- there is a "Tools" section:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3mkpmcdh442lxtlz0ctt.png)

Select the "Page Information" section under the Tools category.

Then you can see the Page ID:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x8q1ibzb11j7j17k2e1w.png)
Introduction to YAML
Tags: devops, yaml
Published: 2022-01-25 18:13:55

Let's start getting info about **YAML** by firstly knowing its full form.
**YAML** stands for *YAML ain't markup language*.
**What is YAML?**
- YAML is actually a data format used to exchange data.
- It is similar to [XML](https://developer.mozilla.org/en-US/docs/Web/XML/XML_introduction) and [JSON](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/JSON) data-type.
- So, YAML is a simple human-readable language that can be used to **represent data**.
- In YAML you can store only data and not commands, unlike other programming languages.
**Data Serialization and Deserialization**
**Serialization - **
This is actually the process of converting the data objects into complex data structures or streams of bytes. Basically, data objects present in complex data structure into the stream of storage that can be used to transfer data in your physical device.
The below image can be helpful to understand this concept: 👇
![1643133237799.jpg](https://cdn.hashnode.com/res/hashnode/image/upload/v1643133313800/XHIIxqHYh.jpeg)
The above thing happens on JSON too in which we call **API** which gets converted to JSON DATA which is more human-readable.
![1643133431800.jpg](https://cdn.hashnode.com/res/hashnode/image/upload/v1643133520980/1ifrws7Xp.jpeg)
The above image shows how the **Serialization** process stores data.
- Objects are basically, code together with some data.
- Data Objects are converted into a series of bytes which saves the state of an object in a form that is easily transmittable
**This is known as Serialization**.
Fields like Big Data, Machine Learning, DevOps, etc. uses this concept
**Serialization Languages: ** JSON,XML and YAML
**De-serialization- **
The file which was converted during serialization can be converted back to an object is Deserialization.
**Object - > File**  (*Serialization*)
**File - > Object**  (*Deserialization*)
See how simple could it be😊.
**Types of Objects YAML stores-**
- Configuration Files of any tools or whatever, some are Kubernetes Config File, Flutter Pubspec YAML file, Docker, etc.
- Log files, caches, etc.
**Benefits of YAML**
- Simple and Easy to read.
- It has a strict syntax(Mistakes aren't allowed like indentation).
- Easily convertible to JSON, XML.
- Most languages use YAML.
- More powerful while representing complex data
- Various tools are available like parsers.
- Parsing is easy.

This was it for now, for the next and last article about YAML and it's datatypes click [here](https://dev.to/sumitmukharjii/yaml-datatypes-and-real-world-examples-10dh).
Also available in Hashnode [here](https://sumitmukharjii.hashnode.dev/introduction-to-yaml)
Using Python and the Wikipedia API to Easily Add Wikipedia Summaries to Your Website
Tags: wikipediaapi, wikipedia, python, django
Published: 2022-01-25 17:57:29

Wikipedia has a [MediaWiki Action API](https://www.mediawiki.org/wiki/API:Main_page) that you can access to very easily add useful reference content to your website.  

For a use case, I use it to add a summary of each author to "quotes by authors" pages for a quotes website. An example here: [Quotes by Albert Einstein](https://discoverquotes.com/albert-einstein/) has a long wikipedia summary about Einstein.  The Wikipedia API returns much shorter summaries (typically a single paragraph) for most wikipages.

I use Django and Python, and there is a Python project at [https://github.com/goldsmith/Wikipedia](https://github.com/goldsmith/Wikipedia) that wraps the MediaWiki API to make things super easy.

Installation is easy as pie(-thon):
`$ pip install wikipedia`

Then import of course:
`>>> import wikipedia`

Then try:
`>>> print wikipedia.summary("Wikipedia")`

To get my author summaries, I search for a specific page in a Django view:
`wikipage = wikipedia.page("Albert Einstein")`

and can then easily grab particulars from the page object and save them to my Author model:
`thisterm = "Albert Einstein"
wikipage = wikipedia.page(thisterm)
print("title = " + wikipage.title)
author.wiki_summary = wikipage.summary
author.wiki_url = wikipage.url
author.wiki_title = wikipage.title
author.wiki_images = wikipage.images
author.save()`

Super simple! (-:  

Two potential issues to plan for:
1. You should of course limit how often you call the MediaWiki Action API per their [guidelines](https://www.mediawiki.org/wiki/API:Etiquette).
2. Often you will not get an exact match for a page for your searchterm (e.g. John Smith above) - in that case you can [look up the specific wikipage id](https://dev.to/dparizek/how-to-find-the-page-id-for-a-wikipedia-page-eg-to-use-with-the-mediawiki-action-api-25k7) and reference that way.

A huge thank you to developer [Jon Goldsmith](https://github.com/goldsmith) for creating that Python wikipedia library and making it so easy!
nix rescues modded minecraft night
Tags: cli
Published: 2022-01-25 17:57:10

---
canonical_url: https://waylonwalker.com/til/nix-install-java8/
series: til
published: true
tags:
- cli
- cli
- cli
title: nix rescues modded minecraft night
---

With the latest version of minecraft it requires a very new, possibly the latest, version of java.  Lately we have been getting into modded minecraft and I maintain the server for us.  It's been tricky to say the least.  One hurdle I recently hit involves having the wrong version of java.

I was getting this error trying to get a 1.12.2 forge server running.

> Caused by: java.lang.ClassCastException: class jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast to class java.net.URLClassLoader (jdk.internal.loader.ClassLoaders$AppClassLoader and java.net.URLClassLoader are in module java.base of loader 'bootstrap')

In researching our errors, I found this on a forum.

> Pre-1.13 Forge only works with Java 8.

I don't write java, or really know how to manage different versions of java, but I have nixpkgs installed and it has a ton of odd stuff like this readily available, so [searching nixpkgs](https://search.nixos.org/packages?channel=21.05&show=jdk8&from=0&size=50&sort=relevance&type=packages&query=java+8) landed me with this.

``` bash
nix-env -iA nixpkgs.jdk8
```

once I had this installed I then just changed out java for the full path to my new nixpkgs.jdk8 java and it worked.

``` bash
/home/walkers/.nix-profile/bin/java -server -Xms${MIN_RAM} -Xmx${MAX_RAM} ${JAVA_PARAMETERS} -jar ${SERVER_JAR} nogui
```

I don't write java or do anything other than host minecraft servers wtih it.  There is probably a better way of maintaining java versions than this, but this worked for me.
Add BootstrapVue to VuePress
Tags: vue, webdev, vuepress, javascript
Published: 2022-01-25 17:51:12

## Create a VuePress project

The first thing we need to do is create a new [VuePress](https://vuepress.vuejs.org/) project. It's really easy with the latest version of npm or yarn. From the [VuePress docs](https://vuepress.vuejs.org/guide/getting-started.html#quick-start)

```bash
yarn create vuepress-site $optionalDirectoryName
```

## Install BootstrapVue

Next we install [BootstrapVue](https://bootstrap-vue.org)
```bash
yarn add bootstrap bootstrap-vue
```

## Configuration
Now we need to import BootstrapVue in `.vuepress/enhanceApp.js`, where we have access to the vue instance.

```javascript
// .vuepress/enhanceApp.js
import { BootstrapVue, IconsPlugin } from "bootstrap-vue";

export default ({ Vue, options, router, siteData }) => {
  // Make BootstrapVue available throughout your project
  Vue.use(BootstrapVue);
  // Optionally install the BootstrapVue icon components plugin
  Vue.use(IconsPlugin);
}
```

Finally we need to load the bootstrap css. VuePress ships with [stylus](https://stylus-lang.com/) by default now, but we can still import css into our stylus file at `.vuepress/styles/index.styl`

```stylus
/**
 * Custom Styles here.
 *
 * ref：https://v1.vuepress.vuejs.org/config/#index-styl
 */

@require '~bootstrap/dist/css/bootstrap.css'
@require '~bootstrap-vue/dist/bootstrap-vue.css'
```

That's it! Now you can use BootstrapVue components in your VuePress app. 

## Example
Vuepress lets you embed components directly in markdown, so you can do something like this
```md
<!-- src/index.md -->
## Hi from bootstrap-vue
<b-button>Hello world!</b-button>
```

Here's an example app I've deployed to netlify which uses various BootstrapVue components including `b-carousel` and `b-table`: https://conorscocktails.netlify.app/

You can find the sourcecode here: https://github.com/ConorSheehan1/conors-cocktails
Puppeteer IDE Extension: What's new ?
Tags: javascript, webdev, programming, productivity
Published: 2022-01-25 17:43:44


![Extension demo GIF](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1280wystd05goq8q45pw.gif)

## Changes

### Added

- **Multi tabs and scripts support**. Now you can store multiple scripts and keep the ones you use often, opened in tabs. Scripts will be stored in browser's storage, **_nothing goes outside from this extension_**.
- **Theme switch**. Instead of changing theme of whole devtools window, now there is a separate theme switch for panel.


| Dark Theme    | Light Theme   |
|:-------------:|:-------------:|
| ![Dark Theme](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/my88s41u0nz40ui4koou.png) | ![Light Theme](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/aidljxcpwmj5p2pgs706.png) |
- **$0 suggestion**. Typing `$0` in editor will give currently selected element's selector suggestion.


![$0 usage GIF](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fuu1ze2uslbs0mheed0p.gif)
- **Logging unhandled errors in console tab of inspected window**. Unhandled errors will now also be logged in inspected window's console tab along with console tab of extension panel.
- **Keyboard shortcuts**. 

## Fixed

- Broken editor icons issue.


## More Information

{% github gajananpp/puppeteer-ide-extension %}
Why I use VSCode as an IDE
Tags: vscode
Published: 2022-01-25 17:39:34

I have been a VSCode user for some time now and I am very happy with the decision. The benefits that VSCode has to offer are so many it is hard to list them all in one post, but here are just a few of the reasons why VSCode is my IDE of choice.

VSCode is my go-to IDE because it offers a great user experience, cross platform support, and tons of integrations. VSCode has quickly become one of the most popular IDEs out there, and for good reason!

Here are some more reasons why VSCode is a great choice for me:

- It runs on Windows, MacOS, Linux … and recently in a web browser
- Its cross platform capabilities allow me to work seamlessly from anywhere
- VSCode comes with built in Git integration which saves me loads of time
- VSCode’s interface feels natural and easy to navigate
- VSCode comes with built in debugging capabilities which helps me find errors quickly
- The code completion feature makes writing code easier and faster
- The extension marketplace provides access to thousands of extensions that can help with anything from syntax highlighting to project management

There are so many benefits to using VSCode as my main IDE — I could go on forever! If you’re looking for an IDE that is fast, reliable and easy to use, VSCode is definitely a great option. Give it a try today!


Happy coding!
Learn Javascript  from Google (FREE) : a Code With Google program. 
Tags: javascript, beginners, tutorial, webdev
Published: 2022-01-25 17:35:53

Hi, today i going to introduce a useful app , created by Google LLC which help us to learn javascript easily. Grasshopper is the best way to start your coding adventure with fun, quick games on your phone that teach you to write real JavaScript. I personally, tried it and i loved it. I recommend this app for beginners.

Grasshopper app - https://play.google.com/store/apps/details?id=com.area120.grasshopper.
Multi Slots in Angular?
Tags: angular, ngcontent, slots, tutorial
Published: 2022-01-25 17:32:46

One exciting concept of Angular is:

> [Content Projection](https://angular.io/guide/content-projection#content-projection): pattern in which you insert, or project, the content you want to use inside another component

This concept exists as part of the HTML Standard and is known as:

> [Slot](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/slot): placeholder inside a web component that you can fill with your own markup, which lets you create separate DOM trees and present them together.

Content Projection can be achieved with an Angular directive name as **ng-content**, and there are two main ways of doing it.

-----

## Simple

A component accepts content from a single source.

### Component Definition

```html
Let's load some additional content:

<ng-content></ng-content>
```

### Usage

```html
<app-simple-content>
  <p>This is a test</p>
</app-simple-content>
```
We can observe how the `<p>` is renderer as a child node of `<app-simple-content>` in the DOM Tree:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pb291u1inu7nt70sdv84.png)

-----

## Multiple

A component accepts content from multiple sources.

### Component Definition

```html
<p>Let's load the main content:</p>
<ng-content select="[main]"></ng-content>
<p>Let's load some extra content:</p>
<ng-content select="[extra]"></ng-content>
<p>Let's load default content:</p>
<ng-content></ng-content>
```

### Usage with one

```html
<app-multi-content>
  <span extra>EXTRA</span>
</app-multi-content>
```
We can observe how the `<span>` is renderer as a child node of `<app-multi-content>` in the DOM Tree occupying the space for EXTRA:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5qhap196p1bgngq7y15v.png)
 
### Usage with all

```html
<app-multi-content>
  <span main>MAIN</span>
  <span extra>EXTRA</span>
  <span>DEFAULT</span>
</app-multi-content>
```

We can observe how the different `<span>` are renderer as a child node of `<app-multi-content>` in the DOM Tree occupying their own space:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zq9o3lz82sgvjceu6xru.png)

-----

Using Content Projection opens a door for applying the [Composite Pattern](https://en.wikipedia.org/wiki/Composite_pattern):

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ywgxzdm814gzpm98wzri.png)
 
> The composite pattern describes a group of objects that are treated the same way as a single instance of the same type of object. The intent of a composite is to "compose" objects into tree structures to represent part-whole hierarchies.


-----

## Full example

The detailed implementation is in one of my [Github repos](https://github.com/abimaelbarea/angularTutorials/tree/master/src/app/ng-content)
Is this the CV of the future?
Published: 2022-01-25 17:31:45

Of course, not... but, starting from the beginning: in my software company many people fill their notebooks with stickers of software logos and other geek's stuff, to the point that one day someone sent an email saying to stop doing that because every time an employee left and a new one came, someone had to spend hours removing them.

From a developer's notebook you can understand if he works for backend or frontend, if he is a devops or something else, and which technology he prefers.
So I came up with the idea of **making a tool to create an image of your PC laptop fulfilled with the stickers you want**, to download or post on social media.
Personally, i'm sure it will be the developers CV of the future.
Get an idea, here: https://www.myskillsasnotebookstickers.com/
#25 - Remove consecutive duplicate words CodeWars Kata (7 kyu)
Tags: javascript, webdev, tutorial, 100daysofcode
Published: 2022-01-25 16:51:36

##Instructions

Your task is to remove all consecutive duplicate words from a string, leaving only first words entries. 

**For example:**

> <u>Input:</u> "alpha beta beta gamma gamma gamma delta alpha beta beta gamma gamma gamma delta"
> <u>Output:</u> "alpha beta gamma delta alpha beta gamma delta"

---

##My solution:

```javascript
const removeConsecutiveDuplicates = s => {
  return s.split(' ').filter((w,i)=> w !== s.split(' ')[i+1]).join(' ')
}
```
---

##Explanation
First I splitted the array into every space so I can get an array with every word, after that I filtered that array and I eliminated every element that is equal to the one next to it, after that I just joined the filtered array into a string


---

**What do you think about this solution? 👇🤔**

[My Github](https://github.com/Cesardlr)
[My twitter](https://twitter.com/cesar__dlr)
[Solve this Kata](https://www.codewars.com/kata/5b39e91ee7a2c103300018b3)
Slides Sobre Sistemas Operacionais - Orbis OS
Tags: sistemasoperacionais, linux, orbisos
Published: 2022-01-25 16:44:35

Olá, pessoas.

Essa é minha contribuição para quem está passando pela disciplina de Sistemas Operacionais.

Eu tive a nota máxima para essa apresentação, então imagino que possa ser útil para alguém. Principalmente as referências.

O sistema que usei para demonstrações práticas foi o Orbis OS. Aquele do Anime. Não foi bem escolha minha. Era isso ou o Qubes, e como não tinha muito tempo... 😅.

Aconselho muito que seja utilizado outro sistema, como Ubuntu ou Elementary OS (que eu gosto bastante).


[link para download do Orbis](https://sourceforge.net/projects/orbisos/)
[link para o blog oficial do Orbis](https://doragonden.wordpress.com/?s=orbis)
[link para os slides da apresentação](https://www.slideshare.net/LucasNogueira565696/apresentao-sobre-sistemas-operacionais-com-orbis-os)
Top 7 Featured DEV Posts from the Past Week
Tags: top7
Published: 2022-01-25 16:39:07

---
title: Top 7 Featured DEV Posts from the Past Week
published: true
description: A round up of the most-read and most-loved contributions from the community this past week
tags: icymi 
cover_image: https://thepracticaldev.s3.amazonaws.com/i/sfwcvweirpf2qka2lg2b.png
---

_Every Tuesday we round up the previous week's top posts based on traffic, engagement, and a hint of editorial curation. The typical week starts on Monday and ends on Sunday, but don't worry, we take into account posts that are published later in the week._ 



## An incredible gesture

@devdevcharlie used the MediaPipe handpose detection machine learning model to try to use it to create UIs. In this post, they show the result of a quick prototype built in a few hours. _Amazing._

{% link https://dev.to/devdevcharlie/building-uis-in-figma-with-hand-movements-3pi4 %}

## Lights, camera, contrast

_"Spending even a small amount of time reviewing your UI for high contrast issues and fixing the highest impact items will go a long way to distinguish your product from others for high contrast users."_
-@mpriour 

Thanks for this post, Matt! I learned so much from it and I think others will, too 😊 

{% link https://dev.to/mpriour/an-introduction-to-high-contrast-accessibility-4im4 %}

## Time is precious

Here's a look at some crucial usages of object destructuring, that, in @atapas' opinion, you must know to save you time and make you a more efficient dev. 

{% link https://dev.to/atapas/javascript-object-destructuring-usages-you-must-know-2o0a %}

## Ready, set, dashboard 

@ironcladdev shows you a way around using Wordpress over your favorite stack without requiring you to spend hours "sweating your brain out coding an admin dashboard". Let's take a look

{% link https://dev.to/ironcladdev/adding-a-nextjs-administration-dashboard-to-your-site-in-seconds-7jb %}

## Watch, read, and learn

@techworld_with_nana explains what DevOps _really_. It's time to get all your DevOps questions answered and doubts erased. Check out this helpful post and YouTube video!

{% link https://dev.to/techworld_with_nana/what-is-devops-really-understand-it-29j7 %}


## A teachable mistake

@jringeisen inadvertently pinged the Places API 17,000 times in one hour, costing $646. But guess what? Mistakes happen and if you learn from them, they can be worthwhile. Better yet, Jonathan shared the incident with all of us so we can avoid it ourselves. Love it. 

{% link https://dev.to/jringeisen/my-646-mistake-with-php-4l9d %}

## Real-time realness

@thesanjeevsharma illustrates (literally 🎨) how to create real-time updates with web sockets, polling/long polling, and server-sent events. 

{% link https://dev.to/thesanjeevsharma/real-time-updates-polling-sse-and-web-sockets-277i %}


_That's it for our weekly Top 7 for this Tuesday! Keep an eye on dev.to this week for daily content and discussions...and be sure to keep an eye on this series in the future. You might just be in it!_
Awes😀me VScode Window Colors Extension 
Tags: vscode, javascript, programming, productivity
Published: 2022-01-25 16:31:19

As a developer, it is quite common to have multiple windows open. I often work with Laravel and React in two separate windows, React controlling my front end and Laravel my back end. I am constantly switching between windows. When working on multiple windows, things get confusing rather quickly. There is a better way, using custom window colors that will help improve your workflow.

**[Window Colors](https://marketplace.visualstudio.com/items?itemName=stuart.unique-window-colors)** extension gives each new VS Code window a unique color based on a hash of the root directory name when it is opened.
Install ALL KALI LINUX TOOLS in ubuntu!
Tags: linux, bash, tooling, tutorial
Published: 2022-01-25 16:24:11

UPDATE: I wrote this a long time ago, the repo has been archived since then, please dont follow this blog if you're unaware of what you do

Kali Linux is made for ethical hacking and penetration testing which comes with almost 600 tools pre installed !

As some of you might already know, Katoolin is a Python script to install Kali Linux tools in Ubuntu, Debian and other DEB-based systems.

If you're a security researcher or enthusiast, Katoolin allows you to install any Kali Linux tools of your choice on top of your Ubuntu system in couple minutes.

It seems that Katoolin is not being updated regularly (the last commit was April, 2019) and it doesn't work in recent Ubuntu versions. The Caveats started adding up due to lack of maintenance.

Fortunately, someone has taken up the torch and is keeping a very stable branch of katoolin. Say hello to Katoolin3, a fork of Katoolin, that helps you to get your favorite Kali Linux tools on Debian, Ubuntu and its derivatives like Linux Mint. Katoolin3 is completely free and open source program.

Now let's get working!
Use the following commands :
`
sudo add-apt-repository universe
git clone https://github.com/s-h-3-l-l/katoolin3
cd katoolin3
chmod +x ./install.sh
./install.sh
sudo katoolin3`

Next it will show tool groups to choose
You can choose what you need and
voila! Done
[Buy me a coffee](https://www.buymeacoffee.com/tawhid)