teleren/devto huggingface dataset:
Why Classes Should Be Sealed in .Net Explained
Tags: dotnet, bettercoding
Published: 2022-10-20 08:09:17

The **sealed** keyword prevents coders from inherent your class.  A **sealed** class can not be used as a base class. 

## Why would you block the inheritance feature of a class?
-  When a class is originally sealed, it can change to unsealed in the future without breaking compatibility.
- Performance
- Security: Most classes are not written well to be inherent. When a class can be inherited, the derived class can access and manipulate the state of the base class.

## Are Sealed classes faster?
Yes, the compiler can add some run-time optimizations, which can make calling sealed class members slightly faster.


## How to seal a class?
Add the **sealed** keyword in front of the class
```
public sealed class Class
{
    // Class members here.
}
```
## Can an abstract class be sealed in C#?
A sealed class cannot be used as a base class. For this reason, it cannot also be an abstract class. 

An abstract class is designed to be inherited by subclasses that either implement or override its methods. An abstract class can not be instantiated. The opposite of a sealed class.

## Sealed in VB.NET?
The equivalent of `sealed` in VB.NET is `NotInheritable` and use exactly the same way.

## Conclusion,  Should all classes be sealed C#?
To code better, you should by default seal all your classes, based on all the positive reasons explained above.  it is much easier to "unseal" the class in a later stage, allowing inheritance, equivalent blocking the inheritance and getting in compatibility trouble.
Laravel 8 Get Last 7 Days Records
Published: 2022-10-20 08:03:31

In this article, we will see laravel 8 get the last 7 days records. In PHP, you can use INTERVAL to get the last 7 days record from the database. 

In laravel, you can get the last 7 days record using the eloquent model. Also, we can see how to get last week's records in laravel 6/7/8 using Carbon functions.

For MySQL queries, we are using INTERVAL operators. It is mainly used to calculate the date and time values. In laravel, we will use the carbon subdays() function to get the last 7 days records.

So, let's see how to get the last 7 days record in laravel 8 or get the last 7 days record in MySQL query.

> Get Last 7 Days Records Using MySQL Example:

In this example, we will see an SQL query to get records from the last 7 days in MySQL.

```
select * from users where created_at > now() - INTERVAL 7 day;
```

---

**_[Read More: Laravel 8 Get Latest Record From Database](https://techsolutionstuff.com/post/laravel-8-get-latest-record-from-database)_**

---

> Get Last 7 Days Record Using Laravel Carbon Example:

In laravel, we will use the carbon subdays() function to get the last 7 days records.

```
$date = \Carbon\Carbon::today()->subDays(7);
$users = User::where('created_at','>=',$date)->get();
```
Notification to email address
Tags: postfix, mailjet
Published: 2022-10-20 08:01:16

We have sender domain(1,2,3) and they are currently sent to smtp relay xyz.softare.com...The routing and delivery are routed through mailjet and a notification should be sent to abc@software.com incase mail was blocked by the sender domains 

I have the sender domains pointing to mailjet in /etc/postfix/transport

Can someone help with this
A Quick 10-Second Programming Joke For Today
Tags: jokes, dailydeveloperjokes
Published: 2022-10-20 08:00:05

---
title: "A Quick 10-Second Programming Joke For Today"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
published: true
tags: #jokes, #dailydeveloperjokes
---

Hi there! Here's today's Daily Developer Joke. We hope you enjoy it; it's a good one.

![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e1258c78158d.png)

---

For more jokes, and to submit your own joke to get featured, check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/). We're also open sourced, so feel free to view [our GitHub Profile](https://github.com/dailydeveloperjokes).

### Leave this post a ❤️ if you liked today's joke, and stay tuned for tomorrow's joke too!

_This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit._

<!--
Joke text:
I never tell the same joke twice

I have a DRY sense of humor.
 -->
Makes blade components blazing fast - Laravel 9.36 Release
Tags: laravel, php, programming, beginners
Published: 2022-10-20 07:51:01

In the new version 9.32 I liked this new feature which is making blade components blazing fast which is a very important development 

Nuno Maduro contributed an optimization to improve blade component performance. I suggest you check out the description in Pull Request https://github.com/laravel/framework/pull/44487 to get the full details of the improvements with examples. In summary, the description includes some rough estimates of enhancements:

Anonymous components — up to 52% faster
Class View components - up to 39% faster
Class Inline components — up to 92% faster
Dynamic components ( that renders anonymous components ) — up to 72% faster
Dynamic components ( that renders inline class components ) — up to 83% faster
Huge kudos to Nuno and all those involved in making this update possible! Laravel forever!

I hope you enjoyed with me and to learn more about this release visit the sources and search more. I adore you who search for everything new.
Source :- https://laravel-news.com/laravel-9-36-0
Source :- https://www.youtube.com/watch?v=eTxRz1Z1cGI
Get the selected values from html file to app in flask
Tags: flask, python
Published: 2022-10-20 07:44:56

I have a application build in flask (sorry I have produced a piece of code below since I am not able to put entire code here).

I need to get whatever is selected from dropdown. Below is the code in template.html where there is a dropdown. I have a name attribute here

template.html

````
<select  name="comp_select" onchange="update_selected_option_value(value)" method="POST">
    {% for ticker in tickers %}<option value="{{ticker}}" SELECTED>{{ticker}}</option>{% endfor %}
</select>
````

Now i am trying retrieve selected value so I am using below code

````
@app.route('/', methods=['GET','POST'])
def dropdown():   
    company_name = request.form['comp_select']
    return render_template('template.html')
````

So basically i need to get selected value in company_name . But I am not able to get it. Can anyone help me what wrong I am doing?
Let's print fibonacci series with js with all explanation and problem solving.
Tags: javascript, react, webdev, beginners
Published: 2022-10-20 07:44:39

Here, Problem solving is the only skill a programmer needs so I would like to show some case for it.
In above question we can find that we have to print fibonacci series,

Now fibonacci series looks like this :
`1 , 1, 2 , 3 , 5 , 8 ......
`
Now, we have to print this fibonacci series so first thing we need is the pattern here , we find that the first number and second number while adding gives the third number. 
For eg : 1 + 1 -> 2 , 1 + 2 -> 3 , 2 + 3 -> 5 .

woo we found the pattern half of the solution is done. Try solving this problem into some paper before writing on code.
Then start coding immediately

```
let a = 0;
let b = 1;
let c;
for (let index = 0; index < 10; index++) {
    console.log(b);
    c = a + b
    a = b 
    b = c
}
```

Now what we have done .
1 -> Declaring variable a , b ,c 
2 -> looping so that we can get how much interval or value we want
3 -> logging the first value as b that gives 1.
4 -> Now variable c adds two variable 1 and 0 in initial
5 -> a takes value of b and b takes value of c 

Conclusion,
Hence this is about the problem solving not about coding
Before Your Coding, What is ReactJS?
Published: 2022-10-20 07:41:10

Kamu harus tau nih React Developer⚛😛Yuk belajar bareng serta diskusi dikolom komentar, serta di save biar ga lupa💬😝

🌱Follow : https://appardana.com/
💭Stay Young, Be Innovative and Keep Learning

#React #Web #Skills #IT #ReactJS #ReactNative #Developer #Roadmap #SelfImprovement #Growth #Aditria #Pardana #AditriaPardana #appardana #iAppTech ⚛️💻

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wirbw3z697jnwlvitfbn.jpg)
Why use Go for Hacking
Tags: webdev, beginners, programming, tutorial
Published: 2022-10-20 07:38:37

Prior to Go, you could prioritize ease of use by using dynamically typed languages-such as Python, Ruby, or PHP at the expense of performance and safety. Alternatively, you could use a statically typed programming language, like C or C++, that offers high performance and safety but isn’t very user-friendly. Go is stripped of much of the ugliness of C, its primary ancestor, making development more user-friendly. At the same time, it’s a statically typed language that produces syntax errors at compile time, increasing your assurance that your code will actually run safely. As it’s compiled, it performs more optimally than interpreted languages and was designed with multicore computing considerations, making concurrent programming a breeze.

These reasons for using Go don’t concern security practitioners specifically. However, many of the language’s features are particularly useful for hackers and adversaries:

Clean package management system Go’s package management solution is elegant and integrated directly with Go’s tooling. Through the use of the Go binary, you can easily download , compile, and install packages and dependencies, which makes consuming third-party libraries simple and generally free from conflict.

Cross-compilation One of the best features in Go is its ability to cross-compile executables. So long as your code doesn’t interact with raw C, you can easily write code on your Linux or Mac system but compile the code in a Windows-friendly, Portable Executable format.

Rich standard library Time spent developing in other languages has helped us appreciate the extent of Go’s standard library. Many modern languages lack the standard libraries required to perform many common tasks such as crypto, network communications, database connectivity, and data encoding (JSON, XML, Base64, hex). Go includes many of these critical functions and libraries as part of the language’s standard packaging, reducing the effort necessary to correctly set up your development environment or to call the functions.

Concurrency Unlike languages that have been around longer, Go was released around the same time as the initial mainstream multicore processors became available. For this reason, Go’s concurrency patterns and performance optimizations are tuned specifically to this model.

[programmingeeksclub](https://programmingeeksclub.com/why-use-go-for-hacking/)
TanStack Router – A Routing Library for TypeScript Applications | Notes
Tags: notes, typescript, library, react
Published: 2023-01-09 10:35:53

---
title: TanStack Router – A Routing Library for TypeScript Applications | Notes
published: true
date: 2022-10-20 07:38:37 UTC
tags: notes,typescript,library,react
canonical_url: https://abhi.page/notes/tanstack-router-intro/
---

> **Direct Links:**
> - [tanstack.com/router/v1](https://tanstack.com/router/v1)

> A fully typesafe router with first-class search-param APIs and built-in caching, built for JS/TS, React, Preact, Solid, Vue and Svelte.

If you’re a fan of TypeScript, you’ll be excited to hear about `TanStack Router`, the first type-safe routing library for TypeScript applications.

Potential advantages of using TanStack Router:

- `Type safety` for routes.
- `Autocomplete` suggestions for routes.
- First-class `search parameter support`: useful for storing state in a URL and sharing links.
- `Improved reliability` by ensuring that routes are correctly defined and used.

One of the challenges with routing in any language is that routes are often defined in one place (e.g. a config file or a page-based system like React Router) and used in another (e.g. links in pages, redirects). This means that if you change a route in one place, you have to manually update it in all the other places where it’s used. This can lead to bugs and broken routing if you miss a change or misspell a route.

TanStack Router aims to solve this problem by providing type safety for routes. This means that the router is aware of all the different routes in your application, and it can give you **autocomplete suggestions** and flag errors if you misspell or use incorrect information for a route. This makes writing routes much easier and helps prevent issues with broken routing.

TanStack Router also has **first-class support for search parameters** , which can be used to store state in a URL and share links. This can be particularly useful if you prefer to use search params over state variables for storing application state.

While TanStack Router _is still in beta_, it shows a lot of promise for improving the routing process in TypeScript applications. If you’re interested in giving it a try, be aware that there are currently some missing features and documentation, and the syntax is subject to change. However, the 100% TypeScript support and type safety make it worth keeping an eye on as it continues to develop.

* * *

[**Read on abhi.page**](https://abhi.page/notes/tanstack-router-intro/)
List of github repos for contributions and participate in Hacktoberfest.
Tags: hacktoberfest, github, opensource, contributorswanted
Published: 2022-10-20 07:33:26

Hey, 
If you want to participate in Hacktoberfest then you can contribute these following repos:-

- 
https://github.com/sandeeprawat28/Donation-Website

- https://github.com/sandeeprawat28/E-Commerce-Website-Clone

- https://github.com/sandeeprawat28/Movies-Tracker
Corteza 2022.9.1. is already a fact!
Tags: release, update, lowcodeplatform, softwareimprovement
Published: 2022-10-20 07:26:44


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

Planet Crust, the driving force behind the Corteza open-source low-code development platform, has released a new update of Corteza. Check out the new features, changes and fixes: https://www.planetcrust.com/planet-crust-releases-corteza-2022-9-1
Emacs as RSS reader.
Tags: emacs, rss, productivity, opensource
Published: 2022-10-20 07:19:20

Do you have a list of websites you visit regularly? Just to find out nothing new was added. This manual scraping is often a waste of time. Worse yet, scanning and filtering these websites for new interesting content is even more time consuming.

Subscribing to an RSS feed can reduce your effort immensely. An RSS feed “pushes” the newest updates to subscribers and they will never miss updates. In order to make use of RSS feeds you need a “feed reader” or “feed aggregator”. Such a feed reader will save you from visiting your favorite websites again and again, so you can use your precious time more productively.

Emacs is the epitome of extensibility, and it’s no surprise that Emacs makes also a great RSS reader! The elfeed package turns Emacs into a full-fledged feed reader which support multiple feeds, searching, filtering and more.

The following shows a sample elfeed configuration with some programming news subscriptions. elfeed will only download the last two days of updates and mark them as unread.

Note: I use use-package. If you -- not, then I suggest removing the first few lines and installing elfeed via `M-x package install elfeed`.

```lisp
(use-package elfeed
:ensure t)

;; data is stored in ~/.elfeed
(setq elfeed-feeds
		'(
				;; programming
				("https://news.ycombinator.com/rss" hacker)
				("https://www.reddit.com/r/programming.rss" programming)
				("https://www.reddit.com/r/emacs.rss" emacs)
				("https://habr.com/ru/rss/all/all/?fl=ru" habr-all)
				("https://habr.com/ru/rss/news/?fl=ru" habr-news)
				("https://nuancesprog.ru/feed" nop)
				("https://dev.to/feed" dev-to)

				;; hobby
				("https://www.reddit.com/r/nasa.rss" nasa)
				("https://habr.com/ru/rss/hub/astronomy/all/?fl=ru" habr-astronomy)
				("https://habr.com/ru/rss/flows/popsci/all/?fl=ru" habr-popsci)

				;; programming languages
				("https://www.reddit.com/r/javascript.rss" javascript)
				("https://www.reddit.com/r/typescript.rss" typescript)
				("https://www.reddit.com/r/golang.rss" golang)
				("https://www.reddit.com/r/rust.rss" rust)

				;; cloud
				;;("https://www.reddit.com/r/aws.rss" aws)
				;;("https://www.reddit.com/r/googlecloud.rss" googlecloud)
				;;("https://www.reddit.com/r/azure.rss" azure)
				("https://www.reddit.com/r/devops.rss" devops)
				("https://www.reddit.com/r/kubernetes.rss" kubernetes)
				))

(setq-default elfeed-search-filter "@2-days-ago +unread")
(setq-default elfeed-search-title-max-width 100)
(setq-default elfeed-search-title-min-width 100)
```

A usual workflow looks like this:

`M-x elfeed`
`M-x elfeed-update`

- `G` fetches the newest RSS feed updates
- `s` filter for a specific topic like typescript, golang or habr-news
- `c` clears the search filter and shows everything again
- navigate up and down with n (next line) and p (previous line)
- `b` open current url in your browser

## Example of RSS usage
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ifbmk5kt5l3wiz9ln37x.png)



For a complete elfeed documentation visit the [official elfeed page](https://github.com/skeeto/elfeed)
Essential plugins for Kubectl CLI
Tags: kubernetes, maintainence, technology, devops
Published: 2022-10-20 06:57:17

This is a short article about handy plugins that can be used along with kubectl CLI , which helps you to can reduce a few of your operational tasks from an admin perspective. Basically, we can extend the capabilities kubectl with the power of plugins, like checking the deprecations of components in the cluster or SSHing to the nodes.

We can install plugins using a plugin manager called krew and there are quite a few available on the website listed here as well. Let's look at how we can get started with plugins :)

**Setup**
The plugins are added using krew and the primary requirement is to install krew them in the system. You can use the below code snippet in Mac/Linux to install it

```
(
  set -x; cd "$(mktemp -d)" &&
  OS="$(uname | tr '[:upper:]' '[:lower:]')" &&
  ARCH="$(uname -m | sed -e 's/x86_64/amd64/' -e 's/\(arm\)\(64\)\?.*/\1\2/' -e 's/aarch64$/arm64/')" &&
  KREW="krew-${OS}_${ARCH}" &&
  curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/latest/download/${KREW}.tar.gz" &&
  tar zxvf "${KREW}.tar.gz" &&
  ./"${KREW}" install krew
)
```
Once you have krew it in the system, now it is time to install the additional plugins.

**Plugins**
There are many plugins available in the OSS GitHub repos, but below are some of my personal favorites.

**1. Kubepug**
KubePug/Deprecations is intended to be a kubectl plugin, which:

Downloads a swagger.json from a specific Kubernetes version
Parses this Json finding deprecation notices
Verifies the current kubernetes cluster or input files checking whether exists objects in this deprecated API Versions, allowing the user to check before migrating

```
kubectl krew install deprecations
#Usage
kubepug --k8s-version=v1.18.6 # Will verify the current context against v1.18.6 swagger.json
```
**2. net-forward**

Simple plugin that lest you create a local port listener on your personal machine that redirects to an arbitrary TCP service that the Cluster can see. This is similar to kubectl port-forward without the restriction that forwarding can only use Pods or Services as destinations.

```
kubectl krew install net-forward

#Usage
kubectl net-forward -i 169.254.169.254 -p 3389 -l 3389
I personally use this a lot to debug issues related to environment specific inside the Windows/Linux nodes.
```

Please feel to try out the plugins on the krew website also, as there are other plugins that could be beneficial to your work.
Hope this info was helpful and thanks for reading the article.!

**References**
[Kubepug](https://github.com/rikatz/kubepug)
[net-forward](https://github.com/antitree/krew-net-forward)
[Krew](https://krew.sigs.k8s.io/plugins/)

In case of any queries, please feel to connect me via the below links

[LinkedIn](https://www.linkedin.com/in/rvr88/)
[Twitter](mysticrenji)
[Medium](https://renjithvr11.medium.com/)
New React Developer Seeking Simple Authentication
Tags: react, tutorial, beginners
Published: 2022-10-20 06:49:24

I am currently learning React + Slim PHP to create full stack app.

I wanted to learn more about authentication/authorization.  From what I read, JSON Web Token (JWT) is the way to go.  Further reading lead me to an article for creating authentication/authorization -- it looks simple enough.  But the only thing I don't like is that I have to use UserFront library for this.

What I would like to achieve is authentication/authorization that resides within my server.  Like I would use my React App locally and preferred not to use the Internet for my app to work.
Restore From Backups
Tags: devops, storybytes, datamanagement, restorebackup
Published: 2022-10-20 04:49:22


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

Any Website or Web Application backup is one of the most critical factors for data management. Whether it’s a server crash, hackers or malware, not having a quick and easy plan can prove to be devastating. Our Backup service will allow us to restore anything that was online before the site went down. But it isn’t just a click on a restore button. The Backup plan has to be smart enough so that everything can be brought back online. Ideally, this happens as fast as possible and comes back even stronger than before. We at Web and App Studio achieve this powerful combination with pre-defined solutions customised to the actual need. You don’t think about them until you need them. But when you need them, they can literally determine the course of your business’ life. At the end of the Day, Website backups are the insurance of the online business.
Simplifying the visual information on the screen
Tags: ux, a11y, gamedev
Published: 2022-10-20 06:39:19

[Cover image](https://www.sie.com/en/blog/inside-the-accessibility-features-of-ratchet-clank-rift-apart)

Do you know the situation when you want to play a game after a hard day, but the information is perceived with difficulty? You have to apply additional cognitive effort to pass the levels.

But tiredness isn't the only reason why mistakes can be made despite great efforts to concentrate! It happens that temporary or permanent diseases interfere with perceiving and understanding information - concussion, dyslexia..

In order to simplify the execution of tasks, it is necessary to enable the player to change the attributes of information in the channels in order to reliably perceive and understand it.

Today I will talk about the visual channel of information.

So, in **Ratchet and Clank: Rift Apart** game, you can assign different shaders to Interactable, Hazard, and Collectible. Colors can be customized. This helps to facilitate the perception of visual information at very overloaded levels.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8yr1v93ko0vvfrvzcmyc.png)
[Image](https://www.sie.com/en/blog/inside-the-accessibility-features-of-ratchet-clank-rift-apart)

There's also a High Contrast Background setting that desaturates the background and leaves key elements like enemies and traversal objects in full color to help them stand out.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qf0lpzsgfapkx9vbw7r1.png)
[Image](https://www.sie.com/en/blog/inside-the-accessibility-features-of-ratchet-clank-rift-apart)