teleren/devto huggingface dataset:
Stacks and Queues
Published: 2022-02-23 07:26:05

##Stack
**LIFO = "last in first out"**
Examine the item most recently added.
`push()`
`pop()`

### implementation -How it works in linked-list

```
inner class
private class Node
{
 String item;
 Node next;
}
```
```
/* === pop() === */
String item = first.item;
first = first.next;   //delete first node
return item;
```
```
/* === push() === */
Node oldfirst = first;
first = new Node();
first.item = "not";
first.next = oldfirst;

```

##Queue 
**FIFO = "first in first out"**
Examine the item least recently added.
`enqueue()`
`dequeue()`

### implementation -How it works in linked-list 
```
inner class
private class Node
{
 String item;
 Node next;
}
```
```
/* === dequeue() === */
String item = first.item;
first = first.next;   //delete first node
return item;
```
```
/* === enqueue() === */
Node oldlast = last;
//create a new node for the end
last = new Node();
last.item = "not";
//link the new node to the end of the list
oldlast.next = last;

```
How would you name the TS interface like this(TS types naming convention)?
Tags: typescript, help
Published: 2022-02-23 07:05:54

For the API `/v1/users`, the data shape of the user is:

```json
{
  id: 1,
  name: 'teresa teng'
}
```

For the API `/v1/user/:id`, the data shape of the user has some extra fields:

```json
{
  id: 1,
  name: 'teresa teng',
  role: 'admin',
  email: 'example@gmail.com'
}
```
I'm looking for good names for the interfaces. The names I've used are:

Option 1:

```ts
interface BaseUserEntity {
  id: number;
  name: string; 
}
interface UserEntity extends BaseUserEntity {
  role: string;
  email: string;
}
```

I don't really like `Base` prefix for the interface name.

Option 2:

```ts
interface UserEntity {
  id: number;
  name: string; 
}
interface UserDetailEntity extends UserEntity {
  role: string;
  email: string;
}
```

I think `User` and `UserDetail` are the same thing, introducing excess words - `Detail`. Do you have any suggestions for the naming convension? Thanks.
Day 30/100 Java
Tags: 100daysofcode
Published: 2022-02-23 06:55:42

Challenges along the way.

Day 30/100

**Language:**
JAVA

**Time Period Spent:**
2 hrs

**Course Taken:**
Udemy: Java Programming Masterclass - Tim Buchalka

**Today's Learning:**
- Inner Classes.

- Code Challenges:
	- Interfaces.

**Additional Notes:**
going through the code challenge it seems like all these implementations are a way of cutting down and cleaning up code. I presume that with this we can create some increase of iteration and speed. Interfaces are nice as it allows you to essentially craft a blueprint for your classes and then override them, giving them extra functionality.
使用vs2022 flutter不能运行的问题
Tags: flutter, vs2022, windows, dart
Published: 2022-02-23 06:36:10

最近新安装了一台电脑，什么软件的都是新的，运行了一下flutter的helloworld，竟然不能运行。
一运行就提示，

```
Can't load AOT data from D:\code\fsrc\f001\build\windows\runner\Debug\data\app.so; no such file.
Unable to start engine without AOT data.
```
网上找了一下答案，发现这个问题还是个新问题，flutter官方都还没有修复。[issues在这里]
(https://github.com/flutter/flutter/issues/97086)
怎么修复呢，[在这里](https://github.com/flutter/flutter/pull/98945)
查看文件改变，按照文件改变，直接把代码更新一下就好。
packages/flutter_tools/lib/src/windows/build_windows.dart 

有一点需要注意，更新完成文件需要找到，\flutter\bin\cache目录
删除，flutter_tools.snapshot文件，这个文件相对于python里面的pyc文件，不删除，刚改的代码就不会重新编译。

改完你就可以重新运行了。

![run ok image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xirhnebfzm26i0osnuga.png)
Big Oh notation
Tags: programming, codenewbie, beginners, javascript
Published: 2022-02-23 06:33:48

## Series Intro:

This series contains notes from interviewcake full couse of Data Structures and Algorithms. 

## Big O Notation

Using not-boring math to measure code's efficiency

## What is Big O Notation

Big O notation is the language we use for talking about how long an algorithm takes to run. It's how we compare the efficiency of different approaches to a problem.

With big O notation we express the runtime in terms of—brace yourself—how quickly it grows relative to the input, as the input gets arbitrarily large.

## Breakdown of Big O Notation

### How quickly the runtime grows 

It's hard to pin down the exact runtime of an algorithm. It depends on the speed of the processor. We use big O notation to talk about how quickly the runtime grows.

### Relative to the input

If we were measuring our runtime directly, we could express our speed in seconds. Since we're measuring how quickly our runtime grows, we need to express our speed in terms of...something else. With Big O notation, we use the size of the input, which we call "nn." So we can say things like the runtime grows "on the order of the size of the input".

### As the input gets arbitrarily large

Our algorithm may have steps that seem expensive when nn is small but are eclipsed eventually by other steps as nn gets huge. For big O analysis, we care most about the stuff that grows fastest as the input grows, because everything else is quickly eclipsed  gets very large.

SOOOO LONG PARAGRAPHS. Right?

Lets take a break here. 
Will continue in next blog...

Thanks for reading <3
Top 10 things you should know as a Programmer 
Tags: webdev, programming, javascript, beginners
Published: 2022-02-23 06:16:27



## Top 10 things Every Programmer should know
 
* As a Developer you should know these things........

1. Write a code fancy nor longer 
   Fancy means take care of your code quality ,less number of 
   lines , use built and new version methods
2. Ready to solve unexpected "Bugs"
3. Always use to write a meaningful names 
   It means give meaningful names to variables, functions , class,   
   packages. It helps to understand others as well
4. Write short Functions 
   Keep your Functions as short as possible which you can easily 
   reuse and understand
5. Always ready to ask Questions to your partners or leader
   Don't be shy just ask
6. Drink water as much as you can and take break after work
7. Test code 
8. As a Developer you should know the knowledge of maintenance, 
   migrating, deployment, scaling your code on different platforms 
   like Heroku, AWS, Netlify, cloud
9. Problem Solving Attitude
   Play games in your free time like puzzle solving
   Problem solving skills through build small projects through 
   data structures or algorithms
10. Googling 
    Beginner, Intermediate, advance, Experienced everyone is 
    Googling 
    Don't be shy just Google it
    You cant learn everything so just google it

Please drop your points
Object destructuring in TypeScript
Tags: typescript, javascript, beginners
Published: 2022-02-23 06:06:09

The cool part about TypeScript is that we can define types for certain variables.
However, there is a scenario that might prove a bit difficult.

And this is destructuring an object.

Let's take the following example:

```js
const user = {firstname: 'Chris', lastname: 'Bongers', age: 32};

const {firstname, age} = user;
```

By using this destructuring, we extract specific properties from an object.

But how do we now define the types for this destructured object?

## TypeScript casting a destructured object type

You might immediately think the following will work:

```js
const {firstname: string, age: number} = user;
```

But this assigns the `firstname` variable to be `string` and the `age` variable to be called `number`.

And when we introduce two of the same type, we are hit with an error since we are redefining a variable.

This is because when we destructure an object, we can rename the properties like so:

```js
const {firstname: userFirstname, age: userAge} = user;
```

To define these types, we have to assign them after the destructuring.

Which would look like this:

```js
const {firstname, age}: {firstname: string, age: number} = user;
```

Do note you can still rename the variables, and we must still use the types for the original names.

```js
const {firstname: userFirstname, age: userAge}: {firstname: string, age: number} = user;
```

We can make this a bit nicer by using [TypeScript interfaces](https://daily-dev-tips.com/posts/typescript-types-and-interfaces/).

```js
interface User {
  firstname: string;
  age: number;
}
const {firstname, age}: User = user;
```

That looks way nicer, right?

And there you go the correct way to typecast a destructured object in TypeScript.

### Thank you for reading, and let's connect!

Thank you for reading my blog. Feel free to subscribe to my email newsletter and connect on [Facebook](https://www.facebook.com/DailyDevTipsBlog) or [Twitter](https://twitter.com/DailyDevTips1)
Help with minting a NFT collection on Opensea
Tags: nft, minting
Published: 2022-02-23 06:03:55

Hello community,

We need some support in the following of areas NFT minting:

1. We want to upload 10,000 NFT images to Opensea using their smart contract, lazy minting and freeze option for the metadata in IPFS. The process of freezing is done individual and has $12 gas fees for each item before sold. Is there a bulk way to freeze the metadata when using Opensea’s smart contract ERC-1155 token and lazy minting?

2. If we create our own Ethereum smart contact with ERC-721 tokens for the NFT collection, do we pay individual gas fees to upload and sell on Opensea? 

Welcome any suggestions on the best way to minimise gas fees and to freeze the metadata.

Will people buy and value a NFT collection on the Polygon blockchain.
Reduce APK size in React Native
Tags: javascript, reactnative, android, app
Published: 2022-02-23 05:57:32

##Reduce App Size in React Native:
 
We all have faced problems related to the size of the built apk in React-Native. The size of the apk is usually very high . This eats up a lot of space in the phone's storage. Let's look at a few methods to avoid large apk size in the final bundle.
 
###Remove Codes and assets.
One simple method is to use light-weight assets. Use jpg instead of a high quality png image (if not required). Use vector icons(Prefer React Native Vector icons). Optimize your image files using some tools like tinypng.com. Also, remove unused codes and JS files.

 
###Prefer light-weight node modules
You can use alternate node modules to reduce the size of APK by finding the weight of your current node modules by the use of cost-of-modules(npm install -g cost-of-modules).If any module is of high cost, replace it with less cost alternatives.
  ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eno6sdlgkuat244qq0xa.png)
 
###Compress Java Bytecode
Navigate to android/app/build.gradle .Set the def enableProguardInReleaseBuilds to true.This would enable Proguard to compress the Java ByteCode leading to reduction in the apk size.
 
###Separate APK for separate CPU architecture
Navigate to android/app/build.gradle .Set the def enableSeperateBuildPerCPUArchitecture to true.This would build different apks for different CPU architecture(x86 and arm).Upon publishing on playstore, playstore will automatically deliver required apks according to the phone's CPU Architecture.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cz9ex2gd4rgqi0xfez8l.png)
VS Code Sparking Watercooler Convos? Here's How
Published: 2022-02-23 04:45:11

Feeling the co-presence of others while working does not just foster camaraderie, it is often the spark that leads to conversations that make communities grow closer together.
 
[![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yihyjahabntdrnip4i7w.gif)](https://www.stateful.com/@admc)
> Get your own coding status at https://app.stateful.com/

## How Does It Work?
You can share your real-time coding status. Actively and passively. You can easily toggle the level of information you are sharing, both for community and beyond. Default sharing settings are Activity, Language, and Availability. Availability will let others know when you are heads down coding. Go ahead, [get your own coding status](https://www.stateful.com/@admc), select what's included, and share it with other devs.

## Invite More Familiar Faces
You probably agree that work time’s more fun when you are surrounded by others. Invite your friends, coworkers, and classmates into this social experience. The more the merrier. Invite them via the [embedded email form](https://stateful.com/@admc) or just grab [your personalized URL](https://stateful.com/@admc) and slide right into their DMs.

Happy coding! Cheers,
Sebastian
Two problem DKMS on the Amazon Linux 2
Tags: linux, dkms, amazonlinux
Published: 2022-02-23 05:55:19

---
title: Two problem DKMS on the Amazon Linux 2
published: true
description: 
tags: linux, dkms, amazonlinux
//cover_image: https://direct_url_to_image.jpg
---

The best way to load the driver into the kernel is to use dkms.

#### Step 1 
to unzip source code to /usr/src
#### Step 2
register driver into dkms service
`dkms add -m DRIVERNAME -v VERSION`
#### Step 3
to build the source against the current kernel
`dkms build -m DRIVERNAME -v VERSION`
#### Step 4
install driver
`dkms install -m DRIVERNAME -v VERSION`
#### Step 5
Load driver
`modprobe DRIVERNAME`

That all. 

From here began problems.
I have checked step 4 on the Ubuntu 20, RedHat 8, CentOS 7, CentOS 8, and everywhere the driver does not load automatically on step 4 except for Amazon Linux.
4 Steps to be a Good Developer
Tags: beginners, programming, webdev, codenewbie
Published: 2022-02-23 05:37:01

> **<u>Always Chaulk outs the flow:</u>**

![mindmap](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/baeflzs5f1xfzrs81cjv.jpg)

Before starting work or task you must write down the flow of your work even if its small thing like CRUD i.e. Create Read Update Delete functionality. Its should be your must rule. It helps you a lot for your time management. Also, with the help of this flow, you will come to know many loopholes which might be missed by you while developing the same.

---

> **<u>Always take a break when you get stressed :</u>**

![break motivation](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0n00861y06us2liqbk6w.jpg)

When you get stuck while coding. Remember to take a small break. It's not only important but it's one the best activity one developer must follow. The stressed developer takes more time to complete the task while on the other hand, free-minded developers complete the same task in a small time.
Refreshments like helping the other teammates in there developing issues, small chitchat or mostly follow COFFEE With Code thing.

---

> **<u>Follow and Read the online blogs:</u>**

![online blogs](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q0qi88qt7z9s3o6ly8au.jpg)

Internet is vast and everyone has access to it. Make proper use of your time and internet. Follow the technical websites, blogs, articles of your interest. Things are changing really fast in today's world and it's very important for one to keep updated ourself. Following are some of the links to get started with:



- Dev.to
- David Walsh
- Smashing Magazine
Many more are there, just google it.

---

> **<u>Always be flexible to grab any opportunity</u>**

![grab opportunity](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/elv4qlrtn7p4gj3vr2pn.jpg)

Being tech-savvy, you should always be ready to catch any opportunity that came between your way. With changing tech stack you should be flexible to jump on required stack according to your project.
It not only helps you to grow as a developer but also it makes you energetic to go through the new technologies. Learn new things. We have many online tutorials to kick start this like Udemy and many more out there. Also at the same time, you need to keep your USP (the main domain of work) strong.

Grow with technology with keeping mastery in your domain.
Python library for Auto ML. 
Tags: python, datascience, beginners, machinelearning
Published: 2022-02-23 05:30:22

Data science is entering the mainstream. Or is it already there?

The field of data science is going through an enormous transformation. Many new technologies are here to make the discipline available to everyone. 

A recent trend in the democratization of data science is AutoML. A low code way to build machine learning models at far less time and effort. 

Data preparation and model selection are critical and time-consuming tasks of a data science project. They are often repetitive, structured processes. Besides the trouble, they aren't tasks that need many intellectual skills. 

Without a doubt, Data scientists' time and brainpower are well utilized if it been on something else.  

In the following article, I've explored a Python library that eliminates tedious tasks in machine learning modeling. It's based on the most popular scikit-learn library. 

[Let the Script Find Out the ML Model that Outperforms Yours](https://towardsdatascience.com/python-automl-sklearn-fd85d3b3c5e?sk=38e971845b22da97f5592c0fc7f66635)

**Do share your thoughts about auto ml tools and the future of data science. **
I lost all of my projects
Tags: ubuntu, help
Published: 2022-02-23 05:21:17

yet again...
A couple of weeks ago I started making a Fnaf type horror game with unique story and visuals and yesterday I finished my work.So alongside it ,there were other projects I didn't push to github and suddenly my hdd was beeping and the whole pc was frozen and I rebooted to see hdd not being detected ....
I tried as many things I could (except sending to a recovery center) and no results at last when I booted with live usb the disk was detected as 4 gigs(it is a 1 tb one tho).So I accepted that the disk is ded so with everything .
Any suggestions to recover my data?
Laravel 9 Form Validation Example With Error Message
Tags: laravel
Published: 2022-02-23 05:20:40

Hi Dev,

In this article, we will cover how to implement laravel 9 form validation tutorial. you'll learn laravel 9 form validation with an error message. This article goes into detail on form validation laravel 9. we will help you to give examples of simple form validation in laravel 9. follow the below step for laravel 9 form validation custom error messages.

Laravel 9 provides a request object to add form validation using it. we will use request validate() for adding validation rules and custom messages. we will use the $errors variable to display error messages. I will show you a very simple step by step example of how to add form validation in the laravel 9 application.

so, let's see the below example for adding form validation.

[Laravel 9 Form Validation Example With Error Message](https://www.codecheef.org/article/laravel-9-form-validation-example-with-error-message)
Azure Trial Hackathon - Azura - Yes Azura!
Tags: azuretrialhack, azure, computervision, hackathon
Published: 2022-02-23 05:16:49

 ## Overview of the Project
This is an extension just like those we put on our browsers and also a sort of searching tool, that takes an Image URL as input and processes it using Microsoft Azure's Computer vision and describes what the image is about. This is basically a tool that exists to describe the one use of Computer vision.

Live demo 🌏
Website is live at [Check Azura](https://azura-website.vercel.app/)

![Azura homepage](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n4alvd3ufet92m66elrs.png)

If we put an image URL of a doggo in the search section and click on search.

![happy Doggo](https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fi.redd.it%2F3h830ttao8341.jpg&f=1&nofb=1)

We will see the following result :)


![Search result](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/miz432b1xsliirxuddw2.png)
 
But do check the extension as well with even better user experience and with text to speech feature that reads out the description of the image. The whole guide on how to use this as extension is on Github (and it's ez!).
Check this video of extension's working.

{%embed https://youtu.be/P8OIaLg4MqI %}

## Submission Category
My project's category is : AI Aces
This uses Cognitive Service, Computer Vision.

## Github Repository

{%embed https://github.com/Seek4samurai/Azura %}

This is Github repository, feel free to use and contribute to it.
Had so much fun making this project and learned so much new about Microsoft Azure.
Feel free to give some advices, criticism😬 and reviews.
Thank you <3
New Years Resolution - Dev Log 18
Tags: webdev, beginners, programming, computerscience
Published: 2022-02-23 04:28:48

My last blog talked about how I was stuck on a bug with client redirecting. Got that bad boy solved. Since then I have also optimized the search function and built out the final page of UI (the job details page). So a lot of good work was done. The bulk of what I have left is intergrading API's into the application. I need Stripe for payments, MailGun for sending emails, and I have decided to use Google's GeoCoding API for searching nearby jobs.

I actually have not made a pretty big decision, how do I use geospatial search. For now, all results are sorted for the newest first, so the most recent jobs posted are seen first. How should I also sort by location? I am not very familiar with searching by multiple conditions. This is something that I need to look into. I do not understand in my mind how to sort by multiple categories. I might try to implement some logic where jobs that match all the filters are gathered, then sorted by proximity. But then you could be seeing posts from a month ago first. Also, I have a remote filter. How do I count remote jobs? I assume they just count as the highest priority proximity. If anyone has some experience with this, pm me, I am all ears.

It makes me a little sad that I have not been able to make a video with the updated website. I do not want to create the video till the entire MVP works. I am most of the way there and only really need to build out the business logic for applying, integrating the API's, and polishing up the small things like SEO. I truly want to have the MVP done by the end of February. Wish me luck!
How To Solve opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error’ ] Error ?
Published: 2022-02-23 04:12:10

Im going to make your life soo much easier.. Instead of using gitbash or powershell commands, or even try to figure out what you did wrong to get this error.

If you are like me, this frustrated me.

What I did to fix this, was close everything associated with your coding build, programs like VSCode or any Windows 10 Explorer Folder windows you may have open.

Then go to your folder that you are having issues with, and delete the folder that says: 

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

`node_modules`

Once you do, you are basically resetting everything you did wrong. And thats probably installing the wrong package that is some how magically conflicting with other modules you already have installed in VSCode.

Once you delete the folder, go back to your VSCode, open up your Terminal, and type:

`npm install`

or whatever installer you use, Yarn etc.

This will look into your package.json file in your app and look for the required modules you had for that package.

Now if you are still having that issue. Repeat this post again, but only after you open the package.json file and delete the modules you do or do not want. Like babel, or react-dom etc. before you run `npm install` again. This way, you are removing the error(s) you made and tried fixing. 

Hope this works for you.

---