teleren/devto huggingface dataset:
A Quick Pros and Cons List on Coding Boot Camps
Tags: webdev, beginners, advice
Published: 2018-12-25 15:11:03

---
title: A Quick Pros and Cons List on Coding Boot Camps
published: true
description: Here are a few things to consider before you jump into a coding boot camp.
tags: #webdev, #beginners, #advice 
cover_image: https://cdn-images-1.medium.com/max/800/1*rXMw-ZtiwTovrzLkcAJmsg.png
---

This is a really touchy subject for both people who have attended a boot camp and those who are considering a boot camp. Some coding boot camps are absolute crap while others are amazing.

I'm just going to give you a few pros and cons about committing to a boot camp and then a little snippet of a few things I've seen from boot camp grads.

## Pros

*It's completely immersive.* You'll live, breathe, and eat code for a few months.

*Employers aren't as averse as it might seem.* [72% of employers](http://blog.indeed.com/2017/05/02/what-employers-think-about-coding-bootcamp/)
 think boot camp graduates are just as good as college graduates.

*You learn fast.* They push you through all of the concepts and some big projects very quickly. That way you can start a new career a lot sooner.

*They can keep you motivated.* Since you're in a class with other people and you've paid thousands of dollars, it's easier to keep going.

*You have the potential to build a strong network.* Some coding boot camps have industry connections that make your job search less stressful.


## Cons

*It's expensive.* The average cost of a boot camp is $12,000. To put that in perspective, that’s almost a full year of college at an in-state, public university!

*They can move too fast.* Sorry if this hurts some feelings, but there is no way you will learn and be proficient in 3 - 5 programming languages and a framework or two in 12 - 14 weeks.

*The quality varies wildly.* You could end up spending thousands of dollars just to get in a class with a poor curriculum, low class participation, and a teacher that just doesn't care. But you might not! It's hard to say.

*You might have to quit your job and live off of loans.* If your boot camp requires you to be there 40+ hours a week, you have to make a big decision.

*There's no guarantee you'll get a job.* While most boot camps boast incredibly high job placement rates, it's not because they give you a job. You still have to get out there and apply and interview.


You already know there are pros and cons to everything, but these are a few I've seen with coding boot camps. Typically grads aren't ready for junior positions. Most of the time they haven't been trained for those real world problems that come up in legacy code or in debugging in general. On the other hand coding boot camp grads can spin up a new project with the latest frameworks relatively fast.

Either way, companies have to decide whether or not they want to spend the time and resources getting you up to speed. So really it comes down to whether you want to spend the money or not.

<hr>

Hey! You should follow me on Twitter because reasons: https://twitter.com/FlippedCoding
Developing on Windows: Docker, Linux VM, WSL or Cygwin?
Tags: discuss, wsl, linux, docker
Published: 2018-12-25 13:33:24

(I'm currently a Mac user, switching to a Dell laptop)

Macs are expensive and Linux has some hardware compatibility problems. That leaves me with Windows.

Most developers I know hate to develop on Windows, unless they're developing .NET applications, which is not my case. Also, I'm very happy with my Unix shell and I don't want to use PowerShell or the terrible Windows CMD.

Don't get me wrong, Windows 10 is great. Microsoft is getting its groove back. And to develop on Windows as a main OS (without dual boot), there are some choices:

1) Docker for Windows
2) Linux VM (VMWare, Virtual Box, Hyper-V)
3) Windows Subsystem for Linux (that is pretty neat)
4) Cygwin

These options give my Unix shell back, and makes development much easier.

Have anyone used any of these options?
Page Object pattern in JavaScript
Tags: testingjavascript
Published: 2018-12-25 13:27:24

---
title: Page Object pattern in JavaScript
published: true
description: Learn how to utilize idiomatic Page Objects to have better e2e tests.
tags: testing javascript
---

https://www.linkedin.com/pulse/page-object-pattern-javascript-vladim%C3%ADr-gorej/
Holidays Side Project Time, or maybe NOT?
Tags: discuss, productivity
Published: 2018-12-25 12:40:51

---
title: Holidays Side Project Time, or maybe NOT?
published: true
description: Are holidays really the perfect time for side projects?
tags: discuss, productivity, meta
---

![alt text](https://thepracticaldev.s3.amazonaws.com/i/9r0npe7taqckvt12horg.png "By Nathan Dumlao")


 On 247 days i wrote code this year and will probably do it on two days more to come. On my twitter timeline and reading in a lot of blog posts i read, holidays are side project time. 4-5 years ago i would have agreed on this but now it's different. 

My parents moved from a it's a daytrip distance to it require some organisation  and at least 4 days to get there distance two years ago. So we see them only once a year. This makes me feel bad when i remember the days in the past where i wasted my time at my parents with side projects instead of spending some time together. Yes you read correctly i wrote wasted. 
Each of us write code in one form or another most of the year and it should be fun and it should stay fun and here is the point: At one point you will not have the joy anymore, at one point it will get a necessity. For me this would be the worst moment in my life, i have to work in a job that brings me no joy anymore. 
I can hear the outcry ohh you are not a passionate software developer, but honestly  i don't see it. The most import job of all of us is to look out after ourselves and our loved ones. Especially these day are made for it. Most of your loved ones have time and you can get  together play board games, go for a walk, watch movies together and most important give your brain a rest from doing the stuff it hast to do all year long.
Another argument i often hear: side projects are the only way i can try new things. This is an argument that makes me mad when i hear it. There is a simple reason for this. As an employer the knowledge of my employees is the most valued possession i have. So if any developer now tells me holidays are the only days in the year to move forward my technical knowledge it means that the developer does not get the chance and the time by his employer to learn new stuff. Ask your employer to get time to try new stuff. If the answer is yes you know your knowledge is valued, if the answer is no, maybe time to look for a new job.

Don't feel bad if you don't work on a side projects on the holidays, even if you don't spend quality time with loved ones. Even if you have spare time and just want to relax by reading a NON tech book, playing games or even the heck, just watch a movie or a series that you missed in all the stress this year. 

Step back take a break, you won't miss out anything. Bring your mindset to a state where it says the heck i hope i can get back to work to do coding again.

Now what is your way, are you just now working on a side project for the holidays? Or did you give yourself a day of?  Anyways, happy holidays
Tips to Learn Programming Language Faster in 2019
Tags: programming, tips, learning
Published: 2018-12-25 12:32:30

---
title: Tips to Learn Programming Language Faster in 2019
published: true
description: Struggling to learn faster in programming? Here are few tips for you! 
tags: #programming #tips #learning
---

Most of us are struggling when we are still beginners, right? Our desire to learn more and quickly. True or not, there are several tips to learn programming language faster!

First, Learn by doing and always play with the code while learning! This is the best way to learn programming languages for beginners, by practising we will remember what we learnt quickly.

Second, Grasp the fundamentals for long-term benefits. Start with the fundamentals of programming, the better you understand them, the easier it is to learn more advanced concepts.

Third, Don't be afraid to ask for help, even the professional developer ask for help when they encounter troubles in the process. So make sure to ask :)

Fourth, Don't just read the sample code! Try it yourself. The more you practise the more you know about the subject!

Fifth, Take breaks when debugging. The bug won't magically disappear, and you will at least restore some needed sanity to improve productivity.

Sixth, Seek out for more online resources. The more resources you gathered, the more productive your learning will be!

And bonus tips! Don't learn so many languages at once, make sure you focus on one language at the time so that you could focus on that specific subject. Learning a different language at once could disrupt your focus and makes your learning harder than ever.

Join [My Telegram Community] (https://t.me/theprogrammersclub) and [Instagram Programmers Club] (https://instagram.com/theprogrammerclub/)!

Good luck with your learning process! :)
How to stub an Upload request to Google API using webmock
Tags: webmock, rspec, googleapiclient
Published: 2018-12-25 10:15:37

---
title: How to stub an Upload request to Google API using webmock
published: true
description: 
tags: webmock, rspec, google-api-client
---

The `google-api-client` gem doesn’t return any response for an upload request when the `X-Goog-Upload-Status` is not set to `'final'`.

When you want to stub an API request you usually write code like this:

```ruby
stub_request(:post, 'https://www.googleapis.com/upload/gmail/v1/users/me/messages/send')
  .with(headers: { 'X-Goog-Upload-Header-Content-Type': 'message/rfc822' })
  .to_return(body: upload_response.to_json,
             headers: {
               content_type: 'application/json'
             })
```

But it does not work for Google Upload API request – it will return `nil` as a response. In order to fix this, you should add the `'X-Goog-Upload-Status': 'final'` to response headers. So the code will look this way:

```ruby
stub_request(:post, 'https://www.googleapis.com/upload/gmail/v1/users/me/messages/send')
  .with(headers: { 'X-Goog-Upload-Header-Content-Type': 'message/rfc822' })
  .to_return(body: upload_response.to_json,
             headers: {
               content_type: 'application/json',
               'X-Goog-Upload-Status': 'final'
             })
```
MariaDB: Backing Up/Restoring Databases On The Command Line
Tags: mariadb, mysql, backup, resore
Published: 2018-12-25 09:12:35

---
title: MariaDB: Backing Up/Restoring Databases On The Command Line
published: true
description: Backing up/restoring databases are good fellows for both development and management of services.This post is about how to back up/restore MariaDB databases on the command line instantly, based on MariaDB Corporation's "Backup and Restore Overview".
tags: mariadb, mysql, backup, resore
---

### Summary

Backing up/restoring databases are good fellows for both development and management of services.
This post is about how to back up/restore [MariaDB](https://mariadb.org/) databases on the command line instantly, based on [MariaDB Corporation](https://mariadb.com/)'s ["Backup and Restore Overview"](https://mariadb.com/kb/en/library/backup-and-restore-overview/).

#### Environment

- MariaDB 10.0

<center>✿ ✿ ✿</center>

### Backing Up

Just `mysqldump ... > file path`:

```shell-session
$ mysqldump -u %user% -p %from-database% > ./database-backup.sql
```

You'll be asked the password.

*If you want to use a one-liner, to exchange `-p` to `-p%password%` will be the way. (Please take notice of the command history which may include the password.)*

#### References

- [Backup Tools - mysqldump](https://mariadb.com/kb/en/library/backup-and-restore-overview/#mysqldump)

### Restoring

Just `mysql ... < file path`:

```shell-session
$ mysql -u %user% -p %to-database% < ./database-backup.sql
```

You'll be asked the password.

*If you want to use a one-liner, to exchange `-p` to `-p%password%` will be the way. (Please take notice of the command history which may include the password.)*

#### Partial Restoring

It's possible to restore some tables or some records by creating a temporary user.

---

This is an example of restoring only `table1` in `db1` by using the temporary user named `admin_restore_temp`.
First, execute [GRANT](https://mariadb.com/kb/en/grant/) for `admin_restore_temp` to have all privileges on only `table1`:

```sql
GRANT SELECT
ON db1.* TO 'admin_restore_temp'@'localhost' 
IDENTIFIED BY 'its_pwd';

GRANT ALL ON db1.table1
TO 'admin_restore_temp'@'localhost';
```

Then, restore with the backup file, `/data/backup/db1.sql`, and the `--force` option like this:

```shell-session
$ mysql -u admin_restore_temp -p --force < /data/backup/db1.sql
```

After MariaDB generates errors, only `table1` will be restored.

---

There are several different ways.
For example, we can restore partial records in some tables by using `INSERT` statements after creating a temporary database instead of using the `mysql ... < file path` command.

#### References

- [Restoring Data from Dump Files](https://mariadb.com/kb/en/library/restoring-
data-from-dump-files/)

<center>✿ ✿ ✿</center>

Happy serving 🌲
Advent of Code Wrap-Up
Tags: adventofcode, discuss
Published: 2018-12-25 07:09:24

---
title: "Advent of Code Wrap-Up"
published: true
description: Advent of Code is over, and I'm looking for some feedback!
cover_image: 
tags: adventofcode, discuss
series: Advent of Code 
---

Ha! Get it? Wrap-up? Presents? Ha! Sorry. 

We did it, everybody.  It's been a long haul, with more than a few pretty difficult challenges.  We had 58 people on the private leaderboard that I put up!  Extra props to:

 - Mustafa Haddara
 - Jon Bristow
 - Samuel Dale
 - Andrew Reddish
 - @tech31842
 - Neil Gall
 - jenovs
 - Tiago Romero Garcia
 - Paula Gearon
 - r0f1

who got a majority of the solutions finished.  There were a lot more people who also kept up for the most part, and I appreciate everybody who shared your solutions and collaborated.

Special thanks to @aspittel, as well as @ben and the DEV team for prompting me to do this, getting me started, providing me with a cover image template, and generally being awesome.

If you've got any feedback for how to improve these discussions for next year, how to make them easier to participate in or more enjoyable, or any comments at all, this is the place for those.  Thanks again, Merry Christmas, and God bless you and your families!
AoC Day 25: Four-Dimensional Adventure
Tags: adventofcode, discuss
Published: 2018-12-25 06:53:11

---
title: "AoC Day 25: Four-Dimensional Adventure"
published: true
description: "Day 25: It's Christmas!  And we've graduated from 3-D puzzles to 4-D!"
cover_image: https://thepracticaldev.s3.amazonaws.com/i/740eqzavaiokg127sai9.png
tags: adventofcode, discuss
series: Advent of Code  
---

Merry Christmas everybody!  We made it!  One last puzzle to save Christmas.  On [Day 25](https://adventofcode.com/2018/day/25), the reindeer is still sick despite our best efforts.  In order to save him, we need to calibrate our device to constellations of 4-D points in space-time.  But first, we need to figure out which points are in which constellations.

Good luck!
TLA Plus
Tags: tlaplus
Published: 2020-04-07 14:25:49

---
title: TLA Plus
published: true
date: 2018-12-25 06:00:00 UTC
tags: TLA Plus
canonical_url: https://jibrankalia.com/blog/tla-plus/
---

I just read an incredible paper written by engineers at AWS: [Use of Formal Methods at Amazon Web Services](https://lamport.azurewebsites.net/tla/formal-methods-amazon.pdf)

I find complex distributed systems fascinating. Reading about the use of mathematics to verify the correctness of distributed systems was very eye-opening.

Some highlights from the paper:

> So far we have used TLA+ on 10 large complex real-world systems. In every case, TLA+ has added significant value, either finding subtle bugs that we are sure we would not have found by other means, or giving us enough understanding and confidence to make aggressive performance optimizations without sacrificing correctness.

> This was a very subtle bug; the shortest error trace exhibiting the bug contained 35 high-level steps.

> That spec did not uncover any bugs but did uncover several important ambiguities in the documentation for the algorithm, which the spec helped to resolve

I would also recommend checking out [The TLA Home Page](http://lamport.azurewebsites.net/tla/tla.html)
React Hooks and the death of Render Props
Tags: react, javascript, web
Published: 2018-12-25 03:11:15

---
title: React Hooks and the death of Render Props
published: true
description: Learn where React Hooks are better than Render Props and if there's any future of Render Props.
tags: react, javascript, web
---

Learn where React Hooks are better than Render Props and if there's any future of Render Props.


https://blog.logrocket.com/react-custom-hooks-and-the-death-of-render-props-a0ce5cba387f
Elixir: function_exported?/3 する前には Code.ensure_loaded/1 を呼び出す
Tags: elixir, webdev, tutorial, programming
Published: 2018-12-25 01:26:35

---
title: Elixir: function_exported?/3 する前には Code.ensure_loaded/1 を呼び出す
published: true
description: 本稿は「function_exported?/3 する前には Code.ensure_loaded/1 を呼び出そう」をもとに加筆・補正し、文章を整えました。
tags: #elixir, #webdev, #tutorial, #programming
---

本稿は「[function_exported?/3 する前には Code.ensure_loaded/1 を呼び出そう](https://qiita.com/melpon/items/c43b2a41c2323e29d653)」をもとに加筆・補正し、文章を整えました。


# function_exported?/3でビヘイビアの関数の実装を確かめる
ビヘイビアが実装されたモジュールから、それらの関数を呼び出すときは、予め[`function_exported?/3`](https://hexdocs.pm/elixir/Kernel.html#function_exported?/3)によりその関数が備わっているかどうか確かめます。たとえば、つぎのような`Foo`ビヘイビアを実装した`FooImpl`モジュールがあるとします。

```elixir
defmodule Foo do
  @callback foo() :: :ok
end

defmodule FooImpl do
  @behaviour Foo

  @impl Foo
  def foo() do
    :ok
  end
end
```

呼び出す関数からは、つぎのように`function_exported?/3`で引数のモジュールの関数がエクスポートされているか、つまり`Foo`ビヘイビアが実装されているかを確認してから呼び出します。これでまったく問題のないコードにみえるかもしれません。

```elixir
defmodule Bar do
  def call_foo(mod) do
    if not function_exported?(mod, :foo, 0) do
      raise "Foo behaviour is not implemented"
    end
    mod.foo()
  end
end

call_foo(FooImpl)
```

しかし、このコードは、`mix`から起動したときに**動作しない場合**があります。


# なぜ動作しないのか
ドキュメントの[`function_exported?/3`](https://hexdocs.pm/elixir/Kernel.html#function_exported?/3)の項には、つぎのような注意書きがあります。引数のモジュールが予めロードされていない場合、`function_exported?/3`はモジュールの読み込みはしません。つまり、関数が実装されていない場合だけではなく、モジュールがまだロードされていないときも`false`が返されるのです。

> Note that this function does not load the module in case it is not loaded.

モジュールを用いるには、そのモジュールが事前にErlang VMにロードされていなければなりません。それを理解するには、Erlangがモジュールをロードする戦略を知る必要があります。戦略はつぎのふたつです(Erlang VMのデフォルトは後者)。

- **組み込みモード**  
アプリケーションを起動したときに、すべてのモジュールがロードされます。
- **対話モード**  
最初にそのモジュールの関数を呼び出したときに、そのモジュールがロードされます。

`mix`からアプリケーションを動かした場合には 対話モードになります。そのため、前掲のコードを動かしたとき、`FooImpl`モジュールの関数をまだどれも呼んでいなければ、`function_exported?/3`は`false`を返してエラーになるのです。他方で、先に実行されたコードが`FooImpl`モジュールの関数を呼び出していると、`function_exported?/3`の戻り値は`true`となり、正しく`mod.foo()`が呼ばれます。

つまり、`mix`から起動したときは、どのコードをとおったかによって動作は変わってしまいます。これが「動作しない場合」があると述べた理由です。なお、[Distillery](https://hex.pm/packages/distillery)で生成すると、デフォルトで[組み込みモード](https://github.com/bitwalker/distillery/blob/7790d50913b766ffdbbb5ab46e44c9f615d6c249/priv/libexec/env.sh#L16)になります。


# 予めモジュールのロードを確かめる
ドキュメントの`function_exported?/3`の項は、[`Code.ensure_loaded/1`](https://hexdocs.pm/elixir/Code.html#ensure_loaded/1)の参照を促します。引数のモジュールがロードされているかどうか確かめて、結果がまだであればロードしてくれる関数です。つぎのように`Code.ensure_loaded/1`の呼び出しを書き加えると、ビヘイビアのモジュールの読み込みが実行されます。

```elixir
defmodule Bar do
  def call_foo(mod) do
    Code.ensure_loaded(mod)
    if not function_exported?(mod, :foo, 0) do
      raise "Foo behaviour is not implemented"
    end
    mod.foo()
  end
end

call_foo(FooImpl)
```

もっとも、モジュールの読み込みは、何らかの理由で失敗するかもしれません。そのときの戻り値は`{:error, reason}`になりますので、エラーの分岐を書いた方がより厳密です(成功であれば`{:module, module}`)。もっとも、その場合にはつぎの`function_exported?/3`が`false`を返して、結局ビヘイビアを実装していないというエラーになります。この例ような簡単なコードでしたら、これで済むこともあるでしょう。
Reason Why Being a Programmer is Awesome
Tags: programmer, awesome, developer, coder
Published: 2018-12-24 13:11:06

---
title: Reason Why Being a Programmer is Awesome
published: true
description: Why being a programmer is awesome?
tags: #programmer #awesome #developer #coder
---
![Awesome Programmer] (https://thepracticaldev.s3.amazonaws.com/i/und6l2l7t9vi2je1wyqa.png)

**Why being a programmer is awesome?** You might ask that question to yourself but there is 17 reason why being a programmer is awesome and here is the list below:


0. Being part of a global industry where everyone knows that arrays start at zero ;)

1. Being challenged every day.

2. Learning something new every day.

3. The opportunity to be creative with your own ideas.

4. Having StackOverFlow and Google as your lovely friends!

5. Technology is the future, and it will be here for a long time.

6. Having the power to change the world with your code.

7. Having the skills to become a freelancer or start your own business easily!

8. Making time consuming tasks super fast!

9. Making pretty decent money.

10. Discovering new open source tools and resources.

11. Making other people's lives easier with your work.

12. Being able to work at home.

13. There is always room to learn more.

14. No worries of the development industry disappearing.

15. Being able to learn anything you need on the internet.

16. Caring about what color your IDE theme is :)


Share with your friends and show them how awesome we are!

Join [My Telegram Channel] (https://t.me/theprogrammersclub) so you won't miss out anything!
Follow My [Instagram] (https://instagram.com/theprogrammerclub/)
React like Hooks for Flutter implementation
Tags: react, hooks, flutter
Published: 2018-12-24 23:36:38

---
title: React like Hooks for Flutter implementation
published: true
description: A React like Hooks implementation for Flutter
tags: react, hooks, flutter
---

### Why?

For work i use react and i hate writing class components, so i immediately go crazy when hooks have been announced and with their obscure-magic allow functional components to use state and side-effect.

When hooks will be allowed for production code, in React, i will be able only to write functional component and avoid the verbosity of classes. Plus i can share stateful logic between components without use the orribles mixins, redux, or other external library and unfamiliar patterns.

Now i use Flutter for a personal project, so i start to implementing something similar to react hooks for avoid writing classes.

Initially when i start using flutter i try avoiding classes using only functions 

```dart
final StatefulWidgetBuilder HelloWorld = (context, setState) {
 ...,
}
```
and using them as builder function in a `StatefulBuilder`.

But i can't dispose things, for example stream subscription. Essentially i can't dispose side-effects.

So i start thinking in another way, i create an `HookBuilder`, with a  `StatefulBuilder` implementation.

Before build, `StatefulBuilder`, initialize an HookContext and on dispose, dispose all registered `Hook`.

I define an `use` function how consume an `HookTransformer` function, store the result in the hooks store and return the value.
Using `use` i define `useMemo`, `useCallback`, `useState`, and later `useEffect`.

So now i can write in my code something like React functional hooked component.
```dart
final StatefulWidgetBuilder HelloWorld = (context) {
 final name = useState('');
 final nameInfo = useAsync(getUserInfo, null, [name]);
  ...
}
```
and using them as builder function in my `StatefulBuilder`.
```dart
...
return StatefulBuilder(builder: HelloWorld);
```

I'm now using it for week, so i decided to split the code and release my implementation of hooks as flutter package and on github [flhooks](https://github.com/alfredosalzillo/flhooks).

Take a look to it.