teleren/devto huggingface dataset:
How to fix an Endless Loop in Python?
Tags: python, discuss
Published: 2017-10-17 02:17:45

---
title: How to fix an Endless Loop in Python?
published: true
description: Python Programming help
tags: #Python #discussion
---

Hello,

This is my first time here on dev.to. I need some help fixing a code.
See I'm learning Python from scratch and created this simple game program using Python that randomly rolls a dice in Visual Studio 2015.

But two problems have risen from my program. The first problem is that the dice doesn't exactly roll randomly. It will give me the random number but the numbers will not change until I close the program and only then do I close the program that it will give me another random set of numbers again.

The second problem I have found is when I run the code, it goes into an endless loop. I'm not sure how I am able to make this loop endless but I don't know how to stop it. If anyone can help me fix my mistakes, I'd really appreciate it.

Please find my code here.

    import random
    min = 1
    max = 6
    dice = random.randint(1, 6)
    dice2 = random.randint(1, 6)

    roll_again = "yes"

    while roll_again == "yes" or roll_again == "y":
        print "Rolling the dices..."
        print "The values are...."
        print dice
        print dice2

    if(dice + dice2 == 6):
        print("You rolled a 6! You have been cursed!")
    elif(dice + dice2 == 7):
        print("You rolled a 7! You have been blessed with money")
    else:
        print("You don't have any blessings")

    roll_again = raw_input("Roll the dices again?")


Thank you in advance.
MongoDB GUI tools for managing your DB's
Tags: mongodb, tools, nosql
Published: 2017-10-17 00:11:26

---
title: MongoDB GUI tools for managing your DB's
published: true
description: Learn to manage your database with Compass
tags: mongodb, tools, nosql
---

When we are working with databases is very useful to manage them using a tool which allows us to query and visualize our information not only fast, but also easy. I'm using [mongodb](https://www.mongodb.com/) in a project and I have found some GUI tools which I think you can find helpful. Let's get started to see them.

### MongoDB Compass (official tool for mongodb)

>*"MongoDB Compass is designed to allow users to easily analyze and understand the  contents of their data collections within MongoDB and perform queries, without requiring knowledge of MongoDB."* [Official site](https://docs.mongodb.com/compass/current/#overview)

### Robo 3T & Studio 3T

>*"Robo 3T (formerly Robomongo) is the free lightweight GUI for MongoDB enthusiasts."*[official site](https://robomongo.org/)"


>"Are you serious about MongoDB? Choose Studio 3T - our fully featured IDE for MongoDB professionals."

Features:

* Fully featured IDE with embedded shell
* Visual Query Builder
* In-Place editing
* IntelliShell with Auto-Completion
* Query MongoDB with SQL
* Export to / import from SQL DB
* Aggregation Pipeline Editor

**Note:** Studio 3T is a paid software, but it's really complete you can download the free trial for 14 days and give it a try

### MongoBooster

>*"MongoBooster is a shell-centric cross-platform GUI tool for MongoDB v2.4-3.4, which provides fluent query builder, SQL query, update-in-place, ES2017 syntax support and true intellisense experience."* [official site](https://mongobooster.com/)

**Note**: if you know any other tool, please let me know in the comments section :), happy coding!
Fallback on maps lookup on Clojure (or a gentle introduction to macros)
Tags: clojure
Published: 2017-10-16 23:14:49

---
title: Fallback on maps lookup on Clojure (or a gentle introduction to macros)
published: true
description: 
tags: clojure
---

So, you have to deal with a map, but you can't be sure whether or not you have a value for a given key. 

The easiest, and probably the most known is to use the get function (that accepts optionally a third argument which is the fallback value).

```clojure
(def a-qb {:name "Josh"
           :surname "McCown"
           :team "New York Jets"})

(def another-qb {:name "Robert"
                 :surname "Griffin III"})

(get a-qb :team) ; => "New York Jets"
(get another-qb :team) ; => nil 
(get another-qb :team "Free Agent") ; => "Free Agent"
```

Another way is to use the [keyword as a function](https://clojure.org/reference/data_structures#Keywords) or even the map as a function. 

```clojure
(:team a-qb) ; => "New York Jets"
(:team another-qb) ; => nil 

(a-qb :team) ; => "New York Jets"
(another-qb :team) ; => nil
```

I've learned that you can also specify a second argument to these cases, and if the value is not found, it will return this second argument.

```clojure
(:team a-qb "Free Agent") ; => "New York Jets"
(:team another-qb "Free Agent") ; => "Free Agent" 

(a-qb :team "Free Agent") ; => "New York Jets"
(another-qb :team "Free Agent") ; => "Free Agent"
```

But what if you want to raise an exception if it does not exists? 

```clojure
(a-qb :team (throw (Exception. )))
(a-qb :team (throw (Exception. )))
```

If you call it this way, it will evaluate all parameters before the function is called (because it is a function), raising an exception regardless if the key-value pair exists or not on the map. A way to workaround this it is to use an `or`.

```clojure
(or (a-qb :team) 
    (throw (Exception. ))
```

Because the `or` is implemented as a macro, it will only evaluate the second sexp `(throw ...)` unless the first sexp is falsy (nil or false) and thus raising an exception only on this case.
Safari's implementation of srcset is buggy, rendering the whole feature basically useless
Tags: webdev, rant, webperf
Published: 2017-10-16 21:53:48

---
title: Safari's implementation of srcset is buggy, rendering the whole feature basically useless
published: true
description: The `srcset` attribute is a great feature when it works, but it fails in cases that are far from edge-cases in Safari.
tags: webdev, rant, webperformance
---

I'd love for someone to point out a solution, but I am seeing that images loaded over AJAX in Safari do not render at all if the `srcset` attribute is present. I could not get it to work, and [found some others with the same issue](https://stackoverflow.com/questions/40807500/responsive-images-using-srcset-sizes-isnt-respected-by-safari-ios). The `srcset` attribute allows you to define several different sources to be rendered based on the size of the window. It has the potential to be a major asset for web performance.

Deciding on the image of choice in JavaScript instead of HTML has the potential to degrade performance, and choosing based on the device header is a complicated solution for a feature that is supposed to be simple. The `srcset` attribute is a great feature when it works, but it fails in cases that are far from edge-cases in Safari. This basically makes the whole feature useless or flimsy at best.

[This post](https://cloudfour.com/thinks/state-of-responsive-images-2017/) argues that "inconsistent implementations" are a feature and not a bug because it forces "browsers to compete". I'm not sure what's meant by that or if this issue can be traced back to that line of thinking. But if this is the result, I certainly disagree with the approach.

I plan to look into the `<picture>` element as a possible replacement. I have no idea yet if it has the same issue. It's generally recommended to "just use `srcset`" for most typical use cases. But since that is not implemented properly, moving to `<picture>` is a fine solution for my purposes.
Finding the right tool for the job
Tags: javascript, node, showdev, devdiary
Published: 2017-10-16 21:28:16

---
title: Finding the right tool for the job
published: true
description: Finding the right foundation for a micro-service by try and error
tags: javascript, node, showdev, dev-diary
---

![micro-service screenshot](https://thepracticaldev.s3.amazonaws.com/i/kcyx1bsf2956st0ftibk.png)

From time to time you come across a real problem. Like a real one, not a "like to solve" one. And then you use your valuable resources —the time between your real job and the moment you fall asleep on your keyboard— to dig in and figure out how to solve it.

#### The Problem
My problem was "**unencrypted passwords** lying in clients emails for **EVER**".

#### The Concept
After a few weeks on brainstorming, a coworker and I found a way to deal with this problem: "encryption in the browser" — well, sounds kinda lame and obvious...

#### The Project
My first attempt was to create a working prototype in Symofony, since it's the framework I'm most familiar with.

The prototype was exactly how I wanted it to be, except the feeling that my micro-service was not micro at all.

```
38 Composer packages
393 NPM packages
```

After a while I tried to get rid of the packages I didn't use, but it got worse.

My first intention was to throw everything away and pretend it never happened.

But then, I decided to give it an other try and recreated the same application in [express](https://expressjs.com).

The amount of packages grew up to **~610 NPM packages**, but the reward was great:

- one ecosystem (node)
- bundled executable (thanks to [pkg](https://github.com/zeit/pkg))
- one language to deal with (js)

#### Result: [cryptletter](https://github.com/Scribblerockerz/cryptletter)
The result of my work can be found at [github](https://github.com/Scribblerockerz/cryptletter). If you have tips, find bugs, or just want to give some feedback on the concept in general, feel free to contact me. Any feedback is appreciated.

#### Lessons learned
The first "weapon of choice" might not be the best. Just using a framework for the sake of using it is most of the time not that good.

I never used express for real project, since I am one from the PHP world. But learning new things is kinda awesome.

---

#### How do you choose a tool or framework for a project?
- "Check the requirements and decide"
- "Let's use [insert framework here] for anything"
- "Wordpress!" — "But you don't even know the requirements?"...
Strides Toast to Failures
Tags: teams
Published: 2017-10-27 20:01:54

---
title: "Strides Toast to Failures"
published: true
tags: Teams
canonical_url: 
---

[![yutacar-28290.jpg](https://www.stridenyc.com/hubfs/yutacar-28290.jpg?t=1508188339085) ](https://www.stridenyc.com/content-hub/strides-toast-to-failure)

At Stride, “Learning from Failure” is one of our core values. We consider learning from failure to be â€˜required’ by all Striders. It runs a thread through everything we do, from hiring, to partnering with clients and vendors, to running our internal communications.

One of the ways we celebrate learning from failure is with our quarterly [Toast to Failures](/blog/great-company-cultures-are-not-accidents). &nbsp;Here’s a peek under the hood inside one of my most cherished Stride ceremonies:

 ![](http://track.hubspot.com/__ptq.gif?a=2136473&k=14&r=https%3A%2F%2Fwww.stridenyc.com%2Fcontent-hub%2Fstrides-toast-to-failure&bu=https%253A%252F%252Fwww.stridenyc.com%252Fcontent-hub&bvt=rss)
VK_KHR_dedicated_allocation unofficial manual
Tags: graphics, vulkan
Published: 2017-12-28 21:15:39

---
title: "VK_KHR_dedicated_allocation unofficial manual"
published: true
tags: graphics,vulkan
canonical_url: http://asawicki.info/news_1661_vk_khr_dedicated_allocation_unofficial_manual.html
---

I wrote a short article that explains how to use Vulkan extenion "VK\_KHR\_dedicated\_allocation". It may be interesting to you if you are a programmer and you code graphics using Vulkan.

Go to article: [**VK\_KHR\_dedicated\_allocation unofficial manual**](http://asawicki.info/articles/VK_KHR_dedicated_allocation.php5)
theuserisvisuallyimpaired.com
Tags: discuss, a11y, design, usertesting
Published: 2017-10-16 20:28:01

---
title: theuserisvisuallyimpaired.com
published: true
tags: discuss, accessibility, a11y, design, user-testing
---

There are two amazing sites with a similar setup, created by Richard Littauer.

  - [theuserisdrunk.com](http://theuserisdrunk.com/) is a service he offered, where he'd get drunk, and then review a site's design.

  - [theuserismymom.com](https://theuserismymom.com) is a similar service, where his mom would use a website, and review it.

I thought it'd be cool to do a similar thing on a smaller scale on dev.to.

I'm visually impaired. On the desktop, [I use a screen magnifier](http://www.frederikcreemers.be/posts/how-to-make-your-website-accessible-to-people-who-use-screen-magnifiers/), and on my iPhone, I use VoiceOver, the built-in screen reader. Using these tools, I'll test out your web sites/applications, and record myself using them. This would be an informal accessibility review where I just look see how usable it is for me. I'm also open to doing this with IOS apps.

For now, I'm doing this for free, as I don't know how much valuable feedback I'll be able to give. 

So post a link to a site/app, and I'll give it a try.

For the next month, I'm committing to doing one of these a week, I may do more.

## A couple of rules/notes

  1. No porn or gambling sites, and no site containing otherwise explicit content. Use your own judgement here.
  2. I reserve the right not to try a site/app, or not to provide the service.
  3. If your app/site requires payment, I'm willing to test out the checkout flow if the amount is under $50, and you [pay me the amount of the purchase in advance](paypal.me/frederikcreemers).
  4. The content of the site/app should preferably be in English. I'm a native Dutch speaker, so I'll take Dutch submissions as well, but English ones will be easier for others when watching the video.
  4. All videos of reviews will be made public.

## Post your link
When posting your link, feel free to add a number of tasks you want me to perform on your site/app
Any rules, tips and tricks for commit message
Tags: vcs, git, tips, discuss
Published: 2017-10-16 19:18:35

---
title: Any rules, tips and tricks for commit message
published: true
tags: vcs, git, tips, discuss
---


Reading commit messages is a great way to understand software evolution without reading all the code.

I use the following rule:
 - start with an action verb: Add, Fix, Remove, Update, Refactore...
 - include the concerned domain (if != code): test, documentation, config, scripts... 
 - a description to explain the "Why?" or "How?"
 - and a reference to ticket or bug

To obtain:

- Fix tests for Linux platform: filesystem was hardcoded - #123
- Add configuration: support article pagination - #345
- Refactore customer subscription service to improve performance - #898


And you, do you use any rules to write better commit message in your company or open source project ?  

[![](https://imgs.xkcd.com/comics/git_commit.png)](https://xkcd.com/1296/)
The 7 Most Popular DEV Posts from the Past Week
Tags: top7
Published: 2017-10-16 16:11:54

---
title: The 7 Most Popular DEV Posts from the Past Week
published: true
description: A round up of the most-read and most-loved contributions from the community this past week.
tags: icymi
cover_image: https://thepracticaldev.s3.amazonaws.com/i/xsr1z6iqv0pd7p3s6ns3.png
---

#1. An answer to the apocalypse 

Blaine's post summarizes an article by The Atlantic, ["The Coming Software Apocalypse"](https://www.theatlantic.com/technology/archive/2017/09/saving-the-world-from-code/540393/) and analyzes Uncle Bob's response, [Tools Are Not The Answer](http://blog.cleancoder.com/uncle-bob/2017/10/04/CodeIsNotTheAnswer.html). 

{% link https://dev.to/bosepchuk/is-uncle-bob-serious-dhi %}

#2. Are you hamster wheeling?

Suzan talks about the plateau every developer faces in their career: continue solving the same problems or move to management/entrepreneurship/open source, with all the outcomes leading to burnout. In this post, we long for the missing career path for programmers. 

{% link https://dev.to/suzanbond/the-missing-career-path-for-software-developers-ed %}

#3. AMA with Sean Larkin, maintainer of webpack!

A fun AMA with Sean, where we learned about why react is better than vue and what his favorite chicken breeds are.

{% link https://dev.to/thelarkinn/i-maintain-webpack-ask-me-anything-an8 %}

#4. Learn the mistakes of others

While making mistakes is part of the learning process, you can also avoid some mistakes by learning from others. Lorenzo shares nine mistakes to avoid while you're building a software engineering career. 

{% link https://dev.to/lpasqualis/9-software-engineering-career-mistakes-to-avoid-at-all-costs-30m %}

#5. Agile, Waterfall, Spiral, Extreme, the list goes on.

Iren gives us a detailed summary of the top six software development methodologies.

{% link https://dev.to/iriskatastic/top-6-software-development-methodologies-9b %} 

#6. ReduxJS in 30 seconds

Exactly how it sounds, Ross gives us an explanation of redux in 576 characters.

{% link https://dev.to/ross/reduxjs-in-30-seconds-5hj %}

#7. Enter the terminal 

The what and why of terminal and bash.

{% link https://dev.to/nrobinson2000/why-you-need-terminal-bpd %}


_That's it for our weekly wrap up! Keep an eye on dev.to this week for daily content and discussions...and if you miss anything, we'll be sure to recap it next Monday!_
You can now display your most awesome GitHub repos on your DEV profile
Tags: meta
Published: 2017-10-16 16:11:51

---
title: "You can now display your most awesome GitHub repos on your DEV profile"
published: true
description: 
tags: meta
description: It's now possible to pull in and display any of your GitHub repositories on your dev.to profile. Profiles get a lot of traffic on the site because people like to know who's behind the posts and comments, and we want to make this experience richer. Future integrations may include Stack Overflow questions you've answered, or any other indications of your software development work that might be scattered across the web.
---

## New feature

It's now possible to pull in and display any of your GitHub repositories on your [dev.to](/) profile. Profiles get a lot of traffic on the site because people like to know who's behind the posts and comments, and we want to make this experience richer. Future integrations may include Stack Overflow questions you've answered, or any other indications of your software development work that might be scattered across the web.

We got a lot of feedback encouraging this feature. People recognized, and we agree, that GitHub profiles are not telling the whole story of you as a developer. We hope that our profiles will help tell your story.

![](https://thepracticaldev.s3.amazonaws.com/i/ekeb1ktrqmo6tc46pamp.png)

You can see it in action on [my profile](/ben) (desktop only for the moment).

If you want to add GitHub repos to your profile, go to [/settings/integrations](/settings/integrations) to add yours. It's nice to see that several folks have already discovered this on their own.

More improvements are coming, and the site is becoming less and less buggy. We are also getting closer to our goal of open-sourcing the project. One major "feature" is that we're putting some more care into the design aesthetics and have some big improvements coming in that regard.

We also have a new feature called [the hiring tag](/t/hiring) where your company can post that you're hiring developers. We plan to charge for this feature, but it's free for now while we work it out. If you are looking for work, you should follow the tag. We'll have more info regarding the special features of this tag, but for now just follow it or email us at yo@dev.to if you're not sure how to make a listing.
Any tips and tricks for code documentation? #discuss
Tags: discuss, junior, documentation
Published: 2017-10-16 15:16:15

---
title: Any tips and tricks for code documentation? #discuss
published: true
description: 
tags: #discuss #junior #documentation 
---

So I'm at my first job after college, working on a mid/large frontend codebase. The initial codebase was created before I got here, and it had no testing or documentation. My teammate and I  went in and created unit tests while adding requested features to the codebase. Our current feature request caused us to refactor a lot of the original code. Now I feel like we are at the point where we need to start adding documentation to the codebase. So far I have just been adding explanatory comments in front of functions in the codebase.  But I feel like I have to do more.

**Do you have tips or suggestions for code documentation? Any useful resources to learn more about code docs?**
What do you build to learn a new language or style?
Tags: discuss, languages, learning
Published: 2017-10-16 15:01:59

---
title: What do you build to learn a new language or style?
published: true
description: 
tags: discuss, languages, learning
---

I like to reimplement [Elm's Json Decoders](https://github.com/elm-lang/core/blob/5.1.1/src/Json/Decode.elm) in whatever language or framework I'm trying to learn. I did this when I was getting up to speed on [fantasyland](https://github.com/fantasyland/fantasy-land) in JS, and when I needed to brush up on Python, and now this week with PureScript. How about you?
Hi i'm Vagelis
Tags: newbie
Published: 2017-10-16 13:00:20

---
title: Hi i'm Vagelis
published: true
description: 
tags: newbie
---

### My name is Vagelis, i study mathematics and my real passion is programming. Taking classes from Codecademy was a great first step, learning HTML and CSS and basic PHP. Udemy came next with classes on web development and Android. I learnd a lot from them and now i consider taking freelancing work but i don't know how to **START**, i have only published an app in Android and another one is almost ready.
Live Chat Agents
Tags: livechat, livechatagents, deskmoz
Published: 2017-10-16 12:30:53

---
title: Live Chat Agents
published: true
description: DeskMoz 24*7 Best live chat service provider
tags: #livechat #Livechatagents #DeskMoz
---

Wheather you are an online business & service provider or an offline store providing a great support service is important to your company. There is a lot of ways to make yourself available for customers and one of them is Live Chat.

There is a lot of benefits of having Live Chat Service for the business as well as for the customer.
But Live chat Service faces major drawback with the availability of trained Live Chat agents because it's  nearly not possible to have trained agents available for 24 hours.

But wherever is a problem there comes a solution and <a href="https://deskmoz.com/about/"> DeskMoz </a> is the best <a href="https://deskmoz.com"> Live Chat agents </a> service provider in the Industry, For DeskMoz every chat is Unique, so they provide the knowledge, Training and tools and every one of their agents add all these things in their personality.
DesMoz's Main moto is to convert your website's visitor into your customer.
They do not let any customer bounce off your website page by offering live help and make sure you secure your sales and lead.

DeskMoz is a pioneer in providing Live Chat Agents Services at dirt cheap prices! At DeskMoz, everyone believes in providing best services with an alternative belief system, which says, ‘whatever it takes, let customers be with you!’ With the team of 100+ enthusiastic experts, DeskMoz is a complete package for your Desk needs. If you are looking for <a href="https://deskmoz.com"> 24×7 Live Chat Operators </a>, Email Management Service, Tickets-Management, DeskMoz are here! Experts are here!

Deskmoz's Chat Agents behave like humans, not bots. In DeskMoz everyone knows that for your business, customer engagement is an important key to success. Their agents are trained to get the visitors’ contact details without sounding like bots. Each of Their agents is recruited after the proper screening, which includes IQ Test, Grammar Test, Typing Speed Test, Chat-Skills Test, & Personal Interview. If they are working for them, they are good with all the chat services DeskMoz are providing to their clients......   :)