teleren/devto huggingface dataset:
What is the difference between Online Analytics Processing and Online Transaction processing?
Tags: systemdesign, database, analytics, devops
Published: 2022-12-03 15:01:03

**Online transaction processing (OLTP)** and **online analytics processing (OLAP)** are two different approaches to managing and analyzing data in a computer system. While they share some common features and goals, they have distinct differences that make them suitable for different types of applications and use cases.

OLTP is a type of data management system that is designed to <u>support high-volume, high-speed transactions</u>. It is typically used in applications where data is constantly being added, updated, and deleted, such as in e-commerce, banking, and other real-time systems. <u>OLTP systems are optimized for fast data access and manipulation</u>, and they typically use a normalized database design to reduce redundancy and improve data integrity.

**OLAP**, on the other hand, is a type of **data management system** that is focused on providing support for complex analytical queries. It is often used in applications where data needs to be analyzed and aggregated in various ways, such as in business intelligence, market research, and other data-intensive fields. OLAP systems are optimized for fast data analysis and aggregation, and they typically use a **multi-dimensional data model to support complex query structures and calculations**.

One of the main differences between **OLTP** and **OLAP** is the type of operations they support. OLTP systems are designed to handle a large number of small, independent transactions, such as inserting, updating, or deleting a single record. OLAP systems, on the other hand, are designed to handle a smaller number of complex, interrelated queries, such as aggregating data across multiple dimensions or calculating complex metrics.

Another difference between **OLTP** and **OLAP** is the way they store and organize data. **OLTP systems** typically use a normalized database design, which organizes data into small, independent tables that are connected through relationships. This allows OLTP systems to store and manipulate data efficiently, but it can make it difficult to perform complex analytical queries. OLAP systems, on the other hand, typically use a multi-dimensional data model, which organizes data into large, interconnected cubes that can be queried and manipulated in many different ways. This allows OLAP systems to support complex analytical queries, but it can make them less efficient for managing and updating data.

In summary, **OLTP** and **OLAP** are two different approaches to managing and analyzing data in a computer system. OLTP systems are optimized for fast data access and manipulation, while OLAP systems are optimized for fast data analysis and aggregation. While they can be used together in some cases, they are typically best suited for different types of applications and use cases.
Dalle Preview: Create Dalle2 images from your messaging apps
Tags: programming, opensource, aws, ai
Published: 2022-12-03 14:56:09

![example](https://raw.githubusercontent.com/alonstern/dalle-preview/main/example.gif)

I made a small project that allows you to create and send Dalle 2 images from your messaging apps (WhatsApp, Discord, Facebook, etc..)

Source code: https://github.com/alonstern/dalle-preview

You can try it with `https://dalle-preview.co/<your image description>`

Feel free to try it and let me know what you think :)
Django setup for mac
Tags: django, python, webapp, webdev
Published: 2022-12-03 14:35:08

**Django** is the framework for designing the web applications using python.While starting with Django we have to setup/create the virtual environment in our working directory then we can go for building the web application.

## 🔶 COMMANDS :

1. Gives the path where you want to create a project folder: cd /Users/nishant/Desktop (Note : There is space between the cd & /)
2. Then create a folder : mkdir my_projects
3. Then Create the virtual environment using python : python3 -m venv env  (Here env is the name of environment you can give the name as per your choice).
4. Then we have to activate the virtual environment using command :source env/bin/activate (env is the name of an environment )
5. After that the environment is ready to work with the given directory now we have to install the django only in given environment using command : pip install django 
6. Then we are creating the project using django : django-admin startproject first_project (Here first_project is the name of the project you can give the name as per your choice).
7. Then open the project : cd first_project
8. Finally we have to run the server using command : python3 manage.py runserver
9. After that in terminal the ip address is created for the launch the project on web : i.e. 127.0.0.1:8000
10. Copy the ip address and paste it on chrome.
11. Done 👍🏻.

## 🔶 Screenshots :

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

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d753fhmfciork4k6wz2m.png)
Connect to an Amazon EC2 instance using your web browser and Amazon EC2 Instance Connect
Tags: ec2, aws, cloud, beginners
Published: 2022-12-03 14:33:12

# Instructions
### Step 1 
In the AWS Management Console search bar, enter EC2, and click the EC2 result under Services:

### Step 2
Navigate to instances


### Step 3
Select your instance and click Connect:

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

The Connect to your instance form will load.

### Step 4
In the form, ensure the EC2 Instance Connect tab is selected:

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

You will see the instance's Instance ID and Public IPv4 address displayed.

### Step 5
In the User name textbox, enter _ubuntu_.

### Step 6
To connect to the instance using a browser-based shell, click `Connect`:

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

A browser-based shell will open in a new window and you will see a shell similar to:

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

You can also connect to the instance using your preferred SSH client and the PPK (Windows) or PEM (Mac/Linux) key files like I explained in a previous post.


<br>
[GitHub](https://github.com/a00ayad00)
[LinkedIn](https://www.linkedin.com/in/a00ayad00)
[Facebook](https://m.facebook.com/a00ayad00)
[Medium](https://a00ayad00.medium.com/)
# Microservices and Applications Monoliths
Published: 2022-12-03 14:14:12

## What are monoliths?

You know that gigantic project that you already work on, that does everything and has everything inside you. So, this is the famous monolith project, a bloated project, with a low life expectancy and that just gives you a headache.

### In what situations is the monolith necessary?

Here I will expose my opinion, which is never and I will explain why I think so.

To some who will say that very small and simple projects should be in monoliths and that later on with the growth of the project it will be migrated to microservices, and what a problem with that! The problem with this is that it almost never happens. I only see one possibility for projects to be done in monoliths, which is school and college projects.

### But it's not all lost

The experience in projects made in monoliths, despite being traumatic, is very important for the maturation of developers, because there you will see, in practice, what should not be done, and the chaos that this generates.

## What are microservices?

Here you should already imagine that microservices are the complete opposite of what I mentioned above, but not and there. Microservices have to be well planned and architected. The delegation of functions must be strategically divided. As the name implies, microservices and dividing an application into small services, similar to a circuit board in a computer, looking at it, we see that each chip has a specific function, as it should be done in microservices.

When building a microservice, good programming practices, Design Patterns and SOLID patterns must be considered, otherwise our entire proposal will be lost.

So summarizing about microservices. Microservices and you strategically fractionate a project into small pieces and hierarchies in an organized and independent way, a special focus on this keyword here "***independent***" which is the basis of the concept.

<br />

[![Texto alternativo da imagem](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ds4alkts3uxq0dsco0nv.png))](https://www.linkedin.com/in/israel-lopes-419a32189)
ERR_PACKAGE_PATH_NOT_EXPORTED in reactjs app
Tags: react
Published: 2022-12-03 13:47:02



When I try to run this React app -->(https://github.com/mehdish9197/reactapp),

I get this error -->

```
node:internal/modules/cjs/loader:544
      throw e;
      ^

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/tokenize' is not defined by "exports" in F:\New folder (6)\django mern stack electronjs projects\New folder (3)\DRF-Ecommerce-Platform-master\client\node_modules\postcss-safe-parser\node_modules\postcss\package.json
    at new NodeError (node:internal/errors:393:5)
    at exportsNotFound (node:internal/modules/esm/resolve:295:10)
    at packageExportsResolve (node:internal/modules/esm/resolve:631:9)
    at resolveExports (node:internal/modules/cjs/loader:538:36)
    at Module._findPath (node:internal/modules/cjs/loader:607:31)
    at Module._resolveFilename (node:internal/modules/cjs/loader:1025:27)
    at Module._load (node:internal/modules/cjs/loader:885:27)
    at Module.require (node:internal/modules/cjs/loader:1105:19)
    at require (node:internal/modules/cjs/helpers:103:18)
    at Object.<anonymous> (F:\New folder (6)\django mern stack electronjs projects\New folder (3)\DRF-Ecommerce-Platform-master\client\node_modules\postcss-safe-parser\lib\safe-parser.js:1:17) {
  code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}
```

I installed node modules with the npm install command And when I hit npm start I get this error

I am using node version 18.12.1...

Can anyone solve my problem?

tnx in advance
Prepare to Coding Interview > Know Data Structures > Hash Table
Tags: interview, coding, hashtables, csharp
Published: 2022-12-03 13:39:25

---
title: Prepare to Coding Interview > Know Data Structures > Hash Table
published: true
description: Know Data Structures - Hash Table
tags: interview, coding, hashtables, csharp
---
Hash table is a mapping between keys and values, each key can have several values, values can repeat, some implementations of the hash tables does not allow repeating values.

Adding value to the hash table
1. Compute the hash code
2. Map the hash code to the array index by hashCode % array.length
3. Put the value to the index

Get the value from Has Table
1. Compute the hash code
2. Map the hash code to the array index by hashCode % array.length
3. Go to the index and find the value if present

Base implementation with C# is below:

```C#
public class HashTableSimpleImplementation
{
    /*
        * Simple implementation of HashTable
    */
    private LinkedList<string>[] _hashTable;

    private int _hashTableSezie = 10;

    public HashTableSimpleImplementation()
    {
        _hashTable = new LinkedList<string>[_hashTableSezie];

        Init();
    }

    private void Init()
    {
        for(int i=0; i < _hashTable.Length; i++)
        {
            _hashTable[i] = new LinkedList<string>();
        }
    }

    /// <summary>
    /// Adding value to the hash table
    /// 1. Compute the hash code
    /// 2. Map the hash code to the array index by hashCode % array.length
    /// 3. Put the value to the index
    /// </summary>
    /// <param name="value"></param>
    public int Add(string value)
    {
        var index = GetIndex(value);

        _hashTable[index].AddLast(value);

        return index;
    }

    /// <summary>
    /// 1. Compute the hash code
    /// 2. Map the hash code to the array index by hashCode % array.length
    /// 3. Go to the index and find the value if present
    /// </summary>
    /// <param name="value"></param>
    /// <returns></returns>
    public string? Get(string value)
    {
        var index = GetIndex(value);

        var list = _hashTable[index];

        foreach(var item in list)
        {
            if (item.Equals(value))
            {
                return value;
            }
        }

        return null;
    }

    private int GetIndex(string value)
    {
        var hashCode = GetHashCode(value);

        var index = hashCode % _hashTableSezie;

        return index;
    }

    /// <summary>
    /// This implementation of hash code returns different code
    /// for the same string value on each run of the application
    /// </summary>
    /// <param name="value"></param>
    /// <returns></returns>
    private int GetHashCode(string value)
    {
        var hashCode = value.GetHashCode();

        return hashCode > 0 ? hashCode : hashCode * -1;
    }
}
```
Search for word boundaries in Vim & VSCode Vim
Tags: vscode, vim, tooling
Published: 2022-12-03 13:33:02

So you know that `/` will bring up search in Vim and VSCode Vim. That's good!

But then you named a variable `is` and now want to find every occurence of that word - but only where it stands alone. So no places where it occurs as part of your `isLargePizza()` function for example.

Luckily, that's doable: `\<` matches the beginning of a word and `\>` the end.

So hitting ...

```
/\<is\>
```

... will to the trick!

Edit:

See [this](https://dev.to/pbnj/comment/23fo0) comment by @pbnj for additional tips relating to word boundary search.
Java Program to print something without using semi-colon
Tags: java, beginners, programming, tutorial
Published: 2022-12-03 13:21:55

In this program, we use a if statement and `System.out.printf()` because it returns object of `PrintStream` which is not `null` when something is passed to the `printf()`.

```java
public class Main {
	public static void main(String[] args) {
		if (System.out.printf("Hello World 👋") != null) {}
	}
}
```


whereas, `System.out.println()` and `System.out.print()` return `void` which cannot be used for a comparison.
Breaking Down the Benefits of JavaScript over Typescript
Tags: javascript, typescript, webdev
Published: 2022-12-03 13:21:02

The world of web development has become increasingly complex, demanding more and more from developers. Many web development frameworks, languages, and tools have emerged over the years. Two of the most popular and widely used languages are JavaScript and TypeScript. Both of these languages are used for developing web applications, but they each have their own set of benefits and drawbacks. 

In this article, we will be comparing JavaScript and TypeScript, so that developers can make an informed decision on which language to use for their web development project. We will be focusing on the benefits of JavaScript over TypeScript.

## What is JavaScript?

[JavaScript](https://scientyficworld.org/top-6-javascript-frameworks/) is a high-level programming language. It is an interpreted language, which means that the code is executed on the user’s computer instead of the server. JavaScript is the most popular language for client-side web development. It is used to create interactive webpages, including dynamic content and forms, animations, and other effects.

## What is TypeScript?

TypeScript is a strongly-typed, object-oriented programming language. It is a superset of JavaScript, which means that all JavaScript code is valid TypeScript code. It adds stronger typing and class-based object programming to JavaScript. 

TypeScript is an open-source language developed and maintained by Microsoft, and is the language of choice for many enterprise-level web applications.

## Benefits of JavaScript

There are many benefits that make JavaScript the language of choice for many developers, such as:

### 1. Easy to Learn and Use

One of the greatest benefits of JavaScript is that it is relatively easy to learn and use. Many developers can pick up the basics of JavaScript in just a few weeks, and start writing code for their projects.

### 2. Familiarity

Another benefit of JavaScript is its familiarity. Since JavaScript is the most popular language for web development, most developers will have some degree of familiarity with the language. 

### 3. Versatility

JavaScript is a versatile language. It can be used to create a wide range of applications, from basic websites to complex web applications. This versatility makes JavaScript an attractive language for many developers.

### 4. Cross-Platform Compatibility

JavaScript is cross-platform compatible, meaning it can run on any platform. This ability makes JavaScript an ideal choice for projects that need to be compatible across multiple platforms.

### 5. Open-Source

JavaScript is an open-source language, which means the source code is freely available for anyone to modify and use. This makes it easy for developers to add features, fix bugs, and optimize the code.

## Conclusion

JavaScript is a popular language for web development and offers many benefits to developers. It is easy to learn and use, is familiar to many developers, is versatile and cross-platform compatible, and is open-source. These benefits make JavaScript an ideal choice for many web development projects.
Responsive Business Agency Website Using Html CSS JavaScript
Tags: css, html, javascript, tutorial
Published: 2022-12-03 13:09:50

{% youtube 5Bl3CCizSRQ %}

How to Build Responsive Business Agency Website Using Html CSS JavaScript

This video will show you how to build a business agency website using html css javascript

[Github Repo](https://github.com/codewithsadee/adex)

---

⏱️ Timestamps
-----------------------------
0:00 - Demo
4:25 - File structure
5:17 - Project initial
12:29 - Header
32:59 - Hero section
56:48 - Service section
1:03:32 - About section
1:13:24 - Features section
1:17:58 - Stats section
1:21:13 - Project section
1:29:06 - CTA section
1:31:07 - Footer
1:39:55 - Media queries

---

[![Become a patreon](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fnjl14kdm5qf08hu5lop.png)](https://www.patreon.com/bePatron?u=62535867)
How to Make Quiz App in React
Tags: beginners, react, javascript, webdev
Published: 2022-12-03 13:04:47

In this article, we will create a Quiz app in react. This Quiz game will be usual like other Quiz game. Here we will have some questions along with 4 options and scorecard. After answering all questions, the result will be appeared, and lastly we will have a button to restart the quiz.

So basically this is going to be a beginner-friendly project, so let’s make this project step-by-step.

##Pre-requisites to Make Quiz App in React

- Basic knowledge of ReactJS.
- Basic knowledge of React hooks.
- Basic knowledge of React props.
- Good knowledge of React Components
.
##Building Skeleton for Quiz App in React
Let’s start with a little hard code, in return() statement, for questions, we have added a header tag for name of quiz, then another heading for score. Then, after we have hard coded our question and its options in the question card. And then lastly we have added result card where we have again hard coded correct answers and a restart button. This is just the beginning of the app, so it is right now hard coded, but we will improve this code after adding CSS.[Read More](https://reactjsguru.com/how-to-make-quiz-app-in-react/)
Discord bot which shows your private Advent of Code leaderboard
Tags: discord, typescript
Published: 2022-12-08 10:39:15

---
title: Discord bot which shows your private Advent of Code leaderboard
published: true
date: 2022-12-03 12:31:22 UTC
tags: discord,typescript
canonical_url: https://livecode247.com/discord-bot-which-shows-your-private-advent-of-code-leaderboard
---

It is December! That means [Advent of Code](https://adventofcode.com) is here! If you don't know what that is:

> _Advent of Code_ is an [Advent calendar](https://en.wikipedia.org/wiki/Advent_calendar) of small programming puzzles for a variety of skill sets and skill levels that can be solved in [any](https://github.com/search?q=advent+of+code) programming language you like. People use them as [interview](https://y3l2n.com/2018/05/09/interview-prep-advent-of-code/) [prep](https://twitter.com/dznqbit/status/1037607793144938497), [company training](https://twitter.com/pgoultiaev/status/950805811583963137), [university](https://gitlab.com/imhoffman/fa19b4-mat3006/wikis/home) [coursework](https://gribblelab.org/teaching/scicomp2021/index.html), [practice](https://twitter.com/mrdanielklein/status/936267621468483584) [problems](https://comp215.blogs.rice.edu/), a [speed contest](https://adventofcode.com/leaderboard), or to [challenge each other](https://www.reddit.com/r/adventofcode/search?q=flair%3Aupping&restrict_sr=on).

## Idea Inspiration

Now, Advent of Code has two kinds of leaderboards. One is the Global Leaderboard where you're competing against the whole world and the other is Private Leaderboards. You can create Private Leaderboards for your class, your club, or a group of friends!

I am a part of a couple of Private Leaderboards and since all of us were on a discord server, I thought why not create a Discord Bot which shows the leaderboard right on the app? And so, I created [this discord bot.](https://github.com/kavinvalli/aoc-private-lb-discord-bot)

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1670070115711/nQrVJmO0d.png)

## Setup

The bot is very easy to set up and get up and running on your server. Follow the instructions on the [GitHub README](https://github.com/kavinvalli/aoc-private-lb-discord-bot#setup) and you will be up and running in no time.

## Deployment

To deploy the app on an EC2, GCP Instance, etc. use [pm2](https://pm2.keymetrics.io/) like mentioned [here](https://github.com/kavinvalli/aoc-private-lb-discord-bot#deployment).

## GitHub

[https://github.com/kavinvalli/aoc-private-lb-discord-bot](https://github.com/kavinvalli/aoc-private-lb-discord-bot)

Check out the GitHub Repository linked above and you will find all the instructions on how to get up and running with the bot.

Feel free to also point out any [issues](https://github.com/kavinvalli/aoc-private-lb-discord-bot/issues), any [PRs](https://github.com/kavinvalli/aoc-private-lb-discord-bot/pulls) are welcome and be sure to star the repo!