teleren/devto huggingface dataset:
Things don't always go as planned
Tags: webdev, javascript, beginners, programming
Published: 2022-12-08 06:15:05


> Progress

When I planned on what I was going to be doing with the code, I overestimated my capabilities, and promise that I will be adding 'factorial'. Not reading through the code much more thoroughly than I should have, I promised that I was going to manage adding this new functionality in due time. However, as I finished my first pull request, I start to realize that it wasn't possible. By adding this new feature, I would have to add new files dedicated specifically in handling factoring. 

The program works as follow

1. There are two values, and these two values will be merged with an operation (+, -, *, /)
2. Once all values are added, it will then produce an 'answer', and check if the answer given is the same one that the user provides

The problem with factoring is that, there aren't multiple digits to add. It's a compilation of digits, numbers, and symbols for one answer, and the code is not built to function as such. Therefore, when creating the last pull request, I could not think of a way to make this work, other than restructuring the entire code, which with my current skills I'm unable to do so.

> Learning Experience

The plan that you start after being assigned an issue will not always go the way you want it to. As you make more progress, issues starts to pop up that you don't even notice from the start. The implementation that you didn't think would take a long time would, and bugs that you don't expect will occur. I did not consider the possibilities of the any issues that might occur when I wrote my plan on my first week. I did not even consider the absurdity of my feature when I was writing my blog. It just never came across in my head the sheer amount of work that has to be put in until I actually wrote my code. For future request, I need to start thinking more about each step that I will take when writing my code, as to leaving my progress to mere predictions.

> Interaction With the Owner

When writing in my issue, I tried to understand what the focus is of the repository. When that was done, I sent my issue, and thankfully the owner accepted it, and gave me the green light to work with adding features.

___

Repository - [BattleMath](https://github.com/JesseRWeigel/battlemath)
Entering the world of Object Oriented Programming(OOP)
Tags: machinelearning, ai, oop, python
Published: 2022-12-08 06:09:21

**Why OOP?**

Before learning anything we should always find the answer of "Why is this useful/Why are we learning this?". So before knowing what is OOP we are going to know why we are even talking about this.
In the physical world we need to create products which are similar to eachother. The products may have the same functionalities but probably with a little different specifications. As we need to use the same base product everytime we work smartly. We make a base skeleton of the products with the similar functionalities and add the specifications later on while creating a particular object. Let's understand this with an example: Suppose you want to build your own house. So what would you do first? You'll hire an architect to make a blueprint of your house. This blueprint is the class which can be called " House" class. This "House" will/may have windows,doors,rooms,balconies and many more things. All of these features are the functionalities of the house. The blueprint of your house can be used by anyone for building their own house. All of the houses which have been built or will be built are "Objects".
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5zi6sj7kaymgk3po02q2.png)



**What is OOP?**

Just like the physical world we need to create many objects with the same functionalities in the virtual world also. So we create a virtual skeleton for that purpose. This is similar to the Resume templates we use to make our own Resumes.In programming languages we use and create many classes and objects to build virtual products. For example: Suppose we are building an "Animal Planet" comouter game which has multiple animals and they all speak different words. In this case "Animal" will be the class and different animals like Dog,Duck and Cat will be the objects. All of them have the "speak" functionality but they speak "Woof"," Quack" and "Meaw correspondingly. In computer programming all of these together(classes, objects, methods etc.) are called Object Oriented Programming. The functionalities are called " methods" in OOP. 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xdzxwq12ns9y25n5lxxr.gif)
CSS tips for absolute beginners
Tags: css, tips, beginners, namangarg
Published: 2022-12-08 06:05:51

## Introduction
CSS (Cascading Style Sheets) is a stylesheet language used to describe the look and formatting of a document written in a markup language, such as HTML. CSS is used to define the styles for the elements on a web page, including fonts, colors, and layouts.

## Tips
1) Start by learning the basics of HTML and CSS before moving on to more advanced topics. This will give you a strong foundation to build upon and make it easier to understand more complex concepts.

2) Use a CSS reset stylesheet to ensure that your styles are applied consistently across different browsers. This will help prevent unexpected behavior and inconsistencies in the way your pages are displayed.

3) Use a CSS preprocessor like Sass or LESS to make your stylesheets more organized and maintainable. These tools can help you write cleaner, more modular code and save you time in the long run.

4) Use a CSS framework like Bootstrap or Foundation to speed up your development process. These frameworks provide a set of reusable styles and components that you can use to quickly build responsive, mobile-friendly websites.

5) Take advantage of the cascading nature of CSS by using specific selectors to target the elements you want to style. This will help you avoid applying styles to the wrong elements and make your stylesheets more efficient.

6) Use tools like the Chrome DevTools to inspect and debug your CSS in real time. This will help you quickly identify and fix any issues with your stylesheets.

## Conclusion
Finally, don't be afraid to experiment and try new things. CSS can be a lot of fun, and the best way to learn is by doing. Good luck!

If you like this thread, then please consider a follow
https://twitter.com/NamanGarg2075
Working with data attributes in CSS
Tags: css, webdev, beginners
Published: 2022-12-08 05:38:44

We previously looked at using [data attributes in JavaScript](https://daily-dev-tips.com/posts/vanilla-javascript-data-attributes/). These data attributes are a fantastic way to store little bits of information on an element without using custom attributes.

However, we can also use them to style some aspects with specific attribute sets.

## CSS attributes in CSS

To paint a simple picture, let's create elements that hold a specific value like this.

```html
<div data-rating="1">Rating</div>
<div data-rating="5">Rating</div>
```

As you can see, our rating is only set as the custom attribute.

Let's first look at how we can style this object, which is very easy by simply using its name.

```css
[data-rating] {
  color: indigo;
}
```

With this, the rating text will be purple.

We can also make it more specific and add styling for particular values.

```css
[data-rating='1'] {
  color: red;
}
[data-rating='5'] {
  color: indigo;
}
```

And to top it off, we can inject the value with CSS!

```css
[data-rating]::after {
  content: attr(data-rating);
}
```

Which would result in the rating being added after our text.

You can play with these data attributes on the following CodePen.

{% codepen https://codepen.io/rebelchris/pen/rNKrdGa %}

### 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)
How to be consistent in learning JavaScript
Tags: javascript, learning, beginners, webdev
Published: 2022-12-08 05:37:02

Consistency is key when it comes to learning any new skill, including JavaScript. Here are a few tips to help you stay consistent in your JavaScript learning journey:

1. Set aside dedicated time each day or week to focus on learning JavaScript. This will help ensure that you make progress consistently and don't get sidetracked by other obligations.

2. Start with the basics. Make sure you have a strong foundation in the fundamentals of JavaScript before moving on to more advanced topics. This will help you understand the concepts more easily and avoid getting overwhelmed or frustrated.

3. Practice regularly. The best  to improve your skills in JavaScript (or any other language) is to practice regularly. This can involve working through tutorials, building small projects, or even just writing code on your own to see what you can come up with.

4. Seek out resources and support. There are many resources available online to help you learn JavaScript, including tutorials, videos, and forums. Don't be afraid to ask for help or advice if you get stuck – there are many experienced developers out there who are happy to share their knowledge and experience.

5. Stay motivated. Learning a new language can be challenging, and it's natural to feel frustrated or overwhelmed at times. Keep yourself motivated by setting small, achievable goals for yourself and celebrating your successes along the way.

Overall, the key to being consistent in learning JavaScript (or any other skill) is to make it a regular part of your routine and to seek out the resources and support you need to stay on track. By following these tips, you can set yourself up for success and make consistent progress in your JavaScript learning journey.
Fast BNB
Tags: atlashackathon22, fastapi, jinja, mongodb
Published: 2022-12-08 05:30:01


## What I built🤔

I Built FastBNB which is generally making use of MongoDB Atlas dataset named sample_airbnb. This sample dataset fulfilling the application to show data in Template and though user can make operations on it.The Web Application is Built with the help of **FastAPI**,**Jinja**,**Motor**,for template designing **Boostrap** and cloud database like **MongoDB Atlas**.


### Category Submission:
Outside the JS Box:Build an application using MongoDB Atlas with any language that is not JavaScript.

### App Link
https://fastbnb.onrender.com/
### Screenshots

**Home Page**
![Home Page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2og1xc3yxdz7nywo7uyk.png)

**Specific Info**
![OneBNB](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z0sfd0mg5znd218b023x.png)

**Confirmation**
![Confirmation](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mmjj4j03hp6la80c0i9c.png)

### Description
Using Mongodb Atlas sample collection to show the data in the application.This data then forwarded to the template engine to render in the form of html and bootstrap to design it.
The backend API is built with FastAPI and Async Python driver like Motor to perform different operations on database.

### Link to Source Code
{% embed https://gitlab.com/su-shubham/fastbnb %}


### Additional Resources/Info
Fast API : https://fastapi.tiangolo.com
Motor: https://motor.readthedocs.io/en/stable/
Laravel 9 Dynamic Line Chart Example
Tags: laravel9, linechart, php, jquery
Published: 2022-12-08 05:30:00

In this article, we will see the laravel 9 dynamic line chart example. 

A dynamic line chart or line plot or line graph or curve chart is a type of chart that displays information as a series of data points called 'markers' connected by straight line segments. 

It is a basic type of chart common in many fields. So, we will learn how to create a dynamic line chart in laravel 9.

So, let's see dynamic line chart example in laravel 9 and line chart in PHP.

For the creation of a dynamic line chart example, we will create a route, controller, blade file, and database.

```
Step 1: Install Laravel 9 For Dynamic Line Chart

Step 2: Create Migration Table

Step 3: Add Route

Step 4: Create Controller And Model

Step 5: Add Code In Controller

Step 6: Create Blade File
```
Android: Simple, open-source apps without ads, tracking and unnecessary permissions
Tags: android, opensource, security, privacy
Published: 2022-12-08 04:41:24

I want to introduce you to a great Android developer team that released countless alternatives to apps that usually come for free but invade your privacy. Simple Mobile Tools made it their main focus to release simple and lightweight yet powerful apps for android that cover a wide range and definitely your basic needs.

All the below listed apps are not collecting any of your data, respect your privacy, non-intrusive and most features are accessible for free. Sounds too good to be true? If you want to thank the developer, you can optionally purchase the "Simple Thank You" app that will unlock some neat features for a low price. Read their mission statement as well.

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

## Simple Mobile Tools Links

- https://www.simplemobiletools.com/
- https://www.reddit.com/r/SimpleMobileTools/
- https://github.com/SimpleMobileTools

Big thumbs up from PrivacyTools.io to the whole development team of Simple Mobile Tools. Keep up the good work, you definitely have your hearts in the right place. Share this article with your best friends and family if they are using android, they might find app alternatives to replace their privacy-invasive counterparts.
Higher Order function and Callback function in Javascript?
Tags: javascript, programming, tutorial
Published: 2022-12-08 04:31:12

**Callback function :** A function passes as argument into another function is called callback function.
**Higher order function :** A function which receives a callback function is called higher order function.
Example :

```JavaScript
function foo(){
	console.log("Hello World");
}
function abu(e){
	e();
}
abu(foo);
```
In this example `abu()` and `foo()` are _higher order function_ and _callback function_ respectively.
Using kubectl to manage multi clusters
Tags: devops, osbkca, kubernetes
Published: 2022-12-08 04:19:11

The Kubernetes command-line tool, [kubectl](https://kubernetes.io/docs/reference/kubectl/kubectl/), allows you to run commands against Kubernetes clusters. You can use `kubectl` to deploy applications, inspect and manage cluster resources, and view logs. For more information including a complete list of kubectl operations, see the [kubectl documentation](https://kubernetes.io/docs/reference/kubectl/).

In this tutorial, I want to share with you how to connect to multi Kubernetes Cluster by using `kubectl` on a computer.

For configuration, `kubectl` looks for a file named `config` in the `$HOME/.kube` directory. To show current configuration, you run command:

```shell
kubectl config view
```

Result:

```yaml
apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: DATA+OMITTED
    server: https://192.168.1.50:6443
  name: cluster-one.me
contexts:
- context:
    cluster: cluster-one.me
    user: khoidn
  name: cluster-one.me
current-context: cluster-one.me
kind: Config
preferences: {}
users:
- name: osbkca
  user:
    client-certificate-data: REDACTED
    client-key-data: REDACTED
```
In above configuration, we have one cluster cluster-one.me. If you have another cluster cluster-second.me with file config at ~/.kube/cluster-second.config . Use the following commands to merge configuration files.

```shell
export KUBECONFIG=~/.kube/config:~/.kube/cluster-second.config
kubectl config view --flatten > ~/.kube/config_temp
mv ~/.kube/config_temp ~/.kube/config
```
Now you run `kubectl config get-contexts` to see the differences.

```shell
CURRENT   NAME              CLUSTER            AUTHINFO   NAMESPACE
*         cluster-one.me    cluster-one.me     osbkca
          cluster-second.me cluster-sencond.me osbkca
```

You can switch context of kubectl with the command `kubeclt config use-context cluster-sencond.me`

Wooow! Enjoy it. [More info](https://osbkca.me/blog/using-kubectl-to-manage-multi-clusters)
GNOME Asia Summit 2022
Tags: gnome, remote, ide, linux
Published: 2022-12-08 04:17:35

GNOME Asia Summit 2022 this year was held as physical event in Kuala Lumpur for the first time after 2 years of online conferences due to the COVID-19 pandemic.

My talk proposal was accepted and I'm presenting the topic of Remote IDE for remote developer. Remote IDE has become my interests this year after fully adopting Github Codespaces and later on Gitpod in my development workflow.

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


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x7kuas0346558z1vgnum.png)
Aryan Kaushik shared his journey in Google Summer of Code (SoC) working  on GNOME app Pitivi, porting it from GTK3+ to GTK4.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/csad1a22ilakjvf1o706.jpeg)
Rosanna Yuen from GNOME Foudation explaining Gnome community Code of Conduct.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5e4gpvx05o2x007uej5u.jpg)
Adzmely Mansor from Nexoprima shared their experiences integrating critical care medical devices with modern system. I was looking forward for this talk as Adzmely is very well known in local development community. Last time listening to his presentation on linux vertical performance tuning really blew my mind.


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

One interesting sharing from him is how they send data from endoscopy machine to the PACS (picture archiving and communication system) which is a medical imaging technology used in healthcare organizations to securely store and digitally transmit electronic images and clinically-relevant reports. The problem is the only way to get data from the machine is by plugging a USB thumbdrive. That make automation not possible. What they did is to plug in a raspberry PI instead which configured to emulate as USB mass storage. Then it just a matter of using inotify to detect writing to the file system and send the file to PACS.

It's a weekend very well spent connecting with some old friends and also meeting new people during the event. This probably my last event for this year and hopefully next year we will have more physical conferences.
OceanBase: A Fast and Scalable Database for Your Applications
Tags: oceanbase, mysql
Published: 2022-12-08 03:59:09

If you are looking for a fast and scalable database for your applications, you may want to consider OceanBase. This open-source DBMS is compatible with MySQL, but offers significantly improved performance and scalability. In fact, OceanBase is 1.9x faster than MySQL, making it an ideal choice for applications that need high-throughput and low-latency data access.

Developed by the Alibaba Group and used in production at some of the world's largest e-commerce sites, OceanBase is designed to support petabyte-scale datasets and millions of concurrent users. Whether you are building an online marketplace, a social network, or a gaming platform, OceanBase can handle your data needs with ease.

One of the key benefits of OceanBase is its distributed architecture, which allows it to automatically distribute data across multiple servers and scale horizontally to support high levels of concurrency. This is in contrast to MySQL, which is a single-node DBMS that can only scale vertically by adding more hardware resources to a single server.

In addition to its distributed architecture, OceanBase also offers several other performance-enhancing features, such as intelligent query optimization, distributed transactions, and real-time data analytics. These capabilities make it possible for OceanBase to deliver high-throughput and low-latency data access, even under heavy workloads.

If you want a fast and scalable database for your applications, give OceanBase a try. It offers many advantages over MySQL, including superior performance and the ability to support large-scale applications. Get started with OceanBase today and see the difference it can make for your project.

[Link to Github](https://github.com/oceanbase/oceanbase)
MongoDB Atlas Hackathon 2022 on DEV
Tags: atlashackathon22
Published: 2022-12-08 03:19:30

## What I built


### Category Submission:


### App Link


### Screenshots


### Description
 

### Link to Source Code


### Permissive License


## Background
(What made you decide to build this particular app? What inspired you?)


### How I built it
(How did you utilize MongoDB Atlas? Did you learn something new along the way? Pick up a new skill?)


### Additional Resources/Info
Brain Master
Tags: web3, unity3d, games, programming
Published: 2022-12-08 03:03:10

HI we have publish new game On our site **[BRAIN MASTER](https://gamesmunch.com/brain-master/)** can you see and tell us how to improve our game
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ih6lh0nrfoyve8nvcotm.png)
Explaining JavaScript closures in one simple program. 3 minute read.
Tags: javascript, closure, webdev
Published: 2022-12-08 03:02:11

**Closures are nothing but functions plus it’s lexical scope**. 

Let’s look at an example to understand closures.

```jsx
function outer(){
	
  let a = 5;
  function inner(){
  	console.log('inner', a);
  }
  inner();
}

outer();

//prints 'inner', 5
```

Here we have a function called outer. 

We have an inner function called ‘inner’ which simply logs inner with a variable a. 
The variable a is declared outside the inner function. 

We call inner inside the outer function. 

When we call the outer function it simply prints the log. That’s simple. 

I’ve modified the code below. Now think of an answer. 

```jsx
function outer(){
	
  let a = 5
  function inner(){
  	console.log('inner', a);
  }
  return inner;
}

let y = outer();

y();
```

It prints the exact same thing. 

I have declared a variable y which stores the outer function and I call y later. 
Here when I return inner, the value that get stored in the variable y must only be inner. 
How does it remember a ? a is outside inner, despite that it remembers a. 

This is called closure. The closure of inner is the function itself + its lexical scope.