teleren/devto huggingface dataset:
Postgresql not working on Mac M1 ARM: quick fix
Tags: 10stips, postgres
Published: 2022-09-17 08:38:36

Sometimes, shit happens.

Especially after a long work-day, when you have no energy left and decide to upgrade system libraries without understanding a dime... and boom! Everything breaks and stop working.

This is exactly what happened to me few weeks ago.

I launched a simple `brew upgrade` to have all formulae updated and after that my postgresql stopped working. From `brew services list` I saw:

```
postgresql@14   error 256 mattia ~/Library/LaunchAgents/homebrew.mxcl.postgresql@14.plist
```

mhh... wtf!??

So I thought, "_maybe I have to start the service again..._"

`➜  ~ brew services start postgresql`
```
Warning: Use postgresql@14 instead of deprecated postgresql
Bootstrap failed: 5: Input/output error
Try re-running the command as root for richer errors.
Error: Failure while executing; `/bin/launchctl bootstrap gui/501 /Users/mattiaorfano/Library/LaunchAgents/homebrew.mxcl.postgresql@14.plist` exited with 5.
```

It seems they changed path to stable postgresql version and there is some wrong configuration in my system. What do I do?

_"I'm tired as shit and don't want to fix this at 8PM"_

_"Tomorrow I can't work"_

_"Worse... I can't read all the databases"_

_"I'm fucked!"_

I looked around and found few suggestions that involved reinstalling the entire postgresql instance.

_"Absolutely not! I don't want to uninstall it and lose the data. There must be another solution..."_

I took a long breath, stretched my arms, and created another [#10stips](https://dev.to/t/10stips) that you're about to read (what's 10stips? the column where you learn how to solve issues within 10 seconds, because I already tested it for you).

## Fix Postgresql installation on MAC M1 ARM

Instead of deleting and reinstalling the entire postgresql installation (you might lose your data!) I just did this:

```
brew services stop postgresql

using Activity monitor check if there are active postgres processes and kill them

reboot the system

rm -rf /opt/homebrew/var/postgres/postmaster.pid

brew services start postgresql@14
```

Now, you might encounter another issue:

```
Library not loaded: '/opt/homebrew/opt/postgresql/lib/libpq.5.dylib' (LoadError)
  Referenced from: '/Users/mattiaorfano/.rbenv/versions/2.4.10/lib/ruby/gems/2.4.0/gems/pg-0.20.0/lib/pg_ext.bundle'
  Reason: tried: '/opt/homebrew/opt/postgresql/lib/libpq.5.dylib' (no such file), '/usr/local/lib/libpq.5.dylib' (no such file), '/usr/lib/libpq.5.dylib' (no such file), '/opt/homebrew/Cellar/postgresql@14/14.5_1/lib/libpq.5.dylib' (no such file), '/usr/local/lib/libpq.5.dylib' (no such file), '/usr/lib/libpq.5.dylib' (no such file) - /Users/mattiaorfano/.rbenv/versions/2.4.10/lib/ruby/gems/2.4.0/gems/pg-0.20.0/lib/pg_ext.bundle
```

There is an incorrect library pathing for postgresql@14, and all you have to do is:

```
sudo ln -s /opt/homebrew/opt/postgresql@14/lib/postgresql@14/libpq.5.dylib /usr/local/lib/libpq.5.dylib
```

Launch the service again with `brew services start postgresql@14` and now you can turn off the computer and go to sleep.

You're welcome ;-)
Hello, I am Thodoris
Tags: devops, kubernetes, python
Published: 2022-09-17 08:31:37


I am a passionate DevOps Engineer. I have worked with variety of IT Technologies in the past, I working as a consultant, who can deliver quality services, currently I am focusing on the implementation of Custom CI/CD Solutions designed with Python and Groovy and executed by Jenkins CI/CD Server, other tools and Platforms I am using are Ansible, Terraform, Kubernetes and AWS.﻿

More information about me can be found from the following link:
https://t-velmachos.start.page/

I hope you like the tutorial, if you do give a thumps up! and follow me in [Twitter](https://twitter.com/TVelmachos), also you can subscribe to my [Newletter](https://dashboard.mailerlite.com/forms/167581/67759331736553243/share) in order to avoid missing any of the upcoming tutorials.


#### Media Attribution
I would like to thank [Clark Tibbs](https://unsplash.com/@clarktibbs) for designing the awesome [photo ](https://unsplash.com/photos/oqStl2L5oxI)I am using in my posts.
How to get matrix columns without numpy in Python
Tags: python, programming
Published: 2022-09-17 08:28:30

```py

mat = [
        [1, 2,3, 5], 
        [4, 6, 7, 8], 
        [9, 10, 11, 12], 
        [13, 14, 15, 16]
    ]


def convertToArr(el):
    return list(el)

cols = list(map(convertToArr, list(zip(*mat))))

print(cols)  # [[1, 4, 9, 13], [2, 6, 10, 14], [3, 7, 11, 15], [5, 8, 12, 16]]
```
This week’s newsletter is out! (17-09-2022) - Doppelgängers
Tags: javascript, tech, webdev
Published: 2022-09-17 08:27:47

---
title: This week’s newsletter is out! (17-09-2022) - Doppelgängers
published: true
description: Another week of great javascript, tech and web development links.
tags: javascript, tech, webdev, discuss
---

Doppelgängers

https://markjgsmith.substack.com/p/mark-smiths-newsletter-17-09-2022

Would love to hear any comments and feedback you have.

[@markjgsmith](https://twitter.com/markjgsmith)
What is OpenRAN?
Tags: webdev, devops, javascript, programming
Published: 2022-09-17 08:26:22

If you own and use a smartphone capable of connecting to arbitrary computers all over the world, then you are a user of Radio Access Networks (RAN). A RAN is provided by your cellular provider, and it handles wireless connections between your smartphone and your communication provider.

While your smartphone may be running an open source operating system (Android) and the server you try to access is probably running Linux, there's a lot of proprietary technology in between to make the connection happen. While you may have a basic understanding of how networking works locally, this knowledge stops when you plug a SIM card into your smartphone in order to make a connection with a cell tower possible. In fact, the majority of software and hardware components in and around a cell tower are still closed source, which of course has some drawbacks. This is where OpenRAN comes into play.

The OpenRAN initiative (shorthand for Open Radio Access Network) was started by the O-Ran Alliance, a worldwide community of mobile operators, vendors, and research and academic institutions. The initiative aims to define open standards between the various components of radio access networks. Interoperability between components of different manufacturers was not possible. Until now.

Radio Access Network

But what exactly is a RAN? In a nutshell, a RAN establishes a wireless connection to devices (smartphones, for example) and connects them to the core network of the communication company. In the context of a RAN, devices are denoted as User Equipment (UE).

The tasks of a RAN can be summarized as follows:

Authentication of UE

The handover of UE to another RAN (if the UE is moving)

Forwarding the data between the UE and the core network

Provision of the data for accounting functions (billing of services or the transmitted data)

Control of access to the various services

OpenRAN

RAN usually consists of proprietary components. OpenRAN defines functional units and interfaces between them:

Radio Unit (RU): The RU is connected to the antenna and sends, receives, amplifies, and digitizes radio signals.

Distributed Unit (DU): Handles the PHY, MAC and RLC layer.
Centralised Unit (CU): Handles the RRC and PDCP layer.

RAN Intelligent Controller (RIC): Control and optimization o
Units are connected to each other by standardized, open interfaces. Furthermore, if the units can be virtualized and deployed in the cloud or on an edge device, then it's called a vRAN (virtual Radio Access Network). The basic principle of vRAN is to decouple the hardware from the software by using a software-based virtualization layer. Using a vRAN improves flexibility in terms of scalability and the underlying hardware.
Decode Ways
Tags: python, leetcode
Published: 2022-09-17 07:36:53

A message containing letters from A-Z can be encoded into numbers using the following mapping:

'A' -> "1"
'B' -> "2"
...
'Z' -> "26"
To decode an encoded message, all the digits must be grouped then mapped back into letters using the reverse of the mapping above (there may be multiple ways). For example, "11106" can be mapped into:

"AAJF" with the grouping (1 1 10 6)
"KJF" with the grouping (11 10 6)
Note that the grouping (1 11 06) is invalid because "06" cannot be mapped into 'F' since "6" is different from "06".

Given a string s containing only digits, return the number of ways to decode it.

The test cases are generated so that the answer fits in a 32-bit integer.


```py
class Solution:
    def numDecodings(self, s: str) -> int:
        dp = {len(s): 1}
        
        for i in range(len(s) - 1, -1, -1):
            if s[i] == "0":
                dp[i] = 0
            else:
                dp[i] = dp[i + 1]

            if i + 1 < len(s) and (
                s[i] == "1" 
                or s[i] == "2" 
                and s[i + 1] in "0123456"
            ):
                dp[i] += dp[i + 2]
        
        return dp[0]
    
    

```
Python to ease your life !!
Tags: python, programming, webdev, beginners
Published: 2022-09-17 07:23:51

Many people are still out there working from home, there is no denying that you never procrastinate while working from home. Surely you will do and mostly you just move the mouse pointer just for the sake of keeping alive of your work status.

Some people do them manually and I wondered whether there are any device for this particular job and I also doubted who's gonna buy these types of devices. So I did a random search amazon and came across these surprising results.

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

![Image2 description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7n6txgl3wnr1w0i0z4t9.png)

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




I was shocked to see that lot of people are really buying these devices when you can do it by simply writing few lines of code and running it.

So here is a simple guide for people to make their own mouse jiggler.

Requirements :

1. Install python3 — [https://www.python.org/downloads/](https://www.python.org/downloads/)
2. Install pip — use this doc [https://pip.pypa.io/en/stable/installation/](https://pip.pypa.io/en/stable/installation/)
3. After that install the package pyautogui`pip install pyautogui `

That’s it, this will do the job

Open any text editor of your choice and just copy paste the code and save as jiggler.py


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



Now run `python jiggler.py`

This will automatically move your mouse every 3 second.

You can tweak and play with the code.

If you like this article consider following.

Twitter Handle — [AmSorry](https://twiiter.com/amsorry_offl)
C# - The benefits and limitations
Tags: csharp, programming, beginners
Published: 2022-09-17 07:04:31

## Introduction to the C# programming language

---

Developed at Microsoft by Mads Torgensen in 2000. It is a general-purpose and multi-paradigm programming language. It is commonly used for back-end programming, for building games, and especially desktop applications. 

---

**So, what are the benefits and limitations of the C# programming language?**
. 
.
.

---
**Benefits:**

- Compilation and execution times are very fast


- Scales automatically and it is updateable


- It is much safer than C and C++ because pointer types are not allowed


- Offers type safety


- It is ideal for development in Windows

---

**Limitations:**

- Not as flexible as C++


- It can have a steep learning curve


- Some errors can be complex in nature, therefore requiring sufficient knowledge and experience


- It has a poor x-platform GUI (Graphical User Interface)


- Doesn't offer the best performance in terms of application performance benchmarks
Why Should you Attend the GAISA 2022?
Published: 2022-09-17 07:01:22

The Global Artificial Intelligence Summit and Awards (GAISA), one of the world’s most prominent AI events, is scheduled for October 07th and 08th, 2022. Organized by the All India Council for Robotics and Automation, The GAISA event brings together some of the most sought-after experts and leaders in Artificial Intelligence. The event has gained a good reputation with the success of its past editions. The event discusses the AI innovations that happened in major sectors such as Healthcare, Agriculture, Education, Smart cities, and Transportation.

For more info visit here: [https://futuretech.media/why-you-should-attend-the-gaisa-2022/](https://futuretech.media/why-you-should-attend-the-gaisa-2022/)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/np2yzlnb32mg63sfkwu5.jpg)
[Short-Note] Data Engineering 101
Tags: datascience, database, dataengineering
Published: 2022-09-17 07:01:01

I have been participating in Data Engineering Accelerated Program for 3 days and this is overview I perceived from program. I skipped technical aspect like coding and pipeline, another article would be better :)

_Program is undergoing and the rest 5 days are waiting for me!_

### History of data engineering
Organization would like to utilize data such as Dashboard. To compute dashbaord, operator need to pull data from sources (on the left one), clean it, and put to dashboard for analytic user (right one)

When data source grow bigger. Manual operator is not capable. **Data Engineering** is come to **automate** the task.

![Data Engineering replace operator](https://i.ibb.co/RYfQ8gH/data-engineering.png)

#### Extract, Transform, Load (ETL)
![ETL](https://i.ibb.co/P5pN9g0/etl-data-engineering.png)

> "We really know how **consumer use** data."

Pull data from source, clean and trasnform, save in storage.

### Extract, Load, Transform (ELT)

> "let **consumer choose**"

Pull data, store in database, then let **consumer choose** which data they want to use and extract from our source.

It speed up time to market at some use-cases.

### Whole process of data engineering in organization.
![whole process of data engineering](https://i.ibb.co/zZSTSPf/overview-of-data-engineering.png)

### Data Engineer with ETL/ELT.
Data engineer write script (python, scala) to automate 
1) pulling data from source, 
2) cleaning them
3) loading them to database. 

Then dashboard will use data to visualize to dashboard.

### Data Warehouse and Data Lake.
Data werehouse is type of database that is optimized to store, search, query huge amount of structure, semi-structure, and (sometime) unstructure data.

Typical dashboard can only show fixed data to user. To acquire insightful one to help making decision, We need data scientist. Somehow current pipeline data can't give proper data to data scientist to explore.

We need place that store **raw data**, **without preprocessing**, and **able to pull** by data scientist. Its name is [[Data Lake]].

### OLTP & OLAP

#### Online Transactional Processing 
is focusing on transaction in database. It's ***read, write, update frequently***. So, it heavily rely on fast processing. 
##### Usecase: 
- Banking
- Shopping
- Retail scanning

#### Online Analyltical Processing
on the other hand, focus on ***large volumn, high dimensional*** data from data warehouse.

##### Usecase:
- Data analytic purpose.
- Machine learning

_I think those are differentiated by database architecture.

### Culture and Organization shifting.
#### Data democratization
![Data democratization](https://miro.medium.com/max/4800/1*H_cyT-lUf0gy88ZAZJmh2w.jpeg)
Core concept: enable everyone in organization access to data. It impact intention of people, culture of organization, and tool for everyone to access.

#### Reference
- Content: https://data-derp.github.io/
- Image & Content: https://youtu.be/qWru-b6m030
How to execute Cypress test cases in WebKit?
Tags: cypress, javascript, testing, automation
Published: 2022-09-17 06:47:22

This blog covers how we can execute Cypress Test cases in WebKit(Safari)

In Cypress version 10.8.0, they have introduced the  support of WebKit(Safari) browser

https://qaautomationlabs.com/execute-cypress-test-cases-in-webkitsafari/
Using Object.assign()
Published: 2022-09-17 06:36:45

Recently, while working on a project, I encountered a situation where i tried to store an object in an array. After pushing that object into the array, I will return the value of the keys into an empty string. Pushing the object wasn't an issue as I used the spread operator and the push() array method and it worked. What I didn't notice was that I was making a reference to the object I was trying to push. So every time I made changes to that object, the members of the array changed too. Experiencing this bug, I understood the importance of Object.assign() and I decided to share. It might help someone who needs it too.

Object.assign() clones all enumerable properties of an object and transfers it into a target source. It invokes getters and setters thereby defining new properties in the target source.

Object.assign() is also used to merge object with same properties and the properties from the object which is cloned overwrites the properties in the target source which has the same key.

The syntax for using object.assign in your code is 

```
object.assign(target, ...source)
```
After cloning or merging an object, it returns the target.

### Error
A type error can occur if the property of the target source is non-writable.

### Exceptions

1. An exception occurs if the properties of the target source are overwritten before the error is raised
2. Object.assign does not work on null or undefined source values.
Common mistakes that beginners in programming make
Published: 2022-09-17 06:13:03

Beginning your coding journey in the ever evolving tech-industry can be confusing . We are bound to make mistakes when confused. There is no doubt that programmers today have to do more than ever before. Technology is moving from modern to outdated fast. It might be scary but it also means there are many opportunities for growth and advancement! To make sure that you don't panic while learning to code, sharing with you few mistakes programmers tend to make at the start.

1.Not focusing on projects:

I see this happen to almost like 90% of the people that are learning to program. What they do is that they try to learn a language, read about the syntax and move on to another language, without learning how to make a project on it. They don’t use that learned technology to build a project and this is not the correct way to learn coding . It’s important to make projects as much as possible when you are starting to learn to code. Project based learning is the best way to learn programming.

2.Ignoring the Documentation:

For most of the languages, well-written documentation is available. Reading the documentation will help you to find a lot of things that you make functions for. You get idea about standard libraries and so instead of writing that whole block of code, using them saves a lot of time. If you have the habit of reading the documentation you will actually learn a lot of new things.

3.Not having a Roadmap:

“Planning is first step of preparation”. It is important to have deadlines and a plan for what you are learning. In the vast sea of technology, losing the flow of our vision is quite easy & you may keep changing tracks(or procrastinate even!). One of the ways to actually overcome this would be to use hashtags. Hashtags on Twitter like 100 days of code, 30 days 30 websites help you say focused. These are challenges people take to not procrastinate since consistency is the key !

4.Too many Languages spoil the brain!

I have seen many of my fellow classmates trying to learn various languages at same time. I see them learning about Python for a week, then switching to JavaScript and then to Java! Whole lot of confusion there! Know that for any programming language, you have to devote a particular amount of time to understand it. You should be able to build some projects using it, and then you can move on to another language. As the saying goes , Jack of all trades is master of none . Once you understand one language, it doesn’t take much time to learn the second one, right? They only differ in the syntax and the logical part remains the same. Once you grasp a particular language, learning others step-by-step is easy.

CONCLUSION:

So yeah, these were a few mistakes that a lot of people ( including me) have made while learning to code. I hope you get an insight of what not to do when you are beginning your coding journey. Happy learning!
Fixed Yarn error insufficient permissions
Tags: yarn, nextapp
Published: 2022-09-17 06:11:08

I got error permission when using yarn create

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

## Solusions:
run command in terminal
```
yarn config set prefix ~/.local
```
Event Loops Immediate Calls #JS Quick Notes.
Tags: javascript, react, node, discuss
Published: 2022-09-17 05:43:32

You don't have to strugle about what is happening as in your application you just need to know which event will be called and when.

Remeber below sequance.
1) process.nextTick();

```javascript
process.nextTick(functionBlockToExecute.); //Function here will be called first no matter it's place where it is declared but only thing is matter that it should be declared along with below other functions than it will execute first
```
2) Promise => resolve.

```javascript
new Promise((resolve, reject) => {
    resolve('bar'); // Promise resolution will be second in stack to be callled.
  });

```
3) Promise => then.

```javascript
new Promise((resolve, reject) => {
    resolve('bar');
  }).then((resolve) => {
    console.log(resolve);
    process.nextTick(zoo); //Here when a promise resiolved then will be called.
  });

```

4) setImmediate(functionCall)

```javascript
 setImmediate(baz); //However setImmediate execute as soon as possible it still executed after above 3 scenarios.
```

Remember above all are immediate calls and are compared with each other when we are working with such a multiple immediate function calls.