teleren/devto huggingface dataset:
Day 6: Android Navigation component and interview preparation
Tags: android, kotlin, career
Published: 2019-07-29 06:13:00

Hey, another day of my [job hunt journey](https://dev.to/rahulchowdhury/day-1-looking-out-2eih) and here's another post.

# Testing so far

So, I started off with view model testing yesterday. I have to say, it was easier than I have been thinking all this time.

Particularly using the MVVM architecture and some helpers for Kotlin coroutines and `LiveData`, the testing session was fun.

I mean I had done automated testing on Node/Express and Ruby/RoR but this was the first time I ran a test on Android. It felt good.

Here's my test class from yesterday's session: [ElephantProfileViewModelTest.kt](https://github.com/rahulchowdhury/elly/blob/master/app/src/test/java/co/rahulchowdhury/elly/ui/profile/ElephantProfileViewModelTest.kt)

If you're using `LiveData` and Kotlin coroutines in your view models, these utility classes will help you:

* [LiveDataTestUtil](https://github.com/rahulchowdhury/elly/blob/master/app/src/test/java/co/rahulchowdhury/elly/LiveDataTestUtil.kt)
* [MainCoroutineRule](https://github.com/rahulchowdhury/elly/blob/master/app/src/test/java/co/rahulchowdhury/elly/MainCoroutineRule.kt)

# What's for today?

Today I'm mainly focusing on preparing for an introductory call from a company. I can't name it as of now.

Let's see how the call goes. 😁

Also, on the development part, I'll be focusing on getting familiar with Android's Navigation component which is supposed to make navigating between screen a lot easier.

Let's see how that goes.

Wish me luck, guys. 🤞🏻
How do I find blockchain developers?
Tags: blockchain
Published: 2019-07-29 06:03:40

Nowadays Blockchain has become the most discussed topic around many businesses, especially in the IT Field. This technology has made a new gateway for payments which is extremely secure.so which company provides the best blockchain developer?

So let me help you, I suggest this company for a blockchain developer because this company provides best blockchain developer in your requirement.

For More Information Read This:- https://bit.ly/2A6q5GO
Testing the Dev.To API for Publishing
Tags: showdev
Published: 2019-07-29 05:15:26

There's really no other way to say it: this post is a test.

For the last week, I've been working on a new tool that leverages the [DevTo API](https://dev.to/api) to help authors schedule publishing time for new posts. I only recently started publishing to this platform, and was surprised to discover scheduled publishing not available. Fortunately, there _is_ an API, so I set out to close the gap.

There is no sandbox for the API, though, and I clearly did not want to publish a bunch of spam during development and testing. So, until now, all testing has simply changed the title of a draft post at the scheduled "publishing" time. My assumption is that if everything else works, it _should_ be a simple matter of changing the behavior to update the publish status instead of updating the title when development is done.

Well, let's see.

This post should go live automatically at 12:15 AM CDT. Hey. It's a test. If it's going to fail, let's fail when no one's watching.

But if you're reading this at 12:15 AM...it worked! 🎉

And that means I've got a lot more to share this week about how it was built, how it works, and how you can use it, too. Stay tuned.
Give your IEO a chance to outperform with Sentexchange
Tags: ieoexchangelist, ieolistingplatform, ieolisting, ieo
Published: 2019-07-29 04:35:10

How do you better the performance of your IEO project? There are many things that you can do but the best bid without a doubt is to enlist it with a platform which makes the campaign far-reaching. Sentexchange is one such exchange that does the job for you and paves the way for your project to ensure its future. With such a platform, you can make sure that your idea reaches every individual and it is liked by every single potential investor.

<strong>Sentexchange</strong> is one such exchange platform which makes deliberate efforts for making your project successful. It has a unique mechanism which is powered by a peer-to-peer network and it digs deeper into the different marketing strategies that are deployed to make campaigns more popular. Eliciting the desired result out of your project is not a big deal anymore as its future is totally protected with millions of users ready to back your idea.

When you are trading with a big number of investors, you get plenty of opportunities and they get even bigger with different projects. The same thing is achieved by this platform as it straightens out all the issues and makes the working quite fluid. There could be different aspects that you need to consider but you need to delimit the functions of every agent that is being used in your project. With Sentexchange, you can make things possible and get more possibilities of spreading the word about your campaign through a directive approach.

You can indeed turn the tide towards your project using this platform, it gives you a perfect setting to explore the boundaries of markets. It endows your project with a system in which maximum results can be procured without losing the chances. It gives great leverage to your project and makes it much better at every front. With better chances of success, you can make changes in the framework and get more attention to your <strong><a href=" https://www.sentexexchange.com/"> IEO Exchange listing platform</a><strong>. It is a vehicle through which you can ascertain the success of your campaign.
AWS Amplify GraphQL Operations with TypeScript and Hooks - Part 3 [Mutations]
Tags: typescript, graphql, amplify, javascript
Published: 2019-07-29 02:38:00

---
title: AWS Amplify GraphQL Operations with TypeScript and Hooks - Part 3 [Mutations]
published: true
description: 
tags: TypeScript, GraphQL, Amplify, JavaScript
series: AWS Amplify GraphQL Operations with TypeScript and Hooks
---

Let's take a quick look at mutations.  This will be a short post, as Amplify makes mutations relatively painless, and the format of GraphQL mutations that we'll look at closely resemble the queries that we've already looked at (take a look at the previous posts in this series for more on that).

## Mutations

To set up for mutations, we need to look at part of the query we did in the previous section.

```typescript
const fetchQuery = async (query: string, variables?: VariablesType) => {
  try {
    setLoading(true);
    const { data } = (await API.graphql(
      graphqlOperation(query, variables)
    )) as {
      data: ResultType;
    };
    setData(data);
  } catch (error) {
    console.log(error);
    setError(error);
  } finally {
    setLoading(false);
  }
};
```

All GraphQL API calls made with Amplify using the `graphqlOperation` function.  We can reuse this, so let's make another function to handle the returning of data.

```typescript
export const gqlOp = async <
  ResultType extends {},
  VariablesType extends {} = {}
>(
  query: string,
  variables?: VariablesType
) => {
  const { data } = (await API.graphql(graphqlOperation(query, variables))) as {
    data: ResultType;
  };
  return data;
};
```

Now we can use this little function in place of the fetch call.

```typescript
const fetchQuery = async (query: string, variables?: VariablesType) => {
  try {
    setLoading(true);
    const data = await gqlOp<ResultType, VariablesType>(query, variables)
    setData(data);
  } catch (error) {
    console.log(error);
    setError(error);
  } finally {
    setLoading(false);
  }
};
```

Now that's done, let's create a function for mutations.

```typescript
export const mutation = async <
  ResultType extends {},
  VariablesType extends {} = {}
>(
  query: string,
  variables?: VariablesType
) => gqlOp<ResultType, VariablesType>(query, variables);
```

Alright, that's it.  Thanks for reading!

Stay tuned for the next one where we tackle subscriptions.
Mastering the useEffect API
Tags: react, javascript, webdev, functional
Published: 2019-07-29 02:31:58

The __Hooks API__ is a great feature that was added in version v16.8 last february and change the way on how we write our React Apps. We now write more functional components instead of class components. We don't need to bind any more functions inside the constructor because of the functional components. So today we demystify the __useEffect__ API.


Basically what this Hook does is __you need to render the component after you've done something. It is mostly used for calling or fetching data from an API or your web service and you need to do something after DOM Updates__.


The __useEffect Hook is basically componentDidMount, componentDidUpdate, and componentWillUnmount combined__.


First, we demonstrate the __componentDidMount__ equivalent to the __useEffect__ API.
![componentDidMount](
https://thepracticaldev.s3.amazonaws.com/i/mgz72q6cp66vyw0hc4vp.png)


![useEffect componentDidMount](https://thepracticaldev.s3.amazonaws.com/i/5aqkwuyvvjegw55ccc4u.png)


You can see the difference between the two examples. The second example has lesser lines than the first one and is more readable than the first we get rid of the constructor method. The key thing here is the second parameter in the useEffect method an empty array what this means is that we only run the first parameter of the useEffect Hook or the callback function __once or we call it only on the first render of the component__.



Second, we demonstrate the __componentDidUpdate__ equivalent to the __useEffect__ API.
![componentDidUpdate](
https://thepracticaldev.s3.amazonaws.com/i/tteabkkwg49yfk5kc8z6.png)

![useEffect componentDidUpdate](https://thepracticaldev.s3.amazonaws.com/i/eatrfdw60usmmm7mxop9.png)


The key thing to remember here is that we pass the __searchTerm__ on the array in the second parameter of the __useEffect__ Hook. When the __searchTerm__ value changes we run the callback function on the __useEffect__ Hook. If the current value of __searchTerm__ is __"a"__ and the new value on the next render is __"ab"__ the __useEffect__ hook compares the value and evaluates that its different and proceedingly calls the callback function.



Lastly, we demonstrate the __componentWillUnmount__ equivalent to the __useEffect__ API.



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



![useEffect componentWillUnmount](https://thepracticaldev.s3.amazonaws.com/i/fwcjgl0hieji66ubz0h3.png)




Inside the callback function on the first parameter on the __useEffect__ Hook, we return a function which is called a __Cleanup__ so that we avoid memory leaks in our app in this example we remove event listeners in the dom and clear the timeout. This Timeout Component Helper that I made is Higher-Order Component that redirects the user to the base path if the components reach if the user does not trigger any events on the events array. The Timeout which in this case is 600 seconds or 5 minutes. Feel free to use this in your projects or add some functionality to it.



####Thanks for reading this post. 
### Have a Good Day Everyone :smiley:.
What's your personal site setup?
Tags: discuss, portfolio, website, stack
Published: 2019-07-29 02:29:24

---
title: What's your personal site setup?
published: true
description: Discussion on how your personal site is setup
tags: discuss, portfolio, website, stack
---

Stack:

My personal site is built upon [Gatsby](https://www.gatsbyjs.org/). So it's a static React site. My newsletter sign-up is powered by a Lambda function which sends responses to Mailgun.

Host: 

I host it using an AWS S3 bucket with CloudFront as a CDN.

Deploy:

I just got a npm script setup for deployment to AWS, but I am not ashamed to admit that I used to drag and drop files into the uploader.

What does your personal site setup look like?

[roush.io](https://roush.io)
[roush.io github](https://github.com/jjroush/New-Roush-io)
C＃言語APIメモ
Tags: webdev, writing, javascript, mysql
Published: 2019-07-29 02:13:05

JavaScriptとWeb APIでデータベース処理を行うWebアプリを作成する【2019年版】 - GrapeCity.devlog https://devlog.grapecity.co.jp/entry/2019/01/17/wijmo-flexgrid-webapi

一週間で身につくC＃言語の基本 http://csharp.sevendays-study.com/

一週間で身につくMySQL http://web.sevendays-study.com/mysql/
You Should Use Python Sets
Tags: python, tutorial, beginners, datastructures
Published: 2019-07-29 00:49:54

> This post contains references to Big O notation[^5], if you aren't familiar with it (or don't remember how it works) now is a good time for a refresher.

There are a ton of data structures available in the standard Python library, most of which go underutilized.  Today I'd like to focus on one type in particular you should probably be using more than you are: the `set`.  You may be already aware of the general concept of sets in computer science[^1], the Python set[^2] is exactly that.

## What is it?

For those of you who don't already know, a `set` is an unordered collection of hashable objects which cannot contain any duplicates.  The hashable part is key here, much like the keys in a `dict`[^3] (A.K.A. associative array [^4]), each entry is hashed to create an index into the underlying data structure.  You can think of a `set` much like a `dict` without any values.

## When to use it?

A `set` is an extremely useful alternative to the more popular `list` in several scenarios:

1. Looking for membership (e.g. the `in` operator).  The lookup time for a `set` is O(1) whereas for a list it's O(n)[^7].
1. If you'll be **removing** members, same story as `in` here regarding complexity.
1. If you need to compare, contrast, or combine collections - the `set` has operators for all of these.
1. If you cannot have any duplicate values in the collection.

## When not to use it?

1. If you need to have more than one copy of the same value in the collection.
1. If the order of the objects matters
1. If the objects in your collection are not hashable[^6]

## How to use it?

```python
set_with_values = {'a', 'b', 'c'}
other_set = set()  # Note {} would be a dict

assert 'a' in set_with_values  # Super speedy operation

other_set.add('c')

assert other_set < set_with_values  # This means other_set is a subset of set_with_values

assert set_with_values > other_set  # Super set

other_set.add('d')

# Set defines a bunch of useful operators
assert set_with_values | other_set == {'a', 'b', 'c', 'd'}
assert set_with_values & other_set == {'c'}
assert set_with_values - other_set == {'a', 'b'}
assert set_with_values ^ other_set == {'a', 'b', 'd'}

set_with_values |= other_set  # You can perform updates with all of those operators
assert set_with_values == {'a', 'b', 'c', 'd'}  # Note only 1 copy of 'c'

set_with_values.remove('d')  # Again, super fast compared to lists
```

## Conclusion
If you aren't already using sets all over your code, you probably should be.  Basically any time you're using `in` with a list or `del` with a list, you should consider using a different structure.

[^1]: https://en.wikipedia.org/wiki/Set_(abstract_data_type)
[^2]: https://docs.python.org/3.7/library/stdtypes.html#set-types-set-frozenset
[^3]: https://docs.python.org/3.7/library/stdtypes.html#mapping-types-dict
[^4]: https://en.wikipedia.org/wiki/Associative_array
[^5]: https://en.wikipedia.org/wiki/Big_O_notation
[^6]: https://docs.python.org/3/glossary.html#term-hashable
[^7]: https://www.ics.uci.edu/~pattis/ICS-33/lectures/complexitypython.txt
Once Upon a Time in a Tutorial Loop
Tags: beginners, tutorial, codenewbie, resources
Published: 2019-07-29 00:24:59

---
title: Once Upon a Time in a Tutorial Loop
published: true
description: Build something as real as a donut and escape the loop!
tags: beginners, tutorial, codenewbie, resources
---

A common pitfall for self-taught and new developers is to spend their time learning solely through tutorial after tutorial without applying those new skills. I am a huge fan of online tutorials but I would highly suggest that new developers break up tutorials by setting aside time to Build A Thing. 

# Why?

Tutorials are great but taking the time to apply your new skills by making something (big or small) is a great way to test the extent of your knowledge, run into errors you would not be exposed to in tutorials and get a project out there for feedback! Projects can also be an excellent confidence booster because as you progress through your coding journey you have reference points that showcase how far you've come. For me, projects are also a great way to combat [imposter syndrome](https://dev.to/kathryngrayson/share-your-experiences-with-impostor-syndrome) and provides me with evidence to build myself up when I am feeling less than confident about my recent career change. 


# How?
There are free testing environments (commonly referred to as coding sandboxes or playgrounds) which can be used to build out mini-projects that you can link out for others to view!  
**In Brower**
- [CodePen: A Frontend environment](https://codepen.io/)
- [JSFiddle](https://jsfiddle.net/)
- [CodeSandbox](https://codesandbox.io/explore)

Alternatively, you could could build a project using your preferred text editor, create a github repository (storage your a digital copy of your project) and host for viewing on a platform service.
**Host your project:**
- [Heroku](https://www.heroku.com/platform)
- [Netlify](https://www.netlify.com/)
- [Firebase](https://firebase.google.com/docs/hosting)

# What should I make?
- Make the scale of your project reasonable for your skill level. Admittedly this sounds like obvious advice but I have seen fellow newbies get swept up with creativity only to get crushed by too large of a scope.
- It can be something that is just fun and makes you smile! I made a weird plot tweet generator for [Avatar The Last Airbender](https://alt-atla.herokuapp.com/).
- [App Ideas](https://github.com/florinpop17/app-ideas)
- [Side Project Ideas](https://www.codementor.io/npostolovski/40-side-project-ideas-for-software-engineers-g8xckyxef)


Happy project building!
Laravel Image Upload
Tags: laravel, laravelnova
Published: 2019-07-29 00:13:44

I am having issues displaying an image when uploaded. I am able to successfully store the image locally, however, the image is not doing two things: 

- The image is not storing under the original file name
- I don't think my route works. Is there a class I need to reference to? 

I am very new at this and have issues. thanks!
What's Your Method of Finding a New Job? 🤔
Tags: discuss, career, beginners, webdev
Published: 2019-07-29 00:12:57

---
title: What's Your Method of Finding a New Job? 🤔
published: true
description: Methods of finding a new job that fits your needs.
tags: discuss, career, beginners, webdev
---

While it makes all the sense in the world to browse job boards, I've been more likely to do a search for local web design and development companies first.

Sites like [Clutch](https://clutch.co/web-developers/chicago) rank those companies—though its filters are impossible to use on mobile. That aggregation has been a good help.

Who's doing it better? …or at least differently?
How Atlassian implemented Multi-tenant architecture
Tags: webdev, architecture, saas, cloudinfrastructure
Published: 2019-07-31 05:30:26

---
title: How Atlassian implemented Multi-tenant architecture
published: true
tags: ['webdev', 'architecture', 'saas', 'cloud infrastructure']
series: Awesome talks curated by Param
description: Carmel Hinks shared the experience of implement multi tenant architecture in atlassian products. It includes answers for what, why, how it was implemented in atlassian.
canonical_url: https://learnwithparam.com/tech-talks/multi-tenant-architecture-by-carmel-hinks/
---

One of my favorite tech talk on this subject, it was short but full of insights on how they scaled their business in different times and why they opted for multi-tenant architecture and how they managed to use it alongside the legacy codebase. And discuss different challenges while implementing it.

{% youtube 0N4KknY_zdU %}
Linux by example - Mount devices and enter our new system
Tags: linux
Published: 2019-07-28 23:12:08

---
title: Linux by example - Mount devices and enter our new system
published: true
description: We talk about mount points to mount and then we enter our new system for the first time.
tags: linux
cover_image: https://thepracticaldev.s3.amazonaws.com/i/5e451mnia53x7n362xla.jpg
---

{% youtube FBzKm5uZw0w %}
📦Generate string from URL pattern
Tags: replit, python, functorflow
Published: 2019-07-28 21:41:31

---
title: 📦Generate string from URL pattern
published: true
tags: replit, python, functorflow
---

```python
from functorflow import ff

# Generate string from URL pattern and values:


pattern = ff("make-url-pattern", pattern="/api/products(/:id)")
res = pattern.stringify( vals={ "id": 43 } ) 

print(res) # '/api/products/43'



# Match pattern against string and extract values:

pattern = ff("make-url-pattern", pattern="/api/products(/:id)")
res = pattern.match( url="/api/products/5" ) 

print(res) # {'id': '5'}
```

{% replit @functorflow/make-url-pattern %}

> Stop wasting time installing and configuring Python libraries. Use them right away. [📦FunctorFlow](https://functorflow.org) instantly auto-install and auto-config them for you.
Arch Linux AUR Helper with ncurses functionality and better searching and sorting 
Tags: archlinux, linux, go
Published: 2019-07-28 21:32:25

Link: https://github.com/ericm/yup

**Yup** is inspired by other AUR helpers but with many new features such as:

- Searching with `yup [search-terms]` returns most accurate results
![](https://raw.githubusercontent.com/ericm/yup/master/assets/scr1.png)

- Uses *ncurses* to display search results. This allows for mouse interaction in the terminal and easier navigation.
![](https://raw.githubusercontent.com/ericm/yup/master/assets/scr2.gif)
- Don't want to use ncurses? Use `yup -n` to use non-ncurses mode

- Want to search the AUR exclusively? Use `yup -a`

- Like *yay*, type `yup` to run a system upgrade.

- An easy to use config file located at `~/.config/yup/config.json` in JSON format.

- Want to see which packages are cluttering up your system? Run `yup -Qos` to get a list ordered package size.

## Differences between yay or trizen
- Yup gives you the **most accurate results** first. As seen in the example above, yup sorts the results to bring the most accurate to the start.

- `Yupfiles` are small files that allow you to batch install packages with a single command. [Here's an example Yupfile](test.Yupfile)

- Yup uses *ncurses*. This allows users to both scroll while not displacing the bottom bar and easily navigate to certain results using more natural forms of user input.

- Yup has an easy config file seperate to that of pacman's. This allows it to be more customisable from the get go.

- Yup has both `yup -c` (for clearing all package cache) and yup `yup -C` (for clearing yup's cache only).

- Yup allows you to disable ncurses mode (to normal terminal output) using `yup -n` temporarily or permanently by changing a value in the config file.

- In the search menu, yup allows you to remove an installed package instantly using the `R` hotkey.

- After selecting packages to install, you can revise your decision if you made a mistake.

- Yup will *soon* allow you to disable any of the dialogue during install using the config menu.
📦CSS unit converter
Tags: replit, python, functorflow
Published: 2019-07-28 21:31:17

---
title: 📦CSS unit converter
published: true
tags: replit, python, functorflow
---

```python
from functorflow import ff, f

# CSS unit converter: px, cm, mm, in, pt, pc, deg, grad, rad, turn, s, ms, Hz, kHz, dpi, dpcm, dppx.

# ---- ff 

# px to cm
r = ff('css-unit').cm(px=10)
print(r) # 0.26458

# ----- f

# px to cm
r = ff('css-unit.cm', px=10)
print(r) # 0.26458

```

{% replit @functorflow/css-unit %}

> Stop wasting time installing and configuring Python libraries. Use them right away. [📦FunctorFlow](https://functorflow.org) instantly auto-install and auto-config them for you.