teleren/devto huggingface dataset:
Day 707 : Medal
Tags: hiphop, code, coding, lifelongdev
Published: 2023-03-06 23:10:39

_liner notes_:
- Saturday : This was the first time back in the station since the basketball season is over in a while. Felt good to be back and looking forward to being on air for the rest of the year. The recording of this week's show is at https://kNOwBETTERHIPHOP.com

![Radio show episode image of a screenshot of a playlist of De La Soul songs with the text De Lall Day in a yellow tag placed on top with the words Mar 4th 2023 The Return](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7b56qgjxgl8acyexrbwq.jpg)

- Sunday : Did the https://untilit.works cyphers and got quite a bit done even though I was super tired from the night before. Ended the night watching "Trigun: Stampede".

- Professional : Thought I was going to be able to start a new proof of concept, but got asked to review a web sample with a new feature coming. Took a lot longer than expected. I was able to at least scaffold the new project so I can get a jump on it tomorrow.

- Personal : So I think I finally got the saving and getting settings and adding events worked out for my side project. Next will be adding photos. Hopefully, it won't be too bad, since it'll be similar to my other site https://dwane.in, but some minor changes. Then again, I'm making this so other people can use it, not just me. I'm finding that a lot of the difficulty is making something as simple as possible. haha.

![An aerial inland photo from the water show a beach in Kālepa Ridge, HI, USA with a very large green mountain with sharp peaks on it's face with a mountain range in the background](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vvswzr8eicwplie7o9gg.jpg)

Got off work a little later than normal, so I'm going to need to put the pedal to the metal (or medal?). Either way, I'm out. Oh and I saw the new "Attack on Titan" special. Holy moly! So good! Probably watch "Vinland Saga" if I have time before bed.

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube nyk_SLTV3YE %}
Many new things in AFFiNE - the sustainable development of the new Knowledge-base
Tags: miro, notion, python, webdev
Published: 2023-03-06 22:25:42


on Twitter: https://twitter.com/AffineDev

###lockSuite just earned its 1000th ⭐ today! It's a major milestone for a project that still lacks proper documentation 😅. Immensely grateful to our amazing community for their unwavering support 👏👏. Thanks for being a part of our journey! 🙌


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




Thanks to our community, a new prototype of `toggle` block type is added in BlockSuite. It's a starting point of community-driven features, and we will do more to make our editor open to extensions. Shoutout to 
@gotjoshua for the contribution! 🙌



![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k0y4qygdazvsvy7dkzhw.png)
What is Database Tuning?
Tags: database, tuning, sql
Published: 2023-03-06 22:22:04

Database tuning is the process of optimizing your database. This process covers all parts of the system - hardware and software - to keep query response times down and keep things running smoothly and efficiently. Being on top of this improves the database's speed, reliability, and scalability. 

Starting off on the right foot with a database is important. The database should be well-planned and efficient, and database tuning should be a routine practice. 

So - what can we do to optimize our database? 

There's many options! Note: This list is general, and tuning practices vary between databases. 

For starters, we can make sure we're allocating enough memory to our database, as lack of memory can cause performance issues. In a similar vein, investing in a powerful CPU can go a long way for your database. 

The improved execution of queries is one of the primary goals of database performance tuning. This involves removing calculations in JOIN and WHERE clauses, checking for indexes, and working with the smallest data set needed. Writing poor queries can result in database performance problems. Because databases can be so huge, we shouldn't use leading wildcards or SELECT *.

Tuning scripts can also be a great starting point. For example, Mysqlreport takes SHOW STATUS and turns it into a more user-friendly report to let you know how well MySQL is running. MySQLTuner assists with configuration and makes recommendations for better performance. Though these scripts are made for MySQL, scripts exist for other Database Management Systems too. 

Database tuning is important for every database, and includes hardware and software considerations such as memory and CPU. Optimized queries and the use of scripts will help you keep your database running efficiently and reliably. 

Thanks for reading,

Kit
Flutter - how to have variables in the Android Manifest file
Tags: flutter
Published: 2023-03-06 22:12:15

If you want to put AdMob ads in your Android app, you will need to specify your AdMob app id in the Android manifest file. However, I am committing this file to source control, so I didn't want to hard code it in there. The Android manifest file is an `.xml` one and, as such, I had no idea how to even have variables in the first place. Luckily, I found [this post](https://medium.com/flutter-community/how-to-setup-dart-define-for-keys-and-secrets-on-android-and-ios-in-flutter-apps-4f28a10c4b6c), what follow is just a summary mostly for my future self on what to do for Android.

1.- In `build.gradle`, type the following somewhere above `android:`:

```
def dartEnvironmentVariables = []

if (project.hasProperty('dart-defines')) {
    dartEnvironmentVariables = project.property('dart-defines')
        .split(',')
        .collectEntries { entry ->
            def pair = new String(entry.decodeBase64(), 'UTF-8').split('=')
            [(pair.first()): pair.last()]
        }
}
```

2.- In `defaultConfig:`, add the following:

```
manifestPlaceholders['APPLICATION_ID'] = dartEnvironmentVariables.APPLICATION_ID
```

3.- In `AndroidManifest.xml`, you can now use the variable. In the case of AdMob it needs to be added as meta-data as so:

```
<meta-data 
          android:name="com.google.android.gms.ads.APPLICATION_ID"
          android:value="${APPLICATION_ID}" />
```

4.- That's it, remember to either `flutter run` or `flutter build` with the env variables, otherwise your app won't build correctly:

`flutter run --dart-define APPLICATION_ID=1234qwerty --dart-define WHATEVER_OTHER_VARIABLE=9876poiuy`

and 

`flutter build appbundle --dart-define APPLICATION_ID=1234qwerty --dart-define WHATEVER_OTHER_VARIABLE=9876poiuy`
🤯Understanding Truthy and Falsy in JavaScript
Tags: webdev, javascript, beginners, programming
Published: 2023-03-06 22:01:05

In this article we will be looking at the definitions of two key expressions in Javascript: **truthy** and **falsy**.

The first time I bumped into this was while talking with a friend who was teaching me some definitions and tips in Javascript, and honestly, this one wasn't that fast to make sense in my mind at first try.

That's why I've decided to write about these important definitions in the most easy and straightforward way, so, let's begin!

## Truthy Values

**Truthy values** are values that are considered `true` when evaluated in a `boolean` context. In JavaScript, the following values are truthy:

`true
non-zero numbers
non-empty strings
objects
arrays
functions`

For example, consider the following code:

```javascript
let x = "hello";
if (x) {
console.log("x is truthy");
} else {
console.log("x is falsy");
}
```

We can see that the value of `x` is a non-empty string, which is a `truthy` value. Therefore, the if block is executed, logging `"x is truthy"` to the console.

## Falsy Values

**Falsy values** are values that are considered `false` when evaluated in a `boolean` context. In JavaScript, the following values are falsy:

`false
0
-0
NaN
null
undefined
empty strings ("" or '')
document.all`

For example, consider the following code:

```javascript
let y = null;
if (y) {
console.log("y is truthy");
} else {
console.log("y is falsy");
}
```

We can see that the value of y is `null`, which is a `falsy` value. Therefore, the else block is executed, logging `"y is falsy"` to the console.

## Conclusion
Understanding **_truthy_** and **_falsy_** values is essential to writing reliable and bug-free code. By knowing which values are considered _**truthy**_ and which are considered _**falsy**_, you can write more concise and readable code that handles edge cases and unexpected inputs.

**_Happy learning and thank you for reading!_**

_If this article was helpful to you, don't forget to hit that ❤️ button and support me with a follow, i will keep posting more content about tech, programming, career development and more! :)_

Until next time!
Deep Learning
Tags: deeplearning, neuralnetwork
Published: 2023-03-06 21:52:53

Deep learning is a subset of machine learning, which is essentially a neural network with three or more layers. 

models are capable enough to focus on the accurate features themselves by requiring a little guidance from the programmer and are very helpful in solving out the problem of dimensionality. Deep learning algorithms are used, especially when we have a huge no of inputs and outputs.

Deep learning is implemented with the help of **Neural Networks**, and the idea behind the motivation of Neural Network is the biological **neurons**, which is nothing but a brain cell.

> `Deep learning is a collection of statistical techniques of machine learning for learning feature hierarchies that are actually based on artificial neural networks.`

_So basically, deep learning is implemented by the help of **deep networks**, which are nothing but **neural networks** with multiple hidden layers._

### Architectures:

- Deep Neural Networks (DNN)

It is a neural network that incorporates the complexity of certain level, which means several numbers of hidden layers are encompassed in between the input and output layers.

- Deep Belief Networks (DBN)

A deep belief network is a class of Deep Neural Network that comprises of multi-layer belief networks.

- Recurrent Neural Networks (RNN)

It permits parallel as well as sequential computation and it is exactly similar to that of the human brain.
Docker Same User Inside a Container Dynamically
Published: 2023-03-06 21:38:49

In this post, we'll create a user dynamically inside a Docker container with the use UID and GID as the user on the host who ran the container.

Previously, we addressed the issue of accessing a mounted volume inside a container as user root inside the container with Docker Compose here: https://dev.to/frederickollinger/docker-compose-access-a-mounted-volume-inside-a-container-41kf

But this solution wound up creating artifacts which were owned by root which meant that accessing them as a regular user on the host was more difficult. 

Thus, we actually want to have a user inside the Docker container which is the same as the host.

The 1st step is to make a bash script which will create a new user inside the container dynamically.

Create a script called entrypoint.sh:

```sh
#!/bin/env bash

USER=container

useradd -u $2 $USER -d /home/$USER
chown container /home/$USER
su $USER
```

This script will basically add a new user called container when the Docker container is 1st run and use the user id passed into the container.

Next create Dockerfile in the same directory:

```sh
FROM centos:7                                                                                                            
USER root

COPY entrypoint.sh /usr/sbin/entrypoint.sh
RUN chmod a+x /usr/sbin/entrypoint.sh
ENTRYPOINT ["/usr/sbin/entrypoint.sh"]
```

This Dockerfile will run our entrypoint.sh script when it's first run. It needs to start as root but then it will change to the container user which happens to have the same user id as whomever started the container.

Build the container, in this example as userdemo:

```sh
docker build -t userdemo .
```

Now run the container.

```
   docker \
    run \
    --rm \
    --name=userdemo \
    --hostname=userdemo \
    --workdir=/home/container \
    -v `pwd`/project:/home/developer/project \
    userdemo \
    /bin/bash `id -u`
```

In this example, you will have a folder called "project" which is mounted inside the container as /home/container/project. You can change this or even add more lines with the volume mount flag.
Create an S3 Multi-Region Access Point (MRAP)
Tags: aws, cloud, awscommunity, 100daysofcloud
Published: 2023-03-06 21:23:57

[65/100] #100DaysOfCloud Today, I created an S3 Multi-Region Access Point with two S3 buckets and uploaded a file which was routed to the closest bucket to the location I uploaded from, and then changes were replicated between all buckets.

Amazon S3 Multi-Region Access Points provide a global endpoint that applications can use to fulfill requests from S3 buckets located in multiple AWS Regions. You can use Multi-Region Access Points to build multi-Region applications with the same architecture that's used in a single Region, and then run those applications anywhere in the world. Instead of sending requests over the congested public internet, Multi-Region Access Points provide built-in network resilience with acceleration of internet-based requests to Amazon S3. Application requests made to a Multi-Region Access Point global endpoint use AWS Global Accelerator to automatically route over the AWS global network to the closest proximity S3 bucket with an active routing status.

When you create a Multi-Region Access Point, you specify a set of AWS Regions where you want to store data to be served through that Multi-Region Access Point. You can use S3 Cross-Region Replication (CRR) to synchronize data among buckets in those Regions. You can then request or write data through the Multi-Region Access Point global endpoint. Amazon S3 automatically serves requests to the replicated dataset from the available Region. Multi-Region Access Points are also compatible with applications running in Amazon virtual private clouds (VPCs), including those that are using AWS PrivateLink for Amazon S3.

You can try do it by yourself by following the steps from the link below: [GitHub](https://github.com/aaditunni/100DaysOfCloud/blob/main/Journey/065/Readme.md)
Looking for Mentors (AI based startup)
Tags: saas, startup, ai
Published: 2023-03-06 21:23:13

My dear dev community members, We all know that now there are quite a number of AI service around us. On this emerging time of AI services, I have come up with a pitch to make a SaaS product. I am in search of a good and experienced mentor who can help us guide and work with us to implement the idea.
If any interested mentors, please contact me.
My LinkedIn: https://www.linkedin.com/in/abhinav-sl/
Hackathon - Hack Together: Microsoft Graph and .NET 🦒 - Day 03
Tags: dotnet, csharp, webassembly, azure
Published: 2023-03-06 21:20:35

Here we are again, at Day 3 this time.

Today I wrote a lot of backend code. I implemented the authentication with Azure AD and I added the Graph Client SDK.

I don't post the entire code here, but just some hightlights.
First of all I added the Graph Scopes to the appsettings.json file.

```json
{
  "AzureAd": {
    "Authority": "https://login.microsoftonline.com/common",
    "ClientId": "1bc3268c-1570-461d-bf0e-e181ba39415c",
    "ValidateAuthority": true
  },
  "GraphScopes": "Files.Read;Tasks.ReadWrite;User.Read;MailboxSettings.Read;email;offline_access;openid;profile;Calendars.ReadWrite;Mail.Read"
}
```
In the GraphScopes property I added all the Graph scopes we need in the application (at least, in this moment).

The ClientId comes directly from an Azure App Registration that I have created for this specific project.
You can follow [this tutorial](https://learn.microsoft.com/en-us/power-apps/developer/data-platform/walkthrough-register-app-azure-active-directory), if you are new with this topic.

In the authentication section I added the redirect url for the login callback.

![login callback](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2ddjp3l3o7vt8geo29pb.png)

In the main page, in the code behind, I create a new Graph Client object from the Graph SDK and I retrieve the emails, ordered by received time in descending order.
I also tried to retrieve the Calendar View to retrieve all the items in the calendar for a given date interval but I get an error every time.
I struggled with this exception for 2-3 hours without success.
I will try again tomorrow to solve this problem.

By the way at the moment I can retrieve all items for the UI and the next time I will work on the presentation layers.
I will create some components for each page section (mail, todo, calendar).

---

Thanks for reading this post, I hope you found it interesting!

Feel free to follow me to get notified when new articles are out 🙂

{% embed https://dev.to/kasuken %}
5 Tips⭐: To Control Scope Creep
Tags: scopecreep, projectmangement, softwareengineering, imalisheraz
Published: 2023-03-06 21:11:29

Scope Creep can be a significant challenge for project managers, as it can cause delays, budget overruns, and frustration for stakeholders. Here are some strategies for controlling scope creep:

✅Define the Project Scope:
It's essential to define the project scope clearly. This includes identifying the project's goals, deliverables, timelines, and budget. This will serve as a reference point throughout the project, helping to ensure that all stakeholders are aligned on the project's scope.

✅Establish a Change Management Process:
Establish a formal process for managing changes to the project scope. This should include a clear process for requesting, reviewing, and approving changes, as well as guidelines for evaluating the impact of changes on the project timeline and budget.

✅Communicate regularly with Stakeholders:
Regular communication with stakeholders is essential for managing scope creep. Project managers should keep stakeholders informed of project progress, potential changes to the scope, and any impact on timelines and budgets.

✅Track Progress against the Project Plan:
Regularly tracking progress against the project plan can help identify scope creep early on. Project managers should monitor the project's progress, comparing it to the project plan and identifying any potential deviations.

✅Prioritize Deliverables:
Prioritizing deliverables can help manage scope creep. Project managers should work with stakeholders to prioritize deliverables based on their importance to the project's overall goals. This can help ensure that the most critical deliverables are completed first, reducing the risk of scope creep.

By following these strategies, project managers can effectively manage scope creep, helping to ensure that projects are completed on time and within budget.
AI target to aviation
Tags: ai, blockchain, aviation, trends
Published: 2023-03-06 21:01:19

Artificial intelligence (AI) are two cutting-edge technologies that are making their way into many industries, including aviation. While blockchain can help improve the security and transparency of aviation data, AI can enhance operational efficiency, safety, and customer experience. I'll explore how blockchain and AI are targeting aviation and what benefits they can bring to the industry.

One of the most significant advantages of blockchain is that it can help reduce the risk of cyber attacks and data breaches. By using blockchain to store data, aviation companies can ensure that the data is encrypted, immutable, and tamper-proof. This can help prevent unauthorized access to sensitive information and reduce the risk of data breaches.

Another benefit of blockchain is that it can streamline supply chain management in aviation. By using blockchain to track the movement of aircraft parts and components, aviation companies can improve the efficiency of their supply chain, reduce the risk of fraud and counterfeiting, and improve the traceability of parts and components.

Artificial intelligence is another technology that is transforming the aviation industry. AI can be used to enhance various aspects of aviation, including flight operations, maintenance, and customer service.

AI can also be used to optimize aircraft maintenance. By analyzing data from aircraft sensors and maintenance records, AI can predict when a component is likely to fail and alert maintenance crews before a problem occurs. This can help reduce maintenance costs, minimize downtime, and improve safety.

In conclusion, blockchain and AI are two technologies that are transforming the aviation industry. While blockchain can help improve the security and transparency of aviation data, AI can enhance operational efficiency, safety, and customer experience.

By leveraging these technologies, aviation companies can improve their operations, reduce costs, and provide better services to their customers. As these technologies continue to evolve, we can expect to see even more innovation and disruption in the aviation industry.
Show loading animation with custom hook in react
Published: 2023-03-06 20:50:23

This animation will work with a loading class in body. If the loading class exists on body animation will be shown, if not animation will removed.

In this way we can reduce our import export statement in every file we want to use loading. 

## We will start our loading animation with style.css file.

**note** I'm using tailwindcss
```css
body.loading {
  overflow: hidden;
}

body.loading::before {
  content: '';
  background-color: rgba(0, 0, 0, 0.85);
  position: absolute;
  inset: 0;
  z-index: 100;
  @apply backdrop-blur-sm;
}

body.loading::after {
  content: '';
  position: absolute;
  background-image: url('./src/assets/img/load.png');
  background-repeat: no-repeat;
  background-position: center;
  background-size: max(3vw, 50px);
  z-index: 101;
  inset: 0;
  @apply animate-spin;
}

```

First we removed overflow from body on loading to remove scrollbar, cause we don't wanna allow a user to scroll on page loading.

Then we added background black on loading(pseduo element before) class and filled it with window size and some more essestial style.

Then we added a Spin image, assign a top position with z-index and rotating with a animation. 

## Now create a hook to toggle loading class on body
create a file called `useLoading.js`

```js
import { useEffect } from 'react';

export default function useLoading(state) {
  useEffect(() => {
    document.body.classList.toggle('loading', state);

    return () => document.body.classList.remove('loading');
  }, [state]);
}

```

We had exported a function that receives bool to toggle class on body. If true passed class will be added, if false class will be removed.

In useEffect hook we can return a function to crean up our work on component unmount, in this case we are removing loading class from body. So, we don't need to worry about loading state on unmount anymore.

## Let's use it
In any component you can use it.
```js
// ... more import
import useLoading from "./useLoading";

export default function App() {
 const [loading, setLoading] = useState(true);
 useLoading(loading);

 useEffect(() => {
  // ... some heavy work
setLoading(false)
 }, [])

 //...

}

```

We have a loading state we passed it to our useLoading hook. Now we can control our loading with just one line 😮. Yeah just update loading state 😀.

[Github](https://github.com/abkarim)
[Youtube in Bangla Language](https://www.youtube.com/@abkarim_)