teleren/devto huggingface dataset:
Decide Design Pattern For Angularjs Mobile App
Tags: angular, designpattern, javascript, discuss
Published: 2017-09-19 10:47:35

---
title: Decide Design Pattern For Angularjs Mobile App
published: true
description: Decide Design Pattern For Angularjs Mobile App
tags: Angularjs, Design Pattern, Javascript, discuss
---
Starting anything from scratch is fun but at the same time a headache because you have to take into account the future possibilities into consideration.

For now I am going to build an app related to E-Wallet but I am stuck here thinking what should be the approach I should take or rather asking a straight forward question which Design Pattern to use my Technologies are Angularjs, OO JavaScript, HTML5, CSS 3.

I have numerous screens like login, registration, payment, etc. and the idea is to use the design pattern that can be helpful from future perspective.

Although this is a specific post but i am sure there are many who might be struggling with this question (Obviously Keeping Senior Devs aside) as we know many patterns but don't know how to make use of it .

Guy's really need help from the community.
Why does the Pomodoro Technique work so well
Tags: ai, productivity, psychology, mentalhealth
Published: 2017-09-20 22:25:40

---
title: "Why does the Pomodoro Technique work so well"
published: true
tags: artificial-intellige,productivity,psychology,mental-health
canonical_url: https://medium.com/@andrew_subarctic/why-does-the-pomodoro-technique-work-so-well-66190ea8ddf
description: The brain is really interesting in its ability to switch between very low level semantics, like a logical if statement, to higher level thoughts such as scheduling time to read and reflect on the philosophical works of Kant.
---

It trains your brain to “flow” and focus

During high school I liked to try different _brain hacks_. My favorite was what I called _triggers_. A brain trigger is simply a deferred memory: “when I get to homeroom, take out my physics book and open it to page 146”. Phrasing an action as the posterior of a condition is one of the most basic building blocks in the human brain. In computers this would be the _if statement_. However the brain version is more powerful because this structure is time sensitive. It is due to this time sensitivity that the Pomodoro Technique works so well. Pomodoro takes one of our most primitive control structures and aligns it with a higher state of mind: **task focus**.

In a previous post I talked about how scheduled events can [cloud your working memory](https://dev.to/andrewlucker/why-do-programmers-wear-headphones-for-the-same-reason-that-you-cantjuggle) and make you lose focus. The Pomodoro Technique is interesting because it uses the exact same phenomena to create the exact reverse effect: by deliberately scheduling a _focus event_, you push out other concerns from your working memory, effectively clearing space for the future use.

The brain is really interesting in its ability to switch between very low level semantics, like a logical if statement, to higher level thoughts such as scheduling time to read and reflect on the philosophical works of Kant. Reading text is one of the highest faculties and something that completely separates humans from other living things with regards to intellectual capacity. Pomodoro Technique is just one example of simple techniques used for high level effect.

_This post was originally published on [medium.com](https://medium.com/@andrew_subarctic/why-does-the-pomodoro-technique-work-so-well-66190ea8ddf)_
🚀 Introducing Lozad.js: Performant & light lazy loading library
Tags: javascript, opensource, showdev, webperf
Published: 2017-09-19 04:09:44

---
title: "🚀 Introducing Lozad.js: Performant & light lazy loading library"
published: true
description: "Lozad.js: Highly performant & light lazy loading library in pure JS for images, iframes and more with no dependencies"
tags: javascript, opensource, showdev, webperformance
---

![lozad.js lazy loading javascript library](https://thepracticaldev.s3.amazonaws.com/i/nptus1dcu12hkhdnjghc.png "lozad.js lazy loading javascript library")

> Lazy loading is a programming practice in which a component is loaded only at the time of need. This gives great performance boost especially when the time taken to load a component is significant, and there are several such components in an application.

In webpages, images/social-widgets/ads/videos etc. contribute majorly to the increase in page load time because of their size or the resources loaded by them. Thus, to decrease page load time, it's absolutely necessary to lazy load all such components which are not critical, at the time of need.

### Yet another Lazy Loading JavaScript library, why?
Existing lazy loading libraries hook up to the scroll event or use a periodic timer and call `getBoundingClientRect()` on elements that need to be lazy loaded. This approach, however, is painfully slow as each call to `getBoundingClientRect()` forces the browser to re-layout the entire page and will introduce considerable jank to your website.

Making this more efficient and performant is what [IntersectionObserver](https://developers.google.com/web/updates/2016/04/intersectionobserver) is designed for, and it’s landed in Chrome 51. IntersectionObservers let you know when an observed element enters or exits the browser’s viewport.

---

### Introducing **Lozad.js**:
- lazy loads elements performantly using pure JavaScript,
- is a light-weight library, just **535 bytes** minified & gzipped,
- has NO DEPENDENCIES :)
- allows lazy loading of dynamically added elements as well.

### Install

```sh
# You can install lozad with npm
$ npm install --save lozad

# Alternatively you can use Yarn.
$ yarn add lozad

# Another option is to use Bower.
$ bower install lozad
```

Or load via **CDN** and include in the `head` tag of your page.

```html
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/lozad/dist/lozad.min.js"></script>
```

### Usage

In HTML, add an identifier to the element (default selector identified is `lozad` class):
```html
<img class="lozad" data-src="image.png" />
```

All you need to do now is just instantiate Lozad as follows:
```js
// lazy loads elements with default selector as '.lozad'
const observer = lozad();
observer.observe();
```

---

For details, checkout [Lozad.js repo on Github](https://github.com/ApoorvSaxena/lozad.js)
Multiple GitHub accounts in the same computer
Tags: github, dev, docker
Published: 2017-09-18 19:35:52

---
title: Multiple GitHub accounts in the same computer
published: true
description: 
tags: #github #dev #docker
---

Due to work I faced the need of using two or more GitHub accounts, sometimes I need to use the accounts in the same machine. I've been trying to use the following solution:

https://code.tutsplus.com/tutorials/quick-tip-how-to-work-with-github-and-multiple-accounts--net-22574

However I couldn't make it to work, by the time I was experimenting with Docker and I got the idea of using a container to just push my changes. So far I haven't identify any security related problems, obviously never expose the container to internet just start it push your changes and stop it, or script it to launch it add the new ssh keys to github push then destroy the container.

The solution is quite simple, start a new container from the image I created in an earlier post: [Creating the Docker image](https://dev.to/ech0server/creating-a-docker-image-and-upload-it-to-docker-hub)

First of all pull the image:

```sh
docker pull drverboten/multigitaccount
```

Then create a new container from the image, but add the path of the source code or any other resource you want to add to your repo as a volume with the -v option:

```sh
docker run -it --name gitpub -v /home/[user]/[path to workspace]:/workspace drverboten/multigitaccount /bin/sh
```
After the container is running, create a new ssh key with the following command:

```sh
ssh-keygen -t rsa -b 4096 -C "[email]"
```
Copy your key to the clipboard you can just cat and copy the text:
```sh
cat ~/.ssh/id_rsa.pub
```

Add the key to GitHub

![GitHub](https://thepracticaldev.s3.amazonaws.com/i/5dog61f5ni00cie1dnc5.png)

Back in the container configure git:

```sh
git config --global user.email "[email]"
git config --global user.name "[username]"
```

And you are all set, just push to GitHub as you normally do, it will post as the configured user.

ðŸ‘»âœŒï¸
Lending Privilege
Tags: techtalks, diversity
Published: 2017-09-18 17:58:40

---
title: Lending Privilege
published: true
description: Scott Hanselman recommended this to me when I was talking to him at a conference. He didn’t give me a list, or try to impart the lessons on me there, he just told me to watch the talk. So here I am recommending it to you.
tags: techtalks, diversity,
---

In software development, in order to get from loose ideas to actual working programs, we rely on patterns and frameworks in which to think. The computer doesn’t care about MVC or MVVM, or SQL or Java for that matter. But in order to get anything done, we distill our infinite possible approaches into concise patterns and conventions. This is important for individuals to wrap their heads around what they're doing and even more critical when team communication enters the picture. Sometimes I’ll have a far-out idea rattling around in my head, and it’s not until I hear it broken down in a book or blog post that equips me with the verbiage and frame of reference to organize my own thoughts.

So I want to present you a talk at GitHub Universe by Anjuan Simmons which I believe helps provide a framework from which to approach social issues which hold our industry back. Scott Hanselman recommended this to me when I was talking to him at a conference. He didn’t give me a list, or try to impart the lessons on me there, he just told me to watch the talk. So here I am recommending it to you.

{% youtube 8Nvg-MMtN_A %}
Open Source Goals and the Year in Review
Tags: goals, opensource
Published: 2017-11-29 03:36:28

---
title: "Open Source Goals and the Year in Review"
published: true 
tags: Goals,goals,open source
cover_image: https://thepracticaldev.s3.amazonaws.com/i/ofs0vl1d548ztnjssitd.jpg
canonical_url: 
---

[Una Kravets](https://twitter.com/una) is one of my favorite designers/developers even though I just discovered who she was, and by accident.

I was doing a little GitHub dumpster diving, scrolling through who I was following. Found a guy who I wanted to keep an eye on who hadn’t posted in a while. I went through his repos and found a personal goals repo. It was a fork. I went to the source and found it was [Una Kravets repo](https://github.com/una/personal-goals).

## Open Sourcing Your Goals Makes You More Productive

Accountability is a thing that most humans need <sup id="fnref-2448-1"><a href="#fn-2448-1">1</a></sup>. Open sourcing my goals has made me pay attention to what I am doing and when. This past week I didn’t get much done, and hesitated sharing it to my [personal goals repo](https://github.com/twhite96/personal-goals). But I did. And it looks pretty bad.

## Goals for the Year and Year in Review Posts

Una posts her _Goals for the Year_ and _Year in Review_ on her blog and I decided I’d do the same thing on this one.

I had my goals on my other blog. Since it is no longer a Apple productivity blog I’ll do it here. It makes more sense here than there.

## What Do You Think

I thought this was a great idea immediately. What do _you_ think? Will you try it? Two weeks in and I am hooked.

* * *

1. Especially if you procrastinate and get off schedule on weekends like I do.&nbsp;↩

The post [Open Source Goals and the Year in Review](https://tiffanywhite.tech/open-source-goals/) appeared first on [Tiffany R. White Blog](https://tiffanywhite.tech).
Ubuntu Setup
Tags: linux, shell, ubuntu
Published: 2017-09-18 16:15:23

---
title: Ubuntu Setup
published: true
description: 
tags: Linux, Shell, Ubuntu
---

The excitement of a new OS or new laptop is palpable. But installing applications that you need to get work done can involve a little drudgery. I formalized the setup in the form of a shell script to ensure that most of the basic applications that I need are installed automatically. You can find the complete script at [https://github.com/mohanarpit/Ubuntu-Initializer](https://github.com/mohanarpit/Ubuntu-Initializer).

All you need to do is copy the script `install_script.sh` and execute it. Some of the applications that it installs are:

* **Source Control**: Git, SVN
* **Languages**: Python, Java, Php, Go, Nodejs
* **Editors**: Atom
* **Databases**: Mysql
* **Servers**: Tomcat, Apache2
* **Utilities**: Tmux, fail2ban, jq etc.

It even creates your key pair, if you don't already have one.
As you can see, it's geared towards web developers but nothing stops you from customising the script to add/subtract applications for your needs.

Over the years, this script has saved me & my team from a lot of hours of hunting and installing basic applications.

Originally posted on [my blog](https://blog.arpitmohan.com/Ubuntu-Initializer)
Measuring AWS Redshift Query Compile Latency
Tags: awsredshiftbigdata
Published: 2017-09-18 15:14:45

---
title: Measuring AWS Redshift Query Compile Latency
published: true
description: 
tags: aws redshift bigdata
---

*This article originally [appeared on my blog](http://wrschneider.github.io/2017/06/02/redshift-compile-latency.html)*

AWS is transparent that Redshift's distributed architecture entails a [fixed cost every time a new query is issued](http://docs.aws.amazon.com/redshift/latest/dg/c-query-performance.html).  The documentation says the impact "might be especially noticeable when you run one-off (ad hoc) queries."

I went deeper to try to quantify exactly what "noticeable" means.

To isolate the impacts of data cache hits/misses from query compilation, I ran a bunch of queries on empty tables so there is no data to load or cache. Each query was slightly modified to trigger a recompilation, by changing the columns or aggregate functions.

I found that the compile latency scales with the complexity of the query.

* Simple query: usually between 1-1.5 sec, with an outlier around 3 seconds.  Example of a simple query:

```
select sum(a1) from foo where a2 = 1;
select sum(a2) from foo where a3 = 1;
-- etc.
```

* More complex query with more conditions, and group-by: usually around 2-3 seconds.  Example of a query in this category:

```
select a8, a9, sum(a1), sum(a2)
from foo
where foo.a3 > 10 and foo.a4 < foo.a5
group by a8, a9;
```

* Even more complex, with joins and group-by: average around 5 seconds, ranging between 3-7 seconds. Example query:

```
select s, s2, count(a6), sum(a7)
from foo
join bar on bar.a = foo.a6
join baz on baz.b = foo.a7
where foo.a3 = 1 and baz.s2 is not null
group by s, s2;
```
The 7 Most Popular DEV Posts from the Past Week
Tags: top7
Published: 2017-09-18 15:11:42

---
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. You've got skills ðŸ’¸

[Steff](https://dev.to/steff_br) isn't a millionaire, _yet_, but she's a coder interested in investments. Here's her take on how to become a millionaire. 

{% link https://dev.to/steff_br/how-to-apply-your-coding-skills-to-turn-yourself-into-a-self-made-millionaire %}


#2. Trump's breakdown
An in-depth tutorial on sentiment analysis on tweets using python. [Rodolfo](https://dev.to/rodolfoferro) covers how to: 
1) Extract twitter data using tweepy and learn how to handle it using pandas.
2) Do some basic statistics and visualizations with numpy, matplotlib and seaborn.
3) Do sentiment analysis of extracted (Trump's) tweets using textblob.
{% link https://dev.to/rodolfoferro/sentiment-analysis-on-trumpss-tweets-using-python- %}

#3. Git it, gurl

Our resident git expert, [JMac](https://dev.to/gonedark), was our AMA guest this week. His AMA covers everything git, ranging from his personal frustrations to git style guides. 
{% link https://dev.to/gonedark/im-a-git-master-ask-me-anything %}

#4. Vue or Preact?

It was announced this week that wordpress and react are breaking up. [Ahmad](https://dev.to/mrahmadawais), a regular wordpress core contributor shares his take on two framework contenders. 

{% link https://dev.to/mrahmadawais/-wordpress-react-breakup-suggest-a-javascript-framework-to-wordpress--tell-why-poll %}

#5. Let your personality shine ðŸŒŸ 
A collection of funny code, comments, and error messages. 

{% link https://dev.to/lpasqualis/16-best-source-code-gems-collection %}

#6. From theory to practice. 
[Vaidehi](https://dev.to/vaidehijoshi), who gave us a gentle introduction to graph theory, is back to help us level up. In this post, we're putting theory to practice. 

{% link https://dev.to/vaidehijoshi/from-theory-to-practice-representing-graphs %}

#7. FAQs: System Design Interviews
Designing Large Scale Distributed Systems has become the standard part of the software engineering interviews. Here's a list of the most frequently asked system design interview questions.  

{% link https://dev.to/fahimulhaq/top-10-system-design-interview-questions-for-software-engineers %}

_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!_
HtC: SD Weeks 1b and 2
Tags: p1xtguides, learningtocode, racket
Published: 2020-01-14 00:00:42

---
title: HtC: SD Weeks 1b and 2
published: true
date: 2017-09-18 14:06:35 UTC
tags: p1xt-guides,learning-to-code,racket
canonical_url: 
---

 **Week 1b** introduced our first Design Recipe for how to design functions. The design recipe has five parts which should be completed more or less in order. While they may seem like overkill for a small function, I am certain they will help writing large and complicated programs. I went through all of the week’s practice problems before attempting the Module Assessment, this helped solidify the steps, syntax, and style required to succeed in the course.

The language itself, Racket, has many many things we will need to look up in HelpDesk. For example, while it has the type Number, there is also type Natural which is a subset of Number and should be used if it is suitable to the program. It makes no sense for the instructor to go over every little bit of the language. First of all it would be impossible, and secondly this way we are forced to teach ourselves and explore the documentation.

![](https://cdn-images-1.medium.com/max/634/1*vuvISt7S4E7TyuTBxy41TA.jpeg)<figcaption>Not quite</figcaption>

**Week 2** moves on from functions to data. If we can define and therefore restrict the type of data our functions receive, it would be easier to design the functions. The first half of the week introduced three new data structures: intervals, enumerations, and itemizations. One example of each was given and we designed a formal data definition (according to the recipe). At first it was a bit overwhelming to read through the recipe, but after a bit of practice it is fairly intuitive.

The second half of the week shows how to design functions based on these new data types. There are a lot of things to keep track of, which is why following the recipes is key. I am slightly terrified of what’s to come, it seems this course is ramping up quite rapidly!
Why I always recommend Arch Linux
Tags: linux
Published: 2017-09-18 13:22:10

---
title: Why I always recommend Arch Linux
published: true
description: Why Ubuntu is less user friendly than Arch-based distros
tags: Linux
---
Normally, the go to distro for newcomers is Ubuntu. It comes with a nice installer and an interface of brand "good enough". But I always recommend Antergos Linux for newcomers, because it is an Arch Linux based distro. Why?

## Software

In Ubuntu the software is usually around one whole year behind the current version. Because the maintainers want the software to be tested and not buggy as new versions are often. In my experience however, the exact opposite is the case: I just had another "incident". Currently I have to use ubuntu, because it is not my PC. I was using Keepass and tried to synchronize the password database via my WebDAV server.

It was not working. Why? Because the version of Mono that was installed by Ubuntu (the "newest" version) was one complete major version behind the current stable version and this old version was not able to handle letsencrypt certificates. The solution after 1 day of searching: Adding the official mono ppa as repository and use the version from there.

With Arch (and Arch based distros) you always get the newest version **in the main software repositories**. I never encountered this issue on my Arch machine, simply because installing keepass also pulled the newest version of mono.

## Software not in the official repositories

On Ubuntu, if your software is not in the official repositories, you are out of luck most of the time. If you are lucky, the software maintainer is hosting a ppa from where you can install it. If not, you have to download a `.deb` and update it manually.

Arch Linux on the other hand has the AUR - the Arch User Repository. Every user can upload a package build script to package any software available. This has the consequence, that if a software is available for linux, you can find it in the AUR. This also means you get normal package updates for those user packages.

## Package manager

Ubuntu's package manager is very verbose, so you have to type a lot in order to do common tasks. To update all installed packages:
```
sudo apt update && sudo apt upgrade
```
compare that to pacman, the Arch Linux package manager:
```
sudo pacman -Syu
```
If you want access to the AUR through the package manager, the most common way is to install `yaourt` a wrapper around `pacman`. With this you can search easily the database of packages:
```
yaourt vlc
```

## TL;DR

If you are a Linux beginner, install Antergos Linux. Once you are comfortable with the command line, switch to bare Arch Linux.
Explain the Boot Sequence Like I'm 5
Tags: explainlikeimfive, discuss
Published: 2017-09-18 12:13:49

---
title:  Explain the Boot Sequence Like I'm 5
published: true
description: 
tags: explainlikeimfive, discuss
---

How do the hardware, bootloader, firmware, BIOS, OS, ... whatever is involved, interact to get a computer from completely off, to a usable state?
How the definition of quality evolves with a project
Tags: testing, codequality
Published: 2017-09-18 11:14:53

---
title: How the definition of quality evolves with a project
published: true
description: 
tags: testing, quality
---

What is quality? There are multiple definitions. In general, it is a level of satisfaction by conformance to expectations, both implicit and explicit, by all stakeholders. 

It is a common thing that a lot of changes are introduced during the project development. New requirements are uncovered, both functional (new features) and non-functional (e.g. accessibility, performance or localization requirements).

Later, as the project evolves, the project goals may change. The basic test strategy and approach [should be updated along with the project evolution](https://binary-studio.com/2017/09/14/definition-quality-evolves-project/).