teleren/devto huggingface dataset:
Learning Python- Intermediate course: Day 7, Making Python modules
Tags: learningpython, python, tutorial
Published: 2021-08-12 07:36:45

We have learnt how to use predefined python modules. Today we will create our very own Python module. 🤩 So put your seatbelts on for this thrilling Python journey🚀
---
____
### Modules in Python

Creating a module in Python is a very easy task. ![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gimh5787334irbtozlp6.png)

- **Step I** Make a python file named mymodule.py *(or any other name ending with `.py`)* which contains various functions. Do this in Python IDLE or any other IDE.
 Here is a sample file-
```python
def hi():
    print("hi")
def hello():
    print("hello")
def add(a,b):
    return a+b
def printer(a):
    print(a)    
```

- **Step II** Save the python file (or copy-paste the file) in the Lib (not libs) folder of the Python source code.
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p0h2lhupyhf1kvi16htj.png)
 
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lch7es61p6z5h4omr62o.png)
 

- **Step III** In the file in which you want to use the module, write `import mymodule` *(import the relevant module name)* After that, just use the functions in the module as predefined functions. Simple !!

Here is the program which uses the functions in our module.
```python
import mymodule
mymodule.printer("Welcome to Python intermediate course!")
print(mymodule.add(2,3))
mymodule.hello()
```
We now save it in a file named 'mymoduletester' and run it.
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/38ckjf3y6kcdx9tiiuhs.png)
 
After we run the file, an output is generated in a command line window.
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6nyx30dz7bw9ptrzucz9.png)
 
OUTPUT-
```
Python 3.10.0a2 (tags/v3.10.0a2:114ee5d, Nov  3 2020, 00:37:42) [MSC v.1927 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
>>> 
= RESTART: C:/Users/aatma/AppData/Local/Programs/Python/Python310/Lib/mymoduletester.py
Welcome to Python intermediate course!
5
hello
 
```

That's it! We have successfully made our own module and used it in our code!🤓 Cool!😎

I have used the IDLE for Python over here, but you are free to use any editor you want. We can have the same effect by using the online GDB compiler as shown below.
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/175gnpj0k8xzvqi8kct2.png)
 
____
✌️So friends that's all for now. 😊 Hope you all are having fun.😎 Please let me know in the comment section below 👇. And don't forget to like the post if you did. 😍 I am open to any suggestions or doubts. 🤠 Just post in the comments below or gmail me. 😉
Thank you all👍

Also please visit the [Learning-Python repo](https://github.com/Aatmaj-Zephyr/Learning-Python) made especially for this course and don't forget to star it too
Understand DevOps Engineer In Broad
Published: 2021-08-12 07:07:09


DevOps comes from two words –“ Development + Operation”. It's not a tool, software, a programming language etc.

It’s a philosophy and mindset on how you take the website to live sessions for users to use it. You shift things from the development stage to the production stage. The concept is used in application lifecycle management to make sure the operation team and development team are in a relaxed mood.

Any software development processes go through many phases. When it's on a small scale like a simple blog website you just go through a few processes, have a domain name, and host it on the cloud. These features are available for the rest of the world to use. But when it comes to large-scale applications, it's different. Let's be clear, it's difficult. Websites like Amazon, Instagram, Youtube  requires various steps to deploy.

Various teams are managing various parts. In a midsize company, there are always two teams. The developer team, which usually works on the code, design, and testing features. This ensures the code is running smoothly on different machines. Developers make sure they follow all the development cycles of software engineering.

The next team is an operation whose role is to manage servers, scale issues, bandwidth, security, and media backups. They have a mandate to make modifications when there is a problem. Let's say the number of user sending request to the servers is above the expected, they might decide to increase the number of servers.
DevOps comes between.

Our development and operations teams must work next to DevOps engineers to make sure everything is up-to-date. In big companies, the developers might exchange roles with operational managers to get to see what's happening in the middle. If you become familiar with both teams and the process they undergo to set everything up, then you become a DevOps expert.

DevOps is an infinite cycle because operations and development never end. When you look at the logo of DevOps it can define itself as an endless path. DevOps also focuses on the automation of the software.

DevOps uses tools like Salt-stack, GitLab, GitHub, and code editors. If you are an engineer in this field, then master knowledge in all those features. You are a great player in the industry, you stand between the final user and technical teams. DevOps is how you view the surrounding technology. Having vast knowledge on almost everything from stage one to production.

Large tech companies might hire DevOps managers. This is someone with experience in handling the development and operations teams together. The manager knows the teams and can change the lifecycle of the development and operation process whenever there is an issue.
How to get Microsoft Certified Azure Fundamentals certifications AZ900 for free
Tags: cloud, beginners, devops
Published: 2021-08-12 06:41:51

I recently got Microsoft Certified Azure Fundamentals certifications and I want to let you know that I was completely free. Yes, Free!

If you planning to get into cloud journey or planning for certifications, you can also get this certification for *free*.

Here is how you can get a free exam voucher for Azure Fundamentals Certification Exam.

You can enroll for Microsoft Virtual Training days for Azure Fundamentals
Keep an eye on this page for upcoming [Virtual Training Day](https://mktoevents.com/Microsoft+Event/286875/157-GQE-382)
Once you are done with the virtual training you will be eligible to take Microsoft Azure Fundamentals AZ-900 Exam for free.


Below topics will be covered in the training

**Day 1:**

-Introduction
-Azure Cloud Concepts
-Core Azure Services
-Azure Solutions and Management Tools

**Day 2:**

Introduction
-Azure Security and Network Security
-Identity, governance, privacy and compliance
-Azure Pricing and Lifestyle

For better preparation for exam  you go through [Microsoft Learn Platform](https://docs.microsoft.com/en-us/learn/certifications/azure-fundamentals/)

Steps to claim you free exam voucher.

- Register for certification visit [certification page](https://docs.microsoft.com/en-us/learn/certifications/exams/az-900)
- Login with appropriate option applicable to you Pearson VUE or Certiport, make sure you use the same email id which you used for register to Virtual Training.
- Once login, go to certification dashboard and claim your free exam voucher.

That's All and All the best for your exam!!!

Let me know if you found it useful.
Ask me Anything on Microsoft Edge Add-ons

Tags: webdev, microsoftedge, edgeextensions, ama
Published: 2021-08-12 06:39:55

I'm Chaitanya from Edge Add-ons Team.

I'm here to connect with web developers who are into or trying to build extensions specifically for Microsoft Edge Browser and I'd like to hear your feedback, ideas & suggestions that I can share & discuss with Microsoft Edge Add-ons Team.

If you're facing any trouble with publishing extension, please reach out to me on twitter at: https://twitter.com/chaitanyalokam or reply to this post. So that, I could guide you through the process.
HTML tags | sub-sup
Tags: html, tags, sub, sup
Published: 2021-08-12 06:13:37

They are used to **create subscripts and superscripts**, for example in mathematical or chemical formulas, to indicate footnotes, in abbreviations in some languages (_Mademoiselle_) or certain ordinals (_4th_).

The included text is usually **displayed in a smaller font** and either **below** (subscript) or **above** (superscript) **the baseline** of the rest of the text.

**It should not be used to alter the baseline of a text for purely aesthetic reasons**, as in a logo, in that case CSS will have to be used.

- Type: *inline*
- Self-closing: *No*
- Semantic value: *No*

[Definition and example `<sub>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/sub) - [Definition and example `<sup>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/sup) | [Support `<sub>`](https://caniuse.com/mdn-html_elements_sub) - [Support `<sup>`](https://caniuse.com/mdn-html_elements_sup)
You Too Can Write Clickbait Headings. Here's How
Tags: beginners, tutorial
Published: 2021-08-12 05:37:38

---
title: You Too Can Write Clickbait Headings. Here's How
published: true
description: How to write clickbait headings
tags: beginners,tutorial,
//cover_image: https://direct_url_to_image.jpg
---

# 🚀
mkws - How to add a navigation menu
Published: 2021-08-12 05:18:32

In order to add a navigation menu to your website, all you have to do is edit the `./share/l.upphtml` file and add your navigation code there. Open up `./share/l.upphtml` in your favorite text editor and add the following lines right below the `body` tag:
```
<header>
    <nav>
            <ul>
                    <li><a href=/>Home</a></li>
                    <li><a href=docs.html>Docs</a></li>
                    <li><a href=src.html>Sources</a></li>
                    <li><a href=contact.html>Contact</a></li>
            </ul>
    </nav>
</header>
```
Edit to match your website.

Then, regenerate your site using the mkws command:
```
./bin/mkws https://example.com
```

Taken from
[How to add a navigation menu](https://mkws.sh/p/How%20to%20add%20a%20navigation%20menu.html)
DailyUI #1 - Sign Up (CodePen)
Tags: codepen, css, design, 100daysofcode
Published: 2021-08-12 05:08:09

DailyUI Challenge #1 - a (propaganda) signup form for the tv show [Motherland: Fort Salem](https://www.imdb.com/title/tt9900092/) because I have an unhealthy obsession with this witch show. Answer the call and take the oath hehee.

The "Take the Oath" button will clear/reset all entered information.

Poster image taken from this [article](https://www.gaudie.co.uk/post/answer-the-call-inside-the-world-of-motherland-fort-salem-2020).

Fonts: 
- PT Sans
- Roboto

[Color Scheme](https://coolors.co/a5252e-353d3f-f8f9f8) :
- #A5252E - the shade of red from the horizontal border line
- #353D3F - the shade of gray from the flag
- #F8F9F8-  the shade of white from the flag

{% codepen https://codepen.io/anniedotexe/pen/YzVBBNy %}
Nomor Sedot WC Surabaya
Published: 2021-08-12 04:38:04

Berikut kami informasikan solusi bagi Anda apabila mengalami masalah seputar WC di rumah Anda. Nomor Sedot WC Surabaya https://sedotwc-bergaransi.com/nomor-sedot-wc-surabaya/
Career Services
Published: 2021-08-12 04:34:41

Today we had a meeting led by a member of the Career Services team. She also happens to be my CSM (CS Manager). It was my first time hearing from her, and now I'm pumped to be working with her.

Aside from presenting as articulate and thoughtful - HR keeps a high standard in these regards so nothing completely *special* here - there was a moment where I felt like 'yeah, this person... I can vibe with this person'.

Here's what happened.

At some point during our CS presentation, an HR grad (and current job seeker) was asked to speak. She expressed, during an otherwise fine delivery, a sentiment that she was lacking somehow in comparison to Computer Science degree-holders, or other job-seekers. Internally, instinctively, I reacted immediately. It took some strong restraint (not even discretion, but *restraint*) to not interrupt this meeting, however briefly, to squelch that notion and stand up for the work were all doing.

That feeling of disquietude stuck with me for a few minutes as our guest speaker wrapped up and our presenter moved forward with her agenda.

But then a really awesome moment came when she broke from the agenda and addressed the feeling that I had.

No - we're not Computer Science grads. We're something else.

We are building skills that are in demand. We're learning how to operate as professional engineers. We're building code that our teammates depend on, and to an industry standard that gives us the right to join and belong to any engineering team out there.

So I didn't want to hear for one second that I was anything less than anyone else who's applying to the jobs I'll be applying to. Because I'm not. And I think the differences are in my favor.

And I'm gratified that my CSM feels that way too and will have my back.
Well...I'ts hoisting after all
Tags: javascript, node, webdev, typescript
Published: 2021-08-12 04:29:28

![hosisting image from chrom](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o3p86c39jkp9fcxuenit.png)
Well the image is self explanatory. You can get an idea of lexical scope of const and how does hosisting work for const.

For some extra fun change const with --var--
Get a user's banner in discord.js v12
Tags: javascript, node, discord, visa2code
Published: 2021-08-12 03:59:34

> The code will be below

Discord Server - https://discord.gg/vUYvswzwMH

YouTube - https://www.youtube.com/c/visa2code

So it uses the [Cryptons API](https://cryptons.ga/)


If user has a banner it will reply with a banner

![Banner](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tqsne73ks7plhr3y7hh5.jpg)


What if user doesnt have a banner?

It will reply with user doesnt have a banner

![No Banner](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9shpf7zyxr8ylu8m4juq.jpg)

Code
https://srcb.in/C97M8fDOIK

```js
 const { MessageEmbed } = require('discord.js');
const axios = require('axios');
  const user = message.mentions.users.first() || client.users.cache.get(args[0]) || await client.users.fetch(args[0]).catch(err => undefined);
	if (!user) return message.reply('You must mention someone to get there banner').catch(console.error);
    
    const res = await fetch(`https://cryptons.ga/api/v1/userbanner?id=${user.id}`)
    
    const json = res.json()
    
    if(json.url === "null") return message.repy('User doesnt have a banner')

    axios.get(`https://cryptons.ga/api/v1/userbanner?id=${user.id}`)
		.then(function(response) {
        if(response.data.url === "null") return message.reply('User doesnt have a banner')
			const embed = new MessageEmbed()
				.setTitle(`Banner`)
				.setImage(response.data.url)
				.setColor('RANDOM')
			message.channel.send(embed);
		});
```
Are Websites and Web Applications Different?
Tags: webdev, beginners
Published: 2021-08-12 03:21:45

Yes, absolutely. Certain characteristics set one apart from the other. 

**1. Interactivity**
![Interactivity](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/02jcmghs8vk2xj86c9vz.jpg)
A website provides *visual and text content* that the user can see and read, but not alter in any way. While in the case of a web application, user can read the page content and manipulate the data on this page. The interaction can take place in: 
1. User clicks a button or,
2. User submits a form and gets a response from the page. 
This response may take a form of a document download, online chat, electronic payment and more.

It is rare to find a website today without any evidence of interactivity. The majority of modern websites contain small web application elements. For example, on a restaurant website, a Google Maps widget may show how to get to the restaurant. However, the ratio between informational content and interactivity tends to be biased towards the former for websites. It is rare for a website to have many interactive elements, and people typically just read, watch or listen to information. Web applications are the opposite since their core functionality is based on interaction.
<hr/>

**2. Aunthetication**
![Aunthetication and Authorization](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ei2mtu9na2dye9apmjx7.png)
Authentication is the process of entering a user's login and password to gain access to a system. It is a must for web software that requires any personal information. User accounts must be secured to prevent unauthorized access and leakage of sensitive data.

The majority of web applications require authentication since they offer more options than websites. Take social networks, for instance. You receive a unique identification number when you register, along with an account. If you use a weak login or password, the system will warn you. If you leave them unchanged, hackers might gain access to your account, steal your information, and annoy other users with junk emails.
<hr/>

**3. Complexity**
![Complexity of Web Development](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9ucwewfxtvd77giyx100.png)
The website will only display the collected information and data if the user searches that page.
Web applications have higher and more complex functions compared to websites.
<hr/>

Conclusion
The process of creating a website is relatively simple. But creating a web application requires a deeper understanding, more experience, and more planning.
Abstraction
Tags: abstraction, webdev, datascience, programming
Published: 2021-08-12 03:04:57

## What is Abstraction
Abstraction is a way to reduce complexity and and produce efficient design. It is used to hide the technical complexity behind something. Layers of abstraction means the times the complexity of the code was reduced. Levels of abstraction are relative to each other.

## Advantages
- if you have some layers of abstraction, it helps the user from writing low level code
- when you have layers of abstraction, you do no have to care about very specific details
- for example, javascript is a language which has multiple layers of abstraction over C. JavaScript reduces the complexity of C code, and hides all the technical complexity(at least much of it)

### Example 1
Another example of layers of abstraction while dealing with users
you do not provide the user with functions and classes and they have to call them, this will just confuse the user.
A website or in other words HTML is another layer of abstraction over javascript as it hides the complexity of javascript code and just delivers the end user with the result he wants, hiding the technical complexity of the javascript code.

### Example 2
code example of layer of abstraction
```js
let input = document.querySelector('input')
let span = document.querySelector('span');
input.addEventListener('input', ()=>{
    let lettersLength = input.value.length;
    let wordsLength = input.value.split(' ').length;
    // splits the name into words and gets the length of the corresponding array

    span.innerText = `Your name has ${lettersLength} letters and ${wordsLength} words in it`;
});
```
The above code has 2 layers of abstraction over it
1. if we compare this code with low level code(for example C programming language code), this code has a layer of abstraction which hides the technical complexity of the low level code
this code hides the complexity of allocating memory, the document API which we used hides the complexity of contacting to the DOM
if we had written the same piece of code in C, it would have been far more complex as we will have to do memory allocation and we will have to make our own API which can contact the browser and the DOM for manipulation
thus, javascript hides the technical complexity of C, thus forming a layer of abstraction
2. if we compare the javascript code to the website render in the browser, the website render has a layer of abstraction and hides the technical complexity of the javascript code from the end user
the user just inputs his name and gets the number of letters and words, which is very simple to the user
the website has a layer of abstraction over javascript code as you do not have to declare variables, split the text into an array to count the number of words, etc., thus hiding the complexity of the javascript code
How can i select my nth-child in javascipt DOM ?
Published: 2021-08-12 02:47:11


<html lang="en" dir="ltr">
  <head>
    <meta charset="utf-8">
    <title>My Website</title>
    <link rel="stylesheet" href="styles.css">

  </head>
  <body>

    <h1>Hello</h1>

    <input type="checkbox">

    <button style=":active color:red;">Click Me</button>

    <ul>
      <li class="list">
        <a href="https://www.google.com">Google</a>
      </li>
      <li class="list">Second</li>
      <li class="list">Third</li>
    </ul>

  </body>

</html>

I want to select the list third and replace it with my Name.
Cross-engine transaction detection in Hibernate v3+
Tags: cfml, coldfusion, hibernate, orm
Published: 2021-08-12 02:38:55

### UPDATE: Now with Adobe support!

So, this is embarrassing. This article _claimed_ to offer a one-liner with Adobe and Lucee compatibility, but I completely neglected to actually _test_ it on ACF before I wrote the blog post. (I thought I'd tested it... evidently not.) I realized this week after attempting to use my "cross-compatible" transaction detection code that **it's not cross-compatible at all!**

Bottom line: I updated the article with a properly-tested, fully cross-engine-compatible snippet to detect transactional context **on both Adobe CF and Lucee**. You're welcome.

-----

We do a lot of ORM work at Ortus, and recently I have been on a bit of a Hibernate binge. One of the important things to note when working with Hibernate is that ORM queries may behave differently _inside_ a transaction block than they do _outside_ a transaction block. More importantly, the transactional handling in, say, Lucee 5.3 begins to break down when working with nested transactions.

I digress, but let's just say it's important to know when the current code is inside a transaction context.

Previously, the best knowledge we had said to run this on Adobe:

    // ADOBE ONLY!
    var isInTransaction = createObject(“java”, “coldfusion.tagext.sql.TransactionTag”).getCurrent()

and something like this on Lucee:

    // LUCEE ONLY!
    var isInTransaction = getPageContext().getDataSourceManager().isAutoCommit() ? false : true;

But digging through the [Hibernate Session docs](https://docs.jboss.org/hibernate/stable/core/javadocs/org/hibernate/engine/spi/SharedSessionContractImplementor.html#isTransactionInProgress--), I found a wonderful little method called `isTransactionInProgress`. And just like that, here's a CFML method to wrap it and consistently detect the transactional context:

```
boolean function isInTransaction(){
    if ( listFindNoCase( "Lucee", server.coldfusion.productname ) ) {
        return ORMGetSession().isTransactionInProgress();
    } else {
        return ORMGetSession().getActualSession().isTransactionInProgress();
    }
}
```

That little beauty works

1.  across CFML engines from Lucee to Adobe ColdFusion
2.  across multiple Hibernate versions from v3.x through v5.x

Now, to be fair, I haven't really stress-tested this. It's _possible_ there are a few situations where Hibernate doesn't yet know a transaction has begun. But so far... it works, and works well!

Until next time!