teleren/devto huggingface dataset:
Answer Questions to Win Prizes in Huawei Enterprise Forums
Tags: discuss
Published: 2019-05-13 09:26:19

---
title:  Answer Questions to Win Prizes in Huawei Enterprise Forums
published: true
tags: discuss
---


https://forum.huawei.com/enterprise/en/Activity-Answer-Questions-to-Win-Prizes-in-Huawei-Enterprise-Forums/thread/526971-100289
how to fix
Tags: replit, node
Published: 2019-05-13 08:54:31

---
title: how to fix 
published: true
tags: replit, nodejs
---

i want to only reverse word strings that are more than 5 letters but in my result even the three letter words are getting reversed, how do i fix this ?

{% replit @meeramenon07/MortifiedImaginaryTheories %}
Store Pickup for Magento 2
Published: 2019-05-13 08:04:32

---
title: Store Pickup for Magento 2
published: true
description: 
tags: 
---


<br>

<p>Magento 2 Store Pickup extension allows you to pick up Products you ordered online from the nearest Store. By adding Store Pickup as a shipping method, customers can select the nearest offline shop to collect their product and save shipping time and cost.</p>
<h3><b> Enable “Store Pickup” as Shipping Method</b></h3>
<p>Magento 2 Store Pickup extension allows your customers to choose “Store Pickup” as the shipping method. And also allows customers to:</p>
<ul>
<li>Select Nearest Shopo for  Collection</li>
<li>Set Date & time</li>
</ul>

<h3><b>Add Unlimited Store Locations</b></h3>
<p>By using this extension you can create multiple shops & outlets  and display them on guided Google Map. You can display locations on separate pages. Also, you can import locations from your Magento 1 shop with the following details:</p>
<ul>
<li>Shop Set Title and  URL Key</li>
<li>Assign To a Store View</li>
<li>Address and Description</li>
<li>Phone, Postcode and Zoom Level</li>
<li>City, Country and Region</li>

</ul>
<h3><b>Configuration Settings</b></h3>
<p>You can change these configuration settings from the Backend.</p>
<ul>
<li>Enable or Disable Functionality</li>
<li>Configure Meta Information</li>
<li>Add Image</li>
<li>Set Default Latitude and Longitude</li>
<li>Add Google Map API Key</li>
<li>Add Google Map Marker</li>
<li>Manage Footer Links</li>
<li>Set up a URL Identifier</li>

</ul>

<h3><b> Powerful Key Features</b></h3>
<ol>
<li>Allow users tio select "Pickup from Store" during Checkout</li>
<li>Allow them to select nearest Store, Date & Time  for Collection</li>
<li>Import Shops Data using CSV File</li>
<li>Bonus Store Locator Exteniosn Features</li>
<li>Dedicated Store Page to List Location on Google Maps</li>
<li>Seperate Landing Page for each Shop Location  to show Timetables and Products</li>
<li>Create Location Tags to let your customers  filter listings</li>

</ol>

<b> Complete Detail and Live Demo- https://marketplace.magento.com/fme-store-pickup.html </b>
<img src="https://thepracticaldev.s3.amazonaws.com/i/3dax4o8lgj31evz1b3oy.jpg" alt="magento 2 store pickup"/>

<img src="https://thepracticaldev.s3.amazonaws.com/i/ckdyqyrqke22hp5by2cx.jpg"/>

<img src="https://thepracticaldev.s3.amazonaws.com/i/j83dh4x5bi00mhmswzct.jpg"/>

<img src="https://thepracticaldev.s3.amazonaws.com/i/4wje837abck6hg5hoei8.jpg"/>
Awesome loading screen using only HTML & CSS
Tags: codepen, html, css, webdesign
Published: 2019-05-13 07:51:39

---
title: Awesome loading screen using only HTML & CSS
published: true
tags: codepen, html ,css ,webdesign 
---



<hr/>
<p>Source Code:</p>
{% codepen https://codepen.io/ahmadbassamemran/pen/zQKqba %}
<hr/>
[Do Not Forget To Like & Subscribe In The Channel:](https://www.youtube.com/AhmadEmran?sub_confirmation=1)
<hr/>

{% youtube __DTSJJLdpE %}
String Manipulation: Reverse a String in C#
Tags: csharp, tutorial, beginners
Published: 2019-06-18 15:18:03

---
title: String Manipulation: Reverse a String in C#
published: true
tags: csharp,tutorial,beginners
series: C# for Beginners
cover_image: https://wellsb.com/csharp/wp-content/uploads/sites/2/2019/03/beginners-reverse-string-featured-min.png
---

In this tutorial, we will write a string manipulation program to reverse any string in C#. Using a char array and helper methods, we will be able to print a string backwards. In previous tutorials, you have learned how to declare and initialize arrays and you know how to use loops to iterate through the elements of an array. We will build on these lessons and learn a useful technique for...

[Source](https://wellsb.com/csharp/beginners/string-manipulation-reverse-string-csharp/)
What’s new in Javascript?
Tags: javascript
Published: 2019-05-13 05:54:24

Some of the new features are still proposal / not compatible in all browsers. So if you are playing with the code, try to use Google Chrome.
And some of them may

##Private Fields

![img](https://i.imgur.com/PFMDvWE.png)
From the counterDemo class, the #counter value is private. If we try to access the #counter, then syntax error will be shown.

##Big Int Multiplication


![img](https://i.imgur.com/uYDeya9.png)

We can multiply 1234567890123456789n * 123n and obtain the correct value if we use BigInt.

##Array Flat


![img](https://i.imgur.com/lonj6pv.png)
Array.flat will convert nested array items to a flat list. By default, it will convert 1 level deep. You can use

const array = [ 1, [2 , [3 , 4 , [5 , 6 ] ]]]
array.flat(Infinity);
The output will be 1 2 3 4 5 6. if we use Infinity it will recursively convert to a flat list.

##Object.fromEntries


![img](https://i.imgur.com/6mijw6Z.png)

We have use Object.entries in many cases. It will return an array from an object. Similarly, we can use the Object.fromEntries that will return the object from an array.
Explain Javascript Async/Sync like I am Five
Tags: javascript, webdev, beginners, node
Published: 2019-05-13 05:34:16

---
title: Explain Javascript Async/Sync like I am Five
published: true
description: Can Anybody explain Javascript ASync/Sync with an example?
tags: javascript, webdev, beginners, nodejs
---

Sometimes, it's hard to comprehend the difference between the two. So Explain it like I am Five.
React Native Full Page Width Swipeable Horizontal ScrollView
Tags: reactnative, android, javascript, ios
Published: 2019-05-13 04:54:00

---
title: React Native Full Page Width Swipeable Horizontal ScrollView
published: true
description: React Native Full Page Width Swipeable Horizontal ScrollView
tags: #reactnative #android #js #ios
---

Source : <a href="https://www.skptricks.com/2019/05/react-native-full-width-horizontal-scrollview.html">React Native Full Page Width Swipeable Horizontal ScrollView </a>

This tutorial explains how to create react native full page width swipeable horizontal scrollView layout for android or ios device. In this example we have created simple swipeable horizontal view and when you can perform swipe left and right operation in your android or iOS device using below code, then you will find below observation:
1. when user swipe left in the device, then it will navigate user to next page or view.
2. when user swipe right in the device, then it will navigate user to previous page or view.

Basically, react native ScrollView component provides a very special property named as pagingEnabled = { boolean }  , in which Boolean can have one of two values either true  or false . pagingEnabled  allows you to stop at every single view during scrolling.

<img src="https://3.bp.blogspot.com/-ey0ntuJOwDs/XNj0QghRLII/AAAAAAAACy0/EfxKPtIS1F088rirKUqeMdjRJ5xqrjEpACLcBGAs/s400/react-native-full-width-horizontal-scrollview.jpg" alt="React Native Full Page Width Swipeable Horizontal ScrollView" />

<a href="https://www.skptricks.com/2019/05/react-native-full-width-horizontal-scrollview.html">Click here to read more</a>
Adding command aliases to PowerShell
Tags: powershell, alias
Published: 2019-05-16 03:30:25

---
title: Adding command aliases to PowerShell
published: true
tags: powershell,alias
cover_image: https://user-images.githubusercontent.com/1228996/57646611-96591a00-7586-11e9-8b7a-68f7736e2c28.png
canonical_url: https://michaeljolley.com/posts/adding-command-aliases-to-power-shell/
---

If you’re like me, there are certain commands that get run repeatedly throughout your day. Between `git checkout`, `docker {whatever}` and navigating to frequent paths with `cd`, I’ve been wondering how much time I could save by shortening these commands and parameters.

I was actually a little jealous of my friends using bash with their nice aliases, so I went hunting for a way to alias in PowerShell. Turns out, it’s really simple!

<!--more-->
## This seat’s taken

PowerShell has built in commands that we don’t want to step on. I won’t list them all (there are MANY), but if you get something wildly unexpected from your aliases then you can Google them.

## So show me already

Okay, okay. So first, let’s create a function in a `.ps1` file.

```
function goGoGadgetGitStatus {
  git status
}
```

The function above simply calls `git status`. You can then setup an alias to call that function.

```
Set-Alias gs goGoGadgetGitStatus
```

Then from your PowerShell console you can type `gs` and it will run `git status`.

That’s a very simplistic example but gives you an idea of what’s possible.

## What about parameters

Great question! We can define parameters in the function and then pass them in.

```
function goGoGadgetGit {
  Param(
    [Parameter(Mandatory = $true, Position = 0)]
    [String]
    $Cmd,
      
    [Parameter(Mandatory = $false, ValueFromRemainingArguments = $true)]
    [String[]]
    $Params
  )

  Switch ($Cmd) 
  {
    # status
    's' { git status $Params }
    # branch
    'c' { git checkout $Params }
  }
}
Set-Alias g goGoGadgetGit
```

Now in our console we can call `g s` to get `git status` or `g c master` to execute `git checkout master`.

I’m not going to go into detail on how to write PowerShell functions or options for parameters. There are plenty of resources out there for the two. But hopefully this showed you a rudimentary way to set up command aliases for PowerShell. Just add the code to your PowerShell profile.ps1 and you’re off to the races.

## PowerShell Alias

I’ve actually created a repository at [https://github.com/MichaelJolley/ps-alias](https://github.com/MichaelJolley/ps-alias) that has the PowerShell script that I include in my profile that gives many aliases for things like Docker, Git, etc. Feel free to fork & PR any aliases that you think might help others.

Got any other suggestions/corrections? Leave a comment below.
Getting started with PySpark on Windows and PyCharm
Tags: pyspark, windows, intellij, pycharm
Published: 2019-10-13 11:38:31

---
title: Getting started with PySpark on Windows and PyCharm
published: true
date: 2019-05-13 00:00:00 UTC
tags: pyspark,windows,intellij,pycharm
canonical_url: https://rharshad.com/pyspark-windows-pycharm/
---

## Pre-Requisites

Both Java and Python are installed in your system.

## Getting started with Spark on Windows

[Download Apache Spark](http://spark.apache.org/downloads.html) by choosing a Spark release (e.g. 2.2.0) and package type (e.g. Pre-built for Apache Hadoop 2.7 and later).

Extract the Spark tar file to a directory e.g. C:\Spark\spark-2.2.0-bin-hadoop2.7

GIT clone [winutils](https://github.com/steveloughran/winutils) to your system e.g. cloned to directory C:\winutils

Add below system environment variables where `HADOOP_HOME` is set to the winutils hadoop binary location (depending on the version of pre-built chosen earlier) and `SPARK_HOME` is set to the Spark location which we had extracted in step 2.

```
HADOOP_HOME=C:\winutils\hadoop-2.7.1
SPARK_HOME=C:\Spark\spark-2.2.0-bin-hadoop2.7
```

Create a new folder `tmp/hive` in your C: drive.

Provide permissions for the folder `tmp/hive` using `winutils.exe` by running below command in your command prompt

```cmd
C:\winutils\hadoop-2.7.1\bin\winutils.exe chmod 777 C:\tmp\hive
```

Now validate the setup by running `spark-shell` from your `SPARK_HOME` directory in your command prompt

```cmd
C:\Spark\spark-2.2.0-bin-hadoop2.7>bin\spark-shell
```

[![](https://rharshad.com/assets/img/2018/05/spark-shell.png)](https://rharshad.com/assets/img/2018/05/spark-shell.png)

## PyCharm Configuration

Configure the python interpreter to support pyspark by following the below steps

1. Create a new virtual environment (File -\> Settings -\> Project Interpreter -\> select `Create Virtual Environment` in the settings option)
2. In the `Project Interpreter` dialog, select `More` in the settings option and then select the new virtual environment. Now select `Show paths for the selected interpreter` option.
3. Add the paths for `Spark Python` and `Spark Py4j` to this virtual environment as shown in the screenshot below.

[![](https://rharshad.com/assets/img/2018/05/pycharm-interpreter-paths.png)](https://rharshad.com/assets/img/2018/05/pycharm-interpreter-paths.png)

Create a new run configuration for `Python` in the dialog `Run\Debug Configurations`.

In the `Python interpreter` option select the interpreter which we had created in the first step. Also in the Environment variables option make sure `Include parent environment variables` is checked.

You can now add your pyspark script to the project and use this run configuration to execute it in a Spark context.
Fix Mistakes in Shell Commands Easily With `fc`
Tags: cli, beginners, shell
Published: 2019-07-24 20:22:04

---
title: Fix Mistakes in Shell Commands Easily With `fc`
published: true
tags: cli, beginners, shell
canonical_url: https://mayeu.me/post/fix-typo-in-shell-commands-easily-with-fc/
---

From time to time, it can be quite cumbersome to fix a mistyped command in your shell. What if you could fix the command you just typed in your favourite editor? Well, that’s exactly what `fc` command is all about, and it is standard to all Unix system (this includes GNU/Linux & macOS). Let see how that work.

From Wikipedia:

> **fc** is a standard program on Unix that lists, edits and reexecutes commands previously entered to an interactive shell.

Using `fc` looks something like this:

1. You type a non-working/wrong command
2. You type `fc`
3. The last typed command (before `fc`) is open in your editor
4. You fix the command, save, and quit
5. When you exit the editor, the edited command is executed

Here is an interactive example in which I use the wrong path and fix it via fc (click on the image to see it in action):

[![asciicast](https://asciinema.org/a/245863.png)](https://asciinema.org/a/245863)

Of course this example is a little bit contrived because you should use autocompletion to navigate folders and not type your path entirely.

Checking my history, I have found this big command (which check if Homebrew’s ZSH path is part of the `/etc/shells` file, and if not, add it):

```
export zshpath="$(brew --prefix)/bin/zsh"; \
grep -q "^${zshpath}" /ec/shells || \
sudo -E sh -c "echo '$zshpath' \>\> /etc/shells"
```

It is not obvious, but there is a mistake right in the middle: `/ec/shells`instead of `/etc/shells`. With `fc` fixing this is really easy to fix since I will have access to my whole editor and not only my shell movement and shortcut.

But that’s not all `fc` can also take an argument to fix an arbitrary command from your shell history, not only the last one.

Use `fc -l` to list your history
 
```
$ fc -l
6213 rm -rf test
6214 brew install asciinema
6215 vim ~/bin/mac-bootstrap
6216 exit
6221 ls
6222 mkdir right-path
6228 asciinema rec
6229 cd wrong-path
6230 fc
6231 cd right-path
6232 pwd
```

Then you can use `fc <history number>` to fix a specific command:

```
$ fc 6214 # Will open “brew install asciinema” in your editor
```

There is not much more to this tool, but you can find the full documentation [of fc here](https://pubs.opengroup.org/onlinepubs/9699919799/utilities/fc.html) if want to check out the other arguments.

*This post was originally published on my website: [mayeu.me](https://mayeu.me/post/fix-typo-in-shell-commands-easily-with-fc/).*
Force HTTP To HTTPS Redirect Via AWS Elastic Load Balancer
Tags: aws, iis, https, ssl
Published: 2020-01-25 22:41:58

---
title: Force HTTP To HTTPS Redirect Via AWS Elastic Load Balancer
published: true
tags: AWS,iis,https,ssl
canonical_url: 
---

## Forcing HTTP to HTTPS redirect on IIS via AWS Elastic Load Balancers

Today I replaced an aging ASP.NET web forms web application with a new static site which for now is just a landing page with a contact form and in doing so needed to force any insecure HTTP requests to HTTPS.

A bit of a gotcha was an error on the redirect and the issue was the `HTTP_X_FORWARDED_PROTO` header also needed to be forwarded along with the redirect.

For example :

```xml
<conditions logicalGrouping="MatchAny">
   <add input="{HTTP_X_FORWARDED_PROTO}" pattern="^http$" />
   <add input="{HTTPS}" pattern="on" />
</conditions>
```

Next up, I needed to redirect any users who were going to `.aspx` pages that no longer existed to a custom 404 HTML page not found page.

This just needed adding to `web.config` like so :

```xml
  <system.web>
      <compilation targetFramework="4.0" />
      <customErrors mode="On" redirectMode="ResponseRewrite">
         <error statusCode="404" redirect="404.html" />
      </customErrors>
   </system.web>

   <system.webServer>
      <httpErrors errorMode="Custom">
         <remove statusCode="404"/>
         <error statusCode="404" path="/404.html" responseMode="ExecuteURL"/>
      </httpErrors>
   </system.webServer>

```

So here it is for the next time I have to do something similar, This is the full `web.config` that needs to in the root folder of the site.

```xml
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.web>
        <compilation targetFramework="4.0" />
        <customErrors mode="On" redirectMode="ResponseRewrite">
            <error statusCode="404" redirect="404.html" />
        </customErrors>
    </system.web>
    <system.webServer>
        <httpErrors errorMode="Custom">
            <remove statusCode="404"/>
            <error statusCode="404" path="/404.html" responseMode="ExecuteURL"/>
        </httpErrors>
        <rewrite>
            <rules>
                <rule name="HTTPS Rule behind AWS Elastic Load Balancer" stopProcessing="true">
                    <match url="(.*)" ignoreCase="false" />
                    <conditions logicalGrouping="MatchAny">
                        <add input="{HTTP_X_FORWARDED_PROTO}" pattern="^http$" />
                        <add input="{HTTPS}" pattern="on" />
                    </conditions>
                    <action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Found" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

```

And to test that the site works I entered it onto [https://www.whynopadlock.com/](https://www.whynopadlock.com/) which gave me the confidence that all was well.

Success 🎉
Web Development Part 2: CSS is Here!
Published: 2019-05-12 23:16:38

---
title: Web Development Part 2: CSS is Here!
published: true
description: 
tags: 
cover_image: https://gallery.mailchimp.com/fbd7db24d41cbb15fbb6a072f/images/76567adb-d5bf-4b2b-aa20-ddbbcb8ce243.png
---

It's time to learn about CSS!
We're going to learn some basics about the language & learn about the many ways to lay out our content! Don't forget to use the hashtag #TimTeachesCode on twitter! Remember, you can all contact me whenever you have questions or feedback.

This course is completely free and will be free forever. It takes a bit of time to prepare and support, so if you'd like to contribute, you can do so at https://paypal.me/tevko. Any contribution helps!

This week: How to CSS?

In the last lesson, we created a CSS naming convention to add classes to our FAQ page HTML. If you're just joining us in the course, that means you'll need to create an FAQ page (for any topic or fictional company) on CodePen and add CSS classes. Re-Read through the last lesson to understand the nuance behind a proper CSS naming convention.

In this lesson, we're going to add styles to our FAQ page. However, we're only going to work on the layout. This means that we'll only be focusing on arranging the blocks of content to conform to our design. Sidebar on the left, main content in the center, header on top (or fixed to the top of the viewport!), etc. We'll also want our content to collapse into a single column when the screen gets smaller (down to 320px wide) Don't add CSS in order to style anything else! There's enough to learn about layout for one week!

Take a look at the following codepen to help gain an understanding of how media queries work - https://codepen.io/tevko/pen/arZreQ

What you'll need to study
- [CSS Layout](https://www.smashingmagazine.com/2018/05/guide-css-layout/)
- [Media Queries on MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries)
- [CSS Layout on MDN](https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Introduction)

A few tips: 
Don't use HTML tables for page layout! They're inflexible and outdated. We have other, more powerful modules for CSS layout!
Make sure you have the correct meta tags in your < head > for the viewport to respond properly when the screen size changes.
Make sure you have enough in your demo to properly experiment with your CSS layout. Ideally, you should have some sort of sidebar, middle column for main content, header, and footer.
Make sure you're using CSS media queries so that your FAQ page is responsive!
Homework: 
Reply to the email with a link to the updated codepen and a brief summary of what you've learned about CSS layout. Also include your plans to continue studying CSS layout and how you'll keep this new skill sharp!

Extra points. This lesson will be tough! Take your time, read through all of the material, and triple check your work! When you get done, look through https://www.smashingmagazine.com/category/css and find a few articles to read. Write down your questions about what you've read and work through googling to answer them in your free time!
Star atlas - three.js
Tags: codepen, threejs, codepenchallenge
Published: 2019-05-12 21:24:51

---
title: Star atlas - three.js
cover_image: https://thepracticaldev.s3.amazonaws.com/i/atc8fi45auu24yj7mvau.png
published: true
tags: codepen, three.js, codepenchallenge
---

Trying codepen new [dev.to share button](https://blog.codepen.io/2019/05/08/220-social-sharing/). So here's a little pen I made for this week #CodePenChallenge.

<p><em>Created for the <a href="https://codepen.io/challenges/2019/May">May 2019 CodePen Challenge</a></em></p>

{% codepen https://codepen.io/trinketmage/pen/LoGgRv %}

Using
[three.js](https://github.com/mrdoob/three.js/)
[d3-scale-chromatic](https://github.com/d3/d3-scale-chromatic/)
[TweenMax](https://greensock.com/tweenmax)