teleren/devto huggingface dataset:
Ontologies - part 2 : definitions & vocabulary
Tags: datascience, ontology, owl, beginners
Published: 2020-12-08 09:37:29

##Why are we even doing this?
As I'm reading further along about ontologies one thing is clear to me. The point of this entire thing is to take the real world - something you innately know and understand - and try to extract from your brain categories and relationships between them that a computer can understand. Once you've got that, said computer can answer queries, create a knowledge base and be trained to play around with the data at astonishing speed.

##Definition
These definitions so far seem the best to me:
An **ontology** is a formal explicit description of concepts in a domain of discourse.
An ontology together with a set of individual **instances** of classes constitutes a **knowledge base**. 

Ontologies consist of classes (eventually subclasses) or concepts. Classs have properties (features and attributes of the class, sometimes calles slots as well) and there can be restrictions on those slots or properties (those restrictions can also be called facets).

##Vocabulary & OOP
Like with all new domains you need to be familiar with a few words before you can understand something like the definition above. 
Object oriented programming in this case is both something that can help and that can hurt. Ontologies are composed of classes and subclasses, and have instances. Sounds familiar, right?

You can safely use your understanding of what an instance is in OOP to help you understand instance in an ontology. For classes however, it's a bit different. In OOP you tend to use classes along with methods, and creating a class will entail you coding the methods, thinking whether or not they're in the right place or need to be split off, instantiating classes so you have access to their methods etc. In ontologies a class is much more descriptive. When you create the ontology you describe the properties of the class and think much more in terms of structure than in terms of what the class does. An ontology is a mapping, not a program. It can be part of a program however, but that's for a later post.
kolkata jackpot lottery
Published: 2020-12-08 09:10:15

Just sit back on your recliner and win a lottery online with www.infernos.in. The rules of Kolkata Jackpot are pretty much basic for all type of lotto online websites. These are all basic steps to any online lottery in India site like Kolkata Jackpot, which helps save you the time of purchasing tickets by waiting in a line. Within minutes you can register and purchase tickets for a lottery online win. The registration process in lotto lottery India is relatively easy but somewhat risky too. India is not an online lottery game-friendly country due to the lack of security. Thus, it becomes crucial that you select a distinguished lotto lottery online site such as Kolkata Jackpot for an authentic online lottery lotto.Read Less
Python Project-Story generator
Tags: python
Published: 2020-12-08 08:01:05

This is a simple Python Project that creates a story generator. We will randomly fill phrases in the sentence template and generate three stories at a time.

Sentence template is "Scene", "who1" + "action" + "who2". 

First step, I want to create four lists.

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

Second step, in order to randomly select items from the list, I will use built in library random.  random.choice()

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

Third step, I will print out the sentence.

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

Last, we need to generate 3 stories at a time. Calling the same print statement three more time only gives the same stories three more times, so I am going to use a while loop.

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

Here is the sample result I got.

    import random

    stories_times = 0
    while stories_times < 3:

        scene = random.choice(["In an abandoned amusement park", "At a human zoo of the aliens", "In a city on Mars", "In a dream",
                           "In a hospital fulled with zombies", " In the magical world of Happy Porter",
                           "In the desert of Planet X", "On the edge of a cliff", " In a magical kingdom"])

        who1 = random.choice(["a talking rabbit that can't lie", "a goblin who wants to be human",
                          "a women who remembers her past life", "a bounty hunter who is also a serial killer",
                          "a time traveler who love eat zombies",
                          "a young witch who accidentally turn herself into a giant pig forever", "an alcoholic detective",
                          "an escaped criminal and a dangerous mental patient", "A snake demon"])

        who2 = random.choice(["a cult leader", "an astronaut who lost his memory ", "a dog who wanted world domination",
                          "a young couple who ran into the path of a psychopath", "baby Yoda",
                          "a bored vampire", " a mad scientist ", "the last chinese emperor", "an evil princess"])

        action = random.choice(["fall in love with", "fights against", "hunt for gold with",
                            "befriend", "revenge the death of", "robbed", " ate ", "forced to kill", "made clothe out of"])

        print(scene + ", " + who1 + " " + action + " " + who2 + ".")

        stories_times = stories_times + 1

    else:
        print("The end.")


Here are some final results.

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

I hope you liked it.
Excel Formulas to Calculate a Moving Average From a set of Data!!
Tags: excelformula, excelformulas
Published: 2020-12-08 11:35:43

---
title: Excel Formulas to Calculate a Moving Average From a set of Data!!
published: true
date: 2020-12-08 09:09:20 UTC
tags: ExcelFormula,Excelformulas
canonical_url: https://geekexcel.com/excel-formulas-to-calculate-a-moving-average-from-a-set-of-data/
---

In this tutorial, we will see how to **calculate a moving or rolling average from a set of data in Excel Office 365**. Let’s see them below!! Get an official version of ** MS Excel**  from the following link: [https://www.microsoft.com/en-in/microsoft-365/excel](https://www.microsoft.com/en-in/microsoft-365/excel)

[![Formulas to calculate moving average](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2020/12/Formulas-to-calculate-moving-average.png)](https://geekexcel.com/excel-formulas-to-calculate-a-moving-average-from-a-set-of-data/formulas-to-calculate-moving-average/#main)<figcaption id="caption-attachment-18964">Formulas to calculate moving average</figcaption>
## General Formula:

- Use the below formula to get the moving average in Excel.

**=[AVERAGE](https://geekexcel.com/how-to-use-excel-average-function-in-office-365-with-examples/)(Range)**

## Syntax Explanations:

- **AVERAGE** – In Excel, the [**AVERAGE Function**](https://geekexcel.com/how-to-use-excel-average-function-in-office-365-with-examples/)will help to return the arithmetic mean of given input numbers.
- **Comma symbol (,)** – It is a separator which helps to separate a list of values.
- **Parenthesis ()** – The main purpose of this symbol is to group the elements.
- **Range** – It represents the input value from your worksheet.

## Example:

- Now we are going to see how to get a moving average from a set of data.
- Refer to the below image.
- Here, we will enter the input values in **Column C**.
- Then, enter the given formula in the formula bar section.
- Finally, we will get the results in **Cell E5**.

![Example](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2020/12/Example-33.png)<figcaption id="caption-attachment-18965">Example</figcaption>

## Verdict:

Here, we have described the simple **formulas used for calculating a moving or rolling average from a set of data in Excel Office 365**. Hope you like this article. If you have any **doubts/queries,** don’t forget to share it with us. To know further updates keep in touch with our website **[Geek Excel](https://geekexcel.com/)** and [**Excel Formulas**](https://geekexcel.com/excel-formula/) **!!**

### Related Articles:

- **[Excel Formulas to Sum the Lowest N values from a range with Criteria!!](https://geekexcel.com/wp-admin/post.php?post=17886&action=edit)**
- **[Formulas to Sum the Lowest N values from a Range in Excel!!](https://geekexcel.com/wp-admin/post.php?post=17866&action=edit)**
- **[Formulas to calculate the running total from a range in Excel!!](https://geekexcel.com/wp-admin/post.php?post=17791&action=edit)**
- **[Excel Formulas Used to Calculate the Subtotal by Invoice Number!!](https://geekexcel.com/wp-admin/post.php?post=17815&action=edit)**
Is it possible to put the 
Tags: laravel, git
Published: 2020-12-08 09:02:55

I work on a Laravel project.

When I'm in master branch and I checkout to another branch I get this message : 

````
$ git checkout 34-my-new-branch
error: Your local changes to the following files would be overwritten by checkout:
        storage/framework/views/caaf62f72d38b7d25287398a507510f101a5b18e.php
Please commit your changes or stash them before you switch branches.
error: The following untracked working tree files would be overwritten by checkout:
        storage/framework/views/057722c519eb01b3d6b8aa1e28f4b226ca8e290e.php
        storage/framework/views/cfb3bd21bb7e616852dcb3192ea1826fb247979f.php
Please move or remove them before you switch branches.
Aborting

````
Is there a way to prevent this message?
Privacy is about taking informed decisions
Tags: privacy
Published: 2020-12-08 09:00:55

---
title: Privacy is about taking informed decisions
published: true
description: Do you trust each service you use? Do you really need each piece of content you consume? That's what I started asking myself and it is paying back.
tags: privacy
series: Privacy myths
---

About my privacy, I feel I need to be proactive and ask:

1. What can go wrong? Are you trading convenience that you don't really need for a privacy level that you need? Or you have enough information to move forward? If you are doing an intervention to protect your privacy, what does it protect you from? Did other such interventions fail or led to inconvenience?
2. What's the likelihood?
3. How bad would that be?

By the time you decide to install a product or signup on a service, it's too late to read the privacy policy and search for reviews.

## Privacy is not about security

Last but not least, another myth is that privacy and security are the same thing. In order to protect your privacy, first you need to protect your security. In my case a password manager like 1password helped me:

1. generate (14 or more number, characters and symbols), store, sync between devices and share secrets like passwords with my family
2. find which of my services (especially email providers and cloud providers) support 2 factor authentication and add it instead of authy or sms for faster copy paste
3. put tags on thing like local services so that I focus on the rest by searching for `tag:`
Advent of Code - Day 1
Tags: javascript, adventofcode, algorithms, challenge
Published: 2020-12-08 08:57:55

I saw the post from @qmenoret and I will now participate in the Advent of Code challenge for December!

{% link qmenoret/advent-of-code-day-2-1m74 %}

Here is my solution to day 1:

```javascript
let array = (document.querySelector('body > pre:nth-child(1)').innerText).split('\n')
let target = 2020

// part 1
array.forEach(x => {
   const diff = target - x
   const result = array.find(y => y == diff)
   result !== undefined && console.log(x * result)
})

// part 2
array.forEach(x => {
 for (let i = 1; i < array.length; i++) {
   const diff = target - x - array[i]
   const result = array.find(y => y == diff)
   result !== undefined && console.log(x * array[i] * result)
 }
})
```

Some thoughts when solving the problem:
- This is just brute force, I could probably reduce the complexity by using other algorithms
- I am learning Rust, I want to try to write the solution in Rust but I have no better way to import the numbers (pointers needed)
[New Repo] Python library for rapid annotation of data
Tags: python, machinelearning, showdev
Published: 2020-12-08 08:55:09

![Demo](https://raw.githubusercontent.com/phurwicz/hover/main/docs/images/app-active-learning.gif)

[Project Home](https://github.com/phurwicz/hover)

- :rocket: Binder apps available for you to try it!
- :heart: Please consider leaving a star if you find this useful :)


The idea is to use dimensionality reduction to put your dataset on a 2D interface, render it interactively with Bokeh, and add Python callbacks to enable all kinds of tricks.

The demo above showcases a simple active learning process where you can annotate a number of texts at a time first, then narrow down to finer scales wherever your model gets confused.
Check your NodeJS program memory utilization
Tags: node, memory, chart
Published: 2020-12-08 08:53:57

As a NodeJS developer, I regularly want to control how much memory is used by the programs I’m creating, so I can assess my code choices and thus keep, update or totally change the way I coded some functionalities.

I try to force myself to do it as much as possible. I think the best version of code is the one that fulfills the requirements with the minimum of resource utilization.

I can do it using some NodeJS built-in functions, such as process.hrtime (https://nodejs.org/api/process.html#process_process_hrtime_time)

But this will add several lines of code and output values to the console.

I prefer to use a small NPM library that will do all the stuff for me and also present the result in a readable graphic chart.

For example, let’s say I want to check the memory utilization when populating then deleting an array (this is a very simple case just to present what can be done). Here is the small program:
```
const randomstring = require('randomstring')

let array=[]
for (let index = 0; index < 10000; index++) {
    array[index]=randomstring.generate(32)
}

for (let index = 0; index < 10000; index++) {
    array.splice(index)
}
```
I want now to check the memory utilization of such program. It will updated, using memuse NPM package (https://www.npmjs.com/package/memuse):
```
const memuse=require('memuse')
const randomstring = require('randomstring')

memuse.init('./mem.csv')

let array=[]
for (let index = 0; index < 10000; index++) {
    array[index]=randomstring.generate(32)
    memuse.poll()
}

memuse.tag('start deletion')

for (let index = 0; index < 10000; index++) {
    array.splice(index)
    memuse.poll()
}

memuse.end('./mem.svg')
```
In the program above, here are the explained steps: 
- I loaded the memuse library
- I initialized it (memory utilization statistics will go into the mem.csv file)
- I called the memuse.poll() function each time I wanted to record the memory utilization statistics
- Just after the array is loaded and before deleting it, I added a tag to locate this step into the chart, using memuse.tag() 
- Finally the memuse.end() produces the graphical chart.

I run the program and I get this nice memory utilization chart:
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/98fgiam4ajta6ztnbzy4.jpg)

I hope this article will help you. Thanks.
Merge two arrays as a set
Tags: javascript, algorithms, functional
Published: 2020-12-08 08:51:09

So, I love the idea of using mathematical set theory in my programming. Specifically, I really want to make use of Javascript's recent addition [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set
) for the convenience of guaranteeing non-duplicate values and convenience APIs for iterating: 

**Example**

```
const s = new Set([
  1,
  2,
  3
])

s.add(3) // 1, 2, 3
s.has(3) // true
s.forEach(...) // etc
```

Problem is, it only works with primitives: e.g. Number, String and not arrays or objects due to (referential) equality limitations in JS (e.g. `{ a: 1 } !== { a: 1 }`.

Which is kinda annoying.

So I wrote functional utility to add an arbitrary array of objects to an existing array, using a specific prop. My thoughts are: is this the most efficient way to do it? What better ways are there to do this?

This is `O(n^2)` which isn't exactly desirable?

```
const mergeArraysAsSet = (ex, merge, compareProp = 'id') => {
  return ex.concat(
    merge.reduce((mergeArray, next) => {
      if (!ex.find((x) => x[compareProp] === next[compareProp])) {
        mergeArray.push(next)
      }
      return mergeArray
    }, [])
  )
}
```
Create a Waterfall Chart in Excel Office 365!! – [with Example]
Tags: createawaterfallchar, excelcharts, exceltutorials
Published: 2020-12-08 10:15:28

---
title: Create a Waterfall Chart in Excel Office 365!! – [with Example]
published: true
date: 2020-12-08 08:40:47 UTC
tags: CreateaWaterfallChar,ExcelCharts,ExcelTutorials
canonical_url: https://geekexcel.com/create-a-waterfall-chart-in-excel-office-365-with-example/
---

A Waterfall chart is one of the built-in chart types in MS Excel. This chart will plot the cumulative result of values as a visual running total. Waterfall charts also called bridge charts. It uses both positive and negative values. The positive values extend upward and the negative values extend downward. In this post, you will learn the simple steps to **Create a Waterfall Chart in Excel Office 365**.

To know more different types of **[Excel Charts](https://geekexcel.com/excel-charts/)**, refer to this link.
## Insert a Waterfall Chart:

- You need to **select the data** that you want to create a chart.

![Select the range](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2020/12/EXCEL_xdBMN4Ferl.png)<figcaption id="caption-attachment-18999">Select the range</figcaption>

- Then, go to the **Insert Tab, click** the **Waterfall chart** button under the Charts section.
- After that, you need to **select** the **Waterfall Chart** option from the drop-down menu.

![Insert tab](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2020/12/Insert-tab-14.png)<figcaption id="caption-attachment-18996">Insert tab</figcaption>

- Finally, you will get the result as shown in the below image.

![Waterfall Chart](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2020/12/Waterfall-Chart.png)<figcaption id="caption-attachment-18997">Waterfall Chart</figcaption>

## Pros and Cons:

### Pros:

- Visual display of positive and negative changes.
- Easy to create in Excel.

### Cons:

- It has only limited options.

## A Brief Summary:

In this post, you can easily understand the steps to **Create a Waterfall Chart in Excel Office 365**. Kindly, give your **suggestions** in the below comment box. Thanks for visiting **[Geek Excel.](https://geekexcel.com/)** Keep Learning!
Typeof array is an object in javascript
Tags: javascript, angular, frontend
Published: 2020-12-08 08:38:41

---
title:Typeof array is an object in javascript
published: true
description: in javascript all derived data type is always a type object. Included functions and array
tags: javascript, react, angular, frontend
//cover_image: https://direct_url_to_image.jpg
---
Often there is a need to compare variable types in javascript
```js
const arr = [2,4,6,8]
const obj = { type: ‘serviceBot’, valid: true }
console.log(typeof arr)
console.log(typeof obj)
```
The result is
```js
object
object
```
Apparently there seems to be something wrong because the array is recognized as an object and seems to be no real difference between object and array.
This because in javascript **all derived data type is always a type object**. Included functions and array.
In case you need to check if it’s an array you can use **isArray** method of **Array**.
```js
const arr = [2,4,6,8]
const obj = { type: ‘serviceBot’, valid: true }
console.log(Array.isArray(arr))
console.log(Array.isArray(obj))
```
The result is
```js
true
false
```
otherwise there is a **instanceOf operator**
```js
const arr = [2,4,6,8]
const obj = { type: ‘serviceBot’, valid: true }
console.log(arr instanceOf Array)
console.log(obj instanceOf Array)
```
and the result will be the same as the previous one.
Why am I here ?
Tags: welcome, webdev, javascript, typescript
Published: 2020-12-08 08:04:18

I asked myself this question after reading @madhunimmo's post. And this is my answer...

I have obsessed with the ideas of fractals and energy flows in the structure of our world. I study the writings of Benoit Mandelbrot and try to apply the knowledge gained in practice.

I believe that the ideal mechanism can be built only by being guided by the principles of self-similarity. Take a look around - every day on the way home or to the office we see beautiful trees around us and do not even think that these are fractals. Each branch is essentially a complete tree. This principle is repeated right down to the leaves. This simple law of self-repetition produces such complex things. Isn't that brilliant?

But what do we look deeper? We learn that inside there is a whole network of delivery of nutrients from the root to the leaves, as well as photosynthetic products from the leaves to the root. This network is also arranged according to the fractal law. It is like rivers - small streams flow into rivers, rivers flow into large rivers, and so on all the way to the sea.

These simple and original solutions haunt me, they blow up my brain. For the last two years I have been trying to apply this knowledge in my project.

So why am I here?

I just finished developing the first version of my front-end framework, but I still can't figure out if I'm moving in the right direction.

[@fract/core](https://github.com/fract/core) - this is my project and I would be very grateful for any feedback. In the end - maybe I'm wasting my time on it?

Thanks

P.S. Why are you here?
Create API Gateway Integration for SQS with CDK.
Tags: aws, cdk, serverless, infrastructure
Published: 2020-12-08 07:27:59

Most people know **Amazon API Gateway** from building HTTP interfaces for **AWS Lambda** functions. But, you can use API Gateway to call a variety AWS APIs using HTTPS. This post shows how to create an HTTPS interface for **Amazon SQS** using the **AWS Cloud Development Kit** without using AWS Lambda.

[AWS CDK: Amazon API Gateway integration for SQS](https://sbstjn.com/blog/aws-cdk-api-gateway-service-integration-sqs/)