teleren/devto huggingface dataset:
Dependency Injection has Me Concerned 
Tags: di
Published: 2019-06-18 14:05:55

I'm a big fan of dependency injection, specifically the poor man's version. However I am greatly concerned that this pattern is heavily abused when using a framework. I'm not the only one who sees this [Don't Blame Dependency Injection](https://www.continuousimprover.com/2018/05/dont-blame-dependency-injection.html) wants to emphasize that it is not even the framework which is at fault. And when you read about the [disadvantages](https://softwareengineering.stackexchange.com/questions/371722/criticism-and-disadvantages-of-dependency-injection) there are similar sentiments, "don't ask if you should use dependency injection, ask what problem are you trying to solve." 

Unspecified Dependencies: this is probably the worst offense for DI frameworks. You can pass a function the DI container which includes what and how to construct the interfaces needed by the function. This is nice because you can pass all the parameters in a single argument and if you need to add a new dependency then the API remains unchanged. This is also detrimental because most DI containers are not checked at Compile Time meaning your users are not informed of the API change needed to call your function. The function signature is no longer self documenting or compiler checked. 

Tight Coupling to the DI Framework: If you utilize a framework and even library it can be hard not to have some form of coupling. They even have frameworks to help with that. One of the other approaches to DI is constructor injection. This is where all of the classes define the dependency in the constructor and the framework builds the tree. Here your entire dependency graph is defined by the framework, if your dependencies are deep you'll be placing DI in every situation and it will be next to impossible to call a function without the framework. 


Global State: There is much written about avoiding global state and how to do it. It is one of the reasons Singleton is seen as an antipattern. With dependency injection containers things are a bit different. While frameworks could be used to build out singletons, this isn't as likely to happen. Instead the assumption is to use a global container leaving only one concrete type per interface. This is not how I view well structured code. 


I think I understand those who oppose garbage collection and say it is better to handle your memory manually, a bit more. I want to say the same thing for dependencies, make it clear what is needed to complete the operation. But I started working in GC languages, but not DI frameworks.
Welcome Thread - v34
Tags: welcome
Published: 2019-06-18 13:54:14

---
title: Welcome Thread - v34
published: true
description: Introduce yourself to the community!
tags: welcome
---

![Hello there](https://media.giphy.com/media/ehnBGPgDOusUM/giphy.gif)

### Welcome!

1. Leave a comment below to introduce yourself! You can talk about what brought you here, what you're learning, or just a fun fact about yourself.

2. Reply to someone's comment, either with a question or just a hello. 👋 

**Great to have you in the community!**
Bootstrap 4 customizer
Tags: javascript, webdev, css, bootstrap
Published: 2019-06-18 13:51:41

---
title: Bootstrap 4 customizer
published: true
description: How to build a custom version of Bootstrap v4
tags: #javascript, #webdev, #css, #bootstrap
---

Hi everybody, it's the first time I'm writing here, so please be kind with my amazing English level :smile:

## [bs-customizer](https://johann-s.github.io/bs-customizer/)

It's a project [we](https://github.com/Johann-S/bs-customizer/graphs/contributors) made to build a custom version of Bootstrap 4.

The idea comes from [Bootstrap 3 customizer](https://getbootstrap.com/docs/3.4/customize/) and because I see a lot of Bootstrap users asking for a Bootstrap 4 customizer.

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


[bs-customizer](https://johann-s.github.io/bs-customizer/) allow you several things:
  - Choosing components and JavaScript plugins you need
  - Minifying the resulting build
  - Importing [Popper.js](https://popper.js.org/) inside

With that simple tool, you'll be able to optimize your Bootstrap build by reducing the Bootstrap's size.

I hope you'll enjoy it!
Chicken Salad Review
Tags: food, salad, life
Published: 2019-06-18 13:43:12

## ⚠️This post is completely unrelated to tech!!!

I have tried some chicken salads since this year to avoid eating unhealthy food like chicken over rice, chicken over rice, and chicken over rice.


### Pret A Manger
`Chicken Salad`
Chicken ⭐⭐⭐⭐⭐
A little bit salty
Volume ⭐⭐⭐⭐⭐
Price ⭐⭐

### McDonald's
`Bacon Ranch Grilled Chicken`
Chicken ⭐⭐⭐
A little bit salty
Volume ⭐⭐⭐⭐
Price ⭐⭐⭐

### McDonald's
`Southwest Grilled Chicken Salad`
Chicken ⭐⭐⭐⭐
A little bit salty
Volume ⭐⭐⭐⭐
Price ⭐⭐⭐

### Gristedes
`Chicken Salad`
the dressing isn't attached   
Chicken ⭐⭐⭐⭐
Volume ⭐⭐⭐⭐
Price ⭐⭐⭐


### DUANEreade
`Chicken Salad`
the dressing isn't attached   
Chicken ⭐⭐
Dry
Volume ⭐⭐⭐⭐
Price ⭐⭐⭐


### Trader Joe's
`Chicken Salad`
the dressing isn't attached   
Chicken ⭐⭐⭐
Volume ⭐⭐⭐
Price ⭐⭐⭐



If you know a good one, please let me know.
Awesome DEV.to Blogs
Tags: beginners, tutorial, todayilearned
Published: 2019-06-18 13:39:11

So over the last week I have been collecting some awesome Blog series to read here on [DEV](https://dev.to/).

Series are good, they give you a lesson wise learning experience which is sometimes far better than single blog posts.
It also helps if your blog is too big to fit into one.

Here are some of my favs 😋:
 
{% link https://dev.to/codemouse92/dead-simple-python-list-comprehensions-and-generator-expressions-2mb5 %}

{% link https://dev.to/teamxenox/-ultra-list-one-list-to-rule-them-all-march-19-4p4f %}

{% link https://dev.to/_darrenburns/10-tools-to-power-up-your-command-line-4id4 %}

![gif](https://media.giphy.com/media/mXnO9IiWWarkI/giphy.gif)
Here is the repository for **awesome dev.to**
{% github https://github.com/Bhupesh-V/awesome-dev.to %}


You may contribute your favorite series directly as a PR or just comment out below 👇.
Discussing the launch of Libra, "A new global currency"
Tags: news, discuss
Published: 2019-06-18 12:58:02

---
title: Discussing the launch of Libra, "A new global currency"
published: true
description: A thread to talk about the launch of Libra
tags: news, discuss
---

## [Libra.org](https://libra.org) is now live.
"Libra’s mission is to enable a simple global currency and financial infrastructure that empowers billions of people."

This project is receiving a lot of attention, and is being described as "Facebook's crypto currency."  [Per TechCrunch](https://techcrunch.com/2019/06/18/facebook-libra/), that's not necessarily an accurate description, though they were a primary backer of the project:
> Facebook won’t fully control Libra, but instead get just a single vote in its governance like other founding members of the Libra Association including Visa, Uber, and Andreessen Horowitz who’ve invested at least $10 million each into the project’s operations.

I enjoy the writing of Fred Wilson from USV.  Here is [his post](https://avc.com/2019/06/why-usv-is-joining-the-libra-association/) on the USV's involvement.

The Libra code is on GitHub: https://github.com/libra/libra
And they've also open-sourced a related programming language called Move: https://developers.libra.org/docs/move-paper

---

I think it's pretty *easy* to take a "Facebook is evil" and highly skeptical and pessimistic position.  That position is totally justifiable given Facebook's track-record on privacy and a host of other issues.  But I also think there's a reasonable case for optimism.

What do other people think?
10 Articles related to Web Development YOU can't miss.
Tags: php, javascript, elasticsearch
Published: 2019-06-18 12:50:16

---
title: 10 Articles related to Web Development YOU can't miss.
published: true
description: 10 Articles related to Web Development YOU can't miss.
tags: PHP, Javascript, Elasticsearch
cover_image: https://thepracticaldev.s3.amazonaws.com/i/6i28dk95r5h0up3gyzph.png
---
<b>1) PHP Cookies and Sessions | Detailed Explanation | Coding Examples</b>

Link To The Article: <a href="https://fullstackgeek.blogspot.com/2019/06/php-cookies-and-sessions-examples.html">PHP Cookies and Sessions | Detailed Explanation | Coding Examples</a>



<b>2) Asynchronous JavaScript | Callbacks | Closures | Promises</b>

Link To The Article: <a href="https://fullstackgeek.blogspot.com/2019/02/asynchronous-javascript-explained-for-beginners.html">Asynchronous JavaScript | Callbacks | Closures | Promises</a>




<b>3) Best PHP Frameworks (2019)</b>

Link To The Article: <a href="https://fullstackgeek.blogspot.com/2019/05/best-php-frameworks.html">Best PHP Frameworks (2019)</a>



<b>4) Introduction to Elasticsearch and the ELK stack</b>

Link To The Article: <a href="https://fullstackgeek.blogspot.com/2019/03/introduction-to-elasticsearch-and-elk-stack.html">Introduction to Elasticsearch and the ELK stack</a>



<b>5) What should I learn after PHP | Roadmap 2019</b>

Link To The Article: <a href="https://fullstackgeek.blogspot.com/2019/05/what-should-i-learn-after-php.html">What should I learn after PHP | Roadmap 2019</a>



<b>6) Redis vs MySQL Benchmarks</b>

Link To The Article: <a href="https://fullstackgeek.blogspot.com/2019/04/redis-vs-mysql-benchmark.html">Redis vs MySQL Benchmarks</a>



<b>7) InnoDB vs MyISAM | Storage Engines | Tabular Differences</b>

Link To The Article: <a href="https://fullstackgeek.blogspot.com/2019/05/main-differences-between-innodb-and-myisam.html">InnoDB vs MyISAM | Storage Engines | Tabular Differences</a>



<b>8) Best PHP Books for Beginners [Updated] [2019]</b>

Link To The Article: <a href="https://fullstackgeek.blogspot.com/2019/06/best-php-books-for-beginners.html">Best PHP Books for Beginners [Updated] [2019]</a>



<b>9) Implementing OTP in PHP using Twilio</b>

Link To The Article: <a href="https://fullstackgeek.blogspot.com/2019/03/implement-otp-in-php-with-example.html">Implementing OTP in PHP using Twilio</a>



<b>10) Var vs Let in JavaScript</b>

Link To The Article: <a href="https://fullstackgeek.blogspot.com/2019/02/var-vs-let-javascript.html">Var vs Let in JavaScript</a>


Happy Learning,
Full Stack Geek
DBIC testing: rs_with_new_rows
Tags: perl, dbic, testing, orm
Published: 2019-06-18 12:33:37

---
title: DBIC testing: rs_with_new_rows
published: true
description: A useful DBIC search method for identifying newly created rows
tags: perl, dbic, testing, orm
---

Here's a handy little [DBIx::Class](https://metacpan.org/pod/DBIx::Class) _ResultSet_ method for when you need to write a test verifying database changes.

```perl
=head2 rs_with_new_rows() : $resultset_with_new_data

Resultset with only PK ids which are greater than the currently
largest one, i.e. it will only return rows created going forwards.

Great for testing.

=cut

sub rs_with_new_rows {
    my $self = shift;
    my $max_id = $self->get_column("id")->max();
    return $self->search({ id => { ">" => $max_id } });
}
```

Put that in the base class for your _ResultSet_ classes to make it available to all of them in one go.

As you can see, the basic operation is to look for the highest `id` column value and then find rows with an id larger than that.

This brings along a few caveats. First off, the PK column needs to be an ever increasing value (probably an `auto_increment` or `sequence` depending on your database).

Second, the PK column obviously needs to be called `id`. If that's not the case, you could solve this by using the [primary_columns](https://metacpan.org/pod/DBIx::Class::ResultSource#primary_columns) method of the _ResultSource_ class and use that.

Third, if this were a proper library it should probably be flexible and and robust enough to be used as part of a more complex query, and we should use the _ResultSet_  [current_source_alias](https://metacpan.org/pod/DBIx::Class::ResultSet#current_source_alias) to fully qualify the column names.

For this simple use case, it works fine though.



# Finally, let's write that test

Here's how the `rs_with_new_rows` method would be used in a test:

```perl
note "*** Setup";
my $tree_node_rs = $schema->resultset("TreeNode")->rs_with_new_rows();

note "*** Run";
# Run code under test, which creates tree nodes

note "*** Test";
is($tree_node_rs->count, 3, "Correct number of tree nodes created");
ok(
    ! $tree_node_rs
        ->search(undef, { order_by => "id" })->first
        ->parent_id,
    "First (top) tree node has no parent",
);
```

This works because of the suuuper nice way we can chain resultsets in DBIC without actually executing any SQL query.

The method `rs_with_new_rows` ends with a call to `->search`, which returns a *new* resultset with the fresh search criteria added. The query doesn't run until we ask for some data, e.g. using `->all`, or `->count`.
I cut my hair for an interview -oh! No!
Tags: interview, old, new, mentalhealth
Published: 2019-06-18 12:27:28

In 2001 my hair had grown down to the middle of my back.After 911 I was laid off from Veriscape (they lost $12 million in funding -but you are welcome for my automatons for your robocalls). I had insanely long, flowing hair at that time -it took me 4 years to grow it that long.

After 911 the software engineering market go really tight, very conservative -in dress, in manner, 'brain bench' tests, etc. BTW, I ranked in the top 3% of all c++ 'brain bench' tests bake then -heh, the concept is laughable these days. But it was a big deal back then. So I decided to start consulting!

It wasn't hard to get c++ interviews after 911 for me. I had the 'street cred' in the Chicago financial community as a 24/7,work hard, play hard, all out,no bullshit, developer. I felt that I wanted a break from the financial developer world so I sought out other venues.

My first venture into 'massive infrastructure' companies was with Motorola. It was a job I had never worked. It was developing 3g phones (not apps -phones) for 3g. For Motorola!. The job payed $55/hour with a 6mo. contract -to hire after that. Wow did  I want to work for those guys. 

The big issue was that I had a lot of hair. Like 3 feet+ of it. 2 days before the Motorola interview, I was sure I had the job...you can see, I'm sure, where this is going.. I got my hair cut. I got the standard business style cut thing for the times. The person cutting my hair literally cried the entire time. It was kind of traumatic for both of us -although not so much over the hair from my point of view... 

And I didn't get the job. Not at all. Was totally turned down -hairless. But I looked damn good for the next job interview! -and scored that one.

---

So, today I cut my hair. I'd been growing it these past 3 years of my 'sabbatical from society (try to explain that in an interview!)'. And it seems somewhat important to me to mention that I really, really, don't like having long hair in the first place. I don't know how other people even tolerate it... because I just always wanted to cut it, but then I'd get busy and time would go buy and, more hair! And in some ways it defined me. So I miss it. And, I'm a huge anti-webber person but... Hair!

Anyway, I shaved the long hair last night so that I 'look' more presentable in upcoming interviews. Nobody cried this time but, funny this, I miss it!

{% youtube PgrIAIHTho8 %}
Java programmers of DEV, what is your favorite IDE?
Tags: discuss, java, productivity
Published: 2019-06-18 12:16:58

It has been a long time since I've touched Java but back then, Eclipse was my favorite. Netbeans was good too but but I liked that Eclipse supported all the various types of projects and had plugins for multiple languages, even Python (PyDEV) and PHP (PDT)!

But a lot has changed since 2012, I moved on to Python and simple code editors like Atom and Notepad++, and the IDE world also went in a totally different direction.

Another thing that happened was Google stopped supporting Eclipse in around 2016 and that shifted the focus from Eclipse to Android Studio, an IDE from Intellij company. I'm not much into android programming but AS is perhaps your only limited option if you choose to go into that direction.

But the most important question is what do developers prefer these days? Do you prefer Intellij over Eclipse or vice versa?
Bitfinex Clone Script | Bitdeal
Tags: clonescriptbitdeal
Published: 2019-06-18 11:58:31

---
title: Bitfinex Clone Script | Bitdeal
published: true
description: Get a best Bitfinex clone script from Bitdeal to start your own exchange like Bitfinex.
tags: clone script bitdeal
---

##Bitfinex Clone Script 

Bitfinex Clone Script is a website script that has all the existing features of top cryptocurrency exchange, Bitfinex.We,Bitdeal is known for developing best Bitfinex clone script with enhanced features,API and plugins to make your own exchange more popular.

Here let us discuss about Bitfinex and how bitdeal can help you in lanuching our crypto exchange as like Bitfinex.

##What is Bitfinex ?

Bitfinex is a cryptocurrency exchange which is Hong-Knog based crypto trading platform owned and operated by iFinex Inc .Inititally, It was started as P2P Bitcoin exchange and margin lending platform.Now , Bitfinex supports for more cryptocurrency and offers digital assets exchange services around the globe.

##Why to start exchange like Bitfinex ?

Bitfinex is a leading global crypto exchange that provides a safe, reliable and stable environment for digital assets trading. Bitfinex has many highlighting features like margin trading.

By starting an exchange like Bitfinez, you can also make high ROI and make your own crypto exchange as a largest and best exchange in the globe.

##Bitdeal - Bitfinex Clone Script 

Bitdeal - Cryptocurrency Exchange and Blockchain Development Company, furinshes the best clone script to start your own cryptocurrency exchange like Bitfinex,Poloniex, Binance, Coinbase,Okex,Bithumb,etc.,We stand unique in making best clone script services all through the globe.

[Get a live demo at Bitdeal Now!!](https://www.bitdeal.net/)
easily track Clear Linux  releases from your shell
Tags: clearlinux, tips, productivity, terminal
Published: 2019-06-18 11:51:30

- running **[Clear Linux](https://clearlinux.org)**, with [swupd](https://clearlinux.org/documentation/clear-linux/guides/maintenance/swupd-guide)'s auto-updates disabled ?
- wanting to know what's going on before updating or just curious ?
- want to save time and avoid browsing the [releases](https://download.clearlinux.org/releases/) web page ?

if **yes** to all the above that _then_ just add to your _.bashrc_ (or _.zshrc_) the following snippet:

```shell
function clr-releases {
  TAIL=${TAIL:-10}
  upstream="https://download.clearlinux.org"
  latest=$(curl -Ls ${upstream}/latest)
  last=()

  while IFS='' read -r line; do
    last+=("${line}")
  done < <(curl -Ls ${upstream}/releases | sed -e 's/<[^>]*>//g' | \
           awk '/^[0-9]/ {print gensub(/\//,"",1,$1)"_"$2"_"$3}' | \
           sort -hk1 -t _ | tail -n "${TAIL}")

  for r in "${last[@]}"; do
    [[ "${r}" == ^${latest}* ]] && echo "${r//_/ }" || echo "${r//_/ } (current)"
  done
}

function clr-log {
  upstream="https://download.clearlinux.org"
  [ -z "$1" ] && rev=current || rev=$1
  {
    [[ ${rev} != "current" ]] && printf "=> current is %s\n" "$(curl -Ls ${upstream}/latest)"
    curl -Ls "${upstream}/releases/${rev}/clear/RELEASENOTES" && echo
  } | less
}
```

`clr-releases` will display, by default, the last 10 published releases (can be tweaked via the `TAIL` _env_ variable) 

`clr-log` will display the _changelog_ of the `current` ClearLinux release if no argument is supplied or the one of the supplied release number
On Advanced Box Shadows
Tags: css, webdev
Published: 2019-06-04 03:25:31

**This article was originally published on 03 December, 2013 at [Trezy.com][canonical].**

`box-shadow` is arguably one of the coolest things to come out of CSS3. However I’ve been creating shadows in Adobe Fireworks and Photoshop for years so I feel like I’m too constrained by CSS3’s `box-shadow` implementation. In an effort to expand my boxy horizons, I set out on a quest to create some cooler shadows.

*Disclaimer:* At the time of this writing filters and transforms still require browser prefixes to work, though filters will only work in Webkit browsers. I have omitted these prefixes from the code examples here for readability but they will be required if you intend to use these techniques.

## Rocking out with box-shadow

My first attempt at making my shadows more dynamic still uses `box-shadow` but it extends its use to create a new effect. My main goal was to avoid using any extra elements, so all we need is a div and we’ll leverage pseudo elements to do the rest of the work.

{% codepen https://codepen.io/trezy/pen/Jrhpc %}

What we’ve done is created two transparent pseudo elements behind our main element. These two pseudo elements then have `box-shadow` applied. This is done so that we can use 2D transforms to angle them, creating a 3D looking `box-shadow` for their parent element.

We also used the `top`, `bottom`, `left`, and `right` properties to keep the shadow from spilling out from the sides of the parent element.

## Box-shadow… without box-shadow?

I was pretty happy with the previous idea, but it didn’t look as awesome as I hoped. My next idea was to create the same effect using gradients.

{% codepen https://codepen.io/trezy/pen/aybiL %}

This time we’re still using our pseudo elements but instead of giving them `box-shadows`, we’ll give them gradients. We also used a new CSS3 property called `filter`. Make sure to check out all the nifty things it can do [here][demo-box-shadows]. We just use the blur to soften the edges and make it look more like a shadow.

## Oooooh… that’s way prettier.

While I was working on this project I ran across a site with an even cooler style of drop-shadow that pointed inward rather than outward:

[Karma][karma]

All I really had to do was flip my last idea and we were good to go!

{% codepen https://codepen.io/trezy/pen/zEtgJ %}

## Conclusion

If you use any of these drop shadows, post a link in the comments! Also, if you come up with any alternative ideas or issues that should be noted, let me know.





[canonical]: https://trezy.com/blog/on-advanced-box-shadows
[demo-box-shadows]: https://html5-demos.appspot.com/static/css/filters/index.html
[karma]: http://demo.truethemes.net/Karma-Wordpress/
What have you learned this week?
Tags: productivity, webdev, javascript, challenge
Published: 2019-06-18 11:36:32

This is a nice question we started to ask in our web guilds every week. So, what have you learned this week? This could be tech related, or something completely different. 

For instance, here are a few things I learned this week:

1. Plankalkül is the first programming language ever written. 
2. You can peer two or more different VPC in AWS, which is pretty cool if you want to access a VPC from another one.
Angular Material 9|8 Tabs Tutorial with Example
Tags: softwaredevelopment, angular98, angular, angularmaterial98
Published: 2020-01-31 21:32:47

---
title: Angular Material 9|8 Tabs Tutorial with Example
published: true
tags: Software Development,angular 9|8,angular , Angular Material 9|8
canonical_url: https://www.positronx.io/angular-material-8-tabs-tutorial-with-example/
---

The post [Angular Material 8 Tabs Tutorial with Example](https://www.positronx.io/angular-material-8-tabs-tutorial-with-example/) appeared first on [positronX.io](https://www.positronx.io).

In this tutorial, we will learn how to create **Angular Tabs using Angular Material Tabs component**. To build Tabs in Angular 8, we will create a basic Angular app from scratch with material UI.

**Let us understand what a Tab is?**


[Click here to read more](https://www.positronx.io/angular-material-8-tabs-tutorial-with-example/)