teleren/devto huggingface dataset:
Embrace the learning adventure
Tags: productivity, learning, writing
Published: 2024-04-13 11:07:00

## Create a habit of continuous improvement and development

With over 20 years of experience in software development, I have learned a lot. And I forgot a lot. Not that it's all gone. But every now and then I have to think hard to remember some really valuable and good things. And I have to search my repositories or the internet for some things I already knew before.

One day on another internet research I came across a [very useful article by Simon Willison](https://til.simonwillison.net/python/pyproject). It was within his collection of short snippets he entitles "[Things I've learned](https://til.simonwillison.net/)". Simon himself was inspired by Josh Branchaud and his TILs, he calls them "[Today I learned](https://github.com/jbranchaud/til)".

The idea of recording my knowledge has been on my mind for years, and it's not a new concept. But this event encouraged me to finally write my own articles. With the short and precise articles I hope I found a way to do it, as Josh describes it:

> Writing daily TIL posts became a habit that I could stick with.
_Josh Branchaud_

I will try to write down things I have learned and things I want to remember. I will try to write them down in a way that I can understand them in a few years. And I will try to write them down in a way that others can understand them, too.

Let's see how it goes.
Things I Wish They Taught Us About C in College
Tags: c, college, beginners, codequality
Published: 2024-04-13 11:05:16

The first programming course in my college and I'm sure in a lot of others was "Programming in C" and for good reason. Like it or not, C is one of the most important programming languages to learn as a budding computer scientist.

Programming in C begins to teach you (the hard way) how software actually works and if you've programmed before, makes you appreciate the beauty of some high-level features in languages that you've probably taken for granted this whole time.

However, as is the case with most exuberant college students, we want to learn programming, not computer science (a discussion perhaps, for another day) and learning C doesn't inspire confidence in building actual software that actual people will use.

Contrary to popular belief however, C is a really easy language to learn and once you've got a hang of the fundamentals, is really easy to build actual software with. The issue lies in the way it is taught in an academic setting. A lot of the quality of life features of the language are glossed over and leave students scared of it.

Here are some features that I wish they taught us in college that make C seem more approachable and help you use it not just as a computer scientist, but an actual programmer.

{% embed https://dev.to/k-srivastava/stdinth-et-al-1340 %}

{% embed https://dev.to/k-srivastava/using-const-3p07 %}

{% embed https://dev.to/k-srivastava/using-typedef-2j06 %}

{% embed https://dev.to/k-srivastava/saving-magic-for-macros-3dk2 %}
Decode JWT Token easily using _jwt-decode_
Tags: jwt, javascript, typescript, npm
Published: 2024-04-13 11:04:59

1. Install with NPM or Yarn

```
npm install jwt-decode
//or
yarn add jwt-decode
```

2. Import package:

```
import { jwtDecode } from "jwt-decode";
```

3. Usage

```
const token = "eyJ0eXAiO.../// jwt token";
// Returns with the JwtPayload type or any type
// const decodedJwt = jwtDecode<JwtPayload>(token);
const decodedJwt: any = jwtDecode(token);

//example print expiration date
console.log(decodedJwt.exp);
```
Saving Magic for Macros
Tags: c, codequality, beginners
Published: 2024-04-13 11:04:42

We often find ourselves in the middle of writing a function that we cannot bring ourselves to simplify further. The ones which end up relying on some kind of inexplicable "magic" that cannot be abstracted away.

Instead of writing these as functions, consider using macros instead. Let me give you a taste of what they are capable of.

Macros are defined using the `#define` directive and are effectively a copy-paste replacement where they are used with appropriate parameter substitutions.

```C
#include <stdio.h>

#define PRINT_MESSAGE(message) printf("%s\n", (message))

int main(void) {
    PRINT_MESSAGE("Hello, world!");
    return 0;
}
```

Macros are incredibly powerful since they accept any token as a parameter. So, you could potentially also do this.
```C
#define PERFORM_OPERATION(number_1, number_2, operator) \
    ((number_1) operator (number_2))

int main(void) {
    int a = PERFORM_OPERATION(1, 2, +);  // 3
    int b = PERFORM_OPERATION(1, 2, -);  // -1
    int c = PERFORM_OPERATION(5, 2, *);  // 10
    int c = PERFORM_OPERATION(4, 2, /);  // 2

    return 0;
}
```

But, my personal favourite use of macros is to create generic versions of certain often used procedures. Here's one that is used to swap two values of any given data type.

```C
#include <stdbool.h>
#include <stdlib.h>

#define SWAP(value_1, value_2, type)\
    do\
    {\
        type* temp = malloc(sizeof(type));\
        *temp = value_1;\
        value_1 = value_2;\
        value_2 = *temp;\
        free(temp);\
    }\
    while (false)
```

Let me try to explain the weirdness. Since we're creating a variable and since macros are effectively a copy-paste substitution, we have to limit the variable's scope. So, we can place it in a separate block like this do-while block that only executes once.

This function would have been a pain to write normally since there is no direct way to pass the data-type to a function in C. In situations like this, it is often much easier to write a simple macro than to create multiple long and similar functions.
Introduction of HTML
Published: 2024-04-13 10:59:50

## Introduction of HTML

HTML or Hypertext Markup Language is a fundamental structure block of the new age websites. It was developed by Tim Berners-Lee in the early 1990s and has played an important part in the development of websites from the 1990s till now there are about 5 versions of HTML each version has a timeline Called [TimeLine of HTML](https://spankingsolutions.com/history-of-html/). In this newsletter, you’ll learn about the significance of HTML and its main features in web enhancement.

[Learn More](https://smartarticlesphere.com/introduction-of-html/)

By [Spanking Solutions.](https://spankingsolutions.com/).
Using typedef
Tags: c, codequality, beginners
Published: 2024-04-13 10:53:22

`typedef` is one of things that I can never look back from. Essentially, it allows to alias existing types in C and makes code much easier to read and write.

Take the following example as an instance.
```C
struct my_struct {
    int a;
    char b;
}

void init_my_struct(struct my_struct* s, int a, char b);
```

Now, we alias the `my_struct` to another value using `typedef`.
```C
typedef struct my_struct {
    int a;
    char b;
} my_struct_t;

void init_my_struct(my_struct_t* s, int a, char b);
```

Notice how much easier it is to follow code. You may also omit the initial name declaration of `my_struct` but I personally prefer it since it gives static analysis tools more information about the struct as opposed to just an anonymous struct. The same may be used for any type, even `enums`. But, I feel the best use of `typedef` is aliasing pointers to functions.

```C
typedef enum color {
    COLOR_RED,
    COLOR_GREEN,
    COLOR_BLUE
} color_t;

void display_value(color_t display_color);
```

The syntax behind them is confusing and weird and stems partly from the notion of "declaration reflects use" but is still strange. Aliasing these behemoths to something much easier to the eye is always welcome.

```C
typedef void (*ParseFunction)();
```
Buy Zolpidem 5mg Online buypillsnow.store
Tags: webdev, javascript, beginners, programming
Published: 2024-04-13 10:38:09

**⏭⏭Click Here To Buy Zolpidem Online⏭⏭ **
**[https://www.cureus.com/users/667412-health-professional-medicuretoall](https://www.cureus.com/users/667412-health-professional-medicuretoall)**

Buying Zolpidem Online Without Prescription can be tempting for those struggling with insomnia, but it's important to approach this decision carefully. While the convenience of online shopping is appealing, it's important to remember that Zolpidem is a prescription medication that should only be taken under the guidance of a doctor. Taking Zolpidem without a prescription can lead to serious health risks, as well as legal consequences.
Using Const
Tags: c, codequality, beginners
Published: 2024-04-13 10:36:55

An important factoring in understanding your code is realising what is mutable and when. Often times, variables we use in code do not need to change or, should not be changed.

C uses the `const` keyword to signify that a variable cannot be mutated. You may have seen this when making strings, `const char*`.

But, using `const` brings up the important discussion of mutability in programs, leading to large online debates about the essence of programming.

There are those who believe that code is nothing but mathematics and such, should not have mutable state at all. Once a variable is declared and initialised, its value cannot and should not change.

On the other side, there are those who say that this approach only works on white-papers and technical documents and that in the real world, with real-time communication to databases and APIs, it is nearly impossible to write pure code.

In any case, realising the importance of constant values is important as a programmer and using `const` for such values encourages writing cleaner code.

While using `const` rarely has any performance benefits, it is important to consider its benefits on developer experience. `const` enforces the idea of constants as opposed to being left as overhead to the programmer.

```C
// Constant parameters.
void do_something(const int data) {
    ...
}

int main(void) {
    // Constant local variables.
    const int number = 5;

    // Constant pointers.
    const char* message = "Hello, world!\n";

    return 0;
}
```
Key components of Machine Learning:
Tags: javascript, machinelearning, education, beginners
Published: 2024-04-13 10:36:50

To fully understand the potential of machine learning, you must consider the features of this technology. Many situations in today's data-rich environment resemble the characteristics of machine learning. 
These seven key characteristics of machine learning make it the go-to technology for companies.

**The ability to visualize data automatically:**
Massive volumes of data are regularly generated by both businesses and average people. Businesses that see important connections in data can make more informed decisions and feel more confident. A wide range of machine learning tools provide rich data snippets that may be used with unstructured as well as structured data. Automatic data visualization platforms in machine learning can provide businesses looking to increase process productivity with a wealth of new insights. These platforms are straightforward to use. ([Machine Learning Training in Pune](https://bit.ly/3NI3dCT))

**The best available automation:**
The ability of machine learning to boost productivity by automating repetitive tasks is among its most significant features. Many organizations now employ machine learning to fuel their paperwork and email automation. For example, the banking sector requires a considerable quantity of work that is predictable, repetitious, and data-intensive. This is the reason why this industry makes extensive use of a range of machine learning technology. This makes accounting tasks faster, more analytical, and more precise. Numerous tasks, like budgeting, automating bank reconciliations, forecasting the future, and helping chatbots respond to financial queries, have previously been handled by machine learning. ([Machine Learning Course in Pune](https://bit.ly/3NI3dCT))


**The ability to change the mortgage market:**
It is a reality that building a positive credit score often takes a lot of customers' patience, discipline, and careful financial preparation. A borrower's consumer credit score, which is based on several factors including length of credit history, total debt, and payment history, is the main way that lenders determine whether or not to extend credit to them. But wouldn't it be great—a more direct and practical approach? Thanks to machine learning, lenders may now obtain a more comprehensive image of their clients. They can predict whether a consumer is a high or low spender now that they know the customer's spending tipping point. Financial firms use comparable tactics for purposes other than mortgage funding.

**Precise Data Analysis:**
Working with huge and heterogeneous datasets makes the trial-and-error procedure that has traditionally been a part of data analysis impractical. All of these problems are best solved by machine learning, which provides efficient substitutes for the laborious analysis of large amounts of data. Machine learning is capable of producing precise analysis and outcomes by creating quick and effective algorithms as well as data-driven models for real-time data processing.
Buy Belbien 10mg Online buypillsnow.store
Tags: webdev, javascript, programming, tutorial
Published: 2024-04-13 10:36:17

**➤ Click Here To Buy Belbien Online➤**
**[https://www.cureus.com/users/684754-health-care](https://www.cureus.com/users/684754-health-care)**

Belbien Tablet 10mg is a trusted medication for managing insomnia. Each tablet contains 10mg of the active ingredient, zolpidem, renowned for its efficacy in promoting sleep. Belbien induces a calming effect, helping individuals fall asleep faster and enjoy a restful night. It is prescribed for short-term use to alleviate sleep difficulties. Prior consultation with a healthcare professional is recommended to ensure proper dosage and usage based on individual needs.
Buy Ambien 10mg Online buypillsnow.store
Tags: webdev, javascript, programming, tutorial
Published: 2024-04-13 10:20:02

🍁🅲🅻🅸🅲🅺 🅷🅴🆁🅴 🆃🅾 🅾🆁🅳🅴🆁 🅽🅾🆆🍁
**[https://www.buypillsnow.store/product/ambien-10-mg/](https://www.buypillsnow.store/product/ambien-10-mg/)**

Ordering with confidence is made possible by our committed staff, who make sure that everything goes well at every stage. We provide free delivery directly to your door, which makes it even better. You should just unwind and let us handle everything rather than worrying about leaving quickly. Thus, why hold off? With our help, you can easily purchase Ambien online and take back control of the quality of your sleep.
Buy Zolpidem Online buypillsnow.store
Tags: webdev, python, devops, ai
Published: 2024-04-13 10:17:35

**⏭⏭Click Here To Buy Zolpidem Online⏭⏭ **
**[https://www.cureus.com/users/666621-hea](https://www.cureus.com/users/666621-hea)**

Buying Zolpidem Online Without Prescription can be tempting for those struggling with insomnia, but it's important to approach this decision carefully. While the convenience of online shopping is appealing, it's important to remember that Zolpidem is a prescription medication that should only be taken under the guidance of a doctor. Taking Zolpidem without a prescription can lead to serious health risks, as well as legal consequences.
Upload File in NextJS without any Library 🌟
Tags: javascript, nextjs
Published: 2024-04-13 10:17:06

🌟 **Upload File in NextJS without any Library** 🌟

So you're working on a Next.js project and need to implement a file upload feature without using any external libraries? 📁 No problem! Next.js provides a straightforward way to achieve this. Let's dive into the code!

### Create the Frontend Part

```jsx
"use client"
import { useState } from "react"

export default function Home() {
  const [file, setFile] = useState()

  const onSubmit = async (e) => { 
    e.preventDefault();
    console.log(file);
    
    let data = new FormData();
    data.set("file", file)
    
    let res = await fetch("/api/upload/route", {
      method: "POST",
      body: data,
    })
    
    let response = await res.json()
    console.log(response);
  }

  return (
    <>
      <form onSubmit={onSubmit}>
        <input type="file" onChange={(e) => setFile(e.target.files[0])} />
        <button type="submit">Upload</button>
      </form>
    </>
  )
}
```

### Create API file `api/upload/route.js`

```js
import { writeFile } from 'fs/promises'

async function handler(req, res, next) { 
  let data = await req.formData()
  console.log(data);
  
  data = data.get("file");
  let bytedata = await data.arrayBuffer()
  let buffer = Buffer.from(bytedata)
  let path = "./public/uploads/" + data.name;
  
  await writeFile(path, buffer);
  return Response.json("hi:hi")
}

export { handler as POST }
```

That's it! 🎉 Now you have a basic file upload setup in your Next.js app. When a user selects a file and hits the "Upload" button, the file is sent to the `/api/upload/route` endpoint, where it's processed and saved to the `public/uploads` directory.

> It is recommended that use remote services like AWS or LINODE and don't upload files where your source code it there.

If you need more guidance, you can check out this [video tutorial](https://www.youtube.com/watch?v=d_N0_i1IvCI&ab_channel=CodeStepByStep) for a visual walkthrough. Happy coding! 🚀
Buy Belbien Online buypillsnow.store
Tags: healthydebate, healthcare, medicine, health
Published: 2024-04-13 10:14:18

**➤ Click Here To Buy Belbien Online➤**
**[https://www.buypillsnow.store/product/belbien-10-mg/](https://www.buypillsnow.store/product/belbien-10-mg/)**

Belbien Tablet 10mg is a trusted medication for managing insomnia. Each tablet contains 10mg of the active ingredient, zolpidem, renowned for its efficacy in promoting sleep. Belbien induces a calming effect, helping individuals fall asleep faster and enjoy a restful night. It is prescribed for short-term use to alleviate sleep difficulties. Prior consultation with a healthcare professional is recommended to ensure proper dosage and usage based on individual needs.
Buy Ambien Online buypillsnow.store !!
Tags: webdev, javascript, beginners, programming
Published: 2024-04-13 10:11:52

**Visit here to shop now : **
**[https://www.buypillsnow.store/product/ambien-10-mg/](https://www.buypillsnow.store/product/ambien-10-mg/)**

Visit our online pharmacy buypillsnow.store to Buy Ambien Online And Get Swift and Efficient Delivery. Ambien is a sleep aid that helps individuals struggling with insomnia. "buypillsnow.store" offers a seamless and secure purchasing experience, ensuring that you can buy Ambien online with ease. Place Your First Order And Save UPTO 20%. buypillsnow.store believe in customer satisfaction and safety, you can buy our product with peace of mind and can trust our services. >>((PLACE YOUR ORDER HERE- www.buypillsnow.store))<<MAIL US- info@buypillsnow.store >>
Kasr Sonlar.
Tags: float, double, kasr, decimal
Published: 2024-04-13 09:59:18

**Kasr sonlar - bu sonning butun qismidan ajralib turuvchi sonlardir. Kasr sonlar ikki xil bo'ladi:** *1) Chiziqli kasr sonlar*  *2) O'nli kasr sonlar.*

**Chiziqli kasr son** - bu kasr sonning surati, maxraji hamda butun qismi mavjud bo'lib, surati chiziqning ustki qismida, maxraji ostki qismida hamda butun qismi esa ikkala qismining oldida joylashgan bo'ladi. Kasr sonlarnig bu turini kundalik hayotimizda umuman ishlatmaymiz, ammo matematik masalalarda ishlatamiz.

**O'nli kasr sonlarga** keladigan bo'lsak, o'nli kasr sonlarning ko'rinishi chiziqli kasr sonlardan ancha faqr qiladi. O'nli kasr sonlarning butun qismi birinchi yozilib, qolgan qismi vergul (,) dan keyin yoziladi. Kasr sonning bu turini kundalik hayotimizda uchratishimiz mumkin. Masalan: insonning o'g'irligini o'lchashda.

**C# da kasr sonlar qanday saqlanadi ?**

>C#da kasr sonlar 3ta ma'lumot turi yordamida saqlanadi.
>>Bular :
1. Float
2. Double
3. Decimal
Kickstart Your Web Development Journey with Free Resources: HTML, CSS, and JavaScript
Published: 2024-04-13 09:51:43

Embarking on the journey to becoming a web developer? Start by mastering the core building blocks: HTML, CSS, and JavaScript.

In recent years, coding bootcamps have surged in popularity among aspiring developers, offering intensive, hands-on learning experiences. These bootcamps are designed to equip you with the practical skills and knowledge needed to excel in the field. According to Indeed, a leading job site, the majority of U.S. companies have hired graduates from coding bootcamps.

However, if you're looking for free resources to kickstart your web development journey, there are plenty of options available:

1. **freeCodeCamp**: A non-profit organization that offers a comprehensive curriculum covering HTML, CSS, JavaScript, and more. They also provide interactive coding challenges and projects to help you apply what you've learned. Visit their website at [freeCodeCamp.org](https://www.freecodecamp.org/).

2. **MDN Web Docs**: Mozilla's developer network provides extensive documentation and tutorials on web technologies, including HTML, CSS, and JavaScript. It's a valuable resource for both beginners and experienced developers. Explore their resources at [developer.mozilla.org](https://developer.mozilla.org/en-US/docs/Web).

3. **W3Schools**: This website offers free tutorials and references on web development languages and technologies, including HTML, CSS, JavaScript, and many others. It's a great resource for learning the basics and exploring more advanced topics. Access their materials at [W3Schools.com](https://www.w3schools.com/).

4. **Codecademy**: While Codecademy offers paid pro subscriptions, they also provide a selection of free interactive coding courses, including introductory courses on HTML, CSS, and JavaScript. It's a good option for hands-on learners. Start learning at [Codecademy.com](https://www.codecademy.com/).

Remember, while these free resources can provide a solid foundation in web development, continuous learning and practice are essential for mastery. Experiment with building your own projects, participate in online coding communities, and stay curious about new technologies and trends. With dedication and persistence, you can forge a successful career in web development without breaking the bank.
insert Default value to database
Published: 2024-04-13 09:45:33

Certainly! In the context of databases, default values are predefined values assigned to a column if no value is specified during the insertion of a record. Here's a real-world example using a `Customer` table:

Suppose you have a `Customer` table with a column for the customer's account status. You want new customers to have a default account status of 'Active' unless specified otherwise. Here's how you might define the table with a default value:

```sql
CREATE TABLE Customer (
    customer_id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
    customer_name VARCHAR(255) NOT NULL,
    account_status VARCHAR(50) DEFAULT 'Active'
);
```

Now, when you insert a new customer without specifying the `account_status`, it will automatically be set to 'Active':

```sql
INSERT INTO Customer (customer_name)
VALUES ('Alice Smith');
```

After this insertion, the `account_status` for 'Alice Smith' will be 'Active' by default. If you need to set a different status during insertion, you can specify it like this:

```sql
INSERT INTO Customer (customer_name, account_status)
VALUES ('Bob Johnson', 'Inactive');
```

In this case, 'Bob Johnson' will have an `account_status` of 'Inactive' because it was explicitly set during the insertion. Default values are particularly useful for setting initial states or fallback values for records in a database.