teleren/devto huggingface dataset:
Are engineers just app builders?
Published: 2022-04-23 04:20:39


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

Many years ago, I met someone from a networking event and we had a follow up meeting.

Minutes into the conversation he started bringing up his business ideas.

I too had ideas of my own that I was passionate about as well - and shared excitedly with him.

He subtly implied that engineers do not make good business people and we should leave the business to someone else who knows better.

I asked him about his past business successes that had him make this statement. He demurred and gave vague answers.

He proceeded to continue talking about his business ideas and said he was looking for someone to build an app for him.

Being an engineer doesn’t mean that you are bad (or good) at business.

Being a non-engineer doesn’t mean that you are good (or bad) at business.

It’s whether or not you put in the effort to acquire those skills.

Have you encountered this situation before?
3.0 release, work is not yet done
Tags: javascript, opensource
Published: 2022-04-23 04:15:41

I exclusively worked on this issue this week [#3464](https://github.com/Seneca-CDOT/telescope/issues/3464). 

## Update Feed in `parser` to use Supabase:
I basically removed all `invalid` and `flagged` feed from [`src/api/parser/utils/storage`](https://github.com/Seneca-CDOT/telescope/blob/master/src/api/parser/src/utils/storage.js) and create functions that would take care of invalidating/flagging feeds using Supabase in [`src/api/parser/utils/supabase.js`](https://github.com/Seneca-CDOT/telescope/blob/master/src/api/parser/src/utils/storage.js). Looking back, it wasn't that hard but it was quite lengthy.

The difficulty was that [this function](https://github.com/Seneca-CDOT/telescope/blob/72d20737f2ce1be2ea4c339ea99c36ecefdf563f/src/api/parser/src/utils/storage.js#L48-L75) uses `isFlagged` function to check flagged feed and now it talks to Supabase instead of Redis which made unit test not pass without mocking it. 
```js
  addFeed: async (feed) => {
    // Check if feed being added already exists in flagged feeds set
    // If it is, do nothing
    if (await isFlagged(feed.id)) return;

    const key = createFeedKey(feed.id);
    await redis
      .multi()
      .hset(
        key,
        'id',
    // ...
  },
``` 

So I literally created a mock for Supabase database though I had a problem with telling Jest to use the mock module. 

Originally, I imported the mock this way

```js
jest.mock('../src/utils/supabase');
const { __setMockFeeds, __resetMockFeeds } = require('../src/__mocks__/utils/supabase');
```

So, `__setMockFeeds` would add the array to the actual module => not the mock factory that Jest uses. Those 2 are different javascript objects and Jerry helped me understand this.

```js
// Correct way to mock
jest.mock('../src/utils/supabase');
const { __setMockFeeds, __resetMockFeeds } = require('../src/utils/supabase');
```

I also had to reworked the parser e2e test, now it looks even simpler. For some reason, I kept forgetting to do `pnpm migrate` and I was stuck on the test for a while. I managed to make it work a few hours before 3.0 release haha.

--- 

However, work is not yet done, Supabase doesn't really work in production, `parser` can't really talk to the database, I hope to fix this soon and earn myself some peace of mind.
Made With Appwrite - Now Live !
Tags: appwritehack, javascript, vue, madewithappwrite
Published: 2022-04-23 02:58:11

## Made With Appwrite is now live

Feel free to test it and add your project 🥳 🥳 🥳

{% embed https://dev.to/elreyes/made-with-appwrite-appwrite-hackathon-46gn %}
Pre 3.0
Tags: javascript, opensource
Published: 2022-04-23 02:55:43

The closer we approaching release 3.0, the more we try to narrow the scope of work and honestly I like how each of us knows what area of focus to take charge on and trim down the excess issues. 

My tasks for this release again are mostly on `parser` service:
* Remove the src/backend
* Update invalid/flag feed functions to use Supabase
* Update docs after removing src/backend

But let's focus on what I did the week prior to 3.0 release

## Removing the src/backend: 
One of the problem I came across was that we passed in our staging `SUPABASE_URL` and development `SERVICE_ROLE_KEY` to `parser`, the pair would never work and we'd never get staging `SERVICE_ROLE_KEY` as it is a secret. I had to change the pair so that the client could work locally, this created another challenge. 
The reason we used staging url was Duke suggestion, he wanted to use the feeds from staging database instead of seeding feeds every time a developer spins up the services locally. Duke quickly wrote a solution to this in [#3541](https://github.com/Seneca-CDOT/telescope/pull/3541) saving us from lengthy setup steps.

This wasn't an easy task, I had to do a lot of detective work, I had to find out which microservice or module that used the legacy backend, luckily there weren't much. Removing dependencies was mundane too, I had to figure out which dependency in was peer dependency in the root `package.json`. 

Deploying the code to production made me a bit anxious, it did break production because I did not consider the nginx proxy config for legacy backend so nginx kept breaking. See those locations removed in [#3550](https://github.com/Seneca-CDOT/telescope/pull/3550).
Apache Cassandra - Awesome Part 1 - What is Apache Cassandra
Tags: cassandra, java, systems
Published: 2022-04-23 02:26:01

**Overview**

Apache Cassandra is an open source, distributed, NoSQL database. It presents a partitioned wide column storage model with eventually consistent semantics.

1. **Open source** - cassandra is open licensed. Anyone can contribute in this project.

2. **Distributed** - These are the database that are stored on multiple locations either with Homogeneous or Heterogenous properties. 
Link: [GFG](https://www.geeksforgeeks.org/distributed-database-system/) [fauna](https://fauna.com/blog/the-why-and-how-of-distributed-databases)

3. **NoSQl Database** - NoSQL databases (aka "not only SQL") are non-tabular databases and store data differently than relational tables. NoSQL databases come in a variety of types based on their data model. The main types are document, key-value, wide-column, and graph.

For partitioned wide column storage model, let's discuss this on next series.
The Science of Efficient Learning Part 2 (course by Andrei Neagoie)
Tags: writing, productivity
Published: 2022-04-23 02:11:33

This is part 2 of Efficient learning.

- **_Pays not to be busy:_** Similar to diffuse mode. It's not good to be working day and night as we might think we're being productive. In reality, we're putting strain on our brains. It's essential to unplug, take breaks and not overwork ourselves. 

---
- _**Chunking:**_ Chunking refers to breaking down a difficult subject into small doable pieces to learn. Once you've broken it down it's easier to see how they're connected.

---
- _**How to solve problems:**_ Solving problems can be done in two different states; While you're in focus mode, breaking it down to solve it, or it can come to you when you're in diffuse mode doing something unrelated. Either way is effective, be sure to utilize both strategies.

---
- _**Deliberate Practice:**_ This means practicing what you're learning even when you feel like you're no longer making progress. Push through those hard times and keep practicing pass your limits. It will help you grow and improve in the long run. 

---
- **_Spaced Repetition:_** This means to ensure your revisiting a topic or subject to maintain that knowledge. The last thing you want to do is to forget what you've learned before. It's important to come back to topics for a refresh so that knowledge stays with you. 

---
- _**Be Adventurous:**_ Meaning you don't have to learn the same things everyday, its okay to learn new things to expand your skills. Also, these new skills doesn't have to be related to what you're working on either. It can be a skill you picked up outside the working life. Just take time to learn and explore new things in life. 

---
- _**Have an endpoint:**_ Create a deadline when accomplishing a goal. Don't work on something forever. Also, set your productivity times and work from there. There's no need for all nighters.

---
- _**Be Bored:**_ The most creative ideas and thoughts come from when your doing absolutely nothing. This is when you let your mind wonder, which is gives the brain rest from being focus mode all the time. 

Stay tuned for the techniques portion in Efficient learning ;)
Apache Cassandra - Awesome Part 0 - Beginning
Tags: cassand, java, systems
Published: 2022-04-23 02:01:53

Hi, In this series of articles we will explore that why apache cassandra is so awesome as NoSQL database. 
I will be going to write each and every detail of Documentation, and If in any case if there are keywords on which i got stuck then we will start on that topic first and will follow the Depth first search mechanism.

Let's start with this series of article and hope to see you soon on the next one i.e Apache Cassandra - Awesome Part 1.
CTRL key based operation with Karabiner-Elements
Tags: macos, beginners
Published: 2022-04-23 01:48:10

## Summary

Recently, I got a MacBook Pro and used [Karabiner-Elements](https://karabiner-elements.pqrs.org/) to customise the keyboard because I had been using [X1E2](https://www.lenovo.com/au/en/laptops/thinkpad/x1-series/X1-Extreme-Gen-2/p/22TP2TXX1E2) with [Kubuntu](https://kubuntu.org/) for a few years, and I no longer used to use the command key-based operation.

## About Karabiner-Elements Rule

- I use another Simple modification to replace `Option` to `Command` with the Rule in this post.

- When you want to target a specific application to apply the keyboard manipulation, you need to figure out the value for `bundle_identifiers` called Bundle Identifier.

- You can find Bundle Identifier on the terminal as follows (`com.microsoft.VSCode` is it in this example), but it is easier to figure out with `EventViewer` provided by Karabiner-Elements instead:

```
grep -A 2 "Identifier" /Applications/Visual\ Studio\ Code.app/Contents/Info.plist
======
<key>CFBundleIdentifier</key>
<string>com.microsoft.VSCode</string>
```

## The File

{% embed https://gist.github.com/brisbanewebdeveloper/ccaa9255a15bb6703089617459ef38ba %}

## References

- [frontmost_application_if, frontmost_application_unless
](https://karabiner-elements.pqrs.org/docs/json/complex-modifications-manipulator-definition/conditions/frontmost-application/)
Why GITHUB is so important ?
Tags: github, opensource, productivity, tooling
Published: 2022-04-23 01:42:02

## What is Git ?

**Git is a free open-source distributed version control system. It was created by _Linus Torvalds_ in 2005.**

## What is GitHub ?

**It's built for developers. It is a repository hosting service, where it hosts a lot of Git-based projects in a variety of different programming languages and also it keeps track of the changes made, others can also review your code and most importantly it is open source.**

## Why GitHub ?

**GitHub makes version control easier and have good graphical interface so, it is very user friendly and intuitive. It also provides you with the easiness of combining the changes and removes the headache of sharing the large code files.**

**It help groups of developers work collaboratively on big software projects. It allows other people to see your stuff, sync up with you, and perhaps even make changes.**

## Why Developers love GitHub ?

- Immensely Powerful Community
- The Largest Shared Repository
- Easy Version Control
- Secure Cloud Storage
- You can stand Out From the Crowd by showcasing your work
- You can link your other relevant professional profiles
as well on GitHub

## How recruiters grade you ?

**Tech stack used** : Make sure not using the same tech
stack for every project.
**Completeness** : Make sure your project is completed
**Functionality** : It should work in the way it is expected
**Readability** : Your code should be readable
**Documentation** : A repo without a simple README is
a wasted opportunity.

## Resources to learn git and github :

- Try.github.io
- Get Started with GitHub (Udemy)
- Learn Git Branching (learngitbranching.js.org)
Version Control with Git (Coursera)
- Learn Git by CodeAcademy
- Version Control with Git by Udacity
- Getting Started with GitKraken for GitHub Users by
GitKraken
- Version Control with Git (Git tower)
Configuring Firebase Realtime Database
Published: 2022-04-23 01:18:02

Hello guys
I am looking for someone who can try and help on how to link The registration form of my web app to the Firebase Realtime database
I find it hard to do so because I watched video tutorials, searched through blogs and step by step following and all seems not to be working

I am using Javascript to link it please can somebody help me?
Thank you so much as you assist me
Why Fail-fast Offensive Programming is better?
Tags: programming, beginners, architecture, android
Published: 2022-04-23 00:24:19

**I personally prefer fail-fast (offensive) over fail-safe (defensive) programming style because it is practical and improves my code productivity.**

I once had a discussion with my boss, and we never came to a conclusion because he is a fail-safe guy, and I'm a fail-fast guy.  So, who is correct? Or is this merely a personal choice?

## Why I Prefer Fail-fast?
In this article, I'm going to share with you 3 reasons why I prefer fail-fast offensive programming style. 

### 1. Validate My Assumptions
Fail-fast validates my assumptions. In coding, we often make assumptions and our assumptions mostly wrong at first because we simply don't fully understand the system. Fail-fast / offensive programming style can quickly validate my assumptions. Each time my code fails, it makes me a better programmer.


### 2. Less Conditional Logics
Fail-safe code usually comes with more conditional logics. If this fails, do another thing and if that fails again, do something else. When proper [clean architecture](https://vtsen.hashnode.dev/series/clean-code) is NOT being done correctly, the fail-safe code could become very messy. Fail-fast simply removes this unnecessary conditional checks.

### 3. Pinpoint Root Cause Faster
Because fail-fast code fails the code immediately, the reported error or exception typically quite close to the actual root cause. This reduces the debugging time significantly. When fail-safe code fails, you will have a hard time finding the root cause because it is not supposed to fail in the first place.

## When I Use Fail-safe?
Well, I still use a fail-safe approach only when dealing with code (e.g. external libraries) that is not within my control. You want your system to be robust to handle any errors or exceptions from this external libraries. Another example is dealing with external dependencies. For example, a network call or file system call which will throw exceptions.

## Final Thoughts
In my opinion, fail-safe defensive programming style is too ideal and not practical because you can't 100% guarantee bug free and cover all scenarios. When there is a bug, it is harder to find the root cause.  Have you ever work on the code base when something fails, and you have no clue at all? It takes you many hours or days to figure out the problem.

So my coding approach is I always do fail-fast first to validate all the assumptions. If the software fails, and I can't fix the issue (due to not within my control), I will convert the code to be fail-safe. Eventually, the fail-fast approach can also lead to a robust system. 

Which approach do you prefer?

---

*Originally published at [https://vtsen.hashnode.dev](ttps://vtsen.hashnode.dev/why-fail-fast-offensive-programming-is-better)*.
Javascript Productivity with Lodash
Tags: javascript, webdev, beginners, programming
Published: 2022-04-23 00:12:20

> Don't be Busy, Be Productive

Life is too short to write everything from scratch. Javascript has an ecosystem of amazing libraries that we can leverage. Lodash is one of them. When you open the official website of lodash you are greeted with the following quote.

> A modern JavaScript utility library delivering modularity, performance & extras.
 
I heavily rely on the utility functions that come with lodash. It not only makes me productive but also reduces my codebase size and thus reduce bugs. 
I created a small tutorial to explain this beautiful library. Check this out 👉


{% youtube K3kZ09iSzXw %}
Array.flatMap() - for applying a map and a flat on an array
Tags: javascript
Published: 2022-04-22 23:54:27

This article is the seventh of the [Array Method Series](https://dev.to/dillionmegida/series/17614). In this article, I will explain the `flatMap` Array method.

## What is the FlatMap Method?
The `flatMap` method of arrays is a higher-order function that applies a `map` and a `flat` on an array. That is, `.map().flat()`.

An array `map` method is used for [for mapping items in an array](https://dev.to/dillionmegida/arraymap-2n2n), while an array flat method is used for [flatting nested arrays within an array](https://dev.to/dillionmegida/arrayflat-for-flatting-nested-arrays-within-an-array-3d1o)

The `flatMap` method maps each item in an array and flattens the final array by one depth level.

This method does not modify the array.

## Syntax of the Some Method

```js
array.flatMap(function(item, index, array){
  // do some things on the item
  // return an array or item
})
// the final array will be flattened
// by 1 depth
```

The `callbackFunction` passed to the `flatMap` method is applied to each item in the array during the loop, and the final array after the loop is flattened by one depth level.

The arguments passed to the callback function in each loop are the `item`, the `index` of the item, and the original `array`.

Before I show you how to use the `flatMap` method, let me first show you how to achieve the function of this method by using a `map` and a `flat`.

## Without the FlatMap Method
The `flatMap` method is an abstracted function that maps through an array and flattens the result. Here's how to do without this method:

```js
const array = [1, 2, 3, 4]

// the mapping
const newArray = array.map(item => {
  return [item, item*2]
})

console.log(newArray)
// [ [ 1, 2 ], [ 2, 4 ], [ 3, 6 ], [ 4, 8 ] ]

// the flattening
const flattenedArray = newArray.flat()

console.log(flattenedArray)
// [1, 2, 2, 4, 3, 6, 4, 8]
```

This code is similar to what the `flatMap` method does in the background. The `map` method loops through each item and returns a value for the final array. The flat method loops through recursively and flattens the final array by one depth level.

## With the FlatMap Method

Here's how you achieve the previous result with `flatMap`:

```js
const array = [1, 2, 3, 4]

const newArray = flatMap(item => {
  return [item, item*2]
})

console.log(newArray)
// [1, 2, 2, 4, 3, 6, 4, 8]
```

More straightforward. The difference between the flat in `flatMap` and the flat in `flat` is that the former does not allow you to specify a depth, while the latter allows you to. `flatMap` only does flattening for a depth of one level.

You may be wondering what the difference is between using a map and a flat (`map().flat()`) and using `flatMap`. Well, apart from the fact that `flatMap` is lesser lines of code and is more concise, it is slightly more efficient than doing two loops (calling `map` and `flat` separately, [according to MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flatMap))
Tips to debug code
Tags: codenewbie, codequality, programming
Published: 2022-04-22 23:18:27

Bugs are frustrating. It is terrible. But to debug it, it is an art that you need to master. You need to have a mindset to not falter.
So this is the tips that I can come out of to debug your code

1. Reproduce the behaviour of the bugs
Take the payload or anything that make the bug comes out. Reproduce it. Regenerate it. Whatever you can do. Simulate it back. This is the first things that you need to do, to see what is the problem

2. Go back to where it last worked
This is the most easiest way. Add the code little by little and see, which code segments that produce the bugs. It takes time, but hey, at least we have progress right?

3. Make changes one by one. Little by littles
Speed and efficiency are good for programmers, but when it comes to bug, we need to be delicate. It is frustrating, but still we need to go through it. Changing many things at a time won't help you to find the bug and fix it. Change something, rerun, and see the output. REPEAT.

4. Get your colleagues to have fresh perspective
Don't stuck yourself for hours or days to fix the same things. Ask your colleagues to see from a new perspective. Take some time off and get fresh eyes on the bug. Get a different point of view

5. Be responsible of the code
Firstly, don't ever blame the compiler. Blame yourself. Assume that the problems is ours and never expect the code to work for the first time so that you don't get your hope high. Of course this will comes from experience. Have a mindset to throw away the code/module if you have to fix it 5-6 times or more. Just start from scratch. Start new. Sometimes, that's the wisest things to do

6. Learn from the bug
This is self explanatory. Each of the bugs that we produce, learn from it. Try to not repeat it in other projects. Ask yourself, and reflect
  - "What can I learn from this?"
  - "What did I do?"
  - "How could I prevent this in the future?"
"Is there any tools or things that I can do to improve my coding skills?"
With this mindset, slowly but surely, you will become a good programmer.

I guess that's all for now. If you have any other tips, do share it in the comment section below!


Cover Photo by <a href="https://unsplash.com/@cdr6934?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Chris Ried</a> on <a href="https://unsplash.com/s/photos/code-bug?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>

---------------------------------------------------------
Thank you for reading :D

Psstt pstt :p
Do consider to love this article ❤️ and follow me! Why not right? It's FREE~ 
I would really appreciate it 👨🏻‍💻 
Will be posting more on things related to AWS, Javascript, Python, Serverless and more!
Responsive Web Design Certified!👨🏻‍💻
Tags: webdev, html, css, freecodecamp
Published: 2022-04-22 22:19:25

## First Certification Down

![RWDcert](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1dkadllmbsyuzkulx6ih.png)
 

- Hello again guys! I am super glad to be letting you know that I've completed the last project for the [Responsive Web Design](https://www.freecodecamp.org/learn/responsive-web-design/) course by Free Code Camp! 

- I now feel comfortable with using programming languages such as HTML and CSS. I find CSS to be a lot of fun with some of the visual effects and things you can do. Next I'll start the following FCC certification in line, which is JavaScript! https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/ :) 

- If anyone has any tips or recommended resources please don't hesitate to let me know! Also thanks for anyone who's been reading these so far, I'll keep updating my progress as I go along 🙂

- **So glad I found DEV.to 😬**