teleren/devto huggingface dataset:
Taming the CUDA
Tags: aws, drivers, gpu, rhel
Published: 2020-07-06 22:58:59

---
title: Taming the CUDA
published: true
date: 2020-07-02 19:15:00 UTC
tags: AWS,drivers,GPU,RHEL
canonical_url: https://thjones2.blogspot.com/2020/07/taming-cuda.html
---

Recently, I was placed on a new contract supporting a data science project. I'm not doing any real data-science work, simply improving the architecture and automation of the processes used to manage and deploy their data-science tooling.  
  
Like most of my customers, the current customer is an Enterprise Linux shop and an AWS shop. Amazon makes available several GPU-enabled instance-types that are well-disposed to running data science types of tasks. And, while RHEL is generically suitable to running on GPU-enabled instance types, to get the best performance out of them, you need to run the GPU drivers published by the GPU-vendor rather than the ones bundled with RHEL.  
  
Unfortunately, as third-party drivers, there's some gotchas with using them. The one they'd been most-plagued by was updating drivers as the GPU-vendor made further updates available. While doing a simple `yum upgrade` works for most packagings, it can be problematic when using third-party drivers. When you try to do `yum upgrade` (after having ensured the new driver-RPMs are available via `yum`), you'll ultimately get a bunch of dependency errors due to the driver DSOs being in use.  
  
Ultimately, what I had to move to was a workflow that looked like:

1. Uninstall the current GPU-driver RPMs
2. Install the new GPU-driver RPMs
3. Reboot

Unfortunately, "uninstall the current GPU-driver RPMs" actually means "uninstall _just_ the 60+ RPMs that were previously installed ...and nothing beyond that. And, while I could have done something like `yum uninstall <DRIVER_STUB-NAME>`, doing so would result in more packages being removed than I intended.

Fortunately, RHEL (7+) include a nice option with the `yum` package-management utility: `yum history undo <INSTALL_ID>`.  

Due to the data science users individual EC2s being of varying vintage (and launched from different AMIs), the value of <INSTALL_ID> is not stable across their entire environment.

The automation gods giveth; the automation gods taketh away.

That said, there's a quick method to make the <INSTALL_ID> instability pretty much a non-problem:
  

> ```
> yum history undo $( yum history info <rpm_name>| \
> sed -n '/Transaction ID/p' | \
> cut -d: -f 2 )
> ```

Which is to say "Undo the yum transaction-ID returned when querying the yum history for <rpm_name>". Works like a champ and made the overall update process go very smoothly.  
  
Now to wrap it up within the automation framework they're leveraging. I don't think it natively understands the above logic, so, I'll probably have to shell-escape to get step #1 done.
NoMethodError: undefined method for nil:NilClass... Explained
Tags: rails, ruby, errorexplained, beginners
Published: 2020-07-02 19:05:59

This is a common Ruby error which indicates that the _method_ or _attribute_ for an object you are trying to call on an object has not been defined.

```ruby
NoMethodError: undefined method SOME_METHOD for nil:NilClass
```

For example, the `String` class in Ruby has the method `size` (which is synonymous with `length`, so I can write...

```ruby
greeting = "hello"
greeting.size
#=> 5
```

But `loveliness` does not exist for a string, so when I type it, I will get...

```ruby
NoMethodError: undefined method loveliness for nil:NilClass
```

I find this will come up when I think I'm operating on an object with methods, but I'm actually operating on a hash with attributes.

```ruby
my_hash[:loveliness]
# "very lovely" yay, this is a thing that exists!
my_hash.loveliness
# NoMethodError: undefined method loveliness nil:NilClass
```

Of course, because this is Ruby, we can actually define `loveliness` if we wanted to _very easily_ by monkeypatching the `String` class.

```ruby
class String

  def loveliness
    "very lovely"
  end

end
```

Now we know how lovely our string is. If I was mistaken or unclear, please feel free to add a comment to clarify anything here.

Happy coding ❤️
8 Reasons you won’t use Python
Tags: python
Published: 2020-07-02 18:58:11

Python is one of the most popular programming language around. The most praised thing about Python is it’s shorter syntax compared to other language & termination of “;”. Python is also known for it’s couple of more advantages.
Let’s talk about Disadvantages of Python. I’ll try to figure out 8 disadvantages of Python.

**1. Speed**
Python is **slower** than C or C++. But of course, **Python** is a high-level language, unlike C or C++ it's really a turtle.

**2. Mobile Development**
Python is not a very good language for **mobile development** . It is seen as a **weak language** for mobile computing. This is the reason very few mobile applications are built in it like Carbonnelle.

**3. Power Consumption**
Python is a power hungry language.

**4. Memory Consumption**
Python is not a good choice for **memory intensive** tasks. Due to the flexibility of the data-types, Python's memory consumption is also high.

**5. Database Access**
Python has limitations with **database access** . As compared to the popular technologies like JDBC and ODBC, the Python's database access layer is found to be bit underdeveloped and **primitive** . However, it cannot be applied in the enterprises that need smooth interaction of complex **legacy data**.

**6. Runtime Errors**
Python programmers cited several issues with the **design** of the language. Because the language is **dynamically typed** , it requires more testing and has errors that only show up at **runtime**.

**7. Not suitable for Low Level programming**
Python is not suitable for low level programming. When you are dealing with low level programming e.g. System programming, OS Development, Kernel, Embedded systems ; you need something like NASM , C, C++. For Dealing with hardware , Python is not a good choice at all.

**8. Low availability of UI / Visual component**
If you want to make a 3D graphic game or a software with attractive UI , then most of the time you have to chose from Java , C++ , C#, Swift , Delphi etc ; not Python. Cause available GUI Library / Frameworks for Python are not yet that rich.
10 STEPS TO BECOME THE BEST DEVELOPER
Tags: devops, webdev, codepen, productivity
Published: 2020-07-02 18:57:30



1)
2)
3)
4)
5)
6)
7)
8)
9)
10) USE A DARK THEME IDE
_
_
Comment Your Views On This.
And tell me which text editor do you use
And which theme you prefer.
The .NET Docs Show: Securing .NET apps
Tags: dotnet, aspnet, webdev, dotnetdocsshow
Published: 2020-07-02 18:50:42

---
title: The .NET Docs Show: Securing .NET apps
published: true
description: The .NET Docs Show: Securing .NET apps with Heather Downing
tags: dotnet, aspnet, webdev, dotnetdocsshow
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/quk9h4vmt02liz4935z4.jpg
---

Lately, [The .NET Docs Show](https://dotnetdocs.dev) has been featuring guests who are focusing on Blazor. Blazor is a framework for building interactive client-side web UI with .NET!

In this episode, [Heather Downing (Microsoft MVP)](https://mvp.microsoft.com/en-us/PublicProfile/5003403) joins hosts, David Pine, Scott Addie, and Cam Soper to share how to secure .NET applications using Okta. Heather shares how to mentally differentiate "Authentication" versus "Authorization", we talk about identity, various authorization servers, tokens, oh my! All sorts of great security & developer tidbits!

{% youtube GY5SQMYN_9o %}

If you liked this video and would like to see some more of our .NET content, please subscribe to our [The .NET Docs Show YouTube Channel](https://www.youtube.com/channel/UCIy_nKrwrd-naf_MPWtXdLA).

# Useful links

- [Introduction to ASP.NET Core Blazor](https://docs.microsoft.com/aspnet/core/blazor?WT.mc_id=devto-thedotnetdocs-dapine)
- [An Illustrated Guide to OAuth and OpenID Connect](https://developer.okta.com/blog/2019/10/21/illustrated-guide-to-oauth-and-oidc)
- [How to use JWT (JSON Web Tokens in .NET)](https://www.jsonwebtoken.io)
- [Is there a simplified way to understand OAuth?](https://www.oauth.com)
- [Okta's Blazor Server-Side App login example]( https://github.com/Quorralyne/OktaBlazorAspNetCoreServerSide)
- [The .NET Docs Show](https://dotnetdocs.dev)
Conectando puntos
Tags: beginners, html, css
Published: 2020-07-02 18:47:16

Pasé varios meses tanteando el terreno, aprendiendo donde me estaba metiendo. Tutoriales de HTML y CSS, Javascript, Python, y hasta D3, ya que mi background de diseñador me empuja a la visualización de datos. Entendía todo, y olvidaba todo. Volvía a aprender, y volvía a olvidar. Intentaba empezar a programar algo sencillo, y me atoraba en cosas básicas. Pasé una tarde averiguando como conectar mi css a mi html. 
Mientras más me involucraba, más me desesperaba: No avanzaba, y me daba cuenta de todo lo que me faltaba por aprender. Tal vez no estaba haciendo las cosas bien. Tal vez no encontraba el tutorial correcto. Tal vez... 
Un día, leí un comentario de @Javascriptual en Twitter: 

{% twitter 1268193330896220163 %}

De alguna forma, me tranquilizó. Paciencia, pequeño Padawan, paciencia. 

Todos esos meses tanteando el terreno me llevaron también a encontrarme el libro Inclusive Components de Heydon Pickering, y esta frase:

*"But the code of the web is not all the code of classical computer science, and should not be judged on the same terms. HTML is the code of writers, and CSS the code of graphic designers. Writers and designers are best positioned to write those kinds of code."*

Repitan conmigo: **CSS es el código de los diseñadores gráficos.**
Encontré mi camino. Vamos allá.
What I Learned About Attitude and Mindset in Coding Bootcamp Pt. 2
Tags: codenewbie, productivity, motivation
Published: 2020-07-02 18:44:50

This is my second post out of a three part series regarding attitudes and approaches to healthily get through a coding bootcamp. Aside from learning to temper my hyper-focus on competition, I’ve also learned that self care is not something to ignore or avoid.  

**Self Care is mandatory**
Pace, balance, rest, and understanding… all of these things contribute to the concept of self care. Think of someone who you care deeply about; for me it would be my future son or daughter. Now, take a look at the way you run your life and the way you treat yourself. Would you want that for them? Would I want my daughter to work an average of 12 hours a day on code and then feel afterwards like she was a total failure and not good enough? Of course not. Sometimes when we step out of our shoes, we can see the absurdity of the expectations we hold for ourselves. Not only is it absurd, but it is not sustainable to ignore other facets of life that make things meaningful. Each one of us is valuable and worthy of self care. 

**Mistake:** 

I got super into the flow of coding during the bootcamp, and in the moment I was like, “I’m not gonna stop until I have everything working!” It was an addictive flow. However, day after day of doing this, I started having focusing and memory problems. I also couldn’t sleep properly because my mind was literally still trying to code in a half dream state. It got to the point where I was forgetting to eat, drink, and get up to go to the bathroom. I started to feel mildly insane. 

**Improvement** 
Then I realized that I was essentially marathoning. In an actual marathon, you run just over 26 miles. Even if you love coding, even if you love running, no one is going to thrive if they keep working at maximum capacity. I felt guilty initially when I took breaks, like “oh I could be learning more about enumerables right now instead of laying in bed”, but then I had an attitude shift to, “I feel guilty about not taking care of myself properly.” Would you feel badly towards someone who just ran a marathon and they’re asking for a break?

This brings in the concept of pacing. It is easier on the body to run a few miles per day rather than doing it all in one session. Same with the brain. Even though I have the *capacity* to marathon the project, that’s probably not what I *should* do. Eventually, I discovered what works best for me: I code 9am-12 noon. Take a yoga and lunch break. Then 1-5pm do more code. Afterwards, I play board games with friends, work on art, and exercise outside (and sometimes splurge on Netflix or Youtube). When I pace it out, it is absolutely amazing how my mind feels so much better. More focus, less stress and it's easier to go to sleep. And just as importantly, my life is more full of all the things I love; I’m not missing out on them. 

What do you think about self care and pacing? What works for you? Feel free to comment below! 

Read [Part 1](https://dev.to/wolfdominion/what-i-learned-about-attitude-and-mindset-in-coding-bootcamp-pt-1-3nl0)
(Proper) Gated Content with Gatsby and an identity provider
Tags: gatsby, auth
Published: 2020-07-02 10:20:40

Is it possible to use Gatsby and any identity provider (agnostic) to achieve a Gated Content experience similar to the one on this website: https://auth0.com/resources/ebooks/no-distractions-ebook-2020.

* New user submits form (without password and account setup)
The page doesn’t reload, instead displays a button to download the content after form submission.
* If a user returns to another download resource on the website they are asked “*Previously, you’ve downloaded content using this address: example@example.com. Would you like to use same address?*”
* User has the option to download using the same email and is given another opportunity to opt-in.

The elements of this I see as being a Proper gated content experience are:

* User doesn’t need to signup for an account with a password just to receive a piece of content, it is a standard form with email.
* The site recognises the user for future downloads
* Form is ‘inline’ in the page not a popup nor redirects around the site.
Survival package (not just) for devOps newbies
Tags: devops, webdev, career, motivation
Published: 2020-07-02 18:39:48

---
title: Survival package (not just) for devOps newbies
published: true
description: Some links for devops newbies.
tags: #devops #webdev #career #motivation 
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/lyws45aeykglssylnv0j.png
---

# Welcome to your company!
Landing at a big software corporation can be tough, especially if their onboarding process is outdated - *which often is!*- along with their unmaintained wiki pages and workflow documentations. Discovering domain secrets is an exhaustive task by itself. The least you need is troubles with general things like coding and communication.

I'm going to share some **tools** that I regularly throw at newcomers at my place. I hope it can help others as well.

## [Design Patterns](https://sourcemaking.com/design_patterns)
Not strictly DevOps related, but it can come in handy, especially if you're a **Bootcamp developer** and you didn't have a lot of software design classes. *SourceMaking* is awesome, make sure to check out their articles about antipatterns as well!

## [Linux Basics](https://linuxjourney.com/)
A good grasp on Linux systems is key at any software job these days. *Linuxjourney* is a beautifully designed informative site that helps you understand all the basic concepts.
For detailed command-line help, I suggest [the-art-of-command-line](https://github.com/jlevy/the-art-of-command-line) by [Joshua Levy](https://github.com/jlevy)


## [Bash Scripting](https://github.com/dylanaraps/pure-bash-bible)
Bash is an awesome language. It's super powerful and super permissive - consequently **super dangerous** if you're not sure how to do things in a safe way. Knowing good boilerplate is essential.


## [Art of biases](https://yourbias.is/)
Making decisions about software can be difficult, but I've learned that knowing the most common biases can protect us from harmful patterns, general management mistakes, sometimes even from technical debt. That's why this site is awesome. Careful with [this one](https://yourbias.is/the-sunk-cost-fallacy) for example. This deserves a whole article.

## [International communication](https://www.hofstede-insights.com/product/compare-countries/)
You might end up being puzzled by the behavior of your colleagues if you've never been exposed to their culture. This tool of *hofstede-insights* can come quite handy to decipher some differences.

## Just some [*Less* infographics](https://less.works/)
Large scale scrum is *the way* these days. I had to include it.

## How others do it
It can be really useful to look at other companies' blogs and see how they do stuff. For example, I really enjoy [Riot's tech blogs](https://technology.riotgames.com/news/putting-jenkins-docker-container), check it out.

## One for the fun
Which is your company? Elaborate in the comments!

![infographic](https://i.imgur.com/FH1arHq.jpg)
Top 5 DEV Comments from the Past Week
Tags: bestofdev
Published: 2020-07-02 18:16:32

---
title: Top 5 DEV Comments from the Past Week
published: true
description: Highlighting some of the best DEV comments from the past week.
tags: bestofdev
cover_image: https://res.cloudinary.com/practicaldev/image/fetch/s--7VrAA2ln--/c_imagga_scale,f_auto,fl_progressive,h_420,q_auto,w_1000/https://thepracticaldev.s3.amazonaws.com/i/qmb5wkoeywj06pd7p8ku.png
---

This is a weekly roundup of awesome DEV comments that you may have missed.  You are welcome and encouraged to boost posts and comments yourself using the **[#bestofdev](/t/bestofdev)** tag.

What @habereder’s coworkers lack in opposable thumbs, they make up for in code-review skills. Check our their comment in the [“Show off your pet(s) :-)”](https://dev.to/cilvako/show-off-your-pet-3ok) thread:

{% devcomment 114e7 %}

@catmcgeecode sheds (fire)light on the sometimes infinite loop of programming in [Explain what a programmer does. Wrong answers only](https://dev.to/domenicosolazzo/explain-what-a-programmer-does-wrong-answers-only-46i9): 

{% devcomment 114nl %}

@miketalbot shared how they vanquished the headache of those irritating debugger windows on Chrome with this sweet new setup:

{% devcomment 118bi %}

@swyx gets candid about… getting candid 😁:

{% devcomment 116j3 %}

@juanfrank77 shares some helpful feedback on their own sneaky bad developer habits to watch out for:

{% devcomment 112mp %}



See you next week for more great comments ✌
Création Site Web
Tags: seo
Published: 2020-07-02 18:08:58

Nous sommes spécialisés dans la <a href="https://creationsitewebs.com">création de site web maroc </a> d’entreprises de toutes tailles et pour tous types de secteurs d’activités Et Marketing Degital: Le référencement naturel (Seo),Le social média marketing.

C'est ainsi que nous créons des sites sur mesure au reflet de votre entreprise et selon un cahier des charges bien défini.


Tous nos sites sont responsive, c'est à dire qu'ils s'adaptent automatiquement aux smartphones et tablettes.
How To Style Sign Up - Building SaaS #47
Tags: python, django, saas, templates
Published: 2020-07-02 18:07:55

{% youtube 7w33auedQXA %}

In this episode, I added styling to the Sign Up page of the site.  We chatted about CSS tools and frameworks, the benefit of feature flags to control what UI is displayed to users, and how to use Tailwind CSS to modify a design quickly.

In the first portion of the stream, we focused on CSS frameworks.  We compared Bootstrap, Semantic UI, and Tailwind CSS.

After that discussion, I talked about feature flags.  The project uses a feature flag to protect the sign up page and only displays the page when I turn on a flag.  This control will be useful for me to gate which new users I would like to allow into my project as I open it up to others.

Once the feature flag was on locally, we worked to style the signup form that was provided by django-allauth.  I kept the form very basic with a plan to expand it in the future.  We also talked about JS frameworks and my plans for which framework to use.

We finished the development for the stream by fixing the notification messages.  While testing the sign up flow, I noticed that multiple notifications appeared from django-allauth and my UI stacked them in a way that looked off.  We used flexbox to fix the issues so that multiple notifications could display well together.

This article first appeared on [mattlayman.com](https://www.mattlayman.com/building-saas/how-to-style-sign-up/).
LeetCode July Challenge -1: ArrangeCoins -solution explained 
Tags: computerscience, algorithms, programming, beginners
Published: 2020-07-02 18:03:21

# Question : Arrange Coins

You have a total of n coins that you want to form in a staircase shape, where every k-th row must have exactly k coins.

Given n, find the total number of full staircase rows that can be formed.

n is a non-negative integer and fits within the range of a 32-bit signed integer.

### Example 1:

```
n = 5

The coins can form the following rows:
¤
¤ ¤
¤ ¤

Because the 3rd row is incomplete, we return 2.
```

### Example 2:
```
n = 8

The coins can form the following rows:
¤
¤ ¤
¤ ¤ ¤
¤ ¤

Because the 4th row is incomplete, we return 3.
```

> Refer the problem [here](https://leetcode.com/explore/challenge/card/july-leetcoding-challenge/544/week-1-july-1st-july-7th/3377/)


---

# Solution:

We can solve this problem in 3 different ways.

Basically, the main idea to solve this problem is same for all 3 approaches. If you observe carefully, for each row K is in increasing order.

### Brute Force approach:

1. Lets start by taking k = 0 and then continue linearly.
2. increment k by 1 and decrement k coins from n 
3. loop until n value is greater than 0.

```
let arrangeCoins = function (n) {
  let k = 0;
  while (n > 0) {
    k++;
    n -= k;
  }
  return n === 0 ? k : k - 1;
};
```
>Time Complexity : O(n)

---

Below 2 approaches follow a similar pattern.

Let's assume we can form K full rows, we get a sum of K terms.
1 + 2 + 3 + 4 ... + k = Arithmetic progression , sum of K terms [k(k+1)/2]

the equation would be `k(k+1) / 2 <= n`

We need to find the maximum K value which satisfies the above equation.

Since our series is in incremental order of coins. We can use the binary search approach to find the maximum value of K

### Binary Search Approach: 

```
let arrangeCoins = function (n) {
  let low = 0,
    high = n;
  let k, current;

  while (low <= high) {
    k = parseInt(low + (high - low) / 2);
    current = (k * (k + 1)) / 2;
    if (current === n) {
      return k;
    }
    if (n > current) {
      low = k + 1;
    } else {
      high = k - 1;
    }
  }
  return high;
};
```
>Time complexity : O(logn)

---

### Math Approach (Efficient approach):

Lets look at our equation once again.

k(k+1) / 2 <= n

#### Let's solve this

k(k+1) <= 2n

Add 1/4 on both sides of the equation.
So that, left side of the equation can be formed into (a+b)^2

(k^2 + k + 1/4) <= (2n + 1/4)

(k + 1/2)^2 <= (8n+1)/4

k <= sqrt((8n+1)/4) - 1/2

Our final equation would be

```k <= (sqrt(8n+1) -1)/2```

Now using this formula, our code would be:

```
let arrangeCoins = function (n) {
  return  parseInt((Math.sqrt(8 * n + 1) - 1) / 2);
};
```
>Time Complexity: O(logn)

---

[Refer source code of other problems](https://github.com/savithagollamudi/leetcode-monthly-challenge)
Soylent Green and Conway’s Law
Published: 2020-07-02 17:54:28

So I was just dragging some tickets around our board, observing the links between work items and how they really are like little microcosms of our social networks at work. Anyone who has been following along with the trends of microservices and loosely-coupled team structures may be familiar with calling this class of phenomenon to be, “Conway’s Law.”

> Any organization that designs a system (defined broadly) will produce a design whose structure is a copy of the organization's communication structure.

[Mel Conway](https://www.melconway.com/Home/Conways_Law.html)

This is no big shocker when you think about it, and many of us have felt this way on an instinctual level for years. If you have broken social systems at work, you will have broken technological systems at work. That’s how it goes.

Or, to summarize, Software is People. IT'S MADE OUT OF PEOPLE!!