teleren/devto huggingface dataset:
Git Bisect, When and How?
Tags: github, git, programming
Published: 2021-04-26 21:00:25

In this article, we will learn about the `git bisect` command which is rarely used but can be helpful in some cases.

## When can we use `git bisect`?
according to [git docs](https://git-scm.com/docs/git-bisect), `git bisect` is used to find a commit that produces a **bug** ; however, I do say that it can be used to find a commit that produces **anything** you can notice in the program output; for example:
  - Log statement (ex. console.log)
  - Enhancement to a certain part ..etc 

Therefore, if you are asking where I can find the commit that is responsible for certain output, you can use `git bisect` command

## When not to use it?
If you want to know the commit or person that is responsible for a certain part of the code, you can use [Gitlens](https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens)

|  | Use `git bisect` | Do not use `git bisect` |
|-|-|-|
| You want | To get the commit and its info   | To get the commit and its info |
| You have |  Output not code.. for example:<br>  - Bug you can reproduce<br>  - log statement |  **Code** so you can use another tool to get the commit info |


## How can I use `git bisect` 🤔?
First, detect the *output* that you are searching for its commit info, then run 
```
git bisect start  
```
then run 
```
git bisect good [hash of commit]
```
 and insert the hash of the commit where you are sure that that certain *output* is not present.
Then run
 ```
git bisect bad [hash of commit]
```
 where you are sure you can reproduce this certain *output*. you can leave it empty to choose the certain commit.

then git will start jumping between commits that are between the **good commit** and the **bad commit** 
for every commit, try to reproduce the *output* that you target, if you can reproduce it, then run `git bisect bad`; 
if you can not reproduce it, run `git bisect good`

Finally, git will log the commit info that is responsible for the output that you are looking for :tada:. 
Then run `git bisect reset` to end the process.

I hope this article has helped you understand `git bisect` command
Back to basics; Shell Scripting
Published: 2021-04-26 20:54:27

Hello, world, it's been a while since the last time I wrote something here, and it's been crazy all the things that have happened since.

Besides quarantine and stuff, I lost my old job, I've had to move twice, lost my computer, and had a lot of bad times. Nonetheless, not everything are bad news.

About a week ago, I decided to go back to my start point, bring back my old childhood dream; becoming an indie game developer.

Anyways, this is not a post for complaining or talking about my life dreams —for that matter, I got my [personal blog](https://medium.com/@alexsc6955), there you'll find my life experience kinda like mixed with video game stories—, we're here to talk about dev stuff and coding.

So, The main reason behind this post is to introduce my new tutorial series where you'll be able to learn Shell Scripting basics and how to develop an easy game by just using your command prompt, a game that will be available on [GitHub](https://github.com/alexsc6955) for you to fork it or contribute. It'd be fun to develop a game as a community.

Please stay tuned for more info about this tutorial, so please, follow me on [Twitter](https://twitter.com/thehomelessdev) and if there's something, in particular, you want to learn about shell scripting, please let me know in the comments down below.

Thanks for reading, till the next time :)
C++ Best Practice #1: Don't simply use: using namespace std;
Tags: cpp
Published: 2021-04-26 20:09:46

The original article was published in the blog: https://fluentprogrammer.com/dont-use-using-namespace-std/

Never try to import the whole std namespace into your program. Namespaces are developed to avoid naming conflicts. But, when we import the whole namespace there is a possibility that this could lead to name conflicts. You can do more harm than more good.

**Description**
```
using namespace std;
```
It is okay to import the whole std library in toy programs but in production-grade code, It is bad. using namespace std; makes every symbol declared in the namespace std accessible without the namespace qualifier. Now, let’s say that you upgrade to a newer version of C++ and more new std namespace symbols are injected into your program which you have no idea about. You may already have those symbols used in your program. Now the compiler will have a hard time figuring out whether the symbol declared belongs to your own implementation or from the namespace you imported without any idea. Some compilers throw errors. If you are unlucky, the compiler chose the wrong implementation and compile it which for sure leads to run time crashes.

For example, consider the below code,
```
#include <iostreeam>
#include "foo.h" \\ Contains the implementation for same_as

using namespace std; \\Bad practice
class semiregular  { }; \\Implemented in foo.h

int main() {
  semiregular  b;
  ............
  cout << "Hello, Congrats.You are on your way to becoming an expert in programming...">>
}
```
The above code won’t trigger any compile-time error if compiled with C++17. It may throw an error when compiled with C++20 that the header file is not included. This is because semiregular is a feature implemented in C++20. So it’s always better to be on the safer side by not loading up your program with all the symbols a namespace offer. Instead use the:: annotation and use the full qualifier like std::cout.
```
#include <iostreeam>
#include "foo.h" \\ Contains the implementation for same_as

class semiregular  { }; \\Implemented in foo.h

int main() {
  semiregular  b;
  ............
  std::cout << "Hello, Congrats.You are on your way to becoming an expert in programming...">>
}
```
The above code didn’t load the whole of std so semiregular is not considered to be part of std and it considers the class implemented by us.

**Conclusion**
Never use “using namespace std;”. This also applies to all the namespaces. There is a possibility for naming conflict.

Reference: https://fluentprogrammer.com/dont-use-using-namespace-std/
Get smart about the future of our technological world
Tags: ai, datascience, blockchain, deeplearning
Published: 2021-04-26 19:47:52

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/92hq80loujijlcxdn528.jpg)

[Humble Book Bundle: Cutting Edge Tech by Morgan Claypool](https://www.humblebundle.com/books/cutting-edge-tech-morgan-claypool-books?partner=indiekings)

Get smart about the future of our technological world! Humble has teamed up with Morgan Claypool to get you up to date on what the future holds when it comes to new tech. Learn about AI, neural networks, and more with eBooks like General Video Game Artificial Intelligence, 5G Mobile Networks: A Systems Approach, and Science Fiction Prototyping: Designing the Future with Science Fiction. Your purchase will transform you into a tech genius and will also support the NAACP Legal Defense Fund & Stop AAPI Hate.

Pay CA$1.25 or more. Normally, the total cost for the eBooks in this bundle is as much as US$627. You choose the price and increase your contribution to upgrade your bundle! This bundle has a minimum CA$1.25 purchase.

Read them anywhere. The eBooks in this bundle are available in PDF and ePub formats, so they work on your computer, e-readers, iPads, cell phones, and a wide array of mobile devices!
Get started with the Go Programming Language with Microsoft Learn! (no experience needed)
Tags: programming, productivity, opensource, go
Published: 2021-04-26 19:30:02

---
title: Get started with the Go Programming Language with Microsoft Learn! (no experience needed) 
published: true
description: Learn how to get started with the Go Programming Language
tags: programming, productivity, opensource, go
series: "#GoLang For Beginners"
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gv08shytu5sw81c4pr8q.png
---

Hello everyone, 

I was recently thinking about trying out another programming language and landed on the Go Language developed by Google. I decided to learn it live on my Twitch stream and take advantage of 
[Microsoft Learn's](https://learn.microsoft.com) free, online training platform. What I enjoy about the learning experience is a mix of fun, guided, hands-on, and interactive content (such as quizzes and more). 

Pretty neat, huh?

You can checkout the video that I made showing this off in action or you can jump straight into [the module](https://docs.microsoft.com/en-us/learn/modules/go-get-started/) now.

This is what the module covers:

* Install and configure Go on your local workstation.
* Install and configure Visual Studio Code and the Go extension.
* Explore the Go Playground.
* Create your first Go application.

Video (12 mins)

{% youtube P_rwJDGy3Ng%}

Conclusion

Feel free to checkout my [Twitch streams](https://twitch.tv/mbcrump) as we learn about security and app development or you can watch the condensed version of all of my streams by subscribing to my [YouTube](https://youtube.com/mbcrump). 

Stay connected with me on social platforms for daily software development news.

-[Twitter](https://twitter.com/intent/follow?screen_name=mbcrump) | [Twitch](https://twitch.tv/mbcrump) | [Instagram](https://instagram.com/mbcrump) | [YouTube](https://youtube.com/mbcrump) | [GitHub](https://github.com/mbcrump) | [Website](https://www.michaelcrump.net)
Status instead of isLoading boolean?
Tags: react, javascript, webdev
Published: 2021-04-26 19:13:34

When I saw the article ['Stop using isLoading boolean'](https://kentcdodds.com/blog/stop-using-isloading-booleans) written by Kent C. Dodds my first thought was - what's wrong with `isLoading` boolean? Why shouldn't I use it? Then I read it. And saw his point.

It is a common practice to use `isLoading` boolean to show some placeholder or spinner when data in our app is loading. This is fine - you set `isLoading` to `false`, change it to `true` when data is loading and when data is here - put it back to `false`. But what happens when error occurs? Data is not loading but there is no data to show either. We start to add more conditions - first not loading and no error, then for not loading but with error, another one for loading. Do you see the point?

What Kent suggests in his approach is having status with different enum values for every case e.g. `'idle'`, `'resolved'`, `'rejected'`. In the code then we can go like (examples based on the article that I mentioned earlier):

```
if (status === 'idle') {
    return <div>Data is loading...</div>
}

if (status === 'resolved') {
    return <div>{Fetched data}</div>
}

if (status === 'rejected') {
    return <div>Something went wrong!</div>
}
```
Thanks to that we can set status for particular case after every activity and there is no need for double conditions (like is not loading and there is no errors etc). 

To get rid of equal signs we can put status info in variables.

```
const isLoading = status === 'idle';

if (isLoading) {
    return <div>Data is loading...</div>
}
```

And that's it! I recommend reading [Kent's article](https://kentcdodds.com/blog/stop-using-isloading-booleans) for deeper explanation and more examples.
How We Deploy React Native App | Hosting Services | Cloud Hosting Services | Free Hosting Services
Tags: reactnative, react, reactnativedeveloper, hostingservices
Published: 2021-04-26 18:42:09

{% medium https://author-adarsh1998.medium.com/how-we-deploy-react-native-app-hosting-services-cloud-hosting-services-5c93e18a1db6 %}
How does RxJs retry Work?  
Tags: rxjs, retry, operators, underthehood
Published: 2021-04-26 18:38:58

---
title: How does RxJs retry Work?  
published: true
description: What is the RxJs operator retry and how does it work? With examples and live code
tags: rxjs, retry, operators, underthehood
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/19a8iw4usd840i2u0ihk.png
 
---

Turns out, `retry` operator, like many others subscribes to the observable that it is applied on. What's different is that `retry` works on the `error` case. On the `error` case it re-subscribes to the source observable as many times as attempts it was given. 

So `retry(2)` will listen for error and retry once, then listen for another error and retry a second time and then on the third error it will give up and let the error bubble up to your error handler.

For more details, **code**, and step by step head over https://www.educative.io/edpresso/what-is-the-rxjs-retry-operator-and-how-does-it-work
Create a Solar-Powered Crypto Mining Rig with Raspberry Pi
Tags: python, raspberrypi, iot
Published: 2021-04-26 18:28:32

---
title: Create a Solar-Powered Crypto Mining Rig with Raspberry Pi
published: true
description: In a Hackster tutorial, we create a solar-powered cryptocurrency "mining rig" with cloud-based reporting on a Raspberry Pi using a PiJuice and Notecard.
tags: python, raspberrypi, iot
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mq8n87ldh5q0ivjkwo1r.jpg
---

Are you ready to cash in on this cryptocurrency thing, but also concerned about the electricity consumed in order to mine your own crypto?

**Well do I have the project for you!**

In this tutorial, we are going to build out a fully-featured cryptocurrency mining solution using:

- [Raspberry Pi 4](https://www.raspberrypi.org/products/raspberry-pi-4-model-b/)
- [PiJuice](https://uk.pi-supply.com/products/pijuice-standard) (for solar management and battery)
- [Notecard and Notecarrier-Pi HAT](https://blues.io/products/) (for portable cellular data)
- [Notehub](https://blues.io/services/) and [Ubidots](https://ubidots.com/) (for a cloud-based dashboard)

![pijuice and notecard](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sft14u6rkjgnpdgprnja.jpg)

Is this prospect of crypto mining with a Raspberry Pi as ridiculous as it sounds? Probably! But let's not let reason stop us from building something fun.

**Ready? Get started over at [hackster.io](https://www.hackster.io/rob-lauer/solar-powered-crypto-mining-with-raspberry-pi-64adee)!**
📢 EuroPython 2021 Call for Proposals
Tags: europython, cfp, conference
Published: 2021-04-26 18:15:36

###### (Original post: https://blog.europython.eu/europython-2021-call-for-proposals-open-cfp/)

We're happy to announce the [EuroPython 2021 Call for Proposals (CFP)](https://ep2021.europython.eu/events/call-for-proposals/) and are accepting proposals for talks, training sessions, workshops, panels, poster sessions, helpdesks and other interactive sessions at EuroPython 2021.

### 🗓 [CFP](https://ep2021.europython.eu/events/call-for-proposals/) Deadline: __Sunday, May 9, 23:59:59 CEST__.

To submit a proposal, please log in to the site (or create an account first) and then proceed to the [CFP page](https://ep2021.europython.eu/events/call-for-proposals/):

![ep cfp](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d1p6nnjqa3n4rdpx547x.jpeg)

---
 
# Topics
We're looking for proposals on all aspects of Python from novice to advanced level, including but not limited to: applications, frameworks, Data Science, internals or topics which you're excited about, your experiences with Python and its ecosystem and creative or artistic things you've done with Python.

EuroPython is a community conference and we're eager to hear about how you use Python in your professional and personal activities.

Feedback has shown that attendees are interested in advanced topics, we would like to encourage more submissions with an advanced level scope for EuroPython 2021. Please also note that we have added back training and workshop submissions. We had to remove those last year due to lack of resources.

# Speaker Mentoring Program
This year we are running a mentoring program to encourage more first time speakers to submit proposals, as well as provide training on delivering talks effectively. We are also looking for more mentors to help with the program.

Please check the [CFP page](https://ep2021.europython.eu/events/call-for-proposals/#Speaker-Mentorship-Program) for details on the mentoring program.

# Help spread the word
We encourage you to share details about our Call for Proposals with your colleagues, friends and social networks. Thanks.

Enjoy,
[EuroPython 2021 Team](https://ep2021.europython.eu/europython/team/)
[EuroPython Society](https://www.europython-society.org/)
[EuroPython 2021 Website](https://ep2021.europython.eu/)
React Context,  for Beginners
Published: 2021-04-26 18:01:30

Intro: 

Traditionally, if a developer wanted to share data through multiple components, that developer would have some parent component pass down said data to its child components via props. While this traditional, "props" approach is functionally sound, it may quickly become burdensome for larger applications who have several components, across multiple generations, that all need the same data - Solution: React Context.

What is Context?

Per React documentation, Context provides a way to share values between components without having to explicitly pass a prop through every level of the tree. In other words, Context is designed to share data that can be considered "global" for a tree of React components, such as the current authenticated user, theme, or preferred language.

What 2 things do you need to create Context?
- The actual context object
- A context provider component

Steps to create and use Context:

Step 1) Diagram of the state the components share - As you can see, we have several components that need access to the same data (user and theme)

Step 2) Create the context for our user data.
To organize our context code, make a new js file inside the /src/context folder to create context for specified data ex) user.
Create context by assigning variable to React.createContext()

Step 3) Setup "provider" component - This provider component will give its child components access to the context data

Step 4) Use the provider component to wrap around any component(s) that need access to the context (and remove any outstanding props from the components that were wrapped).
Inside App, wrap Header and Profile components with UserProvider:

Step 5) Use the useContext hook to access the context data from our components - This is another built-it React hook that lets us access the value of our context provider in any child component.

 A) Import the use Context hook
 B) Import the UserContext js file
 C) Call useContext with our userContext
 D) Use the user object as if it was passed as a prop

Step 6) Test out by updating the value prop in the context provider component to see that the child component has access to the updated data

React Recommendations - Use Context sparingly:
Context is primarily used when some data needs to be accessible by many components at different nesting levels. Apply it sparingly because it makes component reuse more difficult.

If you only want to avoid passing some props through many levels, component composition is often a simpler solution than context. - Before You Use Context

Resources
React Context
useContext
Using Composition Instead of Context
Spring Boot WebSocket with Angular 5 Client | SockJS + STOMP
Tags: springboot, websocket, angular, sockjs
Published: 2021-04-26 17:57:10

https://grokonez.com/spring-framework/spring-websocket/spring-boot-websocket-angular-5-client-sockjs-stomp

Spring Boot WebSocket with Angular 5 Client | SockJS + STOMP

The <strong>WebSocket</strong> protocol provides new capability for web applications: full-duplex, two-way communication. So in the system where the client and server need to exchange data at high frequency and with low latency, <strong>WebSocket</strong> is the best solution. In this tutorial, we're gonna create a Spring Boot Application that uses WebSocket protocol to communicate with Angular 5 Client.

Update: <a href="https://grokonez.com/spring-framework/spring-boot/angular-6-websocket-example-with-spring-boot-websocket-server-sockjs-stomp">Angular 6 WebSocket example with Spring Boot WebSocket Server | SockJS + STOMP</a>

<!--more-->

<h2>Spring WebSocket Application</h2>
<h3>Flow of messages</h3>
We create a <strong>Spring WebSocket Application</strong> with the flow of messages:

<img src="https://grokonez.com/wp-content/uploads/2018/05/spring-websocket-architecture-ws.png" alt="spring-websocket-architecture-ws" width="741" height="372" class="alignnone size-full wp-image-12620" />

- WebSocket clients connect to the WebSocket endpoint at <code>/jsa-stomp-endpoint</code>
- Subscriptions to <code>/topic/hi</code> pass through the <strong>response channel</strong>, then are forwarded to the In-memory broker (Simple Broker).
- User objects sent to <code>/jsa/hello</code> pass through the <strong>request channel</strong> then are forwarded to the spring <strong>WebController</strong>. <strong>WebController</strong> will handle <code>User</code> objects by <code>@MessageMapping</code> and transform  to <code>Hello</code> messages then use <code>@SendTo</code> returns the messages to <code>/topic/hi</code> through the <strong>brokerChannel</strong>.

<pre><code class="language-javascript">
@MessageMapping("/hello")
@SendTo("/topic/hi")
public Hello greeting(User user) throws Exception {
    return new Hello(...);
}
</code></pre>

- The <strong>Simple Broker</strong> broadcasts messages to subscribers through the <strong>response channel</strong>.

<h3>Server side</h3>
In server side, we use <strong>SockJS</strong> and <strong>STOMP</strong> for our application.

What is <strong>SockJS</strong>?
-> <strong>SockJS</strong> lets applications use a WebSocket API but falls back to non-WebSocket alternatives when necessary at runtime, without the need to change application code.

We create a simple Java configuration to enable <strong>SockJS</strong> and <strong>Stomp</strong> in Spring application:

More at:

https://grokonez.com/spring-framework/spring-websocket/spring-boot-websocket-angular-5-client-sockjs-stomp

Spring Boot WebSocket with Angular 5 Client | SockJS + STOMP
#RenderRoundtable: Keeping it Real with Angie Jones
Tags: javascript, react, career, news
Published: 2021-04-26 17:57:02

I wanted to start off by saying thank you all for the immense support you all have shown the #RenderRoundtable, hosted on [Twitter Spaces](https://help.twitter.com/en/using-twitter/spaces). Last week's conversation with [Angie Jones](https://angiejones.tech) was nothing short of amazing!

This past Thursday [Angie](twitter.com/techgirl1908) talked to us about her journey in technology, both as a Master Inventor and Java champion, as well as in her current position in Developer Relations. But, what we weren't expecting was such a candid conversation about authenticity, accountability, and representation in the workplace, alongside a valuable discussion on how delivering on her promises technically and professionally has "set her free." 

As Angie said: *"Now that I've had a taste of bringing my whole self to work, there's no going back!"* And that is exactly what we mean when we say [Render-Atlanta](bit.ly/3etgr5N) is about culture: Our goal is pioneering a movement that enables us to escape the feeling of needing to hide who we *really* are. 

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

So this Thursday we've decided to put ourselves in the hot seat to better answer your questions about any and everything Render and to talk about all of the *amazing* things we have planned for you guys.  Be sure to follow us on [Twitter](twitter.com/renderatl), and check out our [website](renderatl.com) for more information on how to tune into Spaces this Thursday at 7:00 pm EST.

*And did I mention we've got some goodies to give away?*

We absolutely can't wait to see everyone in September, and if you haven't already, don't forget to grab a [ticket](https://ti.to/render-atlanta/Tickets)! Not only do they grant you admission, all tickets include three delicious chef-cooked meals a day (check out our [menu](https://www.renderatl.com/food)!), and an open bar in the evening. 

If you've loved the #RenderRoundtable, you'll also love our awesome lineup of over 25 [speakers](https://www.renderatl.com/speakers). Get your ticket before they're all gone!

Until next time!