teleren/devto huggingface dataset:
how to interact with a webpage with Selenium and Python
Tags: selenium, testing, automation, python
Published: 2019-07-24 11:12:55

---
title: how to interact with a webpage with Selenium and Python
published: true
description: 
tags: selenium,testing,automation,python
---

Once you have navigated to a page, in order for your tests to be useful you will need to interact with that page.

In my example I am going to first find a text box and type something in the text box using Selenium.


```python
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
driver = None
try:
    cpath = "e:\\projects\\sel\\chromedriver.exe"
    driver = webdriver.Chrome(cpath)
    driver.get("https://google.com") # note 1
    e = driver.find_element_by_name("q") # note 2
    e.send_keys("selenium") # note 3
    e.send_keys(Keys.RETURN) # note 3a
    time.sleep(3)
    driver.save_screenshot("google_selenium.png")
finally:
    if driver is not None:
        driver.close()
```

**Note 1** - This line causes the browser to navigate to google.com

**Note 2** - In order to interact with anything on a web page you must first locate the element. As a human we do this without thinking about it. But for Selenium you must explicitly explain it. *Find an element on this page that has a name of "q".

**Note 3 and Note 3a** - Once you have found an element the method send_keys will send text to that web element. In the example above I sent the word "selenium" (without the quotes) followed by a RETURN key.

The RETURN key code looks a little weird. The reason we use the Selenium provided Keys object is because typing a RETURN character is platform dependent. So to make it more uniform Selenium has provided a constant that should work across platforms.

Again at the end of the program a time.sleep is used to pause the test so you can observe it. Also I take a screenshot of the test so you can look at it later.

I will have other posts that go into more detail on locators.
CSS Clip path Card Hover Effects | Only Using HTML & CSS
Tags: html, css, clippath, codepen
Published: 2019-07-24 11:12:08

---
title: CSS Clip path Card Hover Effects | Only Using HTML & CSS

published: true
description: 
tags: html, css, clip-path, codepen
---

{% codepen https://codepen.io/ahmadbassamemran/pen/XvdEoO %}
<hr/>
<h1>CSS Clip path Card Hover Effects | Only Using HTML & CSS
</h1>
<hr/>
[Do Not Forget To Like & Subscribe In The Channel:](https://www.youtube.com/AhmadEmran?sub_confirmation=1)
<hr/>
{% youtube mQbBTqOWN3M %}
Discontinued Social Networks
Tags: tutorials
Published: 2019-09-08 06:31:56

---
title: Discontinued Social Networks
published: true
tags: Tutorials
canonical_url: https://vuild.com/discontinued-social
---

We’ve all seen a social site or two come & go. It seems to fit with the extreme ‘popularity contest’ theme of any social ecosphere. In a way, the number of these dead social sites you remember can pinpoint your age (or at least when you became social media savvy). For a more useful way to spend time, be sure to check out a [list of social networks](https://vuild.com/social-networks) you can actually sign up to.

[Download as PDF](https://vuild.com/discontinued-social?pdf=1)
1. 43Things
2. AsianAvenue
3. Audimated
4. Bolt
5. Buzznet
6. Delicious
7. DontStayIn
8. Eons
9. Experience Project
10. FledgeWing
11. Focus.com
12. Fotolog
13. GamerDNA
14. GetGlue
15. Gogoyoko
16. Goodwizz
17. Hellolingo
18. Hotlist
19. Itsmy
20. Jaiku
21. Jiepang
22. LaiBhaari
23. Late Night Shots
24. LinkExpats
25. Makeoutclub
26. MOG
27. Path
28. Plaxo
29. Playfire
30. Poolwo
31. Quechup
32. Raptr
33. ScienceStage
34. Shelfari
35. SocialVibe
36. Sola
37. Streetlife
38. Students Circle Network
39. Talkbiznow
40. TeachStreet
41. Telfie
42. Tournac
43. TravBuddy
44. Tribe.net
45. Tsu
46. Tuenti
47. Tvtag
48. Tylted
49. Uplike
50. WeeWorld
51. Wellwer
52. Yookos
53. Vine

Let us know if we missed any dead social networks.

This data is from [Vuild’s discontinued social networks list](https://vuild.com/discontinued-social). Please visit [vuild.com](https://vuild.com) for more.
When to use LET or CONST
Tags: javascript, webdev
Published: 2019-07-24 11:00:37

Hello there, 

Wooooow, you are interested in my opinion. I would like to get to know yours too in the comment section below :-D.


I have gone through numerous lines of javascript code from different coders. And I have seen the different use case of `let` and `const`, not conventional I would say.

So, I thought to myself maybe I should share the way I address which to use whenever I am coding, *How I choose whether to use `let` or `const`*.


#### How do I choose?

_Here are my recommendations;_

- Use `let` only on primitive values that are liable to be mutated.

e.g
```javascript
let balance = 475
```

- `const` as it's apparent, should be used for primitive values that you want to make immutable and its identifier should be in UPPER_CASE.

e.g
```javascript
const PI = 3.14 // do you remember this guy from primary math...
```

- And lastly, always use `const` for objects.

e.g
```javascript
// this? , you don't want to lose the reference to your object, right?
// which also encourage explicit operations on your object properties

const EmptyObj = {}
```


I hope this my little opinion is helpful. Once again, I wish to read your opinion in the comment section of this post. It might open my eyes to a different perspective.


##### _Do you enjoy the read?_
4 Best Practices Of Security Penetration Testing Services You Must Follow
Published: 2019-07-24 10:45:11

Penetration testing is one of the most common actions for today’s security-aware businesses. Self-defense being the number 1 element, there are many reasons for executing a pen-test, including better security defenses, decreased risk levels and meeting strict compliance requirements. Let us understand the 4 best practices of Security Penetration Testing Services.
 
1.Define the type of pen-test your organization needs

Before choosing a penetration testing company, it is important to define what type of testing you are looking for. Whether a web application pen-test, a mobile application pen-test or a network infrastructure pen-test. Once the scope of your penetration testing services is defined, the organization will have to specify how they want the pen-test to be performed.

2.Evaluate the skills of the penetration testing team

Additionally to evaluating the pen-testing company completely, it is recommended to take a close look at the actual pen-testers who will perform the process. It is important to identify the expertise of the penetration testing team to demonstrate their technical knowledge.

3.Find out how your data will be secured

Pen-testers certainly recognize how to get access to your private data, but their pen-testing company will have to prove that they will handle and store this data securely before, during and after the penetration test. In the end, you are assigning a third party with the most critical data assets and should obtain an proper explanation about data handling before sharing anything private.

4.Clarify the methodology and process

While choosing your security penetration services company, ensure to confirm that the resources follow an industry-recognized pen-testing methodology. It is important to identify how exactly the pen- testing will be performed and which steps will be followed.

Usually, this level of detail is comprised in the sales proposal or in the statement of work (SOW). Lest, one should not be afraid to ask the pen-testing company to proceed with the methodology they follow during the ethical hacking process. If they follow a similar kind of methodology for all their penetration testing engagements, there are chances that their work quality is good and their level of meticulousness in the engagement is also good.

Conclusion

While assessing a <a href="https://www.testingxperts.com/services/security-testing/">penetration testing company</a>, there are several best practices that you be should keep in mind other than how much the pen-test actually costs. At minimum, ensure that the organization properly evaluates the potential pen-testing vendor and validates their methodology and deliverables, data security practices and capabilities. You may also want to search about the authorizations of the pen-testers who will perform the job.

Penetration testing is a mandate for all organizations who want to comply with the security regulations set by the government. Penetration testing should only be executed by skilled consultants with the essential technical skill set and qualifications.
Heroku, Now.sh, Netlify. What are you using and why?
Tags: javascript, node, cloud
Published: 2019-07-24 10:19:36

I've been playing around with these platforms for a few months, hosting small node projects on each, but this is getting a little tiring going back and forth from each one.

Thought it would be worth getting DEVs thoughts on these platforms and which ones are being used more in the DEV community.

So, do you use any of these to host your js/node projects?

If yes, which one and why? 👨‍💻👩‍💻


Happy coding!
git tips - run git pull over all subdirectories
Tags: git, tips, productivity
Published: 2019-07-24 09:55:36

Pretty handy tips that I use time to time.

# Mac / Linux

```bash
ls | xargs -I{} git -C {} pull

// run in parallel
ls | xargs -P10 -I{} git -C {} pull
```



# Windows


**The good old DOS batch file:**
```
@echo off
for /f %%f in ('dir /ad /b') do (
 cd "%%f"
 git pull
 cd..
)
```



# Reference:
https://stackoverflow.com/questions/3497123/run-git-pull-over-all-subdirectories
PHP Tutorial for for Absolute Beginner
Tags: php, laravel, webdev, tutorial
Published: 2019-07-24 09:27:10

Learn PHP Programming For Web Development The Fast And Easy Way!

The PHP Programming Language is one of the most POPULAR Web Development Programming Languages for a reason. In this course I'll show you why!

You don't need any prior knowledge of coding or web development to take this course. We'll download all the tools you'll need for free, and I'll walk you through setting them up. Then we'll dive right in and start learning the PHP language.

This is the course for you if you're interested in becoming a web developer and maybe don't know where to start. It's also great if you're already a front end developer, but want to add some serious skills to your tool belt. Since PHP powers Wordpress, this course is also great if you'd like to really customize your Wordpress sites (we don't discuss wordpress in this course, but if you understand PHP, you can understand what's going on behind the scenes in Wordpress just by diving into the code and checking it out on your own).

What you’ll learn
-How To Download and Use WAMP Server
- How To Run PHP Locally on your Computer
- Basic PHP Programming Concepts Like Variables, Data Types
- Math Operators, Assignment Operators, Comparison Operators
- How To Do If/Else Statements and Why They're Important
- How To Loop Using While Loops, For Loops, and Foreach Loops
- Understanding Indexed Arrays and Why They Are So Great
- Understanding Associative Arrays (called Hashes or Dictionaries in other Languages)
- All About Functions - Mini Programs Inside Your Program
- We'll Build a FizzBuzz app!
- PHP For Web Development
- Including PHP on a web page
- Requiring Things on a Web Page With PHP
- Using Web Forms With PHP
- Processing Form Data With PHP
- And More!

{% youtube hzyWqpCbGwU %}
My New Friends filter() and map()
Tags: javascript, beginners, webdev, todayilearned
Published: 2019-07-24 09:09:02

Today I have been learning about arrow functions. I've got to say that at first it's hard to wrap my head around the idea that a function can take another function as one of its parameters. But that'll come with time, I suppose.

Anyhow, a very interesting tool I learned about are the methods `filter()` and `map()`.

###What Do They Do?

The most basic answer is they create a new array based on an old one.

They take a function to check or manipulate the elements of an array and, based on the results of the operation, create a new one with only some of the elements or modified elements. Let's have a look at how each of them works.

####filter()

`filter()` takes a function and uses it to *filter* the elements in an array. It returns a new array with only the elements that meet the conditions. For example:

```javascript
const array = [1, 5, 6, 7, 8, 12, 15] //We have an array with several numbers

//But we want an array with only even numbers
const newArr = array.filter((num) => num % 2 === 0) //newArr = [6, 8, 12]
```

Now we have the new array `newArr` that only includes the even numbers in `array`. This method allows us to choose which elements we want from a given array without creating a loop that goes through every one of them.

####map()

`map()` takes a function and calls it on every element of the array. It returns a new array with the altered elements. For example:

```javascript
const array = [1, 5, 6, 7, 8, 12, 15] //Again, array with several numbers

//For some reason, we would like them to be multiplied by 10
const newArr = array.map((num) => num * 10) //newArr = [10, 50, 60, 70, 80, 120, 150]
```

But wait, it gets better. What happens if we want to filter through the elements of an array **and** modify their values? Well, then we can call both methods together like this:

```javascript
const newArr = array.filter(function).map(function)
```

Based on our previous examples, let's say that we want to sieve through an array to take only even numbers and then we want to make those ten times bigger. Here's how we can do it:

```javascript
const array = [1, 5, 6, 7, 8, 12, 15] //Our beloved starting array

const newArr = array.filter((num) => num % 2 === 0).map((num) => num * 10) //newArr = [60, 80, 120]
```

###Conclusion

When we want to create an array based on an old one by taking only some of its elements or calling a function on every element, we can use the methods `filter()` and `map()` to make our lives easier.
React Tips: 1 – Starting React on a Different Port
Tags: react, tips
Published: 2019-07-24 08:28:29

---
title: React Tips: 1 – Starting React on a Different Port
published: true
description: Part 1 of a series of tips on React
tags: React, Tips
---

<link rel="canonical" href="https://www.pmichaels.net/2019/07/20/react-tips-1-starting-react-on-a-different-port/" />

I came up with an idea to start a series of posts on React that offers small tips on things you can do, errors that you might get, and anything else that future me might find useful.

I started by creating a <a href="https://www.pmichaels.net/2019/01/14/a-c-developers-guide-to-reactjs-part-1-create-run/">new react app</a>.  The intention being that I would have a <a href="https://github.com/pcmichaels/react-demos">reference repository on GitHub</a>.

The first part of this concerns starting react on a different port.

<h1>Why?</h1>

There are a couple of reasons that you may choose to do this, but one is to get around the issue when running:

    npm start
    Something is already running on port 3000

<h1>How</h1>

Have a look in your project for a file called package.json. In there, you should see something like this:


    { 
        "name": "react-demos",
        "version": "0.1.0",
        "private": true,
        "dependencies": {
        "react": "^16.8.6",
        "react-dom": "^16.8.6",
        "react-scripts": "3.0.1"
    },
    "scripts": {
        "start": "react-scripts start",
        "build": "react-scripts build",
        "test": "react-scripts test",
        "eject": "react-scripts eject"
    },

In the start section, you can add the port:

    { 
        "name": "react-demos",
        "version": "0.1.0",
        "private": true,
        "dependencies": {
        "react": "^16.8.6",
        "react-dom": "^16.8.6",
        "react-scripts": "3.0.1"
    },
    "scripts": {
        "start": "set PORT=3005 && react-scripts start",
        "build": "react-scripts build",
        "test": "react-scripts test",
        "eject": "react-scripts eject"
    },


The default port is 3000, so if you don’t specify a port, it will always try to start on 3000.

<h1>What if I don’t want to change the port / Why won’t react die?</h1>

Well, you could try the following command in bash:

    taskkill -F -IM node.exe

It should kill all of your React processes.

<h1>References</h1>

<a href="https://github.com/facebook/create-react-app/issues/1083">https://github.com/facebook/create-react-app/issues/1083</a>

<a href="https://stackoverflow.com/questions/45544145/how-stop-after-running-react-scripts-start">https://stackoverflow.com/questions/45544145/how-stop-after-running-react-scripts-start</a>

<a href="https://www.pmichaels.net/2019/07/20/react-tips-1-starting-react-on-a-different-port/">This post was originally published here</a>
Fluid-Structure Interaction Made Easy with FEATool Multiphysics 1.11
Tags: featool, multiphysics, fluidstructureinteraction, simulation
Published: 2019-07-24 08:55:55

---
title: Fluid-Structure Interaction Made Easy with FEATool Multiphysics 1.11
published: true
tags: featool, multiphysics, fluid-structure-interaction, simulation
canonical_url: https://www.featool.com/news/2019/07/24/featool-v1p11-fluid-structure-interaction-in-matlab
---

FEATool Multiphysics 1.11 is now available and extends the multi-simulation solver concept even further by introducing a fluid-structure interaction (FSI) solver (in addition to the existing built-in multiphysics, OpenFOAM, and FEniCS solver integrations).

![](https://thepracticaldev.s3.amazonaws.com/i/3az2vgf9bjejnrkg1j24.jpg)

In addition, the 3D geometry engine has been updated with support for the OpenCASCADE and BRL-CAD open source CSG geometry engines, as well as new built-in geometry primitives for more complex geometries.

FEATool Multiphysics version 1.11 also features:

- new support for more efficient sparse linear solvers, such as MUMPS, and GMRES/BiCGStab with ILU(k) preconditioning.
- Dedicated and improved treatment of internal/interior boundaries
- Support for Gmsh v4.x GEO file format geometry import and export
- New examples and tutorials for thermo-mechanical coupling, fluid-structure interaction, and non-Newtonian flow
- P1/P2 bubble, Nedelec curl, and Raviart-Thomas vector finite element shape functions
- Miscellaneous GUI and usability improvements

Please see https://www.featool.com/news/2019/07/24/featool-v1p11-fluid-structure-interaction-in-matlab for more information and toolbox download.

#multiphysics #fsi #simulation #matlab
How can I use mongoose first with mongoose find, then with forEach loop and as last with mongoose create.
Tags: node, express, javascript
Published: 2019-07-24 08:43:26

---
title: How can I use mongoose first with mongoose find, then with forEach loop and as last with mongoose create.
published: true
description: How can I get rid of "Cannot set headers after they are sent to the client"?
tags: nodejs, expressjs, javascript
---

When I use forEach in mongoose I get a "Cannot set headers after they are sent to the client". I am aware that the forEach is not completely executed because a res.send has apparently already taken place. Otherwise it would at least not come to this error message.

How can I use mongoose with forEach so that the code only continues when the for forEach loop is complete?

Here my code:

{% gist https://gist.github.com/sm-a/25bdcc3f9138eb27f92004ff616930d0 %}
Will Angular Universal get along with httpClient?
Tags: angular, typescript
Published: 2019-07-24 08:18:43

I am currently working on a project which is built mainly based on NgModules. We have 5 different modules and multiple components and services in that. When we tried to enable server-side rendering using Angular Universal, the pages are not rendered completely. The code which is given below is the only part which is rendered. (view source)

This issue is happening when we use httpClient in the code. Without that everything works perfectly.


``` 
<app-root _nghost-sc0="" ng-version="8.1.2"><router-outlet _ngcontent-sc0=""></router-outlet><app-main _nghost-sc1=""><!----></app-main></app-root> 
```

But if we check in browser's developer tools, we could see
```
<app-root _nghost-serverapp-c0="" ng-version="8.1.2"><router-outlet _ngcontent-serverapp-c0=""></router-outlet><app-main _nghost-serverapp-c1=""><!--bindings={
  "ng-reflect-ng-if": "[object Object]"
}--><div _ngcontent-serverapp-c1="" id="home-page"><app-banner _ngcontent-serverapp-c1="" _nghost-serverapp-c2="" ng-reflect-banners="[object Object],[object Object"><p _ngcontent-serverapp-c2="">banner works!</p></app-banner><app-counter _ngcontent-serverapp-c1="" _nghost-serverapp-c3="" ng-reflect-counters="[object Object],[object Object"><p _ngcontent-serverapp-c3="">counter works!</p></app-counter><app-categories _ngcontent-serverapp-c1="" _nghost-serverapp-c4="" ng-reflect-categories="[object Object],[object Object"><p _ngcontent-serverapp-c4="">categories works!</p></app-categories><app-experience _ngcontent-serverapp-c1="" _nghost-serverapp-c5="" ng-reflect-experiences="[object Object],[object Object"><p _ngcontent-serverapp-c5="">experience works!</p></app-experience><app-stay _ngcontent-serverapp-c1="" _nghost-serverapp-c6="" ng-reflect-stays="[object Object],[object Object"><p _ngcontent-serverapp-c6="">stay works!</p></app-stay><app-spotlight _ngcontent-serverapp-c1="" _nghost-serverapp-c7="" ng-reflect-spotlights="[object Object],[object Object"><p _ngcontent-serverapp-c7="">spotlight works!</p></app-spotlight></div></app-main></app-root>

```

I followed the official angular universal documentation.
What am I doing wrong here?
Benefits of Blockchain Powered Crowdfunding for Real Estate
Tags: blockchain, cryptocurrency, software
Published: 2019-07-24 08:01:52

A real estate crowdfunding platform enables real estate companies to attract funds from a variety of investors. Investors use such platforms to evaluate projects and invest directly. It serves as a marketplace where entrepreneurs and investors engage each other with secured transactions.   

A real estate crowdfunding platform can be used by property developers to showcase their project scope, potential, capital requirements, and profit shares to attract investors. Similarly, investors can identify profitable opportunities to make sound investments. The platform makes it faster and easier for both parties to fulfill each other’s requirements.  

Read Full Blog Here: https://www.oodlestechnologies.com/blogs/Benefits-of-Blockchain-Powered-Crowdfunding-for-Real-Estate/

For Blockchain Development Services Visit: https://www.oodlestechnologies.com/blockchain-applications-development/