teleren/devto huggingface dataset:
TISO #01 🤯 crontab -e != sudo crontab -e
Tags: tiso, crontab
Published: 2022-10-03 16:40:24

> Welcome to **TISO** (_Today I Stack-Overflow-ed_)! This a post series where I share what I learnt after facing a weird bug on my code or an unexpected behavior on my machine, in hopes that you also learn from it. Feedback and comments are welcome!

Today I was trying to configure a Linux server to run a NodeJS service on every boot using Cron and Crontab. The shell command to edit the Crontab file where you schedule the tasks is `crontab -e`. But then, while playing around with Crontab, I stumbled upon something unexpected:

Running `crontab -e` opens a different Crontab file than `sudo crontab -e`! If you add some cron tasks on the first one, they won't appear in the latter, and vice versa.

This is because when you run the command without `sudo`, you will add tasks as the current logged in user. But if you add `sudo` then you will add tasks to another Crontab that executes with root user's permissions. Quite dangerous!

Did you know this already? Is there something else you want to add? Feel free to say it in the comments! ⬇

_Original source: [https://stackoverflow.com/questions/43237488/linux-difference-between-sudo-crontab-e-and-just-crontab-e](https://stackoverflow.com/questions/43237488/linux-difference-between-sudo-crontab-e-and-just-crontab-e)_
More new tech skills - Docker up to the plate. Pt 1
Tags: docker, beginners, architecture, devjournal
Published: 2022-10-04 15:25:33

This is definitely **NOT** a tutorial - there are 100's of other places to learn Docker, by people much more knowledgeable than myself.
No, this is the tale of a 3 hour tour... No, wait, this is the tale of the whale that swallowed... No, still not it. Ahhh, this is how my dive into the Docker pool transpired. Which took slightly longer than 3 hours. 

I had heard of Docker (& Kubernetes, that will be a different post) but hadn't paid it much attention. I had a list of other things that I thought I needed to learn first. But seeing Docker or K8s on more & more job descriptions gave me pause. Maybe I should seriously look into this, maybe it could be a quick hit to add to my resume to help with new job opportunities, maybe it's kinda neat...

As I've discovered, it **IS** neat. I think it also fits the need for a resume quick hit for a current technology. While I will not be an expert, I can now speak with some level of knowledge on the core concepts of Docker. If you're familiar with 'traditional' virtualization, the leap to Docker is actually pretty easy.

Enough rambling, how about some actual "what had happened was..."
My current go-to video learning creator is NetworkChuck on YouTube. So that's where I started at 11pm laying in bed one night (TMI?). I watched his "_You need to learn Docker RIGHT NOW!_" video first. The next night "_Docker networking is CRAZY!! (you NEED to learn it)_" & "_you need to learn Kubernetes RIGHT NOW!!_" - I know, I said this was a different post, but I gotta start here...

At this point, I'm hooked. Now I just need to sit down in front of my laptop & start banging on some keys.  For that - check out Part 2 of this series.


Links:
{% embed https://youtu.be/bKFMS5C4CG0 %}
{% embed https://youtu.be/eGz9DS-aIeY %}
{% embed https://youtu.be/7bA0gTroJjw %}
Basics of Binary Code in Computer Science
Tags: binary, computerscience
Published: 2022-10-04 15:16:24

## What is Binary Code? 

For humans, we are able to communicate with one another through our wide range of 7,000+ languages in the world, but the way in which computers communicate to one another is through Binary Code. Any time you go to watch a movie, listen to music, or look up directions, you are giving your device input, and it turns into Binary Code. Binary Code is made up of 2 digits 0's, and 1's, unlike our traditional decimal system that is made up of 10 digits. The 0's and 1's are how computers read, process, and store data. These 0's and 1's can represent any symbol, letter, number, or segment of data. Binary Code can also be broken down further into what is called and Byte, and a Bit.




## Bit

John Tukey, a leading statistician and adviser to five presidents first coined the term in 1946. A single bit is made up of a single 1 or 0. Computers are often classified by the number of bits they can process at one time. Graphics are often described by the number of bits used to represent each pixel, and a certain number of bytes makes up a larger unit called a KiloByte, MegaByte, GigaByte, or a TeraByte.


![byte chart](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6h5vwe7xbvq5j1ohim53.PNG)

## Byte

A byte is a unit of storage capable of holding a single character for example those letters, numbers, and symbols, we talked about earlier. One byte is equal to 8 bits (a single 1 or 0)

```
Byte: This is a single byte composed of 8 bits => 01100011 = "c"
```
Now what if we wanted to used multiple bytes to compose a word or sentence? 

## The Alphabet Using Binary
![Binary Alphabet](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sk97esbs5zqg2pddcf0a.png)

## A word using Binary
![cat binary](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k9wtnnck37bck8g65hc9.PNG)


## Finally A Sentence Using Binary


![ice cream binary](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p4oj4ytlq0xo6stzmz0e.PNG)

This gets very long winded, because a single byte doesn't represent one word, it only represents a single character, which is why us humans don't use this as a form of language, but this binary system is what computers use everyday to communicate!
How To Tackle Object Oriented Design problems in Interviews - ujjwalscript
Tags: techtips, writing
Published: 2022-10-04 15:13:56

####   Original Tweet from [@ujjwalscript](https://twitter.com/ujjwalscript)
{% embed https://twitter.com/ujjwalscript/status/1576821957441785858 %}
Most top tier tech programming interviews ask Object Oriented Design problems.

Here’s what it is and how to tackle them: 

Object Oriented Design problems ask you to depict a given system (for example a parking lot system or a social media) in terms of classes, properties, and relationship of classes with each other

There's no one correct answer. 

1. Gather the requirements

The problem is kept vague on purpose. Your first job is to ask clarifying questions and understand the problem statement well.

Pro tip: Keep creating a written list of requirements. 

If asked to create a social media OOD, you can ask questions like:

- Can users like, comment, post?
- Is friendship mutual (like facebook) or one way (like instagram)?
- What properties of a User do we want to store?

These answers will shape your classes &amp; their relationships 

2. Figure out the basic classes and their functionalities, and discuss it with the interviewer.

In our case, you can have these basic classes:
- User
- Post
- Comment 

3. Next step is to start building relationships between classes

For example:

Post can be of 3 types: ImagePost, VideoPost, TextOnlyPost. Post can have 3 child classes. (Inheritance)

Posts have user as author &amp; Users have other users as friend (association) 

4. The last step is to clearly write and define all classes and properties you have discussed with the interviewer. For example, the final user class may look like this:

User
- name: string
- userid: string
- friends: User[]
- posts: Post[] 

That's all for this thread. If you find this useful:

1. Retweet and leave a like on the first tweet - it encourages me to write more of similar content.

2. Follow me [@ujjwalscript](https://twitter.com/ujjwalscript) for more useful tips and threads ￼ 

You can now follow me on LinkedIn too! I’ll be writing some exclusive content which I don’t post on twitter.

https://t.co/WL3EXHRpaV 

#### Click [Here](https://www.knowledge-twitter.com/?utm_source=dev.to)  For More Posts Like This [https://www.knowledge-twitter.com](https://www.knowledge-twitter.com/?utm_source=dev.to)
If you want to get hired in a unicorn startup, open this - tanaypratap
Tags: techtips, writing
Published: 2022-10-04 15:10:15

####   Original Tweet from [@tanaypratap](https://twitter.com/tanaypratap)
{% embed https://twitter.com/tanaypratap/status/1576799321680486401 %}
If you want to get hired in a unicorn startup, open this: 

📌 Personalize

Always make sure to research well about the companies you wish to work with.

Do not share the same resume with every company you have applied for. 

Know that making your resume generic has a high possibility of rejection.

Only when you personalize it, it will make your resume stand out from thousands of other resumes. 

📌 Passion

Search for your love by trying out new opportunities.

This means investing time in finding your passion.

Find out which startup/sector/industry you are passionate about and apply to those.

That way you can know what will be the best choice for you and excel in it. 

📌 Showcase proof of work

If you are a website designer, redesign the company's website.

If you are into marketing, prepare social media posts and stories for the company.

The idea is to prepare a portfolio and show your talents to the companies. 

Pro tip: You need not make personalized projects for every company you apply for. You can also make it for other companies you are passionate about. 

📌 DM

Connect with people who are working in the company.

Show them a personalized proof of work and ask for feedback. 

This reflects ownership and initiative on your part- a much sought-after skill.

It will also improve your knowledge and presentation skills. 

If you liked this thread:

- RT the first thread and share it with your friends on Twitter
- Follow [@tanaypratap](https://twitter.com/tanaypratap) for content on career, startup, education, and more

Thanks for reading. {% embed https://twitter.com/52322389/status/1576799321680486401 %} 

#### Click [Here](https://www.knowledge-twitter.com/?utm_source=dev.to)  For More Posts Like This [https://www.knowledge-twitter.com](https://www.knowledge-twitter.com/?utm_source=dev.to)
FREE Machine Learning websites that'll put you ahead of 90% of aspirants. - Saboo_Shubham_
Tags: jobs, career, beginners, machinelearning
Published: 2022-10-04 15:03:01

####   Original Tweet  [@Saboo_Shubham_](https://twitter.com/Saboo_Shubham_)
{% embed https://twitter.com/Saboo_Shubham_/status/1576607950289903618 %}
Getting hands-on experience is the fastest way to become a machine learning engineer.

5 FREE websites that'll put you ahead of 90% of aspirants.

(A thread) 🧵👇 

1. Kaggle 

Kaggle is not just a free website, but Kaggle is also a community that supports high-quality Data Science, Machine Learning projects. 

It also hosts an array of ML competitions and provides free cloud notebooks to run your ML experiments.

👉 {% embed https://www.kaggle.com %} 

2. OpenML

OpenML is an open platform for sharing datasets, algorithms, and experiments - to collaboratively learn together.

It aims to make Machine learning research accessible and reusable for all! 

👉 {% embed https://www.openml.org %} 

3. MachineHack

MachineHack is an online platform for Machine Learning Hackathons where one can test and practice their machine learning skills.

If you are new to the field, you can use the sample datasets to learn about different ML algorithms.

👉 {% embed https://machinehack.com %} 

4. Papers With Code

Papers with Code is a free website to learn about the latest in machine learning. It consists of research papers with concise codes attached to them.

If you want to stay ahead of the curve, this website would be a great resource!!

👉 {% embed https://paperswithcode.com %} 

5. Towards AI 

Towards AI is one of the biggest content platforms for AI enthusiasts. Here you can find blogs around applied ML, recent advancements, and tutorials around solving real-world problems with machine learning.

👉 {% embed https://towardsai.net %} 

That's a wrap! 👋

Thanks for reading the thread. ❤️

Follow me [@Saboo_Shubham_](https://twitter.com/Saboo_Shubham_) to access more such Data Science, ML, NLP related content in the future. 

#### Click [Here](https://www.knowledge-twitter.com/?utm_source=dev.to)  For More Posts Like This [https://www.knowledge-twitter.com](https://www.knowledge-twitter.com/?utm_source=dev.to)
Top 7 Featured DEV Posts from the Past Week
Tags: top7
Published: 2022-10-04 15:01:16

---
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._ 

## Meaningful OS Contribution

Just in time for Hacktoberfest, @jmfayard drops some really awesome "unconventional" advice  for making simple but meaningful contributions when working in open source.

{% embed https://dev.to/jmfayard/can-beginners-make-a-simple-but-meaningful-contribution-some-unconventional-advice-hacktoberfest-56oh %}


## JavaScript Under the Hood

Ever wonder what's happening behind the scenes when you run a few lines of JS code? If so, you're in luck. @inancakduvan walks us through it all in this excellent breakdown.

{% embed https://dev.to/inancakduvan/let-me-understand-how-javascript-works-under-the-hood-3ibf %}


## Becoming a Faster Programmer

@marcinwosinek walks us through many helpful tips to speed up our development flow while also reminding us not to rush. 

{% embed https://dev.to/marcinwosinek/how-to-become-a-faster-programmer-hp9 %}


## Working on a Personal Project

@maxr96 collected together seven tips from experience (including occasional mistakes 😅) that can help you with your personal projects.

{% embed https://dev.to/maxr96/7-things-to-consider-when-working-on-a-personal-project-78d %}


## HoloPin: Digital Badges for Devs

You a dev? You like digital badges? Lucky you! @elenalape intros us to Holopin, a digital badge platform built with devs in mind.

{% embed https://dev.to/elenalape/introducing-holopin-the-digital-badge-platform-for-developers-2hlk %}


## Could a 60% Keyboard Benefit You?

In this in-depth breakdown, @ilaif makes a solid case for why they prefer 60% keyboards.

{% embed https://dev.to/ilaif/a-60-keyboard-is-good-for-you-2d4k %}


## Tech Communities to Join

DEV isn't the only developer community out there! Check out @juliafmorgado's awesome list of tech communities and find the places that fit you best.

{% embed https://dev.to/juliafmorgado/tech-communities-you-should-join-online-and-in-person-4nba %}


_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!_
Find the element that appear once in array
Tags: array, python
Published: 2022-10-04 15:00:52

**Problem**
Given an array with items.
each item in the array appear twice except once element.
E.g [1,4,3,4,1]
here the element 3 appear only once hence it should be returned.
**Solution**
_Prerequisite knowledge hashMap or Dictionary._
How do you find the element.
Using Dictionary.

**1 Create a Dictionary**.
**2 Assign the key of the dictionary as the array items, and the value as count of times it appears in the array**.
**3 Return the dictionary item with the value of 1**.

Create items dictionary
Loop through the array i = 0,....n = length of the array-1.
If the array[i] is not a key in the items dictionary create a key with value of 1
if the array[i] is a key in the dictionary increment the value by 1.

Loop through the dictionary of items to get the key with 1 as value and return it, if all are more than one.

return -1. 


_Time Complexity O(n)_
Because we are looping through the array n times.
_Space Complexity O(n)_
Because we are creating a map with at worst case n keys.
FREE collection of specialised JavaScript resource - hashnode
Tags: jobs, javascript, beginners, tutorial
Published: 2022-10-04 14:55:02

####   Original Tweet from [@hashnode](https://twitter.com/hashnode)
{% embed https://twitter.com/hashnode/status/1576898109057236992 %}
Hey Developers ✌️ 
A curated FREE collection of specialised JavaScript resources to start your week perfectly!

Check thread 🧵👇 ![Twitter Image 1](https://pbs.twimg.com/media/FeJEeOhXwAEl6ct.png) 

◽ Learn what variables and constants are in JavaScript and why they are necessary. ~ [@IamTeju_g](https://twitter.com/IamTeju_g)

{% embed https://blog.codingminutes.com/javascript-variables-constants %} 

◽ LocalStorage in javascript for absolute beginners! ~ [@lovelyfin00](https://twitter.com/lovelyfin00)

{% embed https://lovethomokaro.hashnode.dev/how-to-use-localstorage-in-javascript-for-absolute-beginners %} 

◽ See the power of one-liners in Javascript. ~ [@kumartul001](https://twitter.com/kumartul001)

 {% embed https://kumartul.hashnode.dev/killer-javascript-one-liners %} 

◽ Ease your understanding of call, bind and apply methods in Javascript.
  ~ [@afrohappi](https://twitter.com/afrohappi)

{% embed https://happisblog.hashnode.dev/understanding-call-apply-and-bind-method-in-javascript-and-their-uses %} 

◽ Clear your concepts of JavaScript event loop!  ~ [@ChhakuliZingare](https://twitter.com/ChhakuliZingare)

{% embed https://chhakulizingare.hashnode.dev/javascript-event-loop %} 

◽ Got an interview? Check this JavaScript interview preparation cheat sheet. ~ [@themohitgupta](https://twitter.com/themohitgupta)

{% embed https://themohitgupta.hashnode.dev/javascript-interview-preparation-cheat-sheet %} 

◽ Looking for a project, then this is a must-try, a shopping cart.
  ~ [@Sudhanss_u](https://twitter.com/Sudhanss_u)

{% embed https://sudhanshuranjanblogs.hashnode.dev/making-a-shopping-cart %} 

◽ Build your fundamentals about array methods in JavaScript. ~ [@yash_1805](https://twitter.com/yash_1805)

{% embed https://yash1805.hashnode.dev/array-methods-in-javascript %} 

◽ Wondering what is template literal in JavaScript, here you'll findall the answers!  ~ [@MetuNechey](https://twitter.com/MetuNechey)

{% embed https://nechey.hashnode.dev/what-are-template-literals-in-javascript %} 

◽ Does recursion seem daunting? Not anymore; this article is a must-read. ~ [@nwokporo_ebuka](https://twitter.com/nwokporo_ebuka)

{% embed https://codedaddy.hashnode.dev/recursion-in-javascript %} 

What other resource should this JavaScript list include?

Let us know in the comments 👇 

#### Click [Here](https://www.knowledge-twitter.com/?utm_source=dev.to)  For More Posts Like This [https://www.knowledge-twitter.com](https://www.knowledge-twitter.com/?utm_source=dev.to)
Do you want to land a job in Machine Learning? - DatosNinja
Tags: machinelearning, techtips, ai, career
Published: 2022-10-04 14:48:19

####   Original Tweet from [@DatosNinja](https://twitter.com/DatosNinja)
{% embed https://twitter.com/DatosNinja/status/1576657321840754691 %}
Do you want to land a job in Machine Learning?

No relevant experience? 
Just starting with the whole thing?

5 pieces of advice (+ two bonus) by the one and only [@svpino](https://twitter.com/svpino) to stand out in a job interview

A thread 🧶 [↓] 

[@svpino](https://twitter.com/svpino) 

#### 1️⃣ Pick a problem

Don't need to reinvent the wheel. It just need to be interesting and above all...

Keep. it. simple.

[↓] 

[@svpino](https://twitter.com/svpino) 
#### 2️⃣ Build the model

Focus on YOUR solution. 

In the process, you'll be able to find your weaknesses and revisit them for the interview.

[↓] 

[@svpino](https://twitter.com/svpino) 
#### 3️⃣ To get that model out in the world you need an API

- Flask
- FastAPI
- Django
- Node

Seriously... ANY.

[↓] 

[@svpino](https://twitter.com/svpino) 

#### 4️⃣ Build a simple app 

so other people can USE your model.

[↓] 

[@svpino](https://twitter.com/svpino) 

#### 5️⃣ Document the process 

You need to be ready to explain your work to other people. 

Comunication is key 🔑

[↓] 

[@svpino](https://twitter.com/svpino) ⭐ Bonus ⭐ 
Design a retraining pipeline

Or even build it... what would you do if your model needed to stay current with changing data?

(...which is often the case)

[↓] 

[@svpino](https://twitter.com/svpino) ⭐ Bonus ⭐  
Monitor your model

So you're able to know whether your model is still valid or outdated. Or, at least, take the time to think about how you would do it.

[↓] 

If you've found this thread useful, follow 
@datosninja
 and spread the love 💛 with a RT 🔁

{% embed https://twitter.com/DatosNinja/status/1576657321840754691 %}

[↓] 

Also, don't forget to check the full video and subscribe to the channel. Loved it! 💛

{% embed https://youtu.be/QU3LX-zcL3I %} 

#### Click [Here](https://www.knowledge-twitter.com/?utm_source=dev.to)  For More Posts Like This [https://www.knowledge-twitter.com](https://www.knowledge-twitter.com/?utm_source=dev.to)
Leaf-Similar Trees
Tags: javascript, leetcode
Published: 2022-10-04 14:39:46

Two binary trees are considered leaf-similar if their leaf value sequence is the same.

Return true if and only if the two given trees with head nodes root1 and root2 are leaf-similar.

Input: root1 = [3,5,1,6,2,9,8,null,null,7,4], root2 = [3,5,1,6,7,4,2,null,null,null,null,null,null,9,8]
Output: true

```js
/**
 * Definition for a binary tree node.
 * function TreeNode(val, left, right) {
 *     this.val = (val===undefined ? 0 : val)
 *     this.left = (left===undefined ? null : left)
 *     this.right = (right===undefined ? null : right)
 * }
 */
/**
 * @param {TreeNode} root1
 * @param {TreeNode} root2
 * @return {boolean}
 */
var leafSimilar = function (root1, root2) {
  let resultRoot1 = [];
  let resultRoot2 = [];
  getNodes(root1, resultRoot1);
  getNodes(root2, resultRoot2);

  let isValid = false;

  if (resultRoot1.length !== resultRoot2.length) {
    return false;
  }

  for (let i = 0; i < resultRoot1.length; i++) {
    if (resultRoot1[i] !== resultRoot2[i]) {
      return false;
    }
  }
  return true;
};

const getNodes = (root, result) => {
  if (root === null) {
    return;
  }
  if (root.left === null && root.right === null) {
    result.push(root.val);
  }
  getNodes(root.left, result);
  getNodes(root.right, result);
};

```
New Layout Components just Released! 🎉
Tags: react, tailwindcss, uiweekly, news
Published: 2022-10-04 14:34:44

New component just showed up! 🎉  

Layout components with 14 different variations are now available to use!  

[https://wind-ui.com/components/layouts/](https://wind-ui.com/components/layouts/)

As always feel free to give us your feedback and share the love!