teleren/devto huggingface dataset:
Makers Week 4: Databased on a True Story
Tags: makers, ruby, postgres, sql
Published: 2019-12-08 23:55:52

We started on using databases this week. We are using a *SQL* database called *postgres*. It's all new but also it's nice to be able to store data. Although it is a lot to learn in a week hopefully I'll manage.

Day 1

We started on databases and learning how to use them. It was a slow start trying to wrap our heads around them. The challenge was to build a bookmark app that stored URLs. We had to set up the database first which wasn't hard because the documentation was clear. The main issue is how to write the tests for the database which used capybara which I'm not too confident about but we were able to get it started.

Day 2

The next day we learned how to interact with postgres within ruby which was similar to normal postgres. All you needed to do was use the *exec* command before using the same code you'd use in postgres. It was interesting to see the databases in use and how we could alter them to add info to the website.

Day 3

We were shown a new tool to use called *TablePlus* which seemed to be more of a visual interface for *sql* databases. It was definitely nicer to look at than the terminals psql so I could see it being useful. After seeing that wee had to set up a testing environment. We needed to set up a test database so we don't mess up the database for the active site. We also had to reset our database every time so we used *TRUNCATE* to clear the database.

Day 4

Step 10 took quite long because it was creating a full-stack feature. We had to give the user the ability to create bookmarks. So, first of all, we had to create a form that would take the users URL. Then we had to pass it through the post route. Finally, we had to add the user's input to the database so it could then be displayed on the page.

Day 5

We spent this day refactoring our code. We had to take our data out of an array and change it to a hash. This makes it both more readable and more usable. This took longer than expected because be we had to change our test too to use hashes instead of arrays.

Summary

I really enjoyed this week mainly because we got to build apps that actually run. It was quite irritating since I had to use walkthroughs a lot. even though we were told we'd probably have to use them it would’ve been nice to have been able to figure it out by myself.
My #100DaysOfCode challenge
Tags: 100daysofcode, motivation
Published: 2019-12-08 22:50:36

---
title: My #100DaysOfCode challenge
published: true
description: I started the 100DaysOfCode challenge to motivate myself.
tags: 100daysofcode, motivation
---

Two weeks ago I started my 100DaysOfCode challenge to motivate myself. I log my progresses here https://hundredoc.netlify.com/.

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/7bvh5qp64i1wo5h2tfti.png)
Weekend Challenge - RPS
Tags: makers, ruby, sinatra
Published: 2019-12-08 22:39:37

I releasing this blog a little bit later due because we started with databases this week and it kept me very busy. But back to the "RPS" app, we had to make a programme that played "Rock, Paper and Scissor". We were meant to make an "AI" that randomly chose an attack and then later on as a bonus challenge we could add multiplayer. I was a bit too ambitious at the start and thought I could start with multiplayer.

I spent a lot of time stuck on this challenge because of this. I got the app to send the players data but I had issues trying to compare the information. After seeing someone else's work it clarified a few things for me. Mainly that I should've started with the computer and moved onto multiplayer. I still think I need to get understand the way the controller works a bit better. Although with this week I think I have a better grasp of it.

Over the Christmas holidays, I'll revisit all the weekend challenges to hopefully build on the fundamentals. Maybe I'll have new and creative ways to solve the previous problems.
Ripgrep: a handy tool for recursive search
Tags: rust, search, cli, utilities
Published: 2019-12-08 22:31:57

---
title: Ripgrep: a handy tool for recursive search
published: true
description: Ripgrep, the recursive regex search tool you should be using
tags: rust, search, cli, utilities
---

Recursive regular expression search is a universal tool for code wrangling. It pretty much works on any source code tree and comes in handy when data wrangling too.

My favourite tool for this is [ripgrep](https://github.com/BurntSushi/ripgrep) mostly because its defaults are highly sane and 90% of the time just typing `rg 'strange text'` just works.

It combines most of the features of `awk` and `grep` into one more modern, faster utility.

Interestingly a lot of the power and speed of tool comes from the underlying Rust regex implementation.
TL:DR; Do Repetition
Tags: java, codenewbie, beginners, 100daysofcode
Published: 2019-12-06 00:27:28

After too many starts and stops, I've come to realize that what I lacked in trying to learn to program was not enough repetition/ practice. Most Udemy courses are project based, which is great for seeing how something works within a real project, but they don't seem to include much in the way of practice of each concept, and things can sometimes get glossed over. At least, that's the way it seems to me.

It's possible that my expectations are skewed, but what I expected of a "bootcamp" course is something that forces me to program. As an example, when I was in high school learning math, the teacher would go over a concept, and then give us like 2 sheets of problems to solve using those concepts. 

The same goes for music. I learned to play both piano and guitar. I took almost 10 years of lessons starting when I was 5, to about 15 years old. The system for learning was, here's a piece of music. Practice it over and over. More complicated pieces my take a month or more to get nearly perfect. At that point move to the next piece, which might be slightly more complicated/teach some different theory. And on and on. 

About 2 weeks ago I ran into Tim Buchalca's Udemy Java course. It has changed my perspective on what a Udemy course can be. It is huge(75 hours long) and is jam packed with exercises that make you think through problems and write code without just coding along.
Obviously everyone learns different, but for me, having the extra exercises has made a huge difference in my ability to write and understand code, as well as my ability to break down poblems into tiny chunks and work through them.

Once I get through the basics in Java, i have a few small projects in mind that I'm going to build for more practice. That's still a ways out since I'm only 2 weeks in.


If anyone wants to hit me up on Tweeter, I'm @Andevrs.
Thanks for reading.
What Could Pawsibly go Wrong
Tags: watercooler, showdev, discuss
Published: 2019-12-08 22:27:32

I’m not sure if this suffices the hiring manager’s request.

![image shows job application question “in 150 words or fewer, tell us what makes you unique. Try to be creative” and answer “I am open to puns, cats, dogs, code reviews, open source, and pawesome pair purgramming”](https://thepracticaldev.s3.amazonaws.com/i/sm75g1z2y1mnn1rum3ur.jpeg)

How would you have responded to this question?
Danger! Undefined ahead
Tags: javascript
Published: 2019-12-08 22:23:19

---
title: Danger! Undefined ahead
published: true
description: A look at how to detect the presence of a key on an object in JavaScript
tags: javascript
---

Here's an interesting aspect of JavaScript that you may have run across before: if a key doesn't exist on an object, attempting to access that key will return `undefined` rather than throw an error:

```
let obj = {
  a : 1
}
obj['b'] // => undefined
obj['a'] // => 1
```
We could use this aspect to our advantage to check if a key exists on an object:

```
const naive_object_has_key = (object, key) => object[key] !== undefined;
```
But what if an operation somehow accidentally sets the value to `undefined`? Our naïve `object_has_key` method will tell us the key was never set.

The interesting bit is that any key which has been set on an object, even if the value is `undefined`, will be picked up by `Object.keys`:

```
let obj = {
  a : 1
}

obj.a = undefined;

Object.keys(obj) // => ['a']
```
We can use this property to write a smarter `object_has_key` method.
This is useful if you are passing an object around to keep track of values or state, and need to know if the value that was assigned is truly `undefined` or is simply missing from the object:

```
const object_has_key = (object, key) => Object.keys(object).indexOf(key) != -1;

let data = {
  initial_value : 12
}

const transform_data = (object) => object['final_value'] = object['initial_value'] + 12;
```
If we use our new helper method, we can know that a key was never assigned in the first place, even if an operation on that key mistakenly returned `undefined`:

```
object_has_key(data, 'final_value') // => false

const bad_transform_data = (object) => object['final_value'] = undefined;

bad_transform_data(data);

object_has_key(data, 'final_value') // => true
```

If we try and check the value of `data.final_value` after it has been assigned, our helper function will return true. 

```
transform_data(data);

object_has_key(data, 'final_value') // => true
```

Thanks for reading!

Was this helpful or insightful for you? Maybe I'm totally forgetting about something or just completely wrong? Let me know in the comments!
So many clients
Tags: blog
Published: 2019-12-08 22:08:32

A Client is a key part of Uniflow 💧 concept and it is essential to understand his job.

A Client has one job 🦄, and is job is to do it well ✨ at the more detail 🚀 and fastest ⚡️ way possible, no matter the cost 💥.

This is why so many clients will never be enough ⚔️.

And what if : we mixed all the clients together ?

This is obvious to say that, but it allows to see things at another next level.

For instance, if I decide to write a new flow, why this specific flow can't have the similarity implemented in various clients ?

The underling concept here is to create a unified paradigm context for multiple distinct and specific clients.

Moreover, a new dedicated [Library](https://uniflow.io/library) 📖 section is now open to list all available clients 🦄. To get more information about client, refer to the [Doc](https://uniflow.io/docs/concepts) 📚.

All this is now possible at Uniflow 💧 today 🚀.

Happy flowing. 🌟🎉
Bootstrap 4
Tags: blog
Published: 2019-12-08 22:06:26

Uniflow get a new fresh design 🎉 !

We choosed flat design as the purpose is to get strait into the data flow ⚡️.

At the same time we wanted a more spaced interface, to make things more Hero content 🦄.

Boopstrap 4 was choosen to focus on responsive, mobile-first site 📱.

More over, the [Blog](https://uniflow.io/blog) 📝 and [Doc](https://uniflow.io/docs) 📚 sections are now part of the site.
Everyone can contribute to theses on [Github](https://github.com/uniflow-io/uniflow)
How we manage sourcing ?
Tags: blog
Published: 2019-12-08 22:04:26

At Uniflow, there is an issue about how we manage our sources repositories.

As a fact, we use **Git** for versioning the repositories as git is largely adopted, there is no reason to replace that tool over time.

The purpose here is : do we use **monolithic repository** or **multiple standalone repository** ?

There is a great article https://blog.shopsys.com/how-to-maintain-multiple-git-repositories-with-ease-61a5e17152e0 that presents the **pro** and the **con** of both usages.

What we choose for now is **monolithic repository** as the projet grow fast and we got multiple dependencies along all sub repositories and all public contributions will be centralized to https://github.com/uniflow-io/uniflow.

But the issue when using **monolithic repository** is the fact that you want have both **Public** and **Private** repositories.

The solution we found is to combine **monolithic repository** AND **multiple standalone repository** in a quite simple way. So we got :
- one Public monolithic repository
- one Private monolithic repository that have one git submodule to the public monolithic repository.

Here is a scheme to get the idea :

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

This process can change by the time, but it’s now what we use. If you have suggestion, we will be glad to share !
Barnsley’s fern
Tags: casestudy
Published: 2019-12-08 22:02:31

The purpose of this article is to render a fractal from Michael Barnsley.

You can render this by gooing to https://uniflow.io/public/feed/barnsleys-fern

Then click on play button to run the flow.

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

To do that, we have to add a canvas item. Then we use javascript to describe the algorithm.
Wordblitz
Tags: casestudy
Published: 2019-12-08 21:59:23

If you know well the facebook game Wordblitz, then you can easily beat your opponent.

Here we created a public flow https://uniflow.io/public/feed/wordblitz-solver

The purpose of this flow is to solve find lots of words in restricted time that are contains into the 4x4 letter grid as show below :


![wordblitz](https://thepracticaldev.s3.amazonaws.com/i/558cwm60bl3artzn6f3z.png)

When the game appear, you have to type into the config.board Object item all raw 16 letters as follow :

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

You choose your dictionary that match you language, here is ‘french.txt’

Then click on play button to run the flow.

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

It just take few instant and the result of the flow will be found into the last Text item :

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

Now, you can match all word found into the real game and score to the victory. 🎉
Welcome Uniflow !
Tags: blog
Published: 2019-12-08 21:45:02

It’s a great pleasure to annonce public and release of [uniflow.io](https://uniflow.io)

This platform as [saas](https://en.wikipedia.org/wiki/Software_as_a_service) will help you managing your daily recurring tasks.

It’s [Railway Flow Based Programming](https://medium.com/@anton.mishchuk/railway-flow-based-programming-with-flowex-ef04fd338e41), you can manage your flow by [registering](https://uniflow.io/register) now to the interface.

We will try to grow the community and get much more case.

Do not hesitate to contribute on [github](https://github.com/uniflow-io/uniflow) 🎉
Unit Testing is not Jasmine/Karma
Tags: computerscience, testing, javascript, typescript
Published: 2019-12-08 19:57:11

Big revelation here, ready... Jasmine/Karma have redefined the term Unit test. Their prescription is a deviation from the past.

**Traditional Unit Testing**

 Traditional Unit testing allowed for harnessing the class/object and calling any function or method with a predetermined set of input parameters.

Any outbound Http requests were fully functional. All DB requests worked. All security worked, everything just worked. The ouput of each test asserted correctness.

The Units of the Unit test were the functions themselves.

**Diminished Results**

Jasmine/Karma doesn't do this. The reason is that its own web server is used, making all application Http calls fail due to CORS restrictions. 

The prescription for this problem is to inject mock objects and spies. This technique bypasses the traditional meaning of Unit testing. Diminished Unit Testing producing diminished results.

**Solution**

Today we have better testing Frameworks which can double down as both Unit test and include Integration test as soon as the class begins to integrate with other components.

**Better Test Frameworks**

1) Protractor allows 100% addressibiliy to all DOM nodes. Simply enter a well planned set of permutations to one or more inputs, and Assert the output is correct.

2) Cypress is everything Protractor is but allows for Http Request and Response interception. This ability leaves Protractor in the dust.

3) Puppeteer, similar to Cypress but newest to the market. Is as powerful as Cypress.

**Recommendation**

Just say no to Karma/Jasmine except for elementary CTOR tests. Step up to the GUI layer for more in-depth testing. The depth is controlled by the permutations. 

From there add AI to those tests and you may be able to generate tests in seconds.
Best Python podcasts
Tags: python, django, podcast, flask
Published: 2019-12-08 21:05:27

---
title: Best Python podcasts
published: true
description: Podcasts are a great way to stay up-to-date with the latest news in our industry.
tags: Python, Django, podcast, Flask
---

Podcasts are very helpful and they help me a lot in my journey as a software developer.

Originally posted on [my blog](https://rapidpython.com/10-python-podcasts-to-listen-2020/)

Here are some applications we can use to listen to podcasts :

- Google podcasts
- Apple podcast
- Spotify

In this post i will share with you a list of some useful Python podcasts :

[Talk Python to me](https://talkpython.fm/)

**Talk Python to Me** is a weekly podcast hosted by Michael Kennedy. The show covers a wide array of Python topics as well as many related topics. Our goal is to bring you the human story behind the Python packages and frameworks you know and love.

[Python Bytes](https://pythonbytes.fm/)

**Python Bytes** is a weekly podcast hosted by Michael Kennedy and Brian Okken. The show is a short discussion on the headlines and noteworthy news in the Python, developer, and data science space.

[Django Chat](https://djangochat.com/)

**Django Chat** a weekly podcast on the Django Web Framework by William Vincent and Carlton Gibson.

[Podcast. __init__](https://www.pythonpodcast.com/)

The weekly podcast about the Python programming language, its ecosystem, and its community. Tune in for engaging, educational, and technical discussions about the broad range of industries, individuals, and applications that rely on Python.

[Test&Code](https://testandcode.com/)

Test & Code is a weekly podcast hosted by Brian Okken.
The show covers a wide array of topics including software engineering, development, testing, Python programming, and many related topics.
When we get into the implementation specifics, that's usually Python, such as Python packaging, tox, pytest, and unittest. However, well over half of the topics are language agnostic, such as data science, DevOps, TDD, public speaking, mentoring, feature testing, NoSQL databases, end to end testing, automation, continuous integration, development methods, Selenium, the testing pyramid, and DevOps.

[Python for beginner](#)

The Python podcast by **edureka!** will help you in understanding the various fundamentals of Python programming with examples in detail and why you must learn Python. You will also learn about various libraries in python like Pandas, Numpy, Matplotlib, Scipy, Scikit and master advance concepts like Python machine learning, scripts, sequence, web scraping and big data analytics.

Thank you!
Asynchronous Programming in Node
Tags: node, javascript
Published: 2019-12-08 20:49:31

Hello, everyone!  I thought I'd go over a pretty interesting topic, which is asynchronous programming.

The programming language we'll be using is JavaScript (Node), of course.

### An Explanation
The `setTimeout` function in JavaScript calls a function after a certain amount of time in an asynchronous fashion.  We're going to use this inbuild function to our advantage.

Let's first create a wrapper function:
```javascript
let wrapper = function(func) {
    setTimeout(func, 0);
}
```
Nice, so all we need to do now is to call the function with a function as the first argument:
```javascript
let wrapper = function(func) {
    setTimeout(func, 0);
}

wrapper(() => console.log('Hello, world! (1)'));
console.log('Hello, world! (2)');
```

Now if you run it, the output should be like this:
```
Hello, world! (2)
Hello, world! (1)
```

Why is `Hello, world! (2)` shown first?  It's because of the way JavaScript works; it prioritizes non-asynchronous code in the event loop.

There's a great video by Fireship that explains it a bit better: [link](https://www.youtube.com/watch?v=vn3tm0quoqE)
Introverted Job-Seeker
Published: 2019-12-08 19:32:12

Networking used to be a very scary word for me. It's still not my favorite activity, but I have some strategies now that take the fear out of it. As someone pretty far down the introverted side of the Introvert-Extrovert Scale (It's really not a binary), traditional networking has long been intimidating and never really worked for me. 

When I go to big events, I find it difficult to make any connections or even stick around long enough to meet more than a couple people. The noise and the swarm turn me away pretty quickly.

I know I know - just a couple months ago I wrote a blog post about how meetups are not as awkward as you think. However, that doesn't mean they are not tiring, as an introvert. And when your job hunt relies hugely on making connections, that suddenly puts a lot of pressure on the meetups. I still attend a few meetups, but I make the best connections when I'm there to do something other than network. I'll attend a JavaScript meetup and hear about Typescript for the first time, giving me some excellent new research to do, and networking slides in as a secondary benefit. Turns out Typescript is a language that uses JavaScript as a base. From my understanding, it essentially allows you to write a statically typed language that then compiles to plain JavaScript. Sort of best of both worlds, for those who prefer static typing but don't want to miss out on the wide usage of JavaScript. Neat!

No, my biggest success in networking during my post-bootcamp job hunt so far has been reaching out to people one-to-one online. I attended a small college, and have had a fair amount of success reaching out to fellow alumns working in software in the area. The same can be said for fellow graduates of my bootcamp. I'll send an email (if I can find their address) or a linked-in message briefly introducing who I am and how we are connected, and asking for a phone call or coffee (I always offer to pay) to discuss what they do. More often than not, this results in a referral or a name drop, or at least some valuable info about the company.

I'd heard several times the advice that you should find a connection to reference when reaching out to someone, and while that made sense, it wasn't until I'd started doing so that I realized the flip side of that advice - it also makes *me* feel more at ease about the interaction. When I'm talking to someone who shared some professors with me, or attended the same social club at school, even if they were there a different year from me, I feel much more able to connect and less like I'm being a total weirdo imposing on them and demanding their help and attention.

I don't have any massive revelations or ultimate wisdom here, I just thought I'd share this small success. I'm seeing more and more of the tech industry, and learning about all sorts of neat languages and frameworks that I should check out. Networking doesn't have to be scary. You just have to learn how to do it from someone who gets your perspective.