teleren/devto huggingface dataset:
The day HashNode cured my CMS Hopping Syndrome
Tags: hashnode, blogging
Published: 2019-08-18 12:46:54

---
title: The day HashNode cured my CMS Hopping Syndrome
published: true
tags: Hashnode,Blogging
canonical_url: https://blog.kudapara.co.zw/the-day-hashnode-cured-my-cms-hopping-syndrome-cjzgyirw1004elcs19n72gesp
---

Have you ever spent an entire day just struggling to choose which blogging platform to go with? Medium, Ghost, WordPress, Dev, you name it. Say you chose WordPress, how many hours have you burned just digging around for the perfect theme?

This was me for the longest time. Hopping from one CMS to another was a lame excuse I gave myself not to actually write quality content because in my mind I had already told myself that I had not yet found THE PERFECT PLATFORM.

Then one day  [an ad](https://twitter.com/hashnode/status/1126797981393375233) on twitter caught my attention  👀
![hashnode_tweet.PNG](https://cdn.hashnode.com/res/hashnode/image/upload/v1566131128762/TQamYTCSd.png)

I already had a HashNode account due to my CMS Hopping habit, so that was an easy one. I quickly setup my account and whenever I hit any technical roadblocks, I would ping the co-founder of HashNode @[Sandeep Panda](https://hashnode.com/@sandeep) and he was super responsive and I got my blog up and running.

Now I feel like I have no excuse anymore not to write on my blog. The benefits I get from HashNode are quite a handful

- I get to post content on my own domain [blog.kudapara.co.zw](https://blog.kudapara.co.zw)
- I can automatically cross post this blog to other sites like [Dev.to](https://dev.to)
- I do not have to handcraft my own blogging platform (which comes with its own set of challenges🥵)
- If I decide to leave HashNode I can export my data and still maintain the SEO benefits of publishing on my own domain.

So if you are in decision limbo about which platform to go with, I'd say just go with HashNode, you can always change your mind later.
Caesar Cipher + 1
Tags: codepen
Published: 2019-08-18 11:53:13

Full number of exact variations equals to 88! * 1000 * 2147483647 = 3.983209e+146, most of them are differs slightly.


Caesar Cipher +1 *pros*:

1. *N* errors in input produce *N* errors of output
2. Cipher is not sensitive to errors in input alphabet
3. Cipher output is heavily dependent on IV

Caesar Cipher +1 *cons*:

1. Luck of signature algorithm
2. Small IV / easy to broute force
3. Weak against differential attacks


It will support RC error correction, and can be used in conjunction with digital signatures (needs DC to protect from minor changes)

{% codepen https://codepen.io/root_admin/pen/PoYzazw %}
Impetuous Encasing
Tags: cleancode, productivity, badpractice, refactorit
Published: 2019-08-18 11:24:33


Do you remember cleaning your room as a kid, because your parent made you do it? What did that cleaning session look like? Most likely you would just propel your old shirts into the closet, put your toys in a box along with the shoes and a half – finished bag of candy, and then, to top it off, kick that box under the bed. Your room looked clean.
And that is the only thing you can truthfully say about it. It looked clean.
But it wasn't.

Let's not be kids while cleaning our code. Mindless extracting chunks of code into separate methods is arguably one of the worst things you can do with a piece of foul-looking code. 

Face it. You were trying to go easy on yourself. But you did yourself no favours. You've managed to create at least one additional problem to deal with. Now, not only that the code is looking bad, but it is also hiding in the shadows, hoping you won't find it.

I've recently seen a lecture by two gentlemen, on how to approach legacy code. I was blown away by their advice. It was so simple. And even better,they kept presenting it as a minimum effort method. The method was to extract anything and everything we can into methods before you even figure out the semantics behind it.
Their selling point for this approach was: "Let the code tell you what it does".

While I agree with this standpoint, the context of it is extremely important. Bad code does not tell you what it does. Or even worse, it tells you the wrong thing.
 
I have tried this method in practice and very soon found out how bad it was. The method seemed fine for a while. I was doing the refactoring, moving everything into separate methods. The code looked cleaner and more readable. 

Until I took a coffee break and came back to it. It wasn't even remotely more readable. As a matter of fact, I had just hidden the garbage code behind a fancy method name which didn't even properly describe what it was doing. I made it harder to read, since you had to propagate through 5 meaningless method names to find some code that is actually doing something buried in the very core of it.  

Lesson of that day : „If something seems too good to be true, it probably is.”

Now when I think about it, it doesn’t even sound that good. To an engineer, how can an idea of doing something mindlessly and without any thought, be entertaining? 

There are no shortcuts to high-quality, readable and maintainable code. We can't put dirty socks in a box and call them clean. Do your job. Re-engineer, re-design, figure out a completely new architecture for the entire system.

Sloppy code cleanup is worse than none.
Corbind
Tags: kotlin, android, beginners, library
Published: 2019-08-18 10:54:27

Kotlin Coroutine binding APIs for Android UI widgets from the platform and support libraries. **Supports Flow, ReceiveChannel and Actor**.


## Description

This library is for Android applications only. Help you to transform Android UI events into cold [Flow][flow], hot [ReceiveChannel][channel] or just perform an action through an [Actor][actor].


## Github link
https://github.com/LDRAlighieri/Corbind


## Dependencies

```gradle
allprojects {

    repositories {
        mavenCentral()
    }

}
```

Platform bindings:
```gradle
dependencies {
    implementation 'ru.ldralighieri.corbind:corbind:1.0.0-RC'
}
```

AndroidX library bindings:
```gradle
dependencies {
    implementation 'ru.ldralighieri.corbind:corbind-core:1.0.0-RC'
    implementation 'ru.ldralighieri.corbind:corbind-appcompat:1.0.0-RC'
    implementation 'ru.ldralighieri.corbind:corbind-drawerlayout:1.0.0-RC'
    implementation 'ru.ldralighieri.corbind:corbind-leanback:1.0.0-RC'
    implementation 'ru.ldralighieri.corbind:corbind-recyclerview:1.0.0-RC'
    implementation 'ru.ldralighieri.corbind:corbind-slidingpanelayout:1.0.0-RC'
    implementation 'ru.ldralighieri.corbind:corbind-swiperefreshlayout:1.0.0-RC'
    implementation 'ru.ldralighieri.corbind:corbind-viewpager:1.0.0-RC'
}
```

Google 'material' library bindings:
```gradle
dependencies {
    implementation 'ru.ldralighieri.corbind:corbind-material:1.0.0-RC'
}
```


## How to use it?

If you need to get a text change events of EditText widget, simple use case with cold [Flow][flow] will look something like this:
```kotlin
findViewById<EditText>(R.id.et_name)
    .textChanges() // Flow<CharSequence>
    .onEach { /* handle text change events */ }
    .launchIn(scope)
```

If you prefer hot [ReceiveChannel][channel] and you need to get a ViewPager page selection events, then the use case will transform in something like this:
```kotlin
launch {
    findViewById<ViewPager>(R.id.vp_slides)
        .pageSelections(scope) // ReceiveChannel<Int>
        .consumeEach {
            /* handle ViewPager events */
        }
}
```

And if you just need to perform an action on button click, the easiest way will be:
```kotlin
launch {
    findViewById<AppCompatButton>(R.id.bt_confirm)
        .clicks {
            /* perform an action on View click events */
        }
}
```

Just one more traditional example of login button enabling/disabling by email and password field validation:
```kotlin
combine(
    et_email.textChanges()
        .map { Patterns.EMAIL_ADDRESS.matcher(it).matches() },

    et_password.textChanges()
        .map { it.length > 7 },
            
    transform = { email, password -> email && password }
) 
    .onEach { bt_login.isEnabled = it }
    .launchIn(scope)
```


[flow]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/index.html
[channel]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.channels/-receive-channel/index.html
[actor]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.channels/actor.html
Responsive text truncation with CSS
Tags: css, webdev, beginners
Published: 2019-08-18 08:51:35

---
title: Responsive text truncation with CSS
published: true
description: This is a simple example of responsive text truncation using CSS. We can achieve this using either Flexbox (for modern browsers) or Tables (supports also legacy browsers).
tags: css, webdev, beginner
cover_image: https://thepracticaldev.s3.amazonaws.com/i/q3xa7ii9iei1b8kvs451.jpg
---

This is a simple codepen example of responsive text truncation using CSS. We can achieve this using either Flexbox (for modern browsers) or Tables (supports also legacy browsers).

As a bonus, I am also including a responsive multi-line text truncation example.


{% codepen https://codepen.io/AdrianBece/pen/JjPKZOw %}
eclipse maxpermsize=256 issue

Published: 2019-08-18 08:17:34

have downloaded Eclipse but when i click on eclipse installation file it does not run. And when i click on eclipsec file it shows me following message:

"Javahotspot(TM) 64 bit server VM warning: ignoring option Maxpermsize=256: support was removed in 8.0"

I have installed latest Java 8.0 on my windows 7. What should i do? I have tried to search but couldn't find any solution on google . Please i am new in programming so provide me reply in easy steps.
Discord bot that shows PUBG after-match stats
Tags: python
Published: 2019-08-17 22:00:39

<img src="https://raw.githubusercontent.com/glmn/PUBGDiscoBot/master/misc/preview.gif" alt="PUBGDiscoBot" align="center">
<h4 align="center">
    Track and push after-match statistics to discord channel<br>
</h4>

<hr>

Bot that notify all your friends in discord channel about your last game where you got at least TOP-3 rank. <a href="https://github.com/glmn/PUBGDiscoBot">PUBGDiscoBot</a> calculates the amount of kills, knocks and damage you did. It also shows same stats for each of your roster. 

* Discord API based on <a href="https://github.com/Rapptz/discord.py">discord.py</a> library
* PUBG API implemented with <a href="https://github.com/ramonsaraiva/pubg-python">pubg_python</a> project

<hr>

### Bot commands
Bot uses prefix `!pdb-` to detect mention. So every command should start from this prefix plus command from the list down below.


<table>
  <tr>
  <th class="tg-0pky">command</th>
  <th class="tg-0pky">argument</th>
  <th class="tg-0pky">description</th>
  </tr>
  <tr>
  <td class="tg-0pky"><code>track</code></td>
    <td class="tg-0pky"><code>player_name</code></td>
    <td class="tg-0pky"><i>Put player to your track list</i></td>
  </tr>
  <tr>
    <td class="tg-0pky"><code>untrack</code></td>
    <td class="tg-0pky"><code>player_name</code></td>
    <td class="tg-0pky"><i>Remove player from your track list</i></td>
  </tr>
  <tr>
  <td class="tg-0pky"><code>last</code></code></td>
  <td class="tg-0pky"><code>player_name</code></td>
    <td class="tg-0pky"><i>Shows player last top-3 match</td>
  </tr>
  <tr>
  <td class="tg-0pky"><code>list</code></code></td>
    <td class="tg-0pky"></td>
    <td class="tg-0pky"><i>Shows your track list</td>
  </tr>
</table>

### Multitrack
If multiple channel participants track same player or track different players but in same game roster, then bot will send only one message with all participants mentions. In example below, bot sent only one message instead of three, because they are all played in one roster
<img src="https://raw.githubusercontent.com/glmn/PUBGDiscoBot/master/misc/multitrack.png" alt="PUBGDiscoBot" align="center">

### Want to test?
Join special <a href="https://discord.gg/p6TGxqB">discord channel</a> and make your first track.
If your last game was TOP-3 then bot will show you stats immediately, otherwise you need to play PUBG to achive at least TOP-3 rank. 

#### Feedback
Any comments, reviews, suggestions, issues or pull requests will be appreciated.

<a href="https://github.com/glmn/PUBGDiscoBot">Github Link</a>
P.S. This is my first python project.
Untangle react contexts that depend on each other?
Tags: react
Published: 2019-08-18 08:06:50

Recently on Twitter a [question](https://twitter.com/ovidme/status/1162873760489381894) was asked, roughly, how to untangle 2 react contexts that use state/callbacks provided by each other.

Several answers were suggested, ranging from combining them into a single context, to using callbacks from one context to sync state with another.

While I have no doubt that any of the provided solutions could be made to work, I couldn't help but think about another solution that I think is more in the react style of [composition](https://dev.to/bouhm/thinking-in-react-component-composition-fp5).

So, without further ado, my solution:

{% codesandbox fast-sun-w0tsj %}

Much like the [unix philosophy](https://en.wikipedia.org/wiki/Unix_philosophy) of "Do 1 thing, and do it well", each context is reduced to a single responsibility. The two original contexts can now be used independently, with the third context doing only the composition.

Feel free to provide feedback. Good? Bad? Pro's / Con's?
Understanding Microtasks and tasks in JS
Tags: javascript, beginners, webdev
Published: 2019-08-18 07:56:33

<div>Well, as Javascript  developers we all are in a habit of using promises, timers etc. Whenever we think of making a particular piece of code asynchronous the first thing that comes to our mind is using promises or maybe a setTimeout(). Have you ever wondered how these things work under the hood? I have been going through a lot of blogs regarding execution **queues**, **microtasks** and **tasks**, so I decided to jot down my learnings in this post.</div>

Let's start off with a quick exercise(just to brush up your javascript skills)

<img  src="https://thepracticaldev.s3.amazonaws.com/i/yzcd9yf3qlz0vgfm9gt0.png"/>

<h3>Now put on your thinking hats and think what output of above code snippet would be.</h3>

The correct answer goes as
<ol>
<li>call the printer</li>
<li>Inside the Printer</li>
<li>Promise resolved</li>
<li>Timeout 1</li>
</ol>

Yes the output is not exactly what a lot of us must be expecting🤷‍♂️ 🤷‍♂️. But  what goes on behind the scenes in Javascript is very engaging.

Actually  when the *printer function* is called the *Inside the Printer* is logged. Now the important thing to note here is that even when the timer is set to 0 the log statement inside  *setTimeout()* is executed after *promise* is resolved. To understand this you need to know how the event loop handles tasks and microtasks. The event loop runs continuously and ensures that all the tasks queued are executed sequentially. So in our case the *setTimeout()* is scheduled as a task which is executed in the next event loop. But the question here remains is **How the hell does Promise log the statement first?**

*Promises* are queued as microtasks. *Microtasks* are executed straight after the  currently executing script and thus promises are resolved in the same event loop. Calling *.then()* puts the promise in the microtask queue. The microtask queue is processed after callbacks as long as no other JavaScript is mid-execution. That is why *Promise resolved* is logged before *Timeout 1*. 

The crux is -:
<ul>
<li>Tasks have to wait for next round of execution</li>
<li>Microtasks can execute in the same round after the current script finishes execution</li>
</ul>

Hopefully I could explain the topic in a simple yet effective manner. Bye !!!
Introducing Git Angular: a VSCode extension for Angular-style commits
Tags: vscode, git
Published: 2019-08-18 07:09:25

## Why does this extension exist?

A lot of the projects I work on have some variety of pattern you need to follow in order contribute. This largely is because the commit messages will become part of the release notes and/or changelog later on. 

My previous company had a very rough process for Git messages, and most of my personal projects tend to have commits designed for "Future Jim" to read. Because of that, I personally adopted the Git-Emoji commit style, as I enjoy a little bit of spice in my commits.

My current company, however, is very particular about their commit structure. They use a version of [Angular's Commit Message Guidelines](https://github.com/angular/angular/blob/master/CONTRIBUTING.md#commit). The thing is I am having just _the hardest_ time with it, so I wrote this little extension to help myself, and I figured I would share it with other people.

## What does it do?

One thing, fairly simply: _helps you build the starting point for an Angular-style commit_. 

## ... OK?

I know, that doesn't sound so awesome, and if I'm honest this extension isn't meant to be something like [GitLens](https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens), it's just meant to be a simple helper that plugs in to VSCode's default Git extension.

The biggest thing about Git Angular is that it is configurable, either globally or via workspaces. This was done because not every person who is using the Angular commit style will be using _Angular's_ commit style (much like my current company). You and your team could be using different types or scopes, and Git Angular allows for that.

## How do I use it?

Unfortunately, VSCode has about a million extensions that have "Angular" in the title, so it's best to follow [this link](https://marketplace.visualstudio.com/items?itemName=Jhecht.git-angular). Otherwise, the easiset way I found to find it without a lot of fuss or muss is searching for "Git Angular" (quotes included) into the VSCode Extension search box. 

It contributes a single command, `gitAngular.commit`, that you can bind to a keybinding or use from the command palette. I personally bind this to `ctrl+shift+c`

## Wrapping up

Let me know if you think there's something missing from the extension that many Angular-style commit users would enjoy to have.
globatio - win64 app release - search / download / create peer-to-peer content
Tags: torrent, dat, javascript
Published: 2019-08-18 04:59:27

https://github.com/torrentroyal/globatio/releases

Sharing and search for peer to peer content (torrents, datlinks, …) has always been cumbersome. In an attempt to remedy to this situation the opensource project called globatio have been created. It is still under development but already find the source code on github. 

Comments and issues are welcome !
Internship
Published: 2019-08-18 04:09:41

---
title: Internship
published: true
description: 
tags: 
---
Hello. I have some fantastic news. I was recently offered a software engineering internship. I am expecting to start on the 9th. I hope to post more about my experiences in my internship and what I'm learning.

I am still trying to work on my checkerboard Android application using Kotlin. I'm having issues moving the pieces so that they fit in the grid in the appropriate places. For some reason, every JPG picture of a checker piece I put on the board is pushed to the top left corner. Clicking and dragging to the spot I want to put the piece in doesn't help. Changing the row and column doesn't help, either. I'm assuming it has something to do with the overall layout, but I'm not familiar with Android layouts. 

I will update on the app when I find a solution. However, I plan to work on polishing my C++ skills for the internship. The job relies more on C++, so I want to make sure everything I can do with Kotlin and Java, I can do with C++. I also want to make sure I perfect pointers because pointers are very important in C++.
The 3 Sins of Software Engineering Interviews
Tags: career, study, beginners
Published: 2019-08-18 03:59:35

In my time as a software engineer, I've interviewed hundreds of candidates for front-end, full-stack, and backend developer roles. Here are some surprisingly common mistakes that you should avoid to improve your chances of passing the interview. 

## 1. Using a language you don't know

Forget what language is trending right now or what the company you're applying for uses—always use the language you know best. If you love Ruby, just use Ruby! 

Why? Because time is of the essence in a technical interview. If you choose a language that isn't second nature to you, you're going to waste precious mental cycles trying to remember which functions to use and gloss over obvious bugs.

## 2. Only coding in your IDE 

You may not realize how much you rely on the help of your IDE to autocomplete your code on a daily basis. Unfortunately, autocomplete doesn't work on a whiteboard. And some languages (*cough* Java) can be quite verbose and slow you down in an interview. This isn't a showstopper, but it means you should *practice in an interview setting* (in a text editor, on a whiteboard). If you want real-world practice, you should also check out [Exponent's mock interviews](https://www.tryexponent.com/software-engineering?src=devto).

## 3. Not taking a *hint*

Getting stuck in an interview isn't the worst thing, but interviewers hate it when candidates veer off track and ignore their suggestions. Learn to recognize when the interviewer is trying to help you. If you find yourself answering vague questions—like "Why do we we need to do X?" or "How do you know Y?"—your interviewer may be suggesting you try to find an alternative (or simpler) solution. Use this hint as an opportunity to step back and think about your approach. Don't forget that half of the interview is about your communication skills – how well you explain ideas and how well you listen to feedback from the interviewer.

### Want more help?
Want help practicing for your interviews? Check out [Exponent](https://www.tryexponent.com/software-engineering?src=devto), where we match you with experienced mentors who've worked at top tech companies like Google, Facebook, Uber, and Dropbox. Subscribe to our [YouTube channel](https://www.youtube.com/exponenttv) for more helpful tips and videos.