teleren/devto huggingface dataset:
Reset or not Reset CSS?
Tags: css, reset, a11y
Published: 2018-12-26 12:50:19

---
title: Reset or not Reset CSS?
published: true
description: Have you tried removing the reset css from your project and see if it makes a big difference?
tags: html, css, reset, accessibility
---

In my last 4 or 5 projects I dropped the reset CSS and just add this:

```css
* {
  box-sizing: border-box;
}

body {
  margin: 0;
}
```

CSS reset is great, sure! Saves a lot of hours of tests... and a lot of headaches. But have you tried removing the reset css from your project and see if it makes a big difference? After using a reset CSS already looked at your project with an accessibility perspective?
Top 5 Python Books From Beginners to Expert
Tags: python, beginners, expert, fundamental
Published: 2018-12-26 11:09:14

---
title: Top 5 Python Books From Beginners to Expert
published: true
description: Here is the list of top 5 python books from beginners to expert!
tags: #python #beginners #expert #fundamental
---
While there are many [python courses online] (https://www.learnpython.org/), learning from books is still one of the best ways to greatly improve your python skills and knowledge.

## 1. [Python Cookbook, Third Edition, by David Beazley and Brian K. Jones] (https://amzn.to/2QSUiDw)
![Python Cookbook] (https://images-na.ssl-images-amazon.com/images/I/51hFtDvqgfL._SX379_BO1,204,203,200_.jpg)

The *Python Cookbook* covers, in one comprehensive volume, tutorials on the most common programming task. Code examples in the book show how things are done in idiomatic Python 3 code. The book explains why and how the code works, which is very helpful.

## 2. [Learn Python The Hard Way, by Zed A. Shaw] (https://amzn.to/2V6TIR7)
![Learn Python The Hard Way] (https://images-na.ssl-images-amazon.com/images/I/41kW%2BPDaNAL._SX386_BO1,204,203,200_.jpg)

Zed Shaw's *Learn Python The Hard Way* has helped thousands of people learn how to code in Python. The book is notable for taking a hands-on approach to the learning process.

## 3. [Head First Python: A Brain-Friendly Guide, by Paul Barry] (https://amzn.to/2Rh441n)
![A Brain-Friendly Guide] (https://images-na.ssl-images-amazon.com/images/I/513GXqfvg-L._SX433_BO1,204,203,200_.jpg)

*Headd First Python* stands out among Python books for being approachable and easy to make progress with. The witty remarks and illustrations address the exact problems you will encounter as a beginner as a Python programmer.

## 4. [Python Crash Course: A Hands-On, Project-Based Introduction to Programming, by Eric Matthes] (https://amzn.to/2AgS5r7)
![Python Crash Course] (https://images-na.ssl-images-amazon.com/images/I/51F48HFHq6L._SX376_BO1,204,203,200_.jpg)

*Python Crash Course* goes beyond the basics to immersing you into fully functioning software projects. You will code projects using **Django**, the highly popular Python Web Framework. Other projects that will show you the fun side of making games with Python. The book will introduce you to fundamentals of the Python programming language.

## 5. [Fluent Python: Clear, Concise, and Effective Programming, by Luciano Ramalho] (https://amzn.to/2Rktuva)
![Fluent Python] (https://images-na.ssl-images-amazon.com/images/I/412S-7y7aIL._SX377_BO1,204,203,200_.jpg)

**(For Advanced Python Programmers)**
This book is very useful for advanced Python programmers to help you learn the best techniques you should be using. Applying the lessons from the book will result in a clearer, shorter and faster code for all applications you already developing.


If you have any book recommendations for Python Books from Beginners to Expert. Don't forget to mention it below!

Join [My telegram Community] (https://t.me/theprogrammersclub) so you won't miss out a single article!
Storybook for DEV ? 
Tags: help, question, storybook, dev
Published: 2018-12-26 10:32:30

---
title: Storybook for DEV ? 
published: true
description: 
tags: help,question,storybook,dev
---

Is there storybook live demo available for dev.to ? like the one below 
https://building.coursera.org/coursera-ui/

Thanks
Keyword Arguments of Ruby makes code more clear
Tags: ruby, cleancode
Published: 2018-12-26 09:31:08

---
title: Keyword Arguments of Ruby makes code more clear
published: true
description: 
tags: ruby, cleancode
---

In this video the speaker demoed the pros of KWArgs.

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

In the pic, upper code is obviously more clear.

So when should you use it? I think, when it's hard to identify the params you should use KWArgs.

The usage is simple:

```ruby
def foo(bar:, baz:)
end


foo(bar: 1, baz: 2)
```


Do you think so?
What does "single-piece flow" or "one-piece flow" development mean to you?
Tags: softwaredevelopment, projectmanagement
Published: 2018-12-26 09:24:52

---
title: What does "single-piece flow" or "one-piece flow" development mean to you?
published: true
description: I'm currently reading the book, "The Phoenix Project" by Gene Kim, a great book which I highly recommend! 
tags: Software Development, Project Management
---

As the title states, "What does "single-piece flow" or "one-piece flow" development mean to you?". I'm currently reading the book, "The Phoneix Project" by Gene Kim, and I've learned a lot. In the book, it mentioned developing a single-piece flow development system. When you hear that, what does that mean to you? What are some tools/resources/procedures you use to do this? When those words come to me, I instantly think about Git, branching, features, merging, etc...
How do you handle JavaScript errors?
Tags: discuss
Published: 2018-12-26 07:42:45

Hi. I how do you handle JavaScript errors?

I wrote a sample function like this;

### Function

```javascript
let tried = function(callback) {
	let err = null
	
	let errorObject = {}
	
	try {
		callback()
	} catch(ex) {
		err = ex
	}

	return {
		catch: function(data, cb) {
			if(err) {
				if(cb) {
					switch(err.name) {
						case 'EvalError':
							if(data == 'EvalError') cb(err)
							break;
						case 'InternalError':
							if(data == 'InternalError') cb(err)
							break;
						case 'RangeError':
							if(data == 'RangeError') cb(err)
							break;
						case 'ReferenceError':
							if(data == 'ReferenceError') cb(err)
							break;
						case 'SyntaxError':
							if(data == 'SyntaxError') cb(err)
							break;
						case 'TypeError':
							if(data == 'TypeError') cb(err)
							break;
						case 'URIError':
							if(data == 'URIError') cb(err)
							break;
						case 'Error':
							if(data == 'default') cb(err)
							break;
						default:
							cb(err)
							break;
					}
				}
			}
			return this
		}
	}
}
```

### Usage

```javascript
tried(() => {
	thisMethodNotExist()	
}).catch('EvalError', (err) => {
	console.log('Eval error')
}).catch('InternalError', (err) => {
	console.log('Internal error')
}).catch('RangeError', (err) => {
	console.log('Range error')
}).catch('ReferenceError', (err) => {
	console.log('Referans error') // this scope will run.
}).catch('SyntaxError', (err) => {
	console.log('Syntax error')
}).catch('TypeError', (err) => {
	console.log('Tip error')
}).catch('URIError', (err) => {
	console.log('URI error')
}).catch('Error', (err) => {
	console.log('Generic Error')
}).catch('default', (err) => {
	console.log('Custom Error')
})
```

This function helped me many times. Do you have any method like this? Or what is your approach to catching error handling?
SQLSTATE[HY000] [2002] Connection refused
Tags: laravel, xampp, mysql
Published: 2018-12-26 07:29:40

---
title: SQLSTATE[HY000] [2002] Connection refused
published: true
description: Cannot connect to db
tags: #laravel,#xampp,#mysql
---

Hi, I am using xampp server to run my php laravel application. I used the command 'php artisan migrate' for migration and I am getting this error:

  : SQLSTATE[HY000] [2002] Connection refused (SQL: select * from information_schema.tables where table_schema = testing and table_name = migrations)

My env file has been modified like this:
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=testing
DB_USERNAME=root
DB_PASSWORD=

where 'testing' is my db name.
I tried many methods and I cross verified my db credentials too. 
I need help in this
Nashorn JavaScript engine
Tags: todayilearned, javascript, java
Published: 2018-12-26 01:16:20

Few days ago, while looking at this [SIP server][routr], I noticed it being executed using something called [Nashorn], instead of the more popular JavaScript runtime nodejs.

So Nashorn is JS engine in Java, and a successor to the Mozilla Rhino. Bad news is that it already [deprecated][1] in latest Java, without no alternative offered.

Routr developer when asked on his plan following Nashorn deprecation from Java, said he [considering 2 choices][2]:-

> 1. GraalVM takes of and becomes a viable replacement for Nashorn. In which case I will be more than happy to port the project.
> 2. Nashorn die without a viable substitute. In which case I will have no option but to re-write the project in Java.


[routr]:https://github.com/fonoster/routr
[Nashorn]:https://en.wikipedia.org/wiki/Nashorn_(JavaScript_engine)
[1]:https://www.infoq.com/news/2018/06/deprecate-nashorn
[2]:https://www.reddit.com/r/javascript/comments/a8vfwb/i_built_a_sip_server_using_only_javascript_with/
Blogdown Hugo themes to share scripts
Tags: blogdown, hugo
Published: 2020-06-09 14:37:22

---
title: Blogdown Hugo themes to share scripts
published: true
date: 2018-12-26 00:00:00 UTC
tags: blogdown, hugo
canonical_url: https://statnmap.com/2018-12-26-blogdown-hugo-themes-to-share-scripts/
---

I modified two Hugo themes to be able to share R code using blogdown. hugo-future-imperfect and hugo-statnmap-theme are multilingual themes allowing for code folding, syntax highlighting, list of related articles, citation card, SEO graph or contact form.All options listed below are detailed in the Readme page of themes on Github. There are also listed with their configuration parameters in the config file of the “exampleSite” directory in the repository.

See more: [Blogdown Hugo themes to share scripts](https://statnmap.com/2018-12-26-blogdown-hugo-themes-to-share-scripts/)
5 Books Which Will Improve Your Career
Tags: career
Published: 2018-12-25 19:25:29

---
title: 5 Books Which Will Improve Your Career
published: true
description: 5 Books Which Will Change Your Career
tags: Career
cover_image: https://images.unsplash.com/photo-1457369804613-52c61a468e7d?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=900&q=60
---

I read. A lot. And I love reading books that will positively impact my career. I'm the type of person who is motivated by digesting motivational books and podcasts.

The following five books changed my outlook on not only my career, but my life. They've motivated me to be my best self and achieve my biggest goals.

If you've read any of the following books, feel free to let me know your thoughts down below! Otherwise, happy reading 🤓📖

## 1. Originals: How Non-Conformists Move the World 
**Adam Grant**
![Originals](https://images.gr-assets.com/books/1445791874l/25614523.jpg)
In Originals, Adam Grant delves into the study of how "originals", or people who are seen as influential in their respective industries, develop their originality. What's the most effective way to create original ideas and share them with the world? Guess you'll have to read the book to find out 😉.


## 2. Growth Hacker Marketing: A Primer on the Future of PR, Marketing, and Advertising
**Ryan Holiday**
![Growth Hacker Marketing](https://images.gr-assets.com/books/1382075918l/18454317.jpg)
If you're not into reading big books, then this just may be the one for you! Coming in at a whopping 56 pages, Growth Hacker Marketing teaches you the skills you need to effectively market your products, without spending thousands of dollars on marketing. How have notable companies such as Facebook, Evernote, and Airbnb built their empire without traditional methods of marketing? Ryan Holiday spills all their secrets.

## 3. The Power of Habit: Why We Do What We Do in Life and Business 
**Charles Duhigg**
![The Power of Habit](https://images.gr-assets.com/books/1366758683l/12609433.jpg)
The Power of Habit is one of my favorite books of 2018. Using riveting anecdotes, the author uncovers the secret behind effectively, and permanently, altering habits. What makes a habit? How do you break bad habits and adopt healthy ones? You can leverage the tips from this book to improve your every day life.

## 4. Hooked: How to Build Habit-Forming Products 
**Nir Eyal**
![Hooked](https://images.gr-assets.com/books/1407112405l/22668729.jpg)
Hooked examines the concept behind habit-forming products. What lures customers back for more? Nir Eyal explains his four-step process for developing a habit-forming product that will leave customers wanting more.

## 5. Lean UX: Applying Lean Principles to Improve User Experience 
**Jeff Gothelf & Josh Seiden**
![Lean UX](https://images.gr-assets.com/books/1381355830l/13436116.jpg)
Interaction design is a steadily growing field, and it's nearly impossible to build a successful product without a truly great user experience. Lean UX teaches you how to focus on the design experience rather than the deliverables in order to produce the most effective product.
Top 5 DEV Comments from the Past Week
Tags: bestofdev
Published: 2018-12-25 18:27:09

---
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.

@abraham chimes in with a very relatable confession in the **[Tell me a coding confession](https://dev.to/ben/tell-me-a-coding-confession-15e1)** thread.  Obviously there's a time and place to commit something to memory, but IMO it's fine if you also want to rely on a accessible reference _you know is there_:
{% devcomment 7kl6 %}

In **[Please don't commit .env](https://dev.to/somedood/please-dont-commit-env-3o9h)**, @bgadrian provides some guidance on what to do right after installing your operating system:
{% devcomment 7jno %}

I really enjoyed the **[Stop trying to be so DRY, instead Write Everything Twice (WET)](https://dev.to/wuz/stop-trying-to-be-so-dry-instead-write-everything-twice-wet-5g33)** article.  Sometimes a concise re-statement can help make the central take-away a bit more concrete.  That's what @nielsbom does here:
{% devcomment 7jcb %}

Tasked to **[Explain Lazy and Eager Loading Like I'm Five](https://dev.to/chandlerbing016/explain-lazy-and-eager-loading-like-im-five-khb)**, @ryan very much comes through:
{% devcomment 7kfh %}

Finally, @henrique answers **[What is the hardest thing about learning to code?](https://dev.to/emmawedekind/what-is-the-hardest-thing-about-learning-to-code-j7)** with some thoughts about the perpetual struggle to continue learning.  If you can't learn on the job, that can easily contribute to an unhealthy work/life balance:
{% devcomment 7kmh %}

See you next week for more great comments ✌
Image processing with Jimp. Optional methods parameters.
Tags: help, typescript, externallibrary, jimp
Published: 2018-12-25 18:08:35

---
title: Image processing with Jimp. Optional methods parameters.
published: true
tags: help, typescript, external-library, jimp 
---

Hi guys. 

I'm working on some kind of cloud image hosting and processing. I do use [Jimp](https://github.com/oliver-moran/jimp), which is great and works like a charm. 

Jimp's giving a lot of cool image processing methods, such as resizing, scaling and so on. You can chain methods to apply multiple effects, f.ex.:

```javascript
Jimp.read('image/path')
 .then(image => {
     image
        .resize()
        .scale()
        .grayscale()
 })
 ....

```


####What do I want to achieve

I want to process images in a fly. For example, I do have an URL:

`[...].images.io/i/image-uuid?list=a&of=b&params=c`


These params can be f.ex. width, height, scale, rotate etc.

For now I can manipulate image by giving one specific parameter f.ex. 

`[...].images.io/i/image-uuid?scale=0.5`

and it's works - it's scaling image.

But I want to have opportunity to use bunch of options in one request f.ex.:
`[...].images.io/i/image-uuid?scale=0.5&filter=grayscale&rotate=80`

and I do not know how make it work. For now - Jimp offers more than 30 methods what gives us bunch of combinations so simple switch-case won't work. ;) 

Basing on documentation, there is no thing such as optional params, and you cannot pass nulls or undefined as a method params.

Any ideas how can i overcome this? :)


Happy Holidays everyone!
Regex tools
Tags: regex, productivity
Published: 2018-12-25 16:38:22

---
title: Regex tools
published: true
description: regex tools
tags: #regex, #productivity
---

# Regex - tools

working with regex is always painful. most of the time developers end up in copy pasting regular expressions from stack-overflow or other sites. Although this satisfies the needs of most common requirements, it is good to have an idea of what the regex is doing and testing it.

I find following tools very helpful while working with regular expressions.

- Any text editor or IDE

most of the modern ides and text editors come with a good regular expression support for searching text.

![vs code regex](https://thepracticaldev.s3.amazonaws.com/i/2pjtefpbla64n2xt8ac0.PNG)


- [Regulex](https://jex.im/regulex/#!flags=&re=%5E(a%7Cb)*%3F%24)

This is one of my favourite developer tool. Regulex helps to visualize the regular expression

- [regex101](https://regex101.com/)

If you want to write, test & play with regex this is a good site. It also has good regex documentation.
Imperative vs declarative
Tags: programming, beginners
Published: 2018-12-25 16:20:26

---
title: Imperative vs declarative
published: true
description: Imperative vs declarative is an example of categorical thinking. There is a spectrum of values, but we trapped with two categories
cover_image: https://thepracticaldev.s3.amazonaws.com/i/nxx2vq9xl627980r6pr4.jpg
tags: [programming, beginners]
---

**Imperative** - you instruct a machine what to do step by step. Example: assembly language.
**Declarative** - you instruct a machine what you want to get and it supposes to figure it how to do it. Example: SQL.

Imperative vs declarative is an example of limitation of [categorical thinking](https://dev.to/stereobooster/categorical-thinking-22kp). There is a spectrum of values, but we trapped with two categories.

Let's take a look at some examples.

### List operations

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

List operations (iteration, filtering etc) from most imperative to most declarative approach:

1. Imperative programming, which includes `goto` (or `jump` in terms of modern assembly). For example assembly.
2. [Structured programming](http://cs.lmu.edu/~ray/notes/paradigms/), which includes `for` loops and indexed access to elements of the array. For example Pascal.
3. Map/Reduce concept, which includes map and reduce operations, but abstracts away how list itself is organized. For example map/reduce in Scheme.
4. Relational databases, which abstracts away all implementation details of storage. For example SQL.

### CSS position models

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

CSS position models from most imperative to most declarative approach:

1. `position`, `float`, `padding`, `margin`. You need to juggle those properties to achieve the desired layout. For example, see [how to position div in the center](https://css-tricks.com/centering-css-complete-guide/).
2. Flexbox. [A lot of hacks went away](https://philipwalton.github.io/solved-by-flexbox/), but you still can't describe layout precisely, it is still some approximation
3. [CSS Grid Layout](https://css-tricks.com/snippets/css/complete-guide-grid/). You can describe the layout.

Also, need to notice that there is a way too much "knobs" in CSS to manipulate layout. See [this video from deconstructconf](https://www.deconstructconf.com/2017/kevin-lynagh-choosing-features) to understand how this task can be solved better.

_Photo by Fabio Rose on Unsplash_
AnyChart JS Charts 8.5.0 Released with 3D Surface Chart, Word Tree, and More New Features
Tags: javascript, webdev, dataviz, news
Published: 2018-12-25 15:30:33

---
title: AnyChart JS Charts 8.5.0 Released with 3D Surface Chart, Word Tree, and More New Features
published: true
description: AnyChart announces release 8.5.0 of its JavaScript data visualization libraries, bringing Word Tree, 3D Surface Chart, and more new cool features for advanced JS (HTML5) charting.
tags: #javascript, #webdev, #dataviz, #news
canonical_url: https://www.anychart.com/blog/2018/12/25/javascript-data-visualization-libraries-new-features/
cover_image: https://i.imgur.com/XC7xQx6.png
---

AnyChart announced a new major update for its [JavaScript data visualization libraries](https://www.anychart.com) — AnyChart 8.5.0 is released.

The new version delivers a number of cool features and improvements, including:
* 3D Surface Plot;
* Word Tree,
* Y scroller,
* grouping by series in multi-series charts,
* timescale gaps in stock charts,

and more.

For details, check out the [highlights of the AnyChart JS Charts 8.5.0 release](https://www.anychart.com/blog/2018/12/25/javascript-data-visualization-libraries-new-features/) on the AnyChart blog. There, you can also share your suggestions on what should be added to these JS charting libraries next.

Earlier this year, AnyChart was [named](https://dzone.com/articles/best-in-developer-tech-2018-devies-award-winners-n) the best in JS and received a DEVIES award at DeveloperWeek in California.