teleren/devto huggingface dataset:
Generate beautiful directory structures quickly
Tags: directorystructures, utility, tutorial, markdown
Published: 2018-12-07 19:31:45

---
title: Generate beautiful directory structures quickly
published: true
description: Making directory structures for project/libs documentation can be hard, especially if there are a lot of directories inside the project. Nesting and alignment can get tedious very easily. With this tiny utility, generate directory structures with a single command. 
tags: directory-structures, utility, tutorial, markdown
---
![File Structure](https://thepracticaldev.s3.amazonaws.com/i/s3vih30wz26z07xeal71.png)

Yesterday I was trying to create a file structure for one of my project's README. The one I ended up creating wasn't bad, but wasn't good enough either. So, I started looking for a tool that would help me create a beautiful directory structure quickly. 

In MS Windows, `tree` command does it pretty well. But we don't have it in linux (or at least not in Ubuntu 18.04 at the time of writing this). But I managed to find a nifty solution to that: [The Tree Command for Linux](http://mama.indstate.edu/users/ice/tree/). 

## How to install tree?
* Download **The Tree Command for Linux** from [here](http://mama.indstate.edu/users/ice/tree/)
* Unzip the downloaded file (`unzip tree-1.8.0.tgz`)
* `cd` into the unzipped folder
* Execute `make` and then `make install`

That's it. You have tree command installed and available in your terminal. 

## Basic Usage
Open up terminal and execute 

```
tree /path/to/directory
```

_For detailed documentation and help, checkout [Online Man page for Tree 1.8.0](http://mama.indstate.edu/users/ice/tree/tree.1.html)_

There, you have created a tree structure right in the terminal. 

Select the tree structure, copy it and use it where ever you want 😊
Good code
Tags: basics, discuss
Published: 2018-12-07 19:19:35

I always hear developers say "We must write good code" or "That code is bad" but what is good code and what is bad code?

First of all, we are engineers and what is engineering? A very basic description is: To solve a problem using the state of the art at the lower cost.

Now we have to find where the costs are in software development, the costs are mainly divided in two: creation and maintenance. Being maintenance the one that is the biggest by orders of magnitude therefore we need to lower the cost of maintenance. 

We have found that TDD and some others called "good practices" help make software maintenance costs lower by reducing refactoring risks or making a well structured class system. Therefore a codebase with a 90% code coverage and a very low [cyclomatic complexity](https://en.wikipedia.org/wiki/Cyclomatic_complexity) isn't good code because it have those but because thanks to those it keeps it's maintenance cost low.

With all of this said we can say then that good code is the one that is cheapest to produce (being maintenance inside the production cost) and a good engineer is the one that can produces good code.

What are your opinions about this?
Introduction to Spring WebFlux
Tags: spring, reactiveprogramming, springwebflux, api
Published: 2018-12-07 19:01:49

---
title: Introduction to Spring WebFlux
published: true
description: This article introduces the reader to reactive programming using the Spring WebFlux API.
tags: #spring #reactiveprogramming #springwebflux #api
canonical_url: https://auth0.com/blog/introduction-getting-started-with-spring-webflux-api/
---

In this article, you will learn about reactive programming, why it is important, and when to apply it to your projects. You will do so by learning about how reactive programming came to be and its implementation in Spring Boot via the Spring WebFlux API. To better understand these concepts you will build a reactive RESTful API using Spring WebFlux and secure it using OAuth 2.0. 

[Read on 🍃](https://auth0.com/blog/introduction-getting-started-with-spring-webflux-api/?utm_source=dev&utm_medium=sc&utm_campaign=spring_webflux)

![Introduction to Spring WebFlux](https://thepracticaldev.s3.amazonaws.com/i/l9d6ylspgfit8rtjyxw5.png)
Is it worth creating a native mobile app for blogs
Tags: discuss, app, blogs, vue
Published: 2018-12-07 19:01:30

---
title: Is it worth creating a native mobile app for blogs
published: true
description: What's your opinion on creating a native mobile apps for reading blogs.
cover_image: https://thepracticaldev.s3.amazonaws.com/i/fnywcgvhgw9y1z7cy75z.jpg
tags: discuss, app, blogs, vue
---

Is it really worth creating a blog for your blogging website?

Where we can fetch the data using RSS feed and using framework like [VueNative ](https://vue-native.io/), and can build native mobile applications for both Android and iOS.

What do you think? 🤔
Why AI decentralisation is vital for the future of humanity?
Tags: ai, decentralization, blockchain
Published: 2018-12-07 18:41:55

---
title: Why AI decentralisation is vital for the future of humanity?
published: true
description: 
tags: AI, decentralization, blockchain
---
Hello guys, what you think about AI decentralisation? Dr. Maxim Orlovsky described his vision in the article on [Medium] (https://medium.com/pandoraboxchain/digital-immortality-why-ai-decentralisation-is-vital-for-the-future-of-humanity-852be0cd9d33). I'll appreciate if you read it and leave your feedback.
What's the Betamax of your field?
Tags: discuss
Published: 2018-12-07 18:38:33

---
title: What's the Betamax of your field?
published: true
description: Let's talk about obsolete things
tags: discuss
cover_image: http://www.betamaxcollectors.com/images/sonybetamaxsl-25_1.jpg
---

As in - what technology or tool came to prominence and then disappeared despite its technical merit?  Do you miss it?  Would you use it today or was it a product of its time?

Me?  I'm a WordPerfect man.  I know it's not "gone", exactly - but when was the last time you came across an installation in the wild?
Help me solve the "Triple Trouble" challenge on Codewars with Elixir.
Tags: challenge, elixir, help
Published: 2018-12-07 18:06:24

---
title: Help me solve the "Triple Trouble" challenge on Codewars with Elixir.
published: true
description: banging my head against the wall and cannot solve the challenge with Elixir.
tags: challenge, elixir, help
---

#Triple Trouble

Create a function that will return a string that combines all of the letters of the three inputed strings in groups. Taking the first letter of all of the inputs and grouping them next to each other. Do this for every letter, see example below!

Ex) Input: "aa", "bb" , "cc" => Output: "abcabc"

Note: You can expect all of the inputs to be the same length.

*********************************

You are welcome to solve the challenge in any language. I just don't know how to solve it with Elixir.
Gitote, two weeks after
Tags: gitote, opensource, git
Published: 2018-12-07 09:42:31

> Two weeks ago I saw a post about this new `open source end-to-end software development platform with built-in version control, issue tracking, code review` : [this post](https://dev.to/gitote/gitote-has-been-launched-m35). I signed up to see what does [this new platform](https://gitote.in) look like. And after two weeks I can give my mind.

⚠️ I'm only 15 yo, my English isn't perfect and I want to improve it so if you notice a language error, say it in a comment. ⚠️

# Good points

* It is new and open source

I don't know if it's an argument but in my mind, that's very important.
I love open source alternatives. This is based on [Gogs](https://gogs.io/) which is self-hostable.

* Simple user interface

The first thing I noticed is the user interface, so simple and so easy to understand, okay some people can say it is a copy paste of the Github's design but that's not a problem for me.

* Visibility

Gitote is made with the concerns of the social. There is an Explore page which is absolutely amazing I discovered a lot of good projects especially [**J**ust **A**nother shell](https://gitote.in/sahilrajput/Jall) or [Full Tilt Bash](https://gitote.in/TheRedSpy15/Full-Tilt-Bash).

# Negative points

* No unit testing service

That's a big problem for me, I need unit testing but today if you want to use a unit testing service you will have to create a mirror on Gitlab/Github.
EDIT: Gitote is setting up a drone-ci instance.

* I don't know but I have to find other negative points

# Conclusion

I don't say you should use it instead of Gitlab/Github/Bitbucket but you should still try Gitote. I forgot to mention that I am remote intern at Gitote but I said all the things I thought about it good or bad.

There is not a lot of people for now on Gitote but I think the popularity is only a matter of time.
Flags to enable jmx
Tags: java, jmx, debugging
Published: 2018-12-07 17:18:20

---
title: Flags to enable jmx
published: true
description: 
tags: java,jmx,debugging 
---

JMX is the xray of the Java world, it allows you to see threads and memory snapshots, debug and track unoptimized hotspots in your application. The JDK comes with the excellent tool, Mission Control that allows you to connect to a running JVM and collect insights from it. 

![Mission Control](https://thepracticaldev.s3.amazonaws.com/i/abuf0irfzk35zxe8w060.png)  

To configure the JVM for this connection, use these arguments, e.g. in your JAVA_OPTS.

```
-Dcom.sun.management.jmxremote 
-Dcom.sun.management.jmxremote.authenticate=false 
-Dcom.sun.management.jmxremote.ssl=false 
-Dcom.sun.management.jmxremote.port=7199 
```
An Idea To Build Open Source For Animal Welfare
Tags: opensource, discuss
Published: 2018-12-07 16:56:45

---
title: An Idea To Build Open Source For Animal Welfare
published: true
description: 
tags: opensource, discuss
---

I am not good at writing, but I have an open source idea for animal welfare (this is just a rough idea) which in particular in Indonesia is a lot of people throwing away and abandoning their pets just because they (pets) have grown up, people only love their pets when they were puppies. There are even pets that are traded only to be consumed by the human.

Fortunately, now people have started to realize that because many animal defenders give them education and I want to help them (animal defender), I'm just a front end dev who loves animal *p.s most animal defenders have their own shelter*.

The point is I want to build an application that is connected with an animal defender, if people see abandoned animals, people will send their location or maybe chat or something and the application will send an alert or push notification to the closest animal defender.

The application might have some features to adopt pets (with terms and conditions) and others.

Again, this is just a rough idea, but I really want to build this project

If you have an idea, please mention it.

*Correct me if I'm wrong.*
Have you ever heard a more beautiful phrase than this?
Tags: story, monitoring, sre, devops
Published: 2018-12-07 16:01:14

Yesterday a few of us at the office were noticing that we hadn't gotten an alert in the #monitoring channel in Slack for over a week. We get alerts every time error rate on [dev.to](/) pass a certain threshold.

@maestromac investigated. When I caught up with him a little while later about the issue, this was the prognosis:

> Everything's fine with the monitoring. Turns out the site's just more stable.

Have you ever heard a more beautiful utterance?

We lowered the threshold a bit, and should expect an alert now and then at the new level.

Happy coding ❤️

_I'm certain I've just jinxed it, so expect some significant downtime._
AVENGERS: ENDGAME
Tags: offtopic, avengers
Published: 2018-12-07 15:36:33

---
title: AVENGERS: ENDGAME
published: true
description: 
tags: offtopic, avengers
---

FINALLY THE WAIT IS OVER!!!!!11!

Hello everybody and if you haven't watched Avengers: Endgame, I suggest you stop whatever you're doing and do it.

If you have, share your opinions and how much hyped you're about it.

I gotta say that it gave my goosebumps, even my mustache flicked. It's gonna be a HUGE movie IMO.

Thank yall
Daily Coding - DAY-1 # Math
Tags: challenge
Published: 2018-12-07 14:56:14

---
title: Daily Coding - DAY-1 # Math
published: true
tags: challenge
---

Finding the ways
You are given an integer `N` and a value `k` . You need to find a minimum number  `X` which when multiplied to `N` results in the value of N^(1/k)  as an integer. 

For example let N =6  and k=2 , then the answer will be 6 because 6*6 =36  and if we calculate 36^(1/2) it is equal to 6 which is an integer.

`Input`
The first line contains two space-separated values `N` and `6` as input.

`Output`
Print the minimum number `X`  modulo 10^9 + 7

`Sample Input`

    12 2

`Sample Output`

    3

If you multiply 6 with 6  then the result becomes 36 which is a perfect power of 2 .
Daily Coding - DAY 1 # typographically smallest 
Tags: challenge
Published: 2018-12-07 14:42:11

---
title: Daily Coding - DAY 1 # typographically smallest 
published: true
tags: challenge
---

Given a string consisting of lowercase letters only, find the typographically smallest string not present as a substring in it.

Given two string S1 and S2. S1 is considered typographically smaller than S2 if either:

![](https://thepracticaldev.s3.amazonaws.com/i/q4vr2ooa40vz17fk0geh.JPG)

### Input:

The first line of input contains the string S.

### Output:

Answer as stated above.

Constraints:

![](https://thepracticaldev.s3.amazonaws.com/i/m9u1w87f8fm1vs7fnadh.JPG)

### Sample Input

 saurabh
### Sample Output

c
Mutation testing in 1000 characters
Tags: tests, craftsmanship, mutation
Published: 2018-12-07 13:58:30

---
title: Mutation testing in 1000 characters
published: yes
description: A brief overview of what mutation testing is
tags: tests, craftsmanship, mutation
---
Code coverage is an common metric to measure code quality but it doesn't guarantee that tests are really testing the expected behavior.

Mutation testing can be described as tests of tests. It consists of introducing mutations to your codebase and checking if at least one test fails for each mutation (we say that mutation is killed in this case, otherwise it lived):
- inversion of conditions
- change boundary conditions (< becomes <=)
- change incrementation of counters
- change mathematical operators
- return null instead of returned value
- don't call void methoids, constructors...
- many other type of transformations

If a mutation is killed, that means that your tests are covering some edge cases, giving you more confidence about the quality of your tests.

Mutation testing can be an heavy process, so it doesn't need to be executed as often as unit tests, but it can be a step in your release process.

Java projects can use [Pitest](http://pitest.org) library.
State of serverless computing - an open discussion
Tags: serverless, discuss
Published: 2018-12-07 13:54:02

---
title: State of serverless computing - an open discussion
published: true
description: 
tags: #serverless #discuss
---

Working on an article on the state of serverless space, how was 2018 and how will this space evolve in 2019. What can we realistically expect from the big players in the space and what are some of the biggest challenges that they should address?

Anyone wanting to get featured in the article with a quote drop a comment or a message on twitter @johndemian

Cheers!
Oak Codefest 2019
Tags: hackathon, studenthackathon, codefest
Published: 2018-12-07 12:19:30

---
title: Oak Codefest 2019
published: true
description: Bangalore's first overnight student hackathon
tags: Hackathon, Student hackathon, Codefest
---
{% youtube LP5o4kRH8uo %}
 

So I have been someone who has always loved computer science, I started writing code maybe when I was in 6th grade. I went to my first hackathon in 8th grade and it was one of the best experiences I ever had. Since then I have always noticed a lack of hackathons for high school students to encourage them to explore computer science.

I am very proud to say I am able to help solve this problem by bringing you Oak Codefest 2019, the is the second edition of this hackathon. It is Bangalore's first overnight high school hackathon and with just our first event we were able to inspire to other schools to follow suit and host hackathons.

This year for Codefest we want to make our event even bigger and have collaborated with IBM, DigitalOcean, Hackerearth and Ace Creative Learning.

![Alt text of image](https://thepracticaldev.s3.amazonaws.com/i/m99rvtw5130g7xhlef13.jpg)


To find out more details please visit http://codefest.oakridge.in
A missing function of IEx
Tags: iex, elixir, pry, ruby
Published: 2018-12-07 09:23:57

---
title: A missing function of IEx
published: true
description: 
tags: iex, elixir, pry, ruby
---

Recently I learned a function of Pry, "amend-line". This is useful when you have typo.

I wonder, does IEx have a function like this?

I don't find it. Maybe I can hide the IEx prompt to copy paste. How to config this?

Writing in IEx is happy. Try a little, learn a little.

What's your idea for this?
It's just HTML
Tags: web, product, short, showdev
Published: 2018-12-07 09:29:09

---
title: It's just HTML
published: true
tags: Web, Product, Short, showdev
canonical_url: https://miguelpiedrafita.com/just-html/
cover_image: https://images.unsplash.com/photo-1454165205744-3b78555e5572?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=1080&fit=max&ixid=eyJhcHBfaWQiOjExNzczfQ
---
{% blogcast 297 %}

Nowadays, the internet is full of beautiful websites, and it's easy to forget there's something every site shares. At its core, every website is just HTML.

Inspired by the maker movement, I challenged myself to build a simple product related to this idea in a short period of time. While initially aiming for a few hours, I managed to ship it in less than one!

The resulting product is a chrome extension that toggles all the styling a website, so you can see the root HTML components, tables, icons, etc

If you want to try it out, you can [install the extension](https://chrome.google.com/webstore/detail/unstyler/iniahmhgmcmkimliphhbgfkmichgccjd) from the Google Webstore. And, even if you don't, remember that it's just HTML :)
Write better code: Day 3 - Rotation Point
Tags: challenge
Published: 2018-12-07 07:36:19

---
title: Write better code: Day 3 - Rotation Point
published: true
tags: challenge
---

This post originally appeared on [Arjun Rajkumar](https://www.arjunrajkumar.in) 's blog. Arjun is a web developer based in Bangalore, India.

--


### Day 3: Question 2

I opened up a dictionary to a page in the middle and started flipping through, looking for words I didn't know. I put each word I didn't know at increasing indices in a huge array I created in memory. When I reached the end of the dictionary, I started from the beginning and did the same thing until I reached the page I started at.

Now I have an array of words that are mostly alphabetical, except they start somewhere in the middle of the alphabet, reach the end, and then start from the beginning of the alphabet. In other words, this is an alphabetically ordered array that has been "rotated." For example:

```
words = [
    'ptolemaic',
    'retrograde',
    'supplant',
    'undulate',
    'xenoepist',
    'asymptote',  # <-- rotates here!
    'babka',
    'banoffee',
    'engender',
    'karpatka',
    'othellolagkage',
]
```

Write a method for finding the index of the "rotation point," which is where I started working from the beginning of the dictionary. This array is huge (there are lots of words I don't know) so we want to be efficient here.

-

If you want to follow along, feel free to post your answers in the comment. 

My answers are in the comments.
[This problem is from InterviewCake.](https://www.interviewcake.com/question/ruby/shuffle?course=fc1&section=greedy)
PHP To XML API
Published: 2018-12-07 06:34:01

---
title: PHP To XML API
published: true
description: 
tags: 
---
Hello People, 
i have php data that i should send to my API provider who requested the data to be in XML format like this:

I am getting data from a form that has a PAY NOW button.

if(isset($_POST['pay_now'])){
$userid = $_POST['user-id'];

$total_amount = $_POST['total_amount'];

$currency = $_POST['currency'];

$firstname = $_POST['firstname'];

$lastname = $_POST['lastname'];

$email = $_POST['email'];

$phone = $_POST['phone'];

$reasons = $_POST['reasons'];

$application_id = $_POST['application_id'];

$order_id = password_hash($application_id, PASSWORD_DEFAULT);

$token = "XXXXX";

$payUrl = "https://secure1.sandbox.directpay.online/payv2.php?ID=".$token;
$CompanyRef = "XXXXX";

$CompanyRefUnique = "olord11of2273host";

$RedirectURL = "www.mydomain.com/example?success=".$CompanyRefUnique."&congrats=".$CompanyRef."&user=".$userid;

$DeclinedURL = "www.mydomain.com/example?paymentdecline=".$CompanyRef."&user=".$userid;

$PTLtype = 20 ." minutes";

$DefaultPayment = "MO";

$ServiceDescription = $reasons;

$ServiceType = "5525";

$ServiceDate = date("Y:m:d: h:m: ")



$datainput = '
		<API3G>
			<Transaction>
					<PaymentAmount>'.$total_amount.'</PaymentAmount>

					<PaymentCurrency>'.$currency.'</PaymentCurrency>

<RedirectURL>'.$RedirectURL.'</RedirectURL>

<DeclinedURL>'.$DeclinedURL.' </DeclinedURL>

						  <CompanyRefUnique>'.$CompanyRefUnique.'</CompanyRefUnique>

						    <CompanyRef>'.$CompanyRef.'</CompanyRef>

   <PTL>'.$PTLtype.'</PTL>

						    <customerFirstName>'.$firstname.'</customerFirstName>

						    <customerLastName>'.$lastname.'</customerLastName>

<customerEmail>'.$email.'</customerEmail>

						    <DefaultPayment>'.$DefaultPayment.'</DefaultPayment>

</Transaction>
	<Services>
		<Service>
			<ServiceType>'.$ServiceType.'</ServiceType>
							                        <ServiceDescription>'.$ServiceDescription.'</ServiceDescription>
        		<ServiceDate>'.$ServiceDate.'</ServiceDate>
		</Service>

	</Services>

</API3G>';

		$ch = curl_init($payUrl);

				curl_setopt($ch, CURLOPT_URL, $payUrl);

				curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);

				curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

				curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);

				curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

				curl_setopt($ch, CURLOPT_SSLVERSION,6);

				curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml'));

				curl_setopt($ch, CURLOPT_POSTFIELDS, $datainput);

				$response = curl_exec($ch);
					
				curl_close($ch);

}

I am not getting any errors, but am not getting a **redirect to the sandbox** url. How can i make the Paynow Button to work like that?
About icons to favorite
Tags: meta, ui, discuss
Published: 2018-12-07 06:29:21

---
title: About icons to favorite
published: true
description: 
tags: meta, ui, discuss
---

![current icon](https://thepracticaldev.s3.amazonaws.com/i/0yevvg5l4h5csgz7d5hw.png)

The current icon is also great, but ...

![sushi version icon](https://thepracticaldev.s3.amazonaws.com/i/b0qwcutg55n7ylv4vgzo.png)

It is a suggestion, but if you do more like this you will be sushi!

Oh! SUSHI!!!

![We love sushi](https://thepracticaldev.s3.amazonaws.com/i/l8ibjv9cg53bjasc51bb.gif)
Write better code: Day 3 - In-Place Shuffle
Tags: challenge
Published: 2018-12-07 05:54:05

---
title: Write better code: Day 3 - In-Place Shuffle
published: true
tags: challenge
---

This post originally appeared on [Arjun Rajkumar](https://www.arjunrajkumar.in) 's blog. Arjun is a web developer based in Bangalore, India.

--



### Day 3: Question 1

Write a method for doing an in-place shuffle of an array.

The shuffle must be "uniform," meaning each item in the original array must have the same probability of ending up in each spot in the final array.

Assume that you have a method get_random(floor, ceiling) for getting a random integer that is >= floor and <= ceiling.

An in-place algorithm operates directly on its input and changes it, instead of creating and returning a new object. This is sometimes called destructive, since the original input is "destroyed" when it's edited to create the new output.

If you want to follow along, feel free to post your answers in the comment. 

##### My answers are in the comments.
##### [Question from InterviewCake](https://www.interviewcake.com/question/ruby/shuffle?course=fc1&section=greedy)