teleren/devto huggingface dataset:
Visualizing My Imposter Syndrome
Tags: beginners, career, productivity, learning
Published: 2020-08-27 06:18:50

Imposter syndrome is self-doubt, insecurity, and a lack of confidence to the point of feeling that I’m a fraud, having gotten to the point where I am through sheer luck, and soon to be found out.

The real downer about feeling this way is that I can feel it despite all the evidence counter to it. 

And it’s not just me; it seems to be a common occurrence among my fellow software engineers. I think anyone going through change is likely to feel this way at least once in their life.

##**What I’ve Learned**
Through my own experience, some coaching and mentorship, and conversations with others on this topic, I now understand that imposter syndrome can be cyclical for a lot of us. It comes and goes throughout our lives, more frequent for some and less for others. And there are a ton of strategies and tactics circulating the interwebs on ways to cope—not covering those here, sorry.

I also learned to pay more considerable attention to my confidence and moments of strength. I do have moments where I feel very confident, I do have it figured out, and I do deserve to be here. I know others can feel this way, as well. 

And I’ve learned to visualize this cycle. I’m a creative who likes to distill things down to images; it makes things easier for me to wrap my head around, making it easier for me to explain things to others. For my imposter syndrome, I visualize my cycles as a sine wave.

##**Imposter Syndrome Sine Wave**
Peaks and troughs represent confidence and imposter syndrome. I cycle between them over time, sometimes predictably. 

Diagram A is how I visualize this. I keep this visual in my head and call upon it when I self-reflect and self-survey. And I acknowledge where I think I am on this wave.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/3evovxvae18k7raevis1.png)

I think this visual is also a measure of how in or out of my comfort zone I might be. When I’m at a peak, I’m usually doing what I know, what I’m good at, and doing things my way. And when I’m in the trough, I’m generally going through change, learning something new, or doing things someone else's way.

Another thing I look at when considering where I am on this wave is whether or not the peaks and troughs are higher or lower than previous ones. Or more accurately, am I in my comfort zone and stagnating or regressing? Or, am I getting outside of my comfort zone and growing? 

Consider diagram B.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/bp0bgmzo1l6n00f15puq.png)

If I am embracing my confidence and impostor syndrome, and if I’m getting outside of my comfort zone and learning new things, today’s trough (point of imposter syndrome) may actually be elevated and higher than yesterday’s peak (point of confidence). Yup, I said it—if you are growing, what appear to be low points today are you existing on a new and elevated plane!

This visual, and what it implies, makes me feel damn good.

-----
[Follow me on Twitter](https://twitter.com/RickLuevanos) - It's the best way to learn about any new content I publish.
How to Automate Manual Steps after SSH
Tags: linux, django
Published: 2020-08-27 06:13:41

I recently worked on a Django web application which was deployed on a Linux Server with SSH access. Deployments
were done manually and the CI/CD pipeline was still in planning.

We had to perform these tasks every time to deploy the latest changes.

- SSH into the server
- Goto directory where the code is present
- Activate Virtual Environment
- Pull the latest changes on the current branch using Git
- Install any newly added libraries from requirements.txt
- Run migrations for the database
- Run command to generate static files
- Restart Nginx and Supervisor

I found the process repetitive and researched on whether it was possible to automate the commands I need to run
after SSHing into the server.
```shell
ssh -i "webapp.pem" ubuntu@example.com
```

Turns out, we can write a shell script to automate the task.
## Step 1:
Create a new shell script file `deploy.sh` with the following content. Modify it to point to your PEM file, username, and IP address.
```shell
#!/bin/bash
ssh -i "webapp.pem" ubuntu@example.com << EOF
    echo "Hello World"
EOF
```

The above code prints 'Hello World' on the remote server.

## Step 2:
You can write any shell commands between the two `EOF` and it will be run on the remote server.
Add the sequence of commands you currently run manually on the server to this script.

For the Django project, I wrote the following commands that pulls the latest code and restarts the services.
```python
#!/bin/bash
ssh -i "webapp.pem" ubuntu@example.com << EOF
cd /var/www/webapp/

echo "Switching to www-data user"
sudo -Hu www-data bash

echo "Pulling Latest Changes"
git pull

echo "Activating Virtual Environment"
source venv/bin/activate

echo "Installing any new libraries"
pip install -r requirements.txt

echo "Migrating Database"
python manage.py migrate

echo "Returning back to Ubuntu user"
exit

echo "Restarting Supervisor and Nginx"
sudo service supervisor restart
sudo service nginx restart

echo "Deployment Finished"
EOF
```

## Step 3:
Run the below command to change permissions of the script and make it executable.
```shell
chmod a+x deploy.sh
```

## Step 4:
Run the script and it will perform all the deployment.
```shell
./deploy.sh
```

This simple script has saved me a lot of time until the CI/CD process is in place.

## Connect
If you enjoyed this blog post, feel free to connect with me on [Twitter](https://twitter.com/amitness) where I share new blog posts every week.
Mconnect Google Rich Snippets Extension for Magento 2
Published: 2020-08-27 06:09:37

The world around us is evolving and in this digital age, the online shopping has also evolved. Any person on the internet can shop any product in just a few clicks. And the search engines like Google provide an efficient way for customers to find and shop online. There is no better search engine than Google because it alone performs 5.5 billion search queries in a day. But you must be on the top of the SERPs of Google in your niche for taking full benefit. Google search engine crawlers or bots indexes your site and fetches information to show on SERPs. And there are rich snippets that will display meaningful information in the most structured way. Rich snippets like price, rating, availability, and others encourage customers to visit your site. So, it is essential that you add such rich snippet/structured data on your store’s most product pages.

Mconnect Google Rich Snippet Extension for Magento 2 allows store owners to add Google rich snippets, which are compliant to schema.org guidelines and standards. These rich snippets display all the necessary information about products such as reviews, ratings, price, availability, etc. in Google SERPs.

Following are the rich snippets, a store owner can implement in their Magento 2 store. 

Breadcrumbs
Site Name
Product Availability
Search Box
Local Business 
Pinterest Rich Pins
Organizational Schema
Open Graph for Facebook Sharing
Twitter Card for Sharing
Contact us for More Snippets

The extension will dynamically generate information without any need for coding. You just have to enter the necessary business details from the backend for the product/page of your store. This will not only help the Google search engine bots but also help customers to get extra information while still being on the search result pages. Also, the breadcrumbs provide clarity and hierarchical navigation for the store to be more user-friendly.
 
Features of Mconnect Google Rich Snippet Extension for Magento 2:

The extension will display the necessary structured data/rich snippet on SERPs.

It will help drive customers to your store from search engines uplift the conversion.

The extension will highlight your product pages on the search results.

The extension allows you to set up 9 different rich snippets into your Magento 2 store.

Using the extension, you can boost your website’s credibility and CTR by 30%.

The extension helps you to get more exposure for your business with organizational snippets.

It has social media snippets for Twitter, Pinterest, and Facebook.

The rich snippets and structured data affect your ranking on search engines and enhance SEO.

The breadcrumbs help you improve user-friendliness and store navigation.

The admin has to fill in necessary detail in the backend and does not need to do any coding. 

For more such Magento 2 Extensions visit Mconnectmedia.com

Download now: https://www.mconnectmedia.com/advance-rich-snippets-m2.html
Mconnect Gift Card and Certificate Extension for Magento 2
Published: 2020-08-27 05:51:59

Gift card feature works no matter you have an online or offline store. It is noticeable for eCommerce stores because it is a well-known fact that neither recipient nor purchaser has to go outside for the exchange of a gift card. It is one powerful way to boost your sales and conversions. According to a study, 80% of the shoppers purchase one gift card during the holiday seasons and 60% of them spend on shopping more than the value of the gift card. Therefore, it’s now time for you to incorporate such an uplifting tactic to your store.

With the help of a Mconnect Gift Card and Certificate Extension for your Magento 2 store, you can strengthen your store by facilitating your customers to buy gift cards and certificates. Even the extension allows them to send those gift cards to their partners, relatives, or co-workers through email or mail station. Once anyone purchases a gift card, the extension will send a unique code with a message that will be sent to the beneficiary as well. Anyone, existing customers as well as guest customers, can buy gift cards and certificates and send them to their friends. 

Features of Mconnect Gift Card and Certificate Extension for Magento 2:

Options to create various gift cards and certificates from the backend.

Option to send the gift card using email or mail station. 

The extension has advanced pricing choices.

Customers can apply a gift card on the cart page of your Magento store.

The admin can add as many cards as he wishes.

Option to configure the cards as per the requirements
Backend option to manage all the purchased cards and certificates.

The extension comes with a 35 free email template design for gift cards.

It allows you to create custom gift cards and certificate templates and send them to your customers. 

For more such Magento 2 Extensions visit Mconnectmedia.com

Download now: https://www.mconnectmedia.com/gift-card-magento-2.html
Svelte Reactivity and Stores
Tags: javascript, webdev, svelte
Published: 2020-08-27 05:42:25

I don't code in Svelte for my day job, so I only get to work with it on my hobby projects. Like most people, I only occasionally have time to work on them. I will have an ongoing project that I just randomly take a hiatus from because life, and then a month/a few months would pass by (or maybe even a year later), I get back to work on it.

Svelte is an intuitive framework and once you learn the basics, it's easy to navigate a Svelte codebase and get things done. Occasionally there are quirks that catch me off-guard, though.

One of the things that have caught me multiple times now, after taking a break and coming back to a project, is how Svelte handles reactivity with its Stores.

Let's say you have some Writable Stores like this, set up in a `stores.js` file:

```js
import { writable } from 'svelte/store';

export const status_message = writable('Howdy');
export const game_state = writable({});
export const cards = writable([]);
```

You use these stores normally in your other Svelte components. So you have things like this:

```js
<script>
  import { status_message } from './stores';

  status_message.set('Hello!');
</script>

<div>{$status_message}</div>
```

All good so far. Let's say though in some cases you put an object or an array into a Writable Store, like the example above with `game_state` and `cards`. Because usually you intend to update only some subset of the fields within the object, you may write your code like this in a component that updates it:

```js
<script>
  import { game_state } from './stores';

  $game_state.current_turn = 2;
</script>

<div>Current turn: {$game_state.current_turn}</div>
```

And you'll find that `game_state` does not seem to be updated, even though you're using it as an Auto-subscribed Store by virtue of using `$`.

### You have to use `.set()`

The gotcha here is that reactivity is triggered by the `.set()` call, not simply the data in the Writable Store being updated. So the way to do something like the example above would be:

```js
<script>
  import { game_state } from './stores';

  $game_state.current_turn = 2;
  game_state.set($game_state);

  // Alternatively, use .update() instead of .set()
</script>

<div>Current turn: {$game_state.current_turn}</div>
```

When you think about the internal workings of Svelte, it makes sense; the specific functions of `.set()` or `.update()` on a Writable Store is what kicks off re-evaluation and reactivity based on the value of that store.

When I'm just coding though, I tend to think of a Store as simply a variable that can be accessed globally from anywhere in the frontend app and that changes to it immediately reflect everywhere else. Because of that, I tend to forget what I really should do to kick off a reactive update, especially when what's in the Store is an object or array.
Mconnect Flat Rate Shipping Per Product Extension for Magento 2
Published: 2020-08-27 05:35:17

Want a functionality to charge shipping fee per product basis? Shipping of products is one of the priority things for the success of your Magento store. As per the Businesswire study, 93% of online shoppers think that shipping methods are a vital part for positive shopping experience. Not adopting the best shipping methods in your store can impact the shopping experience of users as well as increase the cart abandonment rate. This will make your business suffer from potential losses, which you could have easily converted into revenue. One of the shipping methods you should adopt is a flat rate. But the disadvantage of using this method is that, it applies to the all products of your store. But what if you need a solution that charges shipping fees for specific products or categories of products. 

Mconnect Flat Rate Shipping Per Product Extension for Magento 2 provides you the facility to charge shipping fees based on order amount or per product. With this extension installed in your Magento 2 store, you can charge customers separately for each product. The extension will charge the shipping fee per product added to the cart. If any product does not have any shipping method marked while adding into the cart, the extension will charge the default shipping fee. The extension has the option to enable multiple Qty if any customers add the same product multiple times into the cart. It also has the option to set up free shipping for eligible orders that surpass the threshold amount. The admin of the store can restrict any country from ordering products on their store.

Features of the Mconnect Flat Rate Shipping Per Product Extension for Magento 2:

The extension allows you to set up flat rate shipping for specific products in your store.

Option to enable the multiple Qty if customers add the same product multiple times in the cart.

Option to charge default shipping rate for products not having any specific shipping method or defined with the shipping rate.
 
For each product in the cart, the admin can set up separate flat rate shipping.
Option to allow/restrict the shipping for a particular country.

Free shipping option when order total surpasses the threshold amount.

The extension works fine with all types of products.

Option to show a customized error message when the method is not available. 

For more such Magento 2 Extensions visit Mconnectmedia.com

Download now: https://www.mconnectmedia.com/flat-rate-shipping-per-product-magento2.html
Mconnect Featured Product Slider Extension for Magento 2
Published: 2020-08-27 05:15:49

Want to increase your sales figure high enough for the next quarter? The Magento store owners have one hell of a job. They have to make sure that the sales in their store are coming at a sustainable rate. Many times, you need to create hype around your brand or for certain products you wish to clear out the stock. But how would you tell that to your customers about those products you want to sell. Well, you need to feature those products on your store’s various pages. And for that, you need a powerful module integrated into your Magento 2 store.
Mconnect Featured Product Slider Extension for Magento 2 helps you to feature those special or normal products you want to see as a bestseller of your store or want to clear out the stock. Just select the products you want to feature and the extension will feature them on the various pages like homepage, CMS page, product listing pages, category pages, or any other page on your store. The admin can choose how many products to display in their Magento 2 store. The best feature of the extension is that it showcases the featured product in the slider. With many customization options, this extension will uplift the performance of your store.

Features of the Mconnect Featured Product Slider Extension for Magento 2:

Option to select what product you want to feature in your store.

The admin can set the desired number of products to display in featured slider.

Option to set number desired items in a row.

Enable/disable the featured products slider anytime.

Customize the width and min/max number of the slider images.

The extension is simple to configure and install.

For more such Magento 2 Extensions visit Mconnectmedia.com

Download now: https://www.mconnectmedia.com/featured-product-magento-2.html
Leetcode: Middle Node in Linked List
Tags: computerscience, cpp
Published: 2020-08-27 04:20:44

## Problem

> Given a non-empty, singly linked list with head node `head`, return a middle node of linked list.
>
> If there are two middle nodes, return the second middle node.

## Code

I came up with the following solution in C++ to the problem:

```c++
ListNode* middleNode(ListNode* head) {
  ListNode *fast = head, *slow = head;
  while (fast && fast->next) {
      fast = fast->next->next;
      slow = slow->next;
  }
  return slow;
}
```

​	The algorithm above uses two pointers, a `slow` pointer and a `fast` pointer. The `fast` pointer moves twice as fast as the `slow` pointer. Below I'll explain why the algorithm works.

## Explanation

​	The input we are given is a non-empty, singly linked list. We must show that the algorithm finds the middle node for all non-empty singly linked lists. A linked list can have an odd length or and even length. If the list has an odd length, that means there is exactly one node in the middle. If the list has an even length, then there are two nodes in the middle and we are required to return the second one.

​	Let's first consider the odd case. Let's assume there are `2m+1` nodes where `m` is a positive integer. Both pointers start at node `1`. After the first iteration, the `fast` pointer is at node `3` and the `slow` pointer is at node `2`. After the second iteration, the `fast` pointer is at node `5` and the `slow` pointer is at node `3`. After the third iteration, the `fast` pointer is at node `7` and the `slow` pointer is at node `4`. Let's place the values in a table to understand the trend.

| `fast` position | `slow` position | iteration |
| --------------- | --------------- | --------- |
| 1               | 1               | 0         |
| 3               | 2               | 1         |
| 5               | 3               | 2         |
| 7               | 4               | 3         |
| 9               | 5               | 4         |
| 11              | 6               | 5         |
| 13              | 7               | 6         |
| 15              | 8               | 7         |
| 17              | 9               | 8         |

​	If you notice, the `fast` pointer has position `2*(position of slow pointer) - 1`. Thus, when the `slow` pointer is at the middle of the list (position `m+1`) the `fast` pointer is at position `2*(m+1) - 1 = 2m + 1`. So, if the `fast` pointer moves at twice the speed of the `slow` pointer, then the `slow` pointer will point to the middle node by the time the `fast` pointer arrives at the end of the list. 

​	On a similar vein, we can prove that this algorithm works for an even length list. Let there be `2m` nodes. Since the pattern is the exact same, we determine that when the `slow` pointer arrives at the position `m+1` (the second middle node), the `fast` pointer is at position `2*(m+1) - 1 = 2m + 1`. However, since there are only `2m` positions, that means that the `fast` pointer has already finished traversing the entire list (`NULL`). Thus, the code above still works and the algorithm solves the problem.
Developer Dictionary - Boolean Operators & Logic Gates
Tags: beginners, computerscience, codenewbie, firstyearincode
Published: 2020-08-27 04:02:33

You may have seen 'boolean' as a type in programming languages. Boolean types hold the value `true` or `false`. You may have seen operators like `and`, `or`, `not` or `&&`, `||`, `!`. These all relate to boolean logic.
 
In software programs the boolean data type is primarily used with conditional statements (e.g. if statement). The program takes different actions depending on whether a boolean condition evaluates to true or false.

Boolean operators are implemented in all programming languages. Specialized scripting languages, shell script and database query language (SQL) also support boolean operators in some form.

The word 'boolean' comes from a person named George Boole, who defined this algebraic system of logic. We can understand the concept of boolean logic by studying the below truth tables for the various operators:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/akaocokryyxkupt4dy57.jpg)

For boolean operators the output or the result is solely based on the inputs. If we think of 1 as true  and 0 as false, these values make sense intuitively. Let's look at AND — true AND true is true but for all other combinations where one of the inputs is false, the output is false. This makes sense logically.
 
The logic is different for OR — the result is only false when both inputs are false. In all other cases, where there is at least one input that is true the result is true.
 
NAND means Not AND. The result is the inverse of the result column for the AND truth table above — true becomes false and false becomes true. That's all.

XOR stands for eXclusive OR. XOR is slightly different than any of the other operators — the result is only true when both inputs are different from each other. So if A is true and B is false or vise versa, the result is true. And if both A and B are the same — either both true or both false — then the result is false.

###Logic Gates

So what is this boolean logic good for? The truth tables for boolean operators are implemented into logic gates. A logic gate is an electronic device implementing a logical operation on one or more binary inputs that produces a single binary output. 

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/5ddk8hz7b4y583gim5cu.jpg)

Logic gates are combined to make logic circuits. Logic circuits such as arithmetic logic units (ALUs), computer memory, all the way up complete microprocessors (containing 100 million gates). Logic gates are fundamental building blocks of computer hardware.

Both web and mobile operating systems, as well as browsers and all other software programs we write ultimately execute on a processor of some computer consisting of integrated circuits composed on logic gates.

***

Now you know the concept of Boolean Logic and how it relates to computer hardware. You can start to see the connection between boolean operators in software programs with logic gates used to build computer hardware.