teleren/devto huggingface dataset:
Enabling OpenCensus Tracing with Django and Google Cloud Run
Published: 2021-09-09 21:27:20


 Make sure the service worker you have set up on your Cloud Run service has IAM roles `cloudtrace.agent`. if you are using terraform, it will be set up as such:
```tf
resource "google_project_iam_binding" "service_permissions" {
  for_each = toset([
    "logging.logWriter",
    "cloudsql.client",
    "clouddebugger.agent",
    "cloudtrace.agent"
  ])

  role       = "roles/${each.key}"
  ...
}
```
![Screen Shot 2021-09-09 at 18.21.06](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tuseibc5965w6uvvfy1r.png)

Install the required pip packages from [OpenCensus](https://opencensus.io/) and `google-cloud-trace`. Which is the new hotness that merged `OpenTracing` and OpenMetrics into one beautiful package. I have added these to my `requirements.txt` file. 

```
...
opencensus-ext-django==0.7.5
opencensus-ext-stackdriver==0.8.0
opencensus==0.7.13
...
```
Then `pip install -r requirements.txt`

Now we simply have to configure django settings to include the opencensus middleware and tell the package to export it in StackDriver (now Google Cloud Operations/Monitoring) format.

On my core settings file `/core/settings/base.py`, we have:

```py
MIDDLEWARE = [
    ...
    'opencensus.ext.django.middleware.OpencensusMiddleware',
]

OPENCENSUS = {
    'TRACE': {
        'EXPORTER': 'opencensus.ext.stackdriver.trace_exporter.StackdriverExporter()',
        'PROPAGATOR': 'opencensus.trace.propagation.google_cloud_format.GoogleCloudFormatPropagator()',
    }
}
```

And let's build the new image with `gcloud builds submit` or by using a Cloud Trigger. And we are done! Now you can check the [Google Trace](https://console.cloud.google.com/traces) console to see your traces in action.

![Screen Shot 2021-09-09 at 22.28.43](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l3eqjke3r6wrk3df4bxc.png)
🐋Fazendo ciência de dados com docker
Tags: braziliandevs, devops, datascience
Published: 2021-09-09 21:22:05

AS: Esse conteúdo em breve será apresentado na [Twitch](https://www.twitch.tv/edineidev), será disponibilizado em breve no [YouTube](https://www.youtube.com/channel/UCkSe6llMT88LqEGrMROSUbA) e em forma de Podcast.

Supondo que você já tenha [docker instalado e devidamente configurado seja Windows/Linux/Mac](https://docs.docker.com/get-docker/). Temos uma [ documentação sobre as imagens do Jupyter](https://jupyter-docker-stacks.readthedocs.io/en/latest/using/selecting.html) se quiser uma outra configuração vamos usar a `jupyter/datascience-notebook` mas temos diversas outras.

Usando o `docker run`:
```
docker run --rm -p 10000:8888 -e JUPYTER_ENABLE_LAB=yes -v .\my-notebook:/home/jovyan/work jupyter/datascience-notebook
```

![Veja que o token do jupyter será exposto e será usado a porta 8888 mas vamos usar 10000](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yo48b43mkv8sis8ytgo6.png)

Ficando no final http://127.0.0.1:10000/?token=6f2fa7151f0fa43cd17af52a830bb76114e20e9b3cd31078 ao acessar:

Imagem do launcher do jupyter
![Imagem do launcher do jupyter](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kdndhbqjt3wgv98w0ysz.png)

Vamos selecionar a pasta work
![Vamos selecionar a pasta work](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1jgpbrrkjgf8qvz0nj5j.png)

E escolher Python 3 no Notebook
![E escolher Python 3 no Notebook](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1ovbs4i5bib0ll2l9c42.png)

Escrever `!python — version`
![Escrever !python — version](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4h8jkexyesg3ahdapk64.png)

Vamos notar que o nosso arquivo Untitled.ipynb do jupyter foi para nosso host.
![Vamos notar que o nosso arquivo Untitled.ipynb do jupyter foi para nosso host.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/szlhedvngezcqiu6hb7h.png)
September 9th, 2021: What did you learn this week?
Tags: weeklylearn, discuss, weeklyretro
Published: 2021-09-09 21:20:37

It's that time of the week again. So wonderful devs, what did you learn this week? It could be programming tips, career advice etc.

<center>

![A picture it a dog waving their paw with the caption “Learning, cool at school or at home”](https://media.giphy.com/media/1xpm1nTQiRL96Di3Q6/giphy.gif)
</center>

Feel free to comment with what you learnt and/or reference your TIL post to give it some more exposure.

{%tag todayilearned %}

And remember, if something you learnt was a big win for you, then you know where to drop it as well.👇👇🏻👇🏼👇🏽👇🏾👇🏿

{% link https://dev.to/devteam/what-was-your-win-this-week-1mc2 %}

<center>

![Drama from Entourage screaming “Victory!”](https://media.giphy.com/media/lnlAifQdenMxW/giphy.gif)
</center>
#100daysofcode [Day 10]
Tags: javascript
Published: 2021-09-09 21:12:42

Hey There , Today is the tenth day of 100 days coding challenge ! And Today i tried to know more about local storage and session Storage. and i make this site, here if you add items in this site and do refresh the browser, the items of this site will still remain in this site/page .
code Link : https://lnkd.in/gherj5t6
Live Site : https://lnkd.in/gQwgWkRM
Easter Calculator
Tags: python, programming, computerscience, functional
Published: 2021-09-09 20:38:55

```python
# easter_calculator.py
#   This program takes a year as an input, verifies that it is in the proper
#   range, and then prints out the date of Easter that year.
# by: Scott Gordon

from datetime import datetime, timedelta

def main():
    print("Welcome To the Easter Calculator\n")
    print("Choose a year that you want to find the date of easter from 1982-2048")
    year = int(input("Please enter the year (yyyy) here: "))

    def easter_calc(year):
        """Takes year as input and prints out when Easter was that year."""
        a = year % 19
        b = year % 4
        c = year % 7
        d = ((19*a) + 24) % 30
        e = (2*b + 4*c + 6*d + 5) % 7

        start_date = datetime(year, 3, 22)
        format = "%m/%d/%y"
        easter = start_date + timedelta(d+e)

        if (year >= 1982) and (year <= 2048):
            return f"\nThe date of Easter is {easter.strftime(format)}"
        else:
            return f"\nSorry you must choose a year from 1982 to 2048."

    print(easter_calc(year))


if __name__ == "__main__":
    main()
```
Photo by <a href="https://unsplash.com/@anniespratt?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Annie Spratt</a> on <a href="https://unsplash.com/s/photos/easter?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>
Effective Java: Document All Exceptions Thrown By Each Method
Tags: java, effective, exceptions, architecture
Published: 2021-09-09 20:26:46

---
title: Effective Java: Document All Exceptions Thrown By Each Method
published: true
description: A dive into chapter 74 of Effective Java
tags: java, effective, exceptions, architecture
series: Effective Java Review
canonical_url: https://blog.scaledcode.com/blog/effective-java/document_all_exceptions/
---

Documentation is critical for quickly understanding a class and its methods. Exceptions, both checked and unchecked, are part of the contract of a method and thus should be properly documented to allow users of your code to quickly understand how your code behaves.

Part of what makes good documentation is that it is very specific. While it is not a lie to document that a method throws `Exception` or even `Throwable` it isn't useful. We should be striving to throw (and by extension document) the most specific exception type possible. This is of particular import when we are documenting an interface where the interface's documentation will serve as the common documentation for all the implementations.

JavaDoc offers a simple way to document exceptions thrown by a method by using the `throws` tag. This first-class support for exceptions in JavaDoc can be used for both checked as well as unchecked exceptions. A particular thing that can be extra beneficial about documenting these exceptions can turn into the documentation of the _preconditions_ for the method which can be extremely useful for users of your class. If a particular exception will be thrown from each method in a class you can choose to use a class level comment which can clean up the documentation to an extent.

Documentation is extremely important. We may not always see the immediate payoff of this documentation but in the grand scheme of things, it can pay for itself many times over.
Resume Parser
Tags: machinelearning, nlp, ai, datascience
Published: 2021-09-09 20:01:11

Parsing Resume is not an easy task. This tasks comes with lot of challenges such as 
- resumes for different doamins(IT, commerce, etc) have differnet parsing challenges
- dealing with different fileformats. (docx,pdf,images)
- dealing with resume formats. (structure of resumes)
- Identifying sections within resumes (Education, Work Experience, personal details, etc)
- Develping an ontology for categorization of domain,skills, designation, etc 


## Hybrid approach
- Rule Based Approach
- Statistical Apporach
- Machine Learning Based Approach

1. **Rules Based Approach**
   - Write rules to parse resume and detect diferent sections of resumes using headings.
   - Then write separate rules for each section 
     - Work experience: parse comapny name, company location, duration(from-to-end Date)
     - Education: Parse Instituion name, year, etc

2. **Statistical Based Approach**
   - Use statistics to identify the common skills in a particular domain, a very basic way is to count the number of times that skill is mentioned. 
   - This method also helps to identify if new skill has arised in a particular industry. As more and more candidate start mentioning it the parser will increment the count of that skill in our database. And a threshold will help to qualify the skill.

3. **Machine Learning Based Approach**
   - On having enough data from above two approach, train model to classify the section
   - Trail model to detect NER (location, dates,etc) 

You will always feel your parser lack in perfection, so the correct approach would be to set the threshold around your parser and not getting overwhelmed by all the problems at the same time. and you will also experience the chicken-and-egg problem at start.




Paid tools 
- [Daxtra](https://www.daxtra.com/resume-database-software/resume-parsing-software/)
- [Turbohire](https://turbohire.co/)
- [Burning Glass](https://www.burning-glass.com/products/lens-suite/)


I will Keep updating more on this, Please let me know if you are looking for depth on any specific thing for resume parser.
Sharpen your Ruby: Part 5
Tags: ruby, rails, beginners, tutorial
Published: 2021-09-09 19:53:25

---
title: Sharpen your Ruby: Part 5
published: true
description: Learn Ruby Programming Language
tags: ruby, rails, beginner, tutorial
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ypw5698bi8gw3d19hl5v.jpeg
series: learn-ruby
canonical_url: https://eric-the-coder.com/sharpen-your-ruby-part-5
---

I develop in Javascript, Python, PHP, and Ruby. By far Ruby is my favorite programming language. 

Together let start a journey and revisit our Ruby foundations. 

Follow me on Twitter: <a href="https://twitter.com/EricTheCoder_" class="twitter-follow-button" data-show-count="false">EricTheCoder_</a><script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script> 

<h2>Classic Loop</h2>
In Ruby like any other programming language we can iterate a number of fix or variable times. Here are a classic infinite loop that will execute until the program crash.
```ruby
loop do
  put 'Hello World'
end
```

<h2>While loop</h2>
It is possible loop while a condition is meet.
```ruby
number = 0
while number < 100
  puts number
  number += 1
end
# Will print numbers from 0 to 99
```

<h2>Loop until</h2>
It is possible loop until a condition is meet.
```ruby
number = 0
until number == 10
  puts number
  number += 1
end
# Will print numbers from 0 to 9
```

<h2>Loop x number of times</h2>
```ruby
(1..10).each do |i|
  puts i
end
# print numbers from 1 to 19
```
or also
```ruby
10.times { puts "Hello World" }
```

<h2>Loop through each element</h2>
By far, the most use loop is the 'each' iteration
```ruby
# Array of names
names = ['Peter', 'Mike', 'John']

# Iterate the names list
names.each do |name|  
   puts name
end

# or shorthand version
names.each { |name| puts name }
```

<h2>Break and Continue</h2>
It is possible to stop the loop before the end. It is also possible to skip one iteration and go to the next one.
```ruby
names.each do |name|  
  next if name === 'Mike' 
  puts name
end
# Peter 
# John
```
The iteration will skip the puts statement if the name is equal to Mike

```ruby
names.each do |name|  
  break if name === 'Mike' 
  puts name
end
# Peter
```
The iteration will stop if the name is equal to Mike. 

<h1>Exercise</h1>
Create a little program that:
- Create a loop with 10 iterations (from number 1 to 10)
- Each iteration will print only if the iteration number is even. Odd number will be skip.

Solution
```ruby
10.times do |num|
  next if num.odd?
  puts "Number #{num}"
end
```

<h3>Conclusion</h3>
That's it for today. The journey just started, stay tune for the next post very soon. (later today or tomorrow)

If you have any comments or questions please do so here or send me a message on twitter. 

Follow me on Twitter: <a href="https://twitter.com/EricTheCoder_" class="twitter-follow-button" data-show-count="false">EricTheCoder_</a><script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
Best JavaScript coding projects for beginners! 👨🏻‍💻
Tags: javascript, beginners, programming, webdev
Published: 2021-09-09 19:45:49

If you started coding in JavaScript and want to know some awesome project ideas, to practice this language on its fullest, here are the best JavaScript coding projects for beginners!!
<br>
<hr>
## Weather App

![Weather App](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tvt17rziihrxeorrn21t.png)
This project will help you to learn, how to deal with API's and the JS-fetch function.
<br>
## Shopping Cart

![Shopping Cart](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cfcq7ictx3bcjd73zneu.png)
A shopping cart teaches you how to deal with API's or databases. It allows you to deal with a lot of data. Furthermore you have the possibility to add some filters.
<br>
## Portfolio Page

![Portfolio Page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5fezn5rpf95zijkvndyg.png)
This project is extremely simple. You don't have to use any API's or databases for this. There is no need for any backend! Just make some kind of landing pages and add interesting information about you! For more, just add a simple contact page!
<br>
## Tic Tac Toe

![Tic Tac Toe](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z66t5d7tt138gt6pg3o5.png)
With this game, you'll get a small view into game development. Especially for games where you and your partner have to play in alternating order.
<br>
## To-Do List

![To-Do List](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oulcwttfgt9qu6x7y7ov.png)
With this project you will go deeper into the thematic "removing and adding" elements. You will learn how to deal with "Drag and Drop" and way more!
<br>
## Digital Clock

![Digital Clock](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0bc0sxpsz7w73n2w86pv.png)
The digital clock is a very basic project to get to know the built in function for time. Beside to that you'll learn some CSS skills.
<br>
<hr>
### It's your turn!
Comment down below other awesome projects for beginners, that you already coded. Let me know!
[TIL] Mysql Stuff
Tags: todayilearned, mysql, sql, 10sep2021
Published: 2021-09-09 19:44:23

1) mysql has a json type and the subjectively less interesting spatial types (more r&d coming soon).

2) mysql has a decimal type where you can specify exact number of digits. egs:- some_col DECIMAL(5,2); where 5 is the scale ie number of digits and 2 is the precision ie the number of digits after the decimal.

3) the int column can be declared in these ways
    ...int, ...
    ...int(10), ... 
    ...int(10) unsigned, ...
    ...int(10) unsigned zerofill, ...

4) the '8' int(8) refers to the number of padding to the left of the number not the size/length of the number, and it becomes obvious when zerofill is added.Here is a screen shot i took just for you
![Zerofill screen shot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f1ljlhc69svvb5x463t8.png)

5) Timestamp converts data into utc and back where as date time stores data as is.
[Here's a link to a post by someone who takes the chore of writing articles much more seriously.](
https://www.c-sharpcorner.com/article/difference-between-mysql-datetime-and-timestamp-datatypes/)


**Conclusion (da ta daaa)** this is first of (hopefully) many articles (atleast one per week). Any form of constructive critisism is always welcome with open arms. So.. see you around i guess ${insert akward goodbye}.
ICYMI: Our Celebration of #NationalDogDay
Tags: culture, people
Published: 2021-09-09 19:34:06

In case you missed it: The Armory crew celebrated #NationalDogDay and shared super-cute photos and video of some of the special dogs in our lives. Get your daily dose of cute in the photos below.

{% twitter 1430960074973929476 %}

{% twitter 1430995699324227584 %}

{% twitter 1431008670544896004 %}

<img src="https://p-qKFvWn.b3.n0.cdn.getcloudapp.com/items/kpunOqAZ/697f9d6e-6ab1-4dee-a15a-0630868aa10f.gif?v=10815d5b81c229d195fa7e2efb511ac0" alt="Armory crew with dog friends" />
Prelude to my Journey
Tags: beginners, youtube
Published: 2021-09-09 19:11:18

Getting ready to start my youtube channal. Still need to make some content for it. I hope I'll enspire others to better themself's. It's going to have all my steps I take to becoming a developer. Here's my intro to the videos I'll be making.
https://photos.app.goo.gl/4VpaDTrnKMMEftzH8
Health for Software Engineers🤾
Tags: programming, productivity, discuss
Published: 2021-09-09 19:01:12

There's this common saying - *"health is wealth"*, a proverb often forgotten in modern world. As the world is picking pace and moving faster than ever before, our health is what turns out to be most neglected 😞. 

Now coming to us developers, most us might not prefer to speak on boring topics like health, and quite similarly the software world is very famous for its sedentary lifestyle.

Many software engineers have complained of severe back pain and other issues till they realised that health is something which is important as well.

##Tips for better health ✅

If you are a software engineer, these following suggestions might gift you a better health and a better life. 🎉

**Get Moving🚶‍♂️**
This is probably the most simple yet the most effective decision you as a developer could take for your health. 

After sitting on your chair for hours you might feel a strange dip in your focus and energy levels. A simple walk for 30 mins outside will bring back the focus and refresh your energy levels🔋. 

Who knows you might even get an idea for the bug long left unsolved 🤯!

Human body was not meant to sit for hours in front of a computer. So try getting up and moving around every now and then and I cannot stress this enough.

**Drink Water 🚰**
This is one of the most underrated options. You need to keep yourself hydrated, so consider sipping on a glass of water every now and then. 
> Up to 60% of the human adult body is water

So, do make sure to keep yourself hydrated 🥤.

**Workout🏃‍♂️**

I agree its hard to find time to workout on a regular basis. But lack of physical activity is a silent killer🔪.

Make a determination to workout 3-4 times a week as this will only help you stay healthy in the long run. And better health correlates to better focus 🧠 which equals better software development (if you're a developer).

If its hard for you to find time to hit the gym, no worries, I am attaching some links to workout sessions which I personally find very helpful.

- <a href="https://www.youtube.com/watch?v=edIK5SZYMZo">Replace Treadmill With This 10 Min HIIT/CARDIO Workout</a>
- <a href="https://www.youtube.com/watch?v=KxKJEIqS1HQ&t=872s">20-Minute Interval Run Workout</a>
- <a href="https://www.youtube.com/watch?v=xcG8GnWwGfo&t=11s">Running In Place Workout At Home - Lose Weight Fast</a>

Even 20 mins of home workout, 3 / 4 times a week is way better than weeks of no activity.

**Nutrition 🥦**

Proper nutrition plays a vital role in your health. Instead of eating out prefer food made at home, and prefer fruits and vegetables🍎 over junks 🍔. 

**Sleep 😴**

Probably the most important of all. A good night's sleep can give you a full day's energy and to take on the nasty bug that has been giving you sleepless nights for weeks.

> Sleep is so underrated ✅.

These were some of the changes you as a developer can make in your lifestyle that may not show immediate results but more often than not will help you in the long run.🎉

P.S - Would be great if you let me know in comments where I went wrong or have missed something 😀.
Powerful Devs Conference
Tags: powerfuldevs, azure
Published: 2021-09-09 18:52:36

Want to learn about how to leverage Fusion Teams and the Power Platform to build applications faster and with less code?  

Join our experts at #PowerfulDevsConf on Sep 14, 8–11:30 PT (GMT+8).

You'll hear from community members, Microsoft MVP's and Microsoft execs.  This is a LIVE event with a variety of topics ranging from custom connectors to ALM and more!

Scott Guthrie will kick things off with a fireside chat on why code-first devs should embrace the Power Platform.  And we have an amazing closing keynote with Charles Lamanna and Amanda Silver as they talk about all the latest and greatest innovations and their take on the future of development.  

Register now https://aka.ms/PowerfulDevsConf21
Building a Dictionary app in React js
Tags: tutorial, react, webdev
Published: 2021-09-09 18:48:13


![enter image description here](https://ik.imagekit.io/tyfldsi6ql9s/dictionary-app-ss_Aw7chCnr34.png?updatedAt=1631212915008)

##### In this series, we will build a dictionary app from scratch, the features include, using Public API, playing the pronunciation(audio), bookmarking any word (using local storage to save it) and navigation.

It's a beginner's level React app, in order to get started you just need to know the basics of React (components, JSX, props).

[View live ](https://dictionary-rho.vercel.app/)

[Learn more + Resources](https://www.desicodes.io/projects/dictionary)

[Youtube Playlist](https://www.youtube.com/playlist?list=PLmA3URVkjqnmwxdT6GtkfaGVQ4Wm8hnPo)