<![CDATA[Harduex blog]]>https://harduex.com/blog/https://harduex.com/blog/favicon.pngHarduex bloghttps://harduex.com/blog/Ghost 5.42Sun, 18 Jun 2023 14:38:16 GMT60<![CDATA[How to Become a Better Programmer - 5 Tips for Productivity]]>Are you looking to level up your programming skills and become a better programmer? Whether you're a beginner or an experienced coder, there are always ways to improve your craft. In this article, we'll explore 5 valuable tips that can help you become a more efficient

]]>
https://harduex.com/blog/how-to-become-a-better-programmer-5-tips-for-productivity/648f06db5b1a060001d801c9Sun, 18 Jun 2023 14:37:38 GMT

Are you looking to level up your programming skills and become a better programmer? Whether you're a beginner or an experienced coder, there are always ways to improve your craft. In this article, we'll explore 5 valuable tips that can help you become a more efficient and effective programmer.


1. Master Keyboard Shortcuts and Key Bindings

One of the easiest ways to boost your productivity as a programmer is by memorizing keyboard shortcuts and key bindings. These shortcuts allow you to transition seamlessly between your mouse and keyboard, saving you precious time and reducing the need to switch back and forth.

If you find yourself frequently reaching for the mouse to perform common tasks, it might be time to learn some key bindings. Most popular code editors and IDEs have a wide range of keyboard shortcuts that can significantly speed up your workflow. Take the time to familiarize yourself with these shortcuts, and you'll notice a marked improvement in your programming efficiency. If you're using Visual Studio Code, check out this VSCode cheatsheet.


2. Read the Documentation Thoroughly

When faced with a programming challenge or a new technology, it's tempting to skim through the documentation and look for quick answers. However, taking the time to read the documentation thoroughly can provide a wealth of knowledge and insights that can significantly enhance your programming skills.

Documentation is often written by experts and offers detailed explanations, examples, and best practices. By investing the time to thoroughly understand the documentation, you'll gain a deeper understanding of the tools and frameworks you're using. This knowledge will not only help you solve immediate problems but also enable you to make better decisions and write more robust code in the long run.

So, the next time you encounter a new library or a complex feature, resist the urge to skim. Instead, allocate time to read the documentation thoroughly, and you'll find yourself equipped with a valuable arsenal of knowledge!

3. Code as if Others Are Watching

Even if your code is not being seen by another programmer at the moment, it's essential to write it as if it were. The readability and maintainability of your code are crucial aspects that can make your life as a programmer much easier in the future.

When you write code with the assumption that others will review it, you tend to adopt good programming practices. This means writing clean, well-structured code, using meaningful variable and function names, and adding helpful comments and documentation.

By cultivating this habit, you not only make your code more understandable for others, but you also make it easier for your future self to navigate and modify the codebase. As projects grow and evolve, having code that is easy to read and comprehend becomes increasingly important.

So, even if you are the only one working on a project, think of your code as a form of communication. Treat it as if others will rely on it, and you'll reap the benefits of maintainable and readable code in the long run.

4. Seek Feedback and Collaborate

Programming is not a solitary activity. Seeking feedback from others and collaborating with fellow programmers can help you grow and improve your skills.

Don't be afraid to share your code and ask for suggestions or critiques. Getting input from others can provide fresh perspectives and insights that can lead to better solutions. Engaging in discussions and participating in coding communities or open-source projects can expose you to different approaches and best practices. Embrace collaboration as an opportunity to learn from others and refine your programming abilities.

The field of programming is constantly evolving, and staying updated with industry trends is essential to remain relevant. Continuous and optimized learning is the key to keeping up with the coming wave of new technologies and opportunities.

Currently, one of the prominent trends is the increasing integration of artificial intelligence (AI) in various domains. To keep evolving as a programmer, it's crucial to leverage AI tools such as Chat GPT, GitHub Copilot X, Bing Chat and others. These tools can assist you in tasks like generating code snippets, bug fixing, providing intelligent suggestions, and automating repetitive tasks. By embracing AI, you can enhance your productivity and explore new possibilities in your projects.

Learning can become much faster and easier with AI, but remember: don't be lazy! While AI is a valuable tool, it's essential to double-check the information and always rely on your common sense as the first quality gate. It's important to use AI responsibly and not rely on it blindly. Remember that it is a tool to augment your abilities and creativity, not replace them.

Treat AI as you would treat a human - do not put any information in AI tools that you otherwise would not share with others.

Conclusion

Becoming a better programmer is a continuous journey that requires dedication and a willingness to improve. By mastering keyboard shortcuts and key bindings, reading documentation thoroughly, writing code as if it's being seen by others, seeking feedback and collaboration, staying updated with industry trends, and embracing continuous learning, you can enhance your programming skills and become a more efficient and effective programmer.

Remember, programming is not just about writing lines of code; it's about solving problems, collaborating with others and creating maintainable software. Embrace the mindset of constant growth, strive for excellence, and never stop learning. With each step you take on this journey, you'll become not only a better programmer but also a true master of your craft.

]]>
<![CDATA[The 6 Stages of Fasting and Their Amazing Benefits]]>Fasting has been practiced for centuries, but only recently it has gained popularity as a way to improve health and promote longevity. There are different types of fasting, but one of the most common is intermittent fasting, where you alternate between periods of eating and fasting.

In this article, we

]]>
https://harduex.com/blog/the-6-stages-of-fasting-and-their-amazing-benefits/644ce586b450b800018bf5b3Sat, 29 Apr 2023 09:50:17 GMT

Fasting has been practiced for centuries, but only recently it has gained popularity as a way to improve health and promote longevity. There are different types of fasting, but one of the most common is intermittent fasting, where you alternate between periods of eating and fasting.

In this article, we will discuss the six stages of fasting and their amazing benefits. Let's dive in.

Stage 1: 8-14 Hours

In the first stage of fasting, your blood sugar starts to stabilize, and your body begins to use up the stored sugar called glycogen. At around the 10th hour, your muscles start to use both glucose and fat for energy, which marks the beginning of the transition from sugar burning to fat burning.

Stage 2: 14-24 Hours

During this stage, the liver starts to turn your fat into ketones, and your cravings start to decrease. You'll notice an increase in energy and improvements in your mood, cognitive function, focus, memory, and concentration.

Stage 3: 24-36 Hours

This stage is where you enter a full ketosis state, and your body starts to burn fat for energy. Your appetite will decrease, and you'll experience a drop in ghrelin hormone, which is why you'll feel less hungry. You'll also experience a spike in brain-derived neurotrophic factor (BDNF), which promotes the growth of new brain cells.

Stage 4: 36-48 Hours

At this point, you'll experience serious autophagy, a process where your body recycles old and damaged proteins, microbes, and other waste into new proteins, fuel, and replacement parts. Autophagy helps your body become more efficient and repairs any damage that has occurred. Additionally, autophagy kills cancer cells and decreases oxidative stress and misfolding proteins, which can lead to chronic inflammation and diseases like Alzheimer's.

Stage 5: 48-60 Hours

During this stage, your insulin sensitivity improves, and you experience more autophagy, less inflammation, and healing from atrophy. Your body is also able to protect your muscles from being used as fuel, and the old, damaged proteins that were recycled in stage four are converted into new proteins to help heal atrophy.

Stage 6: 60-72 Hours

In the final stage of fasting, your immune system experiences regeneration and rejuvenation. A 72-hour fast has been shown to lead to a near-complete rejuvenation of the immune system, and people undergoing chemotherapy experience less damage. Your body produces more undifferentiated immune stem cells, which can help in the production of new immune cells.

Conclusion

The benefits of fasting are incredible, and these six stages show just how amazing the process can be. Fasting helps your body become more efficient, improves cognitive function, decreases inflammation, and promotes longevity. Additionally, fasting can help with weight loss and managing chronic diseases like diabetes and heart disease.

]]>
<![CDATA[How to Use TypeScript Aliases to Clean Up Your Import Statements]]>When working with any technology it is important to maintain your code clean and organized. One way to achieve this in TypeScript is by using TypeScript aliases to shorten and simplify your import statements. In this post, we will go over how to configure and use them to make your

]]>
https://harduex.com/blog/how-to-use-typescript-aliases-to-clean-up-your-import-statements/644788dd11ae450001d0329fTue, 25 Apr 2023 08:22:29 GMT

When working with any technology it is important to maintain your code clean and organized. One way to achieve this in TypeScript is by using TypeScript aliases to shorten and simplify your import statements. In this post, we will go over how to configure and use them to make your code better!

What are TypeScript Aliases?

TypeScript aliases allow you to create a shorter name for a module or file. For example, instead of importing a module using a relative path, you can create an alias and use it instead. This makes your code more readable and easier to maintain.

Setting your aliases

To create an alias in TypeScript, you need to define the paths and baseUrl properties in the compilerOptions section in the tsconfig.json file:

{
  "compilerOptions": {
    "baseUrl": "./src",
    "paths": {
      "@components/*": ["app/components/*"],
      "@services/*": ["app/services/*"],
      "@users/*": ["app/users/*"]
    }
  }
}

In the above code snippet, we have defined three aliases: @components, @services, and @users. The asterisk (*) at the end of each path is a wildcard that allows us to import any file within the specified folder.

How to use them in your code

Now that we have defined our aliases, we can use them in our import statements!

import { Component } from "@components/Component";
import { Service } from "@services/Service";
import { User } from "@users/User";

As you can see, our import statements are much cleaner and easier to read. We no longer need to use the relative path (../../../) to import modules.

Using Barrels

Another way to simplify your import statements is by using barrels.

Barrels are files that re-export multiple modules from a single location. For example, you could create a barrel file named index.ts in the app/components folder with the following code:

export { Component1 } from "./Component1";
export { Component2 } from "./Component2";
export { Component3 } from "./Component3";

Then, you could import all of the components using a single import statement:

import { Component1, Component2, Component3 } from '@component';

This is especially useful when you have a lot of modules to import from a single folder.

Benefits of Using Aliases

The major benefit of using aliases is that it makes your code more readable and easier to maintain. When you move components around or add new ones, you won't need to update your import statements. This can save you a lot of time and effort, especially when working on large projects.

Conclusion

By defining aliases and using barrels, you can make your code more organized, readable, and easier to maintain. If you haven't used aliases before, I highly recommend giving them a try in your next TypeScript project.

]]>
<![CDATA[How to Create Music with Artificial Intelligence using MIDI]]>https://harduex.com/blog/how-to-create-music-with-artificial-intelligence-using-midi/6443b6f28b61800001e053aaSat, 22 Apr 2023 17:54:35 GMT

The use of AI (Artificial Intelligence) has revolutionized our world, including the music industry, allowing musicians to explore new ways of creating music. There are two known ways to use AI to create music - one is to work with raw audio, and the other is to use the symbolic approach, which involves working with MIDI files.

MIDI (Musical Instrument Digital Interface) is a language that allows synths and computers to communicate with each other. MIDI is not only a way of sending signals between devices, but also a way of encoding musical information in a structured and universal format. This makes MIDI a language that AI can learn and understand, just like natural languages or programming languages. MIDI files also don't hog up too much space in your memory, making it easy to train AI networks with them.

The first approach is to convert raw audio into MIDI. Basic Pitch is a free audio-to-MIDI converter developed by Spotify that can detect pitch bends. It's a powerful tool for converting raw audio to MIDI. For instance, if you have an audio recording of a John Coltrane gig that features only an upright bass and a piano, you can effortlessly convert this audio into MIDI by uploading the file to Basic Pitch. The tool will convert it to MIDI in no time.

Once you have the MIDI file, you need to use a Digital Audio Workstation (DAW) to load the file on a MIDI track and assign an instrument to it. There are many DAWs on the market, but Ableton Live is a popular choice. With Ableton Live, you can assign any instrument to the MIDI track, and it will play it.

But what if you want to create music from scratch using AI? Magenta Studio is a collection of open-source tools and models built on Magenta, which uses cutting-edge machine learning techniques for music generation. Continuator is one of the tools that uses AI to create new music. It takes a melody as input and generates new melodies based on that input. You can use Continuator to create new melodies, chord progressions, and drum patterns.

Another exciting tool that allows you to incorporate MIDI into your AI projects is This MIDI does not exist. It uses AI to generate new MIDI files based on existing ones. The tool generates a new MIDI file every time you refresh the page, allowing you to explore different variations of the same melody.

Apart from just MIDI, AI can also help with audio editing and making remixes. LALAL.AI is a powerful tool that can extract stems from audio tracks without any loss in quality. You can separate the vocal, instrumental, drums, bass, piano, electric guitar, acoustic guitar, and synthesizer tracks from a song. Then you can feed the Basic Pitch with some beats that you like and extract MIDI files from them and generate variations using Magenta Studio big set of tools!

Another amazing AI tool for stems extraction is Vocalremover.org. It's a free online tool that separates vocals from instrumentals. It uses AI to create karaoke versions of songs and provides two tracks - a karaoke version with no vocals and an acapella version with isolated vocals. With some post audio processing and polishing, you can extact pretty good quality beats and acapellas for your mixes!

In conclusion, using AI to create music has never been more interesting. With tools like Basic Pitch, Magenta Studio and This MIDI does not exist, you can explore new ways of creating music and push the boundaries of what is possible. So why not give it a try and see where AI can take your music?

]]>
<![CDATA[Chromaticism in Modern Music: How to Create Unique and Mysterious Sounds]]>https://harduex.com/blog/chromaticism-in-modern-music-how-to-create-unique-and-mysterious-sounds/643fb5b030e6c600018b159fWed, 19 Apr 2023 10:07:30 GMT

Today, I'm going to talk about chromaticism in music and how you can use it to make your tracks sound more interesting and unique.

Chromaticism means using notes that are not in the key you're playing in. For example, if you're playing in A minor, which has no sharps or flats, you can add notes like C#, D#, F#, G#, or A#. These notes create contrast and tension with the notes in the key.

Chromaticism can add color and expression to your melodies and harmonies. You can use chromatic notes to create passing tones, neighbor tones, suspensions, appoggiaturas, or escape tones. These are all types of non-harmonic tones, which means they don't belong to the chord that is playing at the moment. They create a sense of movement and resolution when they resolve to a harmonic tone.

Chromaticism can also help you change keys or modes. You can use chromatic notes as pivot points or common tones between two keys or modes. For example, if you're in A minor and you want to switch to C major, you can use C# as a pivot point. You can play a chord progression like Am - Dm - E - A - C#dim - F - G - C. The C#dim chord is a type of chord that leads to F, which is the subdominant of C major. By using this chord, you can transition smoothly from A minor to C major.

You can hear examples of chromaticism in classical music from composers like Bach, Mozart, Beethoven, and Chopin. But, it's not just for classical music. Chromaticism is also used in modern music to create interesting and unique sounds. Music producers use chromaticism to express their feelings. For example, the intro music for the TV show Westworld is based on a chromatic scale that starts from A minor and goes up by half steps until it reaches A# minor. The composer Ramin Djawadi, who also composed the music for Game of Thrones, uses  chromaticism and dissonance to create a sense of mystery, urgency, anticipation, tension and suspense. His music uses both orchestral and electronic instruments, and it creates a contrast between classical and modern elements, as well as between organic and artificial sounds.

The other technique called dissonance is the use of chords or intervals that sound harsh or unstable. Electronic music producers use dissonance to create a sense of friction and conflict in their tracks. For example, they might use dissonant intervals like minor seconds, which are only one half step apart, to create a jarring effect.

In summary, chromaticism and dissonance are useful tools for classic and modern music producers. It is used to add contrast, tension, uniqueness and color to the music tracks. You can use chromaticism to modulate to different keys or modes. Additionally, dissonance can can be used to create a sense of tension and suspense.

]]>
<![CDATA[Uploading Our Consciousness To a Computer. But Should We?]]>https://harduex.com/blog/uploading-our-consciousness-to-a-computer-but-should-we/64383a744e3e6f0001d7a538Thu, 13 Apr 2023 17:44:33 GMT

In the movie Self/Less, an extremely wealthy man dying from cancer undergoes a radical medical procedure that transfers his consciousness into the body of a healthy young man. While this might sound like pure science fiction, many experts in the fields of neuroscience and computer science believe that it's possible to transfer human consciousness to a computer. But the question remains, should we do it?

Let's start by understanding the process of uploading consciousness to a computer.

First, we would have to read the source brain to learn how we store memories. Unlike computers, neurons don't store one bit of information; instead, each neuron can create up to 1,000 connections with those around them. Next, we would have to write to the new brain, which involves biochemically modifying neurons and their connections to other neurons. There are trillions of these synaptic connections in each person's head, so this process is incredibly complex.

Assuming we can read and write to brains, we would then have to copy that information. However, the human brain isn't a finite storage system like a hard drive; there could be a lot of space in there, ranging from a few gigabytes to a few million gigabytes. Copying 2.5 petabytes over a USB 3.0 connection, for example, would take more than 80 days.

The biggest issue with uploading consciousness to a computer is accurately mapping the brain. Computer scientists from giant companies, major universities, and world governments have been working on mapping and translating the brain network to a computer network for decades. However, thoughts don't live on a single neuron, nor are they processed in a single place. Instead, they exist as a patterned network of brain cells picking up and processing information.

While the technology to upload human consciousness to a computer isn't quite there yet, it's only a matter of time until we can learn to emulate a brain in a computer and map consciousness on top of it. The question is..

Should we?

One argument for uploading consciousness to a computer is that it could extend human life indefinitely. If we could transfer our consciousness to a computer, we would no longer be limited by the lifespan of our physical bodies. This could allow us to live for hundreds or even thousands of years, which could be incredibly beneficial for scientific research and other fields that require a lot of time.

However, there are also a lot of potential downsides to uploading consciousness to a computer. For one, it's possible that the resulting "uploaded" consciousness would not be the same as the original consciousness. This could result in a loss of individuality or even identity. Additionally, there could be ethical concerns about creating new life forms in the digital realm.

Another potential issue is the impact on society. If only the extremely wealthy could afford to transfer their consciousness to a computer, it could lead to an even greater divide between the rich and the poor. It's also possible that the creation of digital immortality could lead to a lack of motivation and productivity in society, as people would no longer feel the same sense of urgency to accomplish things in their limited lifespan.

To summary, while the technology to upload human consciousness to a computer is advancing rapidly, the question of whether we should do it is complex and multifaceted. While it could offer benefits such as extending human life and advancing scientific research, there are also many potential downsides such as loss of individuality, ethical concerns, and negative societal impacts. Ultimately, the decision of whether to pursue this technology will likely involve a balance of scientific progress, ethical considerations, and societal implications.

]]>
<![CDATA[Effortlessly Backup and Restore Your Ubuntu/Debian Systems with apt-clone tool]]>https://harduex.com/blog/effortlessly-backup-and-restore-your-ubuntu-debian-systems-with-apt-clone-tool/6437d5cd4e3e6f0001d7a4bcThu, 13 Apr 2023 10:23:17 GMTAre you looking for an easy and reliable way to backup and restore packages on your Debian/Ubuntu systems? If yes, then apt-clone is the perfect tool for you!Effortlessly Backup and Restore Your Ubuntu/Debian Systems with apt-clone tool

apt-clone is a simple command-line tool that lets you create "state" files of all installed packages for your Debian/Ubuntu systems. These state files can be restored on freshly installed systems or into a directory, making it easy to get your system up and running again after a crash or other emergency.

There are several use cases for apt-clone, including cloning a server's package selection and restoring it on a fallback system, or backing up your system state to be able to restore it on other machine.

To create a clone, simply run the command:

$ sudo apt-clone clone ~/myhost

This will create an ~/myhost.apt-clone.tar.gz file that contains a state of all the packages installed on your system.

To get more information about the clone, run:

$ apt-clone info ~/myhost.apt-clone.tar.gz

This will give you details about the hostname, architecture, distribution, and more.

To restore the clone, run:

$ sudo apt-clone restore ~/myhost.apt-clone.tar.gz

This will install or remove packages based on the state in the archive, so be careful and make sure you understand what will be changed before restoring. If you want to debootstrap the clone into a specific directory, you can use the --destination option.

In conclusion, apt-clone is a powerful and simple tool that makes it easy to backup and restore your Debian or Ubuntu systems. Give it a try and never worry about losing your system packages.

apt-clone Github

]]>
<![CDATA[How computers "see"]]>When it comes to image processing and machine learning, it's important to understand how computers represent and interpret visual data. In this post, we'll explore how images are represented as arrays of numerical values, and how these arrays can be used as inputs to neural network

]]>
https://harduex.com/blog/how-computers-see/64345eaef1c2e90001d2881fMon, 10 Apr 2023 19:45:04 GMT

When it comes to image processing and machine learning, it's important to understand how computers represent and interpret visual data. In this post, we'll explore how images are represented as arrays of numerical values, and how these arrays can be used as inputs to neural network models.

To represent a digital image, computers use a 2D array of pixel values. Each pixel in the image is represented by a single value, which corresponds to the intensity or color of that pixel. For example, a grayscale image might use a single value to represent the intensity of each pixel, with lower values representing darker pixels and higher values representing lighter pixels. A color image, on the other hand, might use 3 values (one for each color channel: red, green, and blue) to represent the color of each pixel.

To use an image as input to a neural network model, we need to convert the 2D array of pixel values into a 1D array. This is often done using a process called flattening, where the 2D array is "unrolled" into a single, long list of pixel values.

Once the image has been flattened, it can be fed into the neural network model as a single input. The model will then process this input, using its learned patterns and relationships to make predictions or decisions based on the content of the image.

So, how do neural network models "see" and understand images? Essentially, they learn to recognize patterns and features in the pixel values, using these patterns to make predictions or decisions. For example, a model trained to classify images of animals might learn to recognize the shape of ears, noses, and paws in order to differentiate between different types of animals.

In summary, digital images are represented as arrays of pixel values, which can be flattened and used as input to neural network models. These models "see" images by learning to recognize patterns and features in the pixel values, using these patterns to make predictions or decisions.

I hope this post has provided you with some useful and educational information on how computers "see".

See ya in the next blog! 👀

]]>
<![CDATA[Understand Mathematics With The Help of Programming. Translated Mathematical Notations to JavaScript Code.]]>As a self-taught programmer, reading academic papers can be intimidating. However, understanding mathematical notation is essential for many fields, including computer science. That's why I've created this guide to help developers to understand mathematics better by translating it and comparing it to JavaScript code.

One thing

]]>
https://harduex.com/blog/understand-mathematics-with-programming/64345eaef1c2e90001d2881dFri, 06 Jan 2023 22:20:27 GMT

As a self-taught programmer, reading academic papers can be intimidating. However, understanding mathematical notation is essential for many fields, including computer science. That's why I've created this guide to help developers to understand mathematics better by translating it and comparing it to JavaScript code.

One thing to keep in mind when working with math notation is that different symbols can mean different things depending on the context and field of study. It's also important to note that there are several conventions for naming variables, such as using italic lowercase letters for scalars, bold lowercase letters for vectors, and bold uppercase letters for matrices.

In terms of equalities and inequalities, the equals sign = is used for equality, the symbol is used for inequality, and the symbol is used for approximately equal to. The := symbol is used for definition, such as defining a variable or function. In JavaScript, we can use the === and !== operators to check for equality and inequality, respectively. We can also use a function like almostEqual to check for approximately equal values.

When working with square roots and complex numbers, we use the symbol for square roots and the i symbol to represent the imaginary number. In JavaScript, we can use the Math.sqrt function to calculate square roots and represent complex numbers using objects with real and imaginary properties.

Dot and cross products are commonly used in math, and they can be represented using the ·, ×, and symbols. In JavaScript, we can use the dot and cross functions from the gl-vec3 library to calculate these products.

Summation is represented using the Σ symbol, and products of sequences are represented using the Π symbol. These operations can be implemented in JavaScript using loops to iterate over the elements in a sequence and perform the appropriate operation.

Other commonly used symbols in math include the || pipes for absolute value, the hat â symbol for unit vectors, and the and symbols for "element of" and "not an element of", respectively. These concepts can be represented in JavaScript using functions or built-in methods like Math.abs and the in operator.

Functions are a crucial part of math and can be represented using the ƒ symbol. Piecewise functions, which are functions defined using different formulas for different ranges of input, can be represented using the "piecewise" keyword. In JavaScript, we can use functions to represent these concepts and use conditional statements to handle different ranges of input.

There are many common functions used in math, such as trigonometric functions and logarithmic functions, which can be represented using JavaScript's built-in Math object. Function notation can also be represented using the and symbols, and derivatives can be represented using the prime symbol. These concepts can be implemented in JavaScript using functions and the derivative function.

Other commonly used symbols in math include the and symbols for floor and ceiling, respectively, and various arrow symbols for different types of implications and equalities. These concepts can be represented in JavaScript using the Math.floor and Math.ceil functions and conditional statements.

To give you a better idea of how math notation can be translated into JavaScript code, let's look at some specific examples

One common math concept is the dot product of two vectors. In math notation, the dot product is represented using the · symbol, like so:

a · b = c

In JavaScript, we can use the dot function from the gl-vec3 library to calculate the dot product of two vectors:

const vec3 = require('gl-vec3'); 

const a = [1, 2, 3]; 
const b = [4, 5, 6]; 
const c = vec3.dot(a, b); 

console.log(c); // Outputs 32

Another common math concept is the cross product of two vectors. In math notation, the cross product is represented using the × symbol, like so:

a × b = c

In JavaScript, we can use the cross function from the gl-vec3 library to calculate the cross product of two vectors:

const vec3 = require('gl-vec3');

const a = [1, 2, 3]; 
const b = [4, 5, 6]; 
const c = vec3.cross(a, b); 

console.log(c); // Outputs [-3, 6, -3]

Summation is another common operation in math, and it is represented using the Σ symbol. In JavaScript, we can use a loop to iterate over the elements in a sequence and perform the summation operation:

const sequence = [1, 2, 3, 4, 5];
let sum = 0;

for (const element of sequence) {
  sum += element;
}

console.log(sum); // Outputs 15

The absolute value of a number is represented using the || pipes symbol in math. In JavaScript, we can use the Math.abs function to calculate the absolute value of a number:

const number = -5;
const absoluteValue = Math.abs(number);

console.log(absoluteValue); // Outputs 5

These are just a few examples of how math notation can be translated into JavaScript code. By using programming as a different point of view to understand math, we can see how math concepts are applied in a more concrete way and test out different scenarios to see how they affect the result.

Here is a great Github Repository called math-as-code which is a big cheat-sheet for mathematical notation in code form with a plenty of examples!

Happy Calculating!

]]>
<![CDATA[What is the /etc/hosts file?]]>The /etc/hosts file is simply a plain text system file that allows you to map hostnames to IP addresses on your computer. It can be especially useful when you're working on a website or server and need to test it on your local machine before it goes

]]>
https://harduex.com/blog/etc-hosts-file/64345eaef1c2e90001d28824Tue, 27 Dec 2022 16:49:55 GMT

The /etc/hosts file is simply a plain text system file that allows you to map hostnames to IP addresses on your computer. It can be especially useful when you're working on a website or server and need to test it on your local machine before it goes live, or when you want to access a specific server within your network by its hostname rather than its IP address.

To create or edit the /etc/hosts file on a Linux, Unix, or MacOS system, you will need to use a text editor with root privileges.

For example, to create or edit the /etc/hosts file using the nano editor, you would open the terminal and enter the following command:

sudo nano /etc/hosts

This will open the /etc/hosts file in the nano editor, and you can then make any necessary changes.

On a Windows system, you can create or edit the C:\Windows\System32\drivers\etc\hosts file using a text editor such as Notepad or WordPad. To open the file in Notepad, you will need to run the program as an administrator. To do this, right-click on the Notepad icon and select "Run as administrator" from the context menu.

It's important to note that the /etc/hosts file is a system file, and making changes to it should be done carefully. It's a good idea to make a backup of the file before making any changes, and to be sure to follow the correct syntax when adding new entries.

Here are some examples of how you might use the /etc/hosts file:

# Test a website on your local machine before it goes live
127.0.0.1 example.com

# Access a specific server within your network by it's hostname
192.168.1.100 fileserver

In these examples, we've created two entries in the /etc/hosts file:

  • The first entry maps the hostname "example.com" to the local IP address "127.0.0.1". This allows you to test the website on your local machine before it goes live.
  • The second entry maps the hostname "fileserver" to the IP address "192.168.1.100". This allows you to access the file server on your network using the hostname "fileserver" instead of the IP address "192.168.1.100".

It's important to note that the /etc/hosts file is used as a backup when a name server is not available. When you are connected to the internet, your computer will typically use a name server to resolve hostnames to IP addresses. However, if the name server is unavailable or if you are working offline, the /etc/hosts file will be used to resolve hostnames. This is why it's a good idea to keep the /etc/hosts file up to date and accurate.

In order for the changes you make to the /etc/hosts file to take effect, you will need to restart your network. On a Linux system, this can be done using the command /etc/rc.d/init.d/network restart. This will reset the network interfaces and apply the changes you have made to the /etc/hosts file.

]]>
<![CDATA[Breathe Your Way to Better Health: The Wonders of the Wim Hof Method]]>https://harduex.com/blog/breathe-your-way-to-better-health-the-wonders-of-the-wim-hof-method-2/64345eaef1c2e90001d28823Tue, 27 Dec 2022 15:53:18 GMT

Today I will talk about the Wim Hof Method breathing technique, which is a way to use your breath to improve your overall health and well-being.

Why we breathe?

Our bodies are constantly using oxygen to produce energy, and the amount of oxygen we inhale through our breathing directly influences the amount of energy that is released into our body cells. On a molecular level, this happens through various chemical and physiological processes.

Breathing is an unconscious process that is regulated by our autonomic nervous system, so we don't have to think about it all the time. However, it's also something that we can consciously control and influence. In fact, the way we breathe can have a big impact on the chemical and physiological activities in our body.

This is where the Wim Hof Method comes in. Wim Hof is a world-renowned expert on breathing and has developed special breathing exercises that keep his body in optimal condition and give him complete control in even the most extreme situations. His method is based on deep inhaling and exhaling without any force, and he has found that it can have numerous benefits for the body and mind.

Now, you might be wondering how you can try the Wim Hof Method for yourself. It's actually very simple and easy to do. All you need to do is follow these steps:

1. Get comfortable

Find a comfortable position to sit or lie down in, making sure you can expand your lungs freely without feeling any constriction.

2. 30-40 deep breaths

Close your eyes and try to clear your mind. Focus on your breath and try to fully connect with it. Inhale deeply through the nose or mouth, and exhale unforced through the mouth. Repeat this 30 to 40 times in short, powerful bursts. You may experience light-headedness and tingling sensations in your fingers and feet, which are completely harmless.

3. The hold

After the last exhalation, inhale one final time as deeply as you can, then let the air out and stop breathing. Hold until you feel the urge to breathe again.

4. Recovery breath

When you feel the urge to breathe again, take a big breath to fill your lungs and hold it for about 15 seconds before exhaling. This completes one round of the Wim Hof Method. You can repeat this cycle 3-4 times without taking a break in between.

Once you've finished the breathing exercise, take some time to relax and enjoy the calm state that it brings. This can be a great time to meditate as well.

If you're having trouble maintaining a rhythm or pace during your Wim Hof Method breathing sessions, you can use the Breathing Bubble, which is an audiovisual guide that helps you stay on track. Simply watch the bubble as it expands and contracts, and follow along with your breath. You'll hear Wim breathe alongside you, and the background sounds will help you tune out your surroundings and focus on nothing but your breath.

I hope you give the Wim Hof Method a try and see the benefits for yourself. Remember to always practice in a safe and comfortable environment, and never do it while driving or near water pools.

Happy breathing!

]]>
<![CDATA[The power of cold showers]]>Cold showers have a reputation for being uncomfortable and unpleasant, but they can also have numerous benefits for both the body and the mind. Here are a few reasons why you might want to consider incorporating cold showers into your daily routine!

Improved circulation

Cold water can stimulate blood flow

]]>
https://harduex.com/blog/the-power-of-cold-showers/64345eaef1c2e90001d28820Sun, 25 Dec 2022 13:34:47 GMT

Cold showers have a reputation for being uncomfortable and unpleasant, but they can also have numerous benefits for both the body and the mind. Here are a few reasons why you might want to consider incorporating cold showers into your daily routine!

Improved circulation

Cold water can stimulate blood flow and improve circulation, which can help to flush out toxins and improve the overall health of your skin.

Increased energy

Cold water in the morning can act as a natural pick-me-up, providing a burst of energy and helping you to feel more alert and awake.

Stress relief

Cold water can have a calming effect on the body, helping to reduce stress and tension. It can also help to improve mood and mental clarity.

Improved immune system

Cold water can stimulate the immune system, helping to boost your body's natural defenses against illness.

Increased strength and endurance

Cold water can help to improve physical performance by reducing inflammation and increasing muscle strength and endurance.

So, how do you go about incorporating cold showers into your routine?

Start by taking a warm shower as you normally would, and then gradually reduce the temperature until you reach a level of cold enough that you start to feel uncomfortable. Then, stay underneath the water from 30 seconds as beginner up to 1-2 minutes as you get used to it. Don't forget to take deeper contolled breaths to calm your heartbeat.

You can also try alternating between warm and cold water, starting with warm and then switching to cold for 30 seconds to a minute before switching back to warm.

It's important to listen to your body and be mindful of your own limits. If you're not used to cold showers, it's best to start slowly and gradually increase the duration and intensity as your body becomes accustomed to the cold.

Overall, the power of cold showers lies in their ability to improve physical and mental health, boost energy and mood, and stimulate the immune system. If you're looking for a natural way to improve your overall well-being, give cold showers a try!

]]>
<![CDATA[Dockerfile vs docker-compose.yml: Understanding the Differences]]>https://harduex.com/blog/dockerfile-vs-docker-compose/64345eaef1c2e90001d2881eThu, 22 Dec 2022 11:41:06 GMT

Docker is a tool that helps you package and deploy applications easily. It uses two main files to manage Docker containers: the Dockerfile and the docker-compose.yml. These files are both important, but they serve different purposes.

Let's start with the Dockerfile

Think of it as a set of instructions for building a Docker image. A Docker image is like a blueprint for a container, which is an isolated environment that runs your application. You can think of a Dockerfile as a recipe for making a Docker image. It tells Docker what base image to use (e.g., Ubuntu), what dependencies to install (e.g., Apache, PHP), and any additional configuration or setup that needs to be done (e.g., copying files, setting environment variables).

Here's an example of a simple Dockerfile:

FROM ubuntu:20.04

RUN apt-get update && apt-get install -y apache2

COPY index.html /var/www/html/

EXPOSE 80

CMD ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"]

This Dockerfile uses the Ubuntu 20.04 base image and installs Apache. It then copies an HTML file (index.html) to the Apache web root directory and exposes port 80. Finally, it starts Apache in the foreground.

Now let's talk about the docker-compose.yml file

This file is used to define and run multi-container Docker applications. A multi-container Docker application is a group of interconnected containers that work together to run a complete application.

Here's an example of a docker-compose.yml file:

version: '3'
services:
  web:
    build: .
    ports:
      - "80:80"
  db:
    image: mysql:5.7
    environment:
      MYSQL_ROOT_PASSWORD: password
      MYSQL_DATABASE: my_database

This docker-compose.yml file defines two services: "web" and "db". The "web" service uses the Docker image built from the current directory (using the instructions in the Dockerfile) and exposes port 80. The "db" service uses the MySQL 5.7 image and sets some environment variables.

To summarize, the Dockerfile is used to build a single Docker image, while the docker-compose.yml is used to define and run multi-container Docker applications. They are both useful in different ways and can help you take full advantage of Docker's containerization capabilities.

Keep the containers up and running!

]]>
<![CDATA[Become a Google Search Expert Using Google Dorks]]>https://harduex.com/blog/become-a-google-search-expert-with-these-advanced-techniques/64345eaef1c2e90001d2881cWed, 21 Dec 2022 17:57:16 GMT

Google Dorks are advanced search queries that can help you find specific, hard-to-access information on the internet. By using specific keywords and operators, you can find easily exactly what you're looking for and also information that may not be easily discoverable through normal search methods.

To use Google Dorks, you need to enter specific keywords or phrases into the search bar along with certain operators or modifiers. These operators and modifiers allow you to specify the type of information you're looking for. For example, you can use the site: operator to search for information on a specific website, or the filetype: operator to search for a specific type of file. You can also use the intext: operator to search for specific words or phrases within the body of a webpage.

For example, you can use the search site:example.com intext:keyword to find pages on the website example.com that contain the word keyword in the body of the page.

In the other hand, you can use filetype:pdf keyword to find PDF files containing the word keyword

The inurl: operator allows you to search for pages with a specific word in the URL.

By becoming proficient in the use of Google Dorks, you can become a true expert in finding the information you need on the internet. However, it is important to use this tool responsibly and respect the privacy of others.

If you are interested to learn more about google dorks, here is a huge Google Dorks List.

But these Google Dorks are not the only way to rank you up with the best of the Google experts when it comes to the art of search. There are a ton of other expert tips and tricks that can help you find exactly what you're looking for on the internet.

Here is a list of 10 tips that will help you become a Google search pro in no time

1. Use explicit phrases

To search for an exact phrase, enclose it in double quotes. For example, searching for "internet marketing" will return results that contain that exact phrase, rather than results that contain each word individually.

2. Exclude unwanted words

If you want to exclude certain words from your search results, use the "-" sign in front of the word you want to exclude. For example, searching for "internet marketing -advertising" will return results that contain the phrase "internet marketing", but exclude any results that also contain the word "advertising".

3. Use similar words and synonyms

To include results that contain similar words or synonyms, use the "~" symbol in front of the word. For example, searching for "internet marketing" ~professional will return results that contain the phrase "internet marketing" as well as results that contain similar words or synonyms, such as "digital marketing" or "online marketing".

4. Use "OR" to broaden your search

By default, Google will return results that contain all the terms specified in your search. To broaden your search and include any one of multiple terms, use the "OR" operator (note: it must be capitalized). For example, searching for "internet marketing OR advertising" will return results that contain either "internet marketing" or "advertising".

5. Look up phone numbers

To find information about a phone number, use the "phonebook:" operator. For example, searching for phonebook:617-555-1212 will return information about the phone number, including the location and possibly the name of the person or business associated with it.

6. Find out the area code for a phone number

To quickly find out the location of a phone number based on its area code, simply enter the 3-digit area code into the search bar. For example, searching for 617 will return information about the area code and its location.

7. Search for numeric ranges

To search for results that contain a range of numbers, use the X..Y operator (where X and Y are the numbers at either end of the range). This can be useful for searching for years, prices, or other numerical ranges. For example, searching for "president 1940..1950" will return results about presidents who served during that time period.

8. Look up stock prices

To find current financial information and a thumbnail chart for a particular stock, enter the ticker symbol as your search term. For example, searching for GOOG will return information about Google's stock.

9. Use Google as a calculator

To perform a quick calculation, simply enter your expression into the search bar. Google will return the result of the calculation. For example, searching for 48512 * 1.02 will return the result of that calculation.

10. Look up word definitions

To quickly find the definition of a word or phrase, use the "define:" command. For example, searching for "define:plethora" will return the definition of the word "plethora"

In conclusion, Google Dorks and other search tips and tricks can help you find specific information on the internet more efficiently. By learning and using these advanced search queries, operators, and other techniques, you can become a true expert in finding what you're looking for online. However, it's important to always use these tools responsibly and respect the privacy of others. Whether you're looking for information on a specific website, a particular document type, or just trying to find the definition of a word, these tips and tricks will help you find what you need more easily.

Go search for something!

Become a Google Search Expert Using Google Dorks
]]>
<![CDATA[How big companies creates and uses shadow profiles to know everything about you?]]>Have you ever noticed that the ads you see online seem to be tailored specifically to your interests? It's not just a coincidence – it's likely that a company has created a shadow profile about you.

What is a shadow profile

We wanted to display the concept of a person thinking. We entered a dark room, spent a long time adjusting the light, and came up with this image.
Photo by Ben Sweet / Unsplash
]]>
https://harduex.com/blog/how-big-companies-creates-and-uses-shadow-profiles-to-know-everything-about-you/64345eaef1c2e90001d2880bTue, 20 Dec 2022 19:51:13 GMT

Have you ever noticed that the ads you see online seem to be tailored specifically to your interests? It's not just a coincidence – it's likely that a company has created a shadow profile about you.

What is a shadow profile

How big companies creates and uses shadow profiles to know everything about you?
Photo by Ben Sweet / Unsplash

A shadow profile is a detailed, behind-the-scenes profile that companies build about you using data they've collected from a variety of sources, including your online activity, social media accounts, and even your interactions with other people. This information is then analyzed and used to create a comprehensive picture of who you are and what you do. Shadow profiles have a history dating back to 2012, when a data breach of over six million Facebook users' personal information revealed the existence of shadow profiles. These profiles are created using data collected from various sources, such as online activity, social media accounts, and interactions with other people. The data is analyzed and used to create a comprehensive picture of the individual, including their interests, preferences, habits, and relationships.

How do big companies create shadow profiles?

How big companies creates and uses shadow profiles to know everything about you?
Photo by Scott Graham / Unsplash

Big companies create shadow profiles by collecting data about you from a variety of sources. This can include data that you actively provide, such as when you create an account or make a purchase. It can also include data that is passively collected, such as your browsing history or location data. Once this data is collected, it is combined and analyzed to create a shadow profile. This profile can include information about your interests, preferences, and habits, as well as your relationships and connections with other people.

How do these companies use your shadow profile?

How big companies creates and uses shadow profiles to know everything about you?
Photo by Warren Wong / Unsplash

Big companies use shadow profiles for a variety of purposes. One common use is for targeted advertising. By analyzing your shadow profile, companies can create ads that are tailored specifically to your interests and preferences. This can make the ads more effective and increase the chances that you will click on them. Shadow profiles can also be used for research and development. By understanding your preferences and habits, companies can create products and services that are more likely to appeal to you. Finally, shadow profiles can be used for security purposes. By analyzing your online activity, companies can detect patterns that may indicate suspicious behavior or potential threats.

What can you do to protect yourself?

How big companies creates and uses shadow profiles to know everything about you?
Photo by Franck / Unsplash

While it is not possible to completely opt out of having a shadow profile, there are steps you can take to protect your privacy. One option is to use privacy-focused browsers such as brave browser and search engines such as searX that do not track your activity. You can also use privacy-enhancing tools such as virtual private networks (VPNs) to encrypt your internet connection and prevent your data from being collected. Another option is to be selective about the information you share online. Consider whether you really need to provide certain pieces of information, such as your phone number or home address, when signing up for accounts or making purchases. You can also use privacy settings on social media platforms to control who can see your activity and what information is visible to others.

Conclusion

Shadow profiles are a powerful tool that big companies use to gather information about you and your habits. While it is not possible to completely opt out of having a shadow profile, there are steps you can take to protect your privacy and limit the amount of data that is collected about you. By understanding how shadow profiles are created and used, you can make informed decisions about the information you share and take control of your online privacy.

]]>