teleren/devto huggingface dataset:
Day 372 : Back In Town
Tags: hiphop, code, coding, lifelongdev
Published: 2021-05-21 21:57:45

_liner notes_:
- Professional : Not a bad day. Pretty much finished the sample app I've been working on to demonstrate a new SDK. Came out pretty good. Made a correction to the documentation and asked a couple of questions in our Slack group. Asked for a feature to be added that is not super needed, but would be a nice to have. After that, headed into town to send my old laptop back.

- Personal : Last night, I finished making the countdown timer in the navigation bar of my side project. It's a Web Component so I just added some more functionality that will only show certain parts of the countdown depending on what attributes are included. I think that was it and went to sleep.

![Looking out from inside a cave at large rock formations sticking out of the ocean at sunset in Ilhéu De Baixo, Portugal](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e0u5yp6l3sarstgo13tc.jpg)

So after dropping off my old work laptop, I made it to the park I normally go to since I'm back in town. Going to work on the radio show for tomorrow and after that, going to a recording session with some artists I know. Should be a good time.

Have a great night and weekend!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube oFAn8GEBbmM %}
Kotlin HTTP Call with AsyncTask example | Android
Tags: kotlin, asynctask, android
Published: 2021-05-21 16:43:08

https://grokonez.com/android/kotlin-http-call-with-asynctask-example-android

Kotlin HTTP Call with AsyncTask example | Android

In this tutorial, we're gonna look at way to implement HTTP Call with <code>AsyncTask</code> to get data from Yahoo Weather API.

<!--more-->
<h2>I. Technologies</h2>
- Android Studio 3
- Kotlin 1.1.51
<h2>II. Overview</h2>
<h3>1. Goal</h3>
We will build an Android App that uses <code>AsyncTask</code> to implement asynchronous HTTP request to Yahoo Weather API:

<img src="https://grokonez.com/wp-content/uploads/2017/12/kotlin-http-asynctask-goal.png" alt="kotlin-http-asynctask-goal" width="283" height="526" class="alignnone size-full wp-image-9721" />
<h3>2. HTTP Call with AsyncTask</h3>
<h4>2.1 AsyncTask</h4>
AsyncTask allows us to perform background operations, then publishs results on the UI thread without having to manipulate threads and/or handlers.

To work with <code>AsyncTask</code>, we must create its subclass, then override at least one method named <code>doInBackground()</code>:
<pre><code class="language-kotlin">
class GetWeatherAsyncTask : AsyncTask<Params, Progress, Result>() {

    override fun onPreExecute() {
        // Before doInBackground
    }

    override fun doInBackground(vararg params: Params?): Progress {
        // ...
        publishProgress(progressResult)

        return result
    }

    override fun onProgressUpdate(vararg values: Progress?) {
       // use progressResult to do things such as updating UI...
    }

    override fun onPostExecute(result: Result?) {
        // Done: use result which is returned from doInBackground()
    }
}
</code></pre>
<h4>2.2 HttpURLConnection</h4>
We use HttpURLConnection to work with HTTP-specific features.

- get a new <code>HttpURLConnection</code> by calling <code>URL.openConnection()</code>
- read the response from the stream returned by <code>getInputStream()</code> method (<code>inputStream</code> field in Kotlin)

More at:

https://grokonez.com/android/kotlin-http-call-with-asynctask-example-android

Kotlin HTTP Call with AsyncTask example | Android
javascript, html, css, production design
Published: 2021-05-21 20:41:19

I began learning JavaScript and immediately struggled to synthesize the concepts. I realized that I needed to further develop my understanding of HTML and CSS, because the three languages work together like a jigsaw puzzle. 

They are all components of styling and interactivity, similar to the design of a stage production. They are all integral parts of composing a compelling user experience which, at its essence, is storytelling. Just as in an opera or other type of stage production the set design, costuming, and lighting are all essential parts of bringing characters to life, the frontend languages of computer programming allow users to engage with the virtual realities we developers weave. 

The other metaphor I found myself delving deeply into is that of the DOM tree, and its nodes. The word node comes from the Latin nodus ‘knot’. It is in these knots where further branches extend, creating a veritable ecosystem which can easily grow into a brambly mess if you aren’t paying attention. For me, I found that when I lost track of my <div></div>’s, things got messy. 

Building, hedging, trimming and styling with attention and care proved to be the most effective way of managing front end development. Any time I began coding without intention or focus, I inevitably ended up making some kind of mistake or creating some type of bug, simply through inattention. Any time this happened I stepped away, took a breath, and reviewed my notes regarding the design narrative for my application. 

For this project, because JavaScript was developed in 1995 I wanted to use Times New Roman because it harkens back to those days. I wanted to use Millennial Pink as the background, because Millennials are into VaporWave and mid90s culture and aesthetic. I wanted the application to look clean, and minimal, and I wanted to make it look similar to Instagram. 

Just as it is with backend development, where you need to go in with a strategy to manage the way in which your data will be structured, so too must you approach front end development with a strategy to manage your narrative structure.
TIL a Unity GameCreator List Trick
Tags: todayilearned, gamedev, unity3d, gamecreator
Published: 2021-05-21 20:30:21

2021-05-20

As time goes on, I'm more enthusiastic about game systems rather than game engines. And lately, I've been enamored with [Game Creator](https://gamecreator.io). 
Note: I sometimes refer to Game Creator as GameCreator (no space) or GCIO.

If you have the Shooter module, it involves the following steps.
0. Setup GameCreator and its Shooter module.
1. Build a new Ammo asset with specific properties.
2. Build a new Weapon asset that uses this Ammo asset. 
3. Add a game object with a Character Shooter that can Draw the Weapon and Shoot it.

I flesh out these steps in more detail in my [docs](https://docs.goldenxp.com/gamecreator-shooter-basic-setup/) but what I learned today that was rather interesting was that you can pick a random value from a List very easily in Game Creator. This is very useful for moving objects for quick tests or otherwise inducing predictable behaviors. 
![Random List](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xk9gr3h3ewuq42mpxnll.png)

Eyy I forgot to hit publish :[
Laravel One of Many Eloquent Relationship Example
Tags: laravel, php
Published: 2021-05-21 20:11:39

A new one of many Eloquent relationships is coming to Laravel 8.42 thanks to a PR contribution by Lennart Carstens-Behrens along with collaboration from Taylor Otwell is released some days ago. This one of many relationships is very useful.

So what is one of many relationships is? The one-of-many relationship creates a one-to-one association from a one-to-many relationship. This quote is not enough to define this relationship. So let's see an example to understand.

Many times you will see that a model may have many related models, yet you want to easily retrieve the "latest" or "oldest" related model of the relationship. For example, a User model may be related to many BrowserHistory models.

https://techvblogs.com/blog/one-of-many-eloquent-relationship-laravel
Deploying a Next.js app with AWS Amplify
Tags: aws, nextjs, react, devops
Published: 2021-05-21 20:06:44

This week AWS amplify announced support for deploying Next.js SSR apps, which has been a long awaited feature. You can read the announcement [here](https://aws.amazon.com/about-aws/whats-new/2021/05/aws-amplify-hosting-announces-server-side-rendering-support-for-next-js-web-apps/).

### Next app
For the purposes of this guide we will deploy the basic app scaffold provided by [create-next-app](https://www.npmjs.com/package/create-next-app)

### Deployment
Since we will be using Amplify, we first need to go through the installation and setup process. We can figure out how to do that by following the [official docs](https://docs.amplify.aws/cli/start/install).

#### Creating an Amplify Project
Once we have Amplify configured we can go ahead and create a project. We can achieve that by running `amplify init`

![Domain List](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9kg1xgzxa6oc28ivgz7p.png)
We will need to create a name for our project and a profile to use and amplify will spin up all the resources we will need.

#### Zero config deploy
Amplify provides a zero config deploy similar to vercel, which allows us to connect a git provider to use for our deployments. To get started we can go the the [Amplify console](https://console.aws.amazon.com/amplify/home) and select Host web app.

![Host web app](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2sk80v08570ezhbcuynx.png)
##### Select git provider
We can now select our preferred git provider such as Github for this example.
![Select a git provider](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tgyl5fmmfakakh3ymqsw.png)
##### Add repo branch
After selecting our desired git provider we can select which branch we would like to deploy from.
![Select repo branch to deploy from](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/acjfykq1gsqqx3ywmfk4.png)
##### Configure build settings
After selecting a branch we can now configure our build settings, for the most part we won't need to modify this config as Amplify will take care of that for us.
![Configure build setting for deployment](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a7nvyogub0rmygu9kqbl.png)
##### Review
Now we can review everything looks correct before triggering a deploy.
![Review configuration](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4x2ql54oxk73xyykw14d.png)
##### Verify deployment
Finally we can see the deployment starting and in a few minutes our site will be live!
![Verify deployment](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nxzuyu21clcmztu4u60j.png)

### Conclusion
Thanks to Amplify we can now deploy Next.js SSR app on AWS with a relatively low effort. Let me know what you think about this new feature!
Why Developer Advocates Should First Publish Content on a Personal Blog
Tags: devrel, opinion
Published: 2021-05-28 21:52:21

---
title: Why Developer Advocates Should First Publish Content on a Personal Blog
published: true
date: 2021-05-21 19:18:21 UTC
tags: DevRel,Opinion
canonical_url: https://maxkatz.org/2021/05/21/why-developer-advocates-should-first-publish-content-on-a-personal-blog/
---

[![](https://katzmax.files.wordpress.com/2019/12/yearblogging-featured.png?w=782)](https://katzmax.files.wordpress.com/2019/12/yearblogging-featured.png)

In a blog post [Where to publish content?](https://dev.to/maxkatz/where-to-publish-content-53ao) I shared why I recommend to publish on your own blog first:

1. It allows you to build your portfolio and keep all your work in one place
2. It allows to build your personal brand
3. It can act as your “second” resume as it shows that you actually published. It’s easy to put anything on a resume. A blog shows the actual work. GitHub is a resume for your code. A blog is a resume for your thoughts. 
4. When you get a new job, the content you published will be available on your personal blog and not on the company’s blog
5. If something happens to other sites (no longer available, site offline, put behind a paywall), you still have the content on a personal blog

After you publish on your own blog, it can be a good idea to republish or syndicate on to other platform such as Dev.to, LinkedIn, Hashnode and others.

I was reading a blog post from Stephanie Morillo [Why Developers Should Archive Their Old Content](https://www.stephaniemorillo.co/post/why-developers-should-archive-their-old-content) where Stephanie talks about the importance of archiving your work because of a situation like this:

{% twitter 1389649958895333380 %}

Now, Felix Salmon is a journalist so the idea of first publishing on personal blog and then republishing is not an option. But for Developer Advocates these guidelines are usually a lot more relaxed. You usually have a lot more freedom to decide where to publish first.

If you read the tweet thread, it looks like the articles are back online. But, I still believe is a good example that anything you publish on someone else website, it can disappear, placed behind a paywall or anything else.

So my advice for Developer Advocates: start a blog, publish there first, and then republish where makes sense.
Move the mouse for dog walking
Published: 2021-05-21 19:02:57

<p>Here is a tutorial for walking your dog !<br>
Made with all my love on Twitch.tv ! &lt;3</p>


{% codepen https://codepen.io/emilienleroy/pen/RwpKxVZ %}

<p>Follow me :p<br>
<a href="https://twitch.tv/emilienjc" target="_blank">https://twitch.tv/emilienjc</a><br>
<a href="https://github.com/EmilienLeroy" target="_blank">https://github.com/EmilienLeroy</a><br>
<a href="https://codepen.io/emilienleroy/" target="_blank">https://codepen.io/emilienleroy/</a><br>
 <a href="https://twitter.com/LeroyEmilien" target="_blank">https://twitter.com/LeroyEmilien</a></p>
I have created Web Gallery app using Reactjs , WebRTC and Chakra UI
Tags: react, webrtc, chakra, showdev
Published: 2021-05-21 18:37:07

Hello Community,

In this blog post i will show you how i have created a simple web gallery app using WebRTC. 
I have also added download functionality and remove image functionality. 

We knew that react is awesome because it can easily combine with any javascript library without much configuration.

### Technology i have used
1. Reactjs
2. WebRTC
3. Chakra UI


Chakra ui is really well if you want better accessibility in your react app.


## Lighthouse Results


![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pbrrwsrbbwgxir0amlgl.png)



![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2y7osnhlxlles6n24hlh.png)

I have deployed this app on netlify so that you can visit and learn by exploring

[live demo](https://react-web-gallery.netlify.app/)


You can checkout the code on github

{% github harshmangalam/react_web_gallery %}
More into Data types!
Tags: java, goal, motivation, beginners
Published: 2021-05-21 18:28:15

Today is **day five** of my learning Java journey.

Yesterday, I had learnt and shared with you the data types available in Java and the various types under the respective Primitive and Reference data type. Today, I would be sharing more in depth about each of the data types discussed in the previous post.

As we had discussed that Java has eight sub types of data types under the category of Primitive data types.
+ The types Byte, Short Int and Long can be combined under one umbrella as *Integer* data types.


| Type        | Size in bits           | Range|
| ------------- |:-------------:| -----:|
| byte  | 8 bits| -127 to 128 |
| short | 16 bits      |   -32768 to 32767|
| int   | 32 bits      |    -2147483648 to 2147483647 |
| long  | 64 bits      | -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807|
 
+ these types of integer data types have a wide implications from being as variable types in control statements, for example in loops as control variables data type to general purpose mathematics.
+ the byte and short data type are generally type-casted with (byte) or (short) so as to make it clear to compiler so as not to be mistaken with int.
+ also with large data type we use 'L' as format specifier. for example - 244368L

+ Another data type that combines two data types are **Floating Point Types** : -
  + it consists of float and double.
  + if you are new to programming let me break it clear for you that floating point numbers are those that have a **decimal part** in common language or technically those number which have a **fractional component**.

| Type        | Size in bits           | Range|
| ------------- |:-------------:| -----:|
| float  | 32 bits| 1.4 E -45 to 3.402835E38|
| double | 64 bits      |   1.7976931348623157 x 10308 to  4.9406564584124654 x 10-324|

  + in case of data having float or double value we use format specifier 'f' or 'd' respectively. for example - 0.002f or 0.0235d.  

+ Char data type:-


| Type        | Size in bits           | Range|
| ------------- |:-------------:| -----:|
| char  | unsigned 16 bits| 0 to 65,535|
  
   + also the ASCII values are valid as Java characters.
   + arithmetic manipulations are viable on char data type.


+ Boolean data type:-
   + it has two values **true** and **false**.
   + these true and false are defined as reserved words in Java as it defines the values true and false using these words and not like in many programming languages where false is considered as 0(zero) and true as any other value than 0. 

Closing for today, and will be sharing my next learnt topic tomorrow till then keep learning, keep growing. Also feel free to give any suggestions or add up any point that I may have missed.
Freelancing, LUCK or Hard Work. What you think?
Tags: discuss, learning, coding
Published: 2021-05-21 18:07:46

So, before you get onto a conclusion I want to tell you that I am talking about initial stages, and here are my views on this.

### My Opinion
According to me freelancing is all about connections as the person with more connections have a much higher chance to rise more in freelancing.

### The First Project,
is something which kickstarts a freelancer journey. What if you don't get a person who give you the first project. How anyone will hire someone if he don't have a connection with you.

### Building Connections,
is something we can say depend on both luck and hard work but which one covers most part of it.

### I think it's more about Luck and less about hard-work at initial stage


👇*CHANGE MY MIND*👇
*COMMENT YOUR OPINOIN*
Dump Context Action
Tags: github, githubactions
Published: 2021-05-22 08:44:48

---
title: Dump Context Action
published: true
date: 2021-05-21 18:01:06 UTC
tags: github, githubactions
canonical_url: https://michaelheap.com/dump-context-action/
series: Action Spotlight
---

This week's Action Spotlight introduces a new kind of action. It's the first time we're featuring a [composite action](https://docs.github.com/en/actions/creating-actions/creating-a-composite-run-steps-action), which allows you to include multiple workflow steps as a single `uses` statement.

| Fact Sheet | |
| --- | --- |
| Author | crazy-max |
| Contributors | 1 |
| Stars | 9 |
| Repo | [https://github.com/crazy-max/ghaction-dump-context](https://github.com/crazy-max/ghaction-dump-context) |
| Marketplace | [https://github.com/marketplace/actions/dump-context](https://github.com/marketplace/actions/dump-context) |

## What does it do?

This action outputs the following items from the runner environment:

- `env`
- `runner`
- `github`
- `job`
- `steps`
- `strategy`
- `matrix`

This allows you to see things like `github.event` in the output to debug the data available to your actions.

## How does it work?

This is a composite action, which means that the whole thing is in a [single `action.yml` file](https://github.com/crazy-max/ghaction-dump-context/blob/master/action.yml). It contains the fields that we'd expect to see, such as `name`, `author` and `branding`. However, it also has a value that we've not seen before; `runs.using: composite`.

This tells Actions that the action provides steps that should be run as though they were provided in the workflow itself.

There are seven steps, each dumping a different aspect of the environment. Each step uses the `toJson` function to convert the input to a string that can be rendered in the output and stores that in the environment. Storing it in the environment prevents quoting issues when echoing out the value later.

The characters before each heading (e.g. `\033[31;1;4m`) are ANSI escape codes, which tells the output to make that text red, bold and underlined.

Finally, each step has the shell set to `bash`. This makes the action usable on all operating systems. Without this, the action would default to Powershell on Windows and fail.

That's all there is to it - seven steps, all following the same pattern to output useful data in the logs.

## Common use cases

There's only one use case - dump the current context to for debugging purposes:

```yaml
name: Dump Context
on: [push, pull_request]
jobs:
  dump:
    runs-on: ubuntu-latest
    steps:
      - name: Dump context
        uses: crazy-max/ghaction-dump-context@v1
```
Kotlin GridView example: Show Item Details | Android
Tags: kotlin, android, gridview
Published: 2021-05-21 16:37:31

https://grokonez.com/android/kotlin-gridview-example-show-item-details-android

Kotlin GridView example: Show Item Details | Android


In previous <a href="https://grokonez.com/android/kotlin-gridview-example-show-list-of-items-on-grid-android">post</a>, we had known how to show list of Items using <code>GridView</code>. This tutorial shows you way to implement onClick Event on Item and come into its details.

Related Post: <a href="https://grokonez.com/android/kotlin-listview-example-android">Kotlin ListView example | Android</a>

<!--more-->
<h2>I. Technologies</h2>
- Android Studio 3
- Kotlin 1.1.51
<h2>II. Overview</h2>
<h3>1. Goal</h3>
We will build an example that uses <code>GridView</code> to show list of food items like this:
<img src="https://grokonez.com/wp-content/uploads/2017/12/kotlin-gridview-goal.png" alt="kotlin-gridview-goal" width="287" height="522" class="alignnone size-full wp-image-9668" />

When clicking on any Item, we can go to its details in new Activity:
<img src="https://grokonez.com/wp-content/uploads/2017/12/kotlin-gridview-show-details-goal.png" alt="kotlin-gridview-show-details-goal" width="285" height="520" class="alignnone size-full wp-image-9677" />
<h3>2. Project Structure</h3>
<img src="https://grokonez.com/wp-content/uploads/2017/12/kotlin-gridview-show-details-structure.png" alt="kotlin-gridview-show-details-structure" width="379" height="402" class="alignnone size-full wp-image-9679" />

In this example, we add <code>FoodDetails</code> Activity class. Clicking on any Item in <code>MainActivity</code> will direct us to <code>FoodDetails</code> (with image, name, description).
<h2>III. Practice</h2>
<h3>1. Set up Project</h3>
- Create <strong>New Project</strong>:
<img src="https://grokonez.com/wp-content/uploads/2017/12/kotlin-gridview-create-project.png" alt="kotlin-gridview-create-project" width="273" height="402" class="alignnone size-full wp-image-9662" />

- Add each item insides <a href="https://grokonez.com/wp-content/uploads/2017/12/sample_images.zip">sample_images</a> to <strong>res</strong>/<strong>drawable</strong> folder.

- Add <code>FoodDetails</code> Activity:
<img src="https://grokonez.com/wp-content/uploads/2017/12/kotlin-gridview-add-activity-details.png" alt="kotlin-gridview-add-activity-details" width="266" height="448" class="alignnone size-full wp-image-9680" />
<h3>2. Layout</h3>
<h4>2.1 Container Layout</h4>
Open <strong>res</strong>/<strong>layout</strong>/<strong>activity_main.xml</strong> file:

More at:

https://grokonez.com/android/kotlin-gridview-example-show-item-details-android

Kotlin GridView example: Show Item Details | Android