teleren/devto huggingface dataset:
Press Information Department – PID Jobs 2022
Published: 2022-11-26 21:39:01

The Press Information Department is giving golden Employment  opportunities to its visitors.Press Information Department (PID) Jobs 2022 Opening for Pakistani Citizens.We have received this information about jobs from Daily Express newspaper which is published on daily basis. Online applications are required from eligible and interested Male / Female candidates from all over the country for appointment to the following vacancies.Online Applications PID Website
          www.pid.gov.pk
 can be submitted through.Interested persons having Master to Primary education are eligible to apply.
<p>&nbsp;</p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1WQLTDkllp4O49o_8DYh2uEuqB8igoOoBPcK5GNVhuvZT74UX1eg8EKcNNRr_qF10QzYX1AcgS7DRWIm-ZmvQAG8bhvZT9MtSxvZvy5JdbELJ6EjMhprrNVSr1M04A82YidC25HNe1vOFObUuPMkNFZi5MuSnAfDHnFoarDim3CkXOsLnd6yIt0Eucg/s1280/20221125_174154.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="837" data-original-width="1280" height="209" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1WQLTDkllp4O49o_8DYh2uEuqB8igoOoBPcK5GNVhuvZT74UX1eg8EKcNNRr_qF10QzYX1AcgS7DRWIm-ZmvQAG8bhvZT9MtSxvZvy5JdbELJ6EjMhprrNVSr1M04A82YidC25HNe1vOFObUuPMkNFZi5MuSnAfDHnFoarDim3CkXOsLnd6yIt0Eucg/s320/20221125_174154.jpg" width="320" /></a></div><br /><div class="separator" style="clear: both; text-align: center;"><br /></div><br /><p></p>

These vacancies are Administrative Assistant, Data Analyst, Media Monitoring, Coordinator, MIS Specialist, Non-Linear Editor, Office Assistant.  Office Assistant, Policy  Coordinator ,Openings for the posts like Research Associate, Sweeper, System Analyst.A good and attractive salary will also be given, the details of which are given below. Individuals who are looking for the latest Press Information Department (PID) Jobs 2022 and fulfill the required conditions of the posts can get the Today Jobs in Pakistan after applying online
**[Read More](urlhttps://www.blogingtlash.com/2022/11/press-information-department-pid-jobs.html
)**
Strong bends, hard breaks. Thank you, bullies.
Tags: bullying, impostor, strong, hard
Published: 2022-11-26 20:56:45

I was bullied at school, a lot.

I was the weakest child in the class, weaker than any boy or girl in the class. Normally I was bullied by 2-4 people at once, including one case when few of them held me and one "friend" inserted a syringe needle into my arm. I guess it was fun for them, in a way.

Picking up karate when I was 15 made my life easier, as all the bullies f*cked off after few months of karate studies. I got disgusted with people who respect others just because "others" can physically fight back, so I got transferred into a better school.

Later I was struggling with studies and computer science.
I have totally messed up my Math exams, probably because my parents were divorcing and I couldn't keep my hands still - they were shaking all the time, a lot. While other friends were sent to special preparation courses and supported, I was explained that it is OK to go to a vocational school if I am not smart enough to go to uni.

I made it to the uni, a free place. I kept switching courses till I got into IT. Energetics -> Bioinformatics -> IT.
I was expelled 3 times, 2 times by "mistake". Uni lost my papers. Twice.

After first year my average mark was around 1, on a scale from 0 to 5. I didn't study well. Partially because I was not inspired (I just wanted to learn IT), partially because I was working 24-36 hours on the weekend, in security. It was normal for me to come to the exam after 12-14 hours of work with no sleep at all in between.

Why would I do work and studies at the same time? Because I could not afford buying food in the canteen. Because I could see how hard it was for my parents to provide clothing and food to a grown up.

I am blessed with having all that experience.
I am very strong now. What is more - I can relate to those in need.

I am a noob and an impostor, who is not afraid to accept it and to learn openly. 

Why am I sharing?
It is OK not to be OK. 
It is OK to struggle while studies.

As long as you keep focusing on doing something valuable for others - you will prevail. We will prevail. Nothing. Nothing will stop us.

P.S. That's all good, but what can I do? 
Well, you can do something like [impostorlearns.it](www.impostorlearns.it)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9pi6r3uycqba8lqdcxnl.png)
How to give Docker Desktop more RAM/swap than the limit
Published: 2022-11-26 21:28:41

Docker Desktop on Mac has a limit of 8GB RAM and 4GB of swap:

![Docker Desktop resources](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tmrnhbdxk7zmt4c71imb.png)

You can allocate even more swap space by running these commands:

```
host$ docker run --rm -ti -v swap:/swap --privileged
root@91dd1647484a:/# fallocate -l 4G /swap/file
root@91dd1647484a:/# chmod 600 /swap/file
root@91dd1647484a:/# mkswap /swap/file
Setting up swapspace version 1, size = 4 GiB (4294963200 bytes)
no label, UUID=2e028e57-9572-4bed-94c8-093ae1af1211
root@91dd1647484a:/# swapon /swap/file
root@91dd1647484a:/# free -m
               total        used        free      shared  buff/cache   available
Mem:            7951         280        7083         321         587        7191
Swap:           8191           0        8191
root@91dd1647484a:/#
```

The swap space will be available to all containers. It also persists across restarts.

To delete the swap space, run `docker volume rm swap` then restart Docker Desktop. You will get an error saying it couldn't be deleted, but after the restart it will be gone.
Things I learned this week - Week 47 (2022 ed.)
Published: 2022-11-26 21:18:22

1. Unit testing - Nodesjs + Jest
{% embed https://www.youtube.com/watch?v=Ntd_rT-ZSBM %}

2. Google Cloud Platform - Cloud Pub/Sub made easy
{% embed https://www.youtube.com/watch?v=cvu53CnZmGI&list=PLIivdWyY5sqKwVLe4BLJ-vlh9r9zCdOse %}

3. Decide how to architect your solution with GCP services
{% embed https://www.youtube.com/watch?v=2tLXKCgqwLY %}

4. Introduction to Microservices Architecture
https://medium.com/@madushankanipunajith/introduction-to-microservices-architecture-f0c7eefe79f1

5. Typescript 4.9
https://javascript.plainenglish.io/typescript-4-9-is-huge-ff94046e0ee5

6. Event loops in Javascript
{% embed https://www.youtube.com/watch?v=lqLSNG_79lI %}
Consequences of Badly Planned (or unplanned) Software and Not Writing Clean Code
Tags: productivity, discuss, tutorial, news
Published: 2022-11-26 21:03:17

We all made small personal projects without making any kind of planning or documentation.

But when we get involved in big-scale projects, we need to have a solid plan.

This article ([Link](https://www.pullrequest.com/blog/cost-of-bad-code/)) written by Lyal Avery in 2018, demonstrates the result of an investigation to understand the importance of good planning and documenting every detail of projects, using models and design documentation, using a good architectural structure before starting a new software project.

There are very heavy consequences and the importance of having good, clean coding practices and solid documentation before starting a software project is crucial.

According to research, 20% of software projects fail due to bad code.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2dfxkgchwo51i1r8z09o.png)

Our work is mainly divided into two parts. Programming and engineering.

Many give a lot of importance to programming but few give importance to good planning and making a solid design with solid structures that perhaps lasts months to do without writing any code.

Doing projects with bad design, results in having badly done projects, or perhaps thrown away without even finishing.

Believe me, I have met software engineers who have more experience than me, who had plans for software that in their dreams is worth thousands of dollars and explaining their wonderful ideas on a single sheet of note paper... 

And when I spoke to them about the need for documentation and good planning, they didn't want to understand me or they just didn't care, all they wanted was code and code. 

Everything ended without finishing their wonderful ideas because they had never come up with a perfectly documented software plan.

If you're doing serious work, you have to start seriously.
For this reason, it is very important to do good preparation.
Badly written and unplanned code can save you an hour of time but maybe it can cause you 20 hours of searching and fixing later when the bugs come out.

Have you ever had any good or bad experiences with SDLC ? It would be a good idea to share your experience and thoughts about it. Maybe you can help others through your post.
What do you think of a good database for a microblogging web application?
Tags: database, mongodb, postgres, nosql
Published: 2022-11-26 20:26:09

What is the good database for a microblogging platform? First relational (SQL) or not (NoSQL)?

- MySQL
- PostgreSQL
- MongoDB
- Apache Cassandra

I know there's nothing called "a good database", but hey, I'm just asking for your opinions! So, what do you think? And if you have another suggestion, something like graph databases, no problem, make yourself home!
Python Programming Bootcamp #5 - REPL and __dunderscore__
Tags: python, beginners, tutorial
Published: 2022-11-26 19:29:00

---
title: Python Programming Bootcamp #5 - REPL and __dunderscore__
published: true
description: Continuing the bootcamp
tags: python, beginner, tutorial
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
published_at: 2022-11-26 19:29 +0000
canonical_url: https://code-maven.com/programming-bootcamp-for-scientists-5
series: bootcamp
---

{% youtube G4F8wTK-Be4 %}


00:00 Keyboard shortcuts for the slides
01:25 Reviewing the exercises from the previous chapter. Talking about operator precedence.
04:09 The math module of Python. Attributes and methods.
09:45 The Python interactive shell (REPL).
19:40 The beginning of the "Second steps" chapter up till "Conditional main".
19:55 Modules - the sys module, getsizeof.
30:00 The main function, indentation.
35:25 Can a function be named the same name as an already existing function?
37:10 Indentation
38:36 Conditional main (dunderscore) (error correction: those are quotations around "__main_"_ not parentheses.)
A Smart Dumb Components Pattern for Angular
Published: 2022-11-26 19:24:08

Most of the Smart Dumb Component UI pattern implemented for Angular that I have seen seem to split each view component into one smart component and one dumb/presentation component. I have recently come up with a variation to this pattern where one global smart component can be setup for all the view components for an Angular SPA.

Here is a demo of the implementation of this pattern for an SPA - [StackBlitz](https://stackblitz.com/edit/angular-ivy-ksa1b1?file=NOTES.TXT)

and here is the link to the source - [GitHub](https://github.com/mapteb/framework-for-angular-development/tree/starter-example)

An interesting thing happens when the view component is split into a Smart and Dumb components - you need only to unit test the smart component and the dumb components get tested in e2e. If you have only one smart component for the whole project then you only need to unit test one method (but with different input data for each view).

For the example given above if you run "ng test" you would get:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1csx98aa08erwdr0d1bk.PNG)

Interestingly, the unit test script used above can be reused in any Angular project. You only need to change input data.

If you run "ng e2e" you would get

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ugxj0kjtv2gc61caqywy.PNG)

**Conclusions**
The smart dumb component pattern described here is shown to offer several advantages towards Testing.
From Noob => Freelance => Professional Developer Journey
Tags: webdev, beginners, programming, discuss
Published: 2022-11-26 18:48:42

Coding is fun and inspiring when you think you can create something from a blank text editor. 

The above question may be a realistic inspiration for many programmers/developers. Many people love coding but to do that as a profession or making a living, I think it may be a good topic to start with. 

It will be inspiring to hear from real life experience of developers/coders here. How do you start from scratch with no programming/coding background => get a job/project and start to make a living. 

And when it comes to leisure or business, how do you make a living and still enjoy coding || how do enjoy coding and still make a good living? Should I use &&? 

Appreciate it if anyone could share some enlightenments.
Context Manager With Files In Python
Published: 2022-11-26 18:33:20

## What is a Context Manager?

 Context manager is commonly used with reading and writing files to assist in conserving system memory and improve resource management by ensuring that each process holds its resources while executing.

 It's an object, that is notified when a context starts and ends, of a class that implements the 2 magic methods `__enter__` and `__exit__` and any other methods if needed. 

  
  __For example__: when a context manager ends, the object file is closed. 
  
```python
with open('test_ch30.txt' , 'w+') as file:
	file.write('Blew the lid of ur life')
  
 # the open file has automaticlly been clossed 
```

> Opening a file using `with` statement ensures that [File descriptor](https://www.computerhope.com/jargon/f/file-descriptor.htm) are closed automatically.


## How  `with` statment implements a context manager?

  1-  When an object is called with a `with` statment, the 
   interpreter invokes the `__eneter__` method ,which is used to 
   call and performe the setup code required and needed for the 
   process yo be excuted, before the `with` statment.

  2- 	When the `with` statments ends, the interpreter invokes the `__exit__` method .



*Illustartion* :


![alt text][logo]

[logo]: https://i.pinimg.com/originals/4d/58/99/4d589946718af5d2bc4c7f19a6221960.jpg "context_excution_circle"



## What's required to implement a contect manager class?

```python
class ContextManager(object):
	"""docstring for ContextManager"""
	def __init__(self):
		pass
		
	def __enter__(self):
		print("__enter__()")
		# optionaly return an obj
		return "an instance"

	def __exit__(self , exc_type , exc_val , traceback):
		print("__exit__ with " , exc_val if exc_val else ' nope')


with ContextManager() as e:
	print("is a " , e)

```

##  Multiple context managers
```python

with open('test_ch30.txt') as input_file, open('test_ch77.txt', 'w') as output_file:
	# do something with both files.
	# e.g. copy the contents of input_file into output_file
	for line in input_file:
		output_file.write(line + '\n')

# It has the same effect as nesting context managers:
with open('test_ch30.txt') as input_file:
	with open('test_ch77.txt', 'w') as output_file:
		for line in input_file:
			output_file.write(line + '\n')

```


## Manage Resources

```python 
class File():
	def __init__(self, filename, mode):
		self.filename = filename
		self.mode = mode
	def __enter__(self):
		self.open_file = open(self.filename, self.mode)
		return self.open_file
	def __exit__(self, *args):
		self.open_file.close()


for _ in range(10000):
	with File('test_ch30.txt', 'w') as f:
		f.write('foo')

```

## ManageFile class follow. 

ManageFile class follow/adhere the context manager protocole and support the with statment [Code link](https://github.com/Rowida46/Python-for-profesional/blob/main/Playing_with_Folders/Context_Manager.py#L16)
How spring boot application work as web application
Tags: java, spring
Published: 2022-11-26 18:31:23

Spring boot has everything to create a web application and makes web application development fast and hassle-free. The embedded server makes web application creation easy in Spring boot. If embedded server doesn't exist, then we required to install web server like tomcat and deploy application there. After that, only we can use our Java application as web application. But with the help of embedded server, when we create the deployable unit of application i.e JAR, web-server becomes part of it.

Tomcat is the default embedded server for the Spring boot application. So we don't need to do anything to add tomcat in our Spring boot application because it comes with spring boot starter web. 

```
<dependency>
			 
 <groupId>org.springframework.boot</groupId>
 <artifactId>spring-boot-starter-web</artifactId>
			
</dependency>
```
If any client makes a request to our Java server, tomcat handles the request.This functionality is made possible by the HTTP Connector element. Two important attributes of HTTP connector are protocol and SSLEnabled. The protocol attribute defines the protocol the connector will use to communicate and bydefault set to HTTP/1.1. SSLEnabled attribute helps connector to decide to use SSL handshake/encryption/decryption. Tomcat has more than one HTTP connector, and we can use anyone. In this blog we will talk about NIO connector. 

The NIO connector do non blocking I/O. NIO connector has two thread pools, one holds the poller thread, and other holds the worker thread. Whenever a client makes a request to our Java server, NIO connector uses a thread from poller thread pool and keeps the connection alive. It push these request to handle by the thread from worker threads. Size of both pools are configurable.
SendGrid is deceptive about "Opened emails" statistic
Published: 2022-11-26 18:02:08

### After in-depth analysis of SendGrid system, I came to the following conclusions:

- Their "open" event is not accurate, as it can be trigger by either a BOT or a human
- They know this _(and have built their analytics dashboard, knowingly or unknowingly, so that it doesn't reflect this issue)_

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5grdxxih3wrdcesxhob3.png)
On the above screenshot, you can see that 46 emails are being opened within 100 seconds exactly. There were 96 recipients in total, so that'd mean about 50% opened the email right away?
That's odd, isn't?

### But let's do more testing:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uwupljr9g6yizgyl6xvj.png)
On this batch, we got even better numbers!
66 recipients, 52 of them opened the email within 40 seconds. 🎉

Our marketing team must be awesome, and our product terrific for such quick enthusiasm!
Well, except the "click" rate is ... 1%. Odd, isn't?

### But how does that "open" event works, by the way?

It's simple. SendGrid adds a "pixel" in the email, basically an image which points to a script. Whenever that script is being downloaded, it means the email has been opened. Simple!
_This might not be 100% accurate, but you get the big picture._

👉 SendGrid doesn't know that you've opened the email by actually clicking on it, **they only know that it has been opened**. 

### And what else could open our emails? 🤔

Well, you guessed it (probably): SPAM checkers, and any other "AI" that would read the email content (like Gmail, to know whether to store it into your "Promotion" inbox and all of that).

In conclusion, SendGrid cannot make the difference between an email opened by an actual human, or by a bot!

And that would be fine, it they weren't trying to hide it. (or at least, make it obvious that this information is not 100% accurate!)

Companies use KPIs to run a business, and sometimes, those KPIs are "how many people are reading our newsletter?". Well, when you make strategic decisions like that based on deceptive information, it can hurt.

> Following this analysis, I've contacted the "Trust & safety" team at SendGrid with a few advices on how to be more transparent about this fact, and decided to write a public article about it. 

I believe companies should put transparency over growth.
Don't just hide your problems, but fix it instead, or at least tell us about it.

N.B: I bet other "Email delivery providers" have the exact same issue, and are deceptive, too.

_P.S: I hope nobody got fired "for doing a bad job" because their email campaign had a 1% clicks out of 80% reads. But, murphy law, right?_
Possible Nested Structures App Use
Published: 2022-11-26 17:49:21

- Quizzes to move on to the next pages.
   - Creates an array using checkboxes (at first)
      - Loops through the array and checks for the matching correct answers, if the answers do not match up, show the amount of answers correct and incorrect and do not allow the user to move on to the next page until they answer the correct number or questions needed for that page.
        - Correct number of answers needed for each page will vary 

- Answers will be hints on previous pages. 

**Code Example**
```
<form>
  <label>Red</label>
  <input type= "checkbox" name="quiz 1[]" value="red">

  <label>Blue</label>
  <input type= "checkbox" name="quiz 1[]" value= "blue">

  <button>Submit</button>
</form>
```



**Output**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wa0x5tw48lnfhcdit8hg.png)


**Console (When both options are clicked)**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u0zcngl8vj8af4aiuvfu.png)


*Thought:* Nested hash, keys could be different quizzes or items in a list, quiz, challenge, etc...



 **Source:** *Helper Methods, Pt 2 (Video Timestamp: 34:45)*
Web editor (TinyMCE) to use with your web applications
Tags: editor
Published: 2022-11-26 17:28:55

TinyMCE editor

I have used this editor within web applications that has a rich set of features.

- https://www.tiny.cloud/

It has both Cloud and self-hosting options.

This angular front end framework integration guide is a good place to start to try this editor:
 
- https://www.tiny.cloud/docs/tinymce/6/angular-cloud/

This project has a very good set of documentation.
This 'basic example' https://www.tiny.cloud/docs/tinymce/6/basic-example/ and other guides would get you started right away to use this editor in your web application/web site.
Web Developer Template Resources
Published: 2022-11-26 16:53:52

**A must-explore template resource for web developers.**

- [HTML5Up](https://html5up.net/)

- [Templatemo](https://templatemo.com/)

- [freehtml5](https://freehtml5.co/)

- [Styleshout](https://www.styleshout.com/)

- [Start Bootstrap](https://startbootstrap.com/)

- [Zerotheme](https://www.zerotheme.com/)

- [html5xcss3](https://www.html5xcss3.com/)

- [Colorlib](https://colorlib.com/wp/templates/)

- [Free-css](https://www.free-css.com/free-css-templates)

- [Hubspot](https://www.hubspot.com/resources)

- [Mobirise](https://mobirise.com/html-templates/)

- [Bootstrap Made](https://bootstrapmade.com/)

- [Theme For App](https://themesfor.app/)

- [Bootstrap Taste](https://bootstraptaste.com/)

- [One Page Love](https://onepagelove.com/)

- [Tool Plate](https://www.tooplate.com/)

- [Cruip](https://cruip.com/free-templates/)

- [UIDeck](https://uideck.com/)
GRPC Node + NextJs + Prisma + Envoy Proxy
Tags: node, grpc, nextjs, prisma
Published: 2022-11-26 16:37:47

## **GRPC Node + NextJs + Prisma + Envoy Proxy**
This is a simple CRUD for task management app built with below techs:

1. GRPC-Node
2. NextJs
3. Prisma
4. Envoy Proxy

Currently, I have used 4 Unary RPCs and 1 Server streaming RPC for streaming real-time data, and in the future will implement Client streaming RPCs and Bidirectional streaming RPCs🫡.

I have also used Prisma to store tasks in the database.
The tasks list route("/tasks") will be real-time using GRPC Server streaming RPC, upon adding a new task a trigger will be fired at connected clients.

As well I have added a Unary RPC route to destroy unused clients, maybe you can use a Cron job to trigger that route every 30min or based on your requirements.

GitHub repo: [Real-Time Task Management App](https://github.com/Ozair0/RealTime-Task-Management-App)