teleren/devto huggingface dataset:
Stress and cherry pick free hot fix deployments
Published: 2019-11-08 12:05:26

Git is an amazing tool, incredibly flexible and extremely capable. It’s a shame that Linus Torvalds will be remembered mainly by Linux, because in fact git is probably a much more used tool than Linux itself.

Regardless of that, git flexibility also imply that sometimes we can over complicate things, and one of the scariest things is the releasing process and the scariest of all scenarios: the hotfix.

Well, fear no more, I have a better solution for you for those hotfix releases.

The recommendation from git itself is normally to do a cherry pick. However, and in my experience, that results in uncountable headaches and problems with conflicts and what noes, and scare the most senior of the developer, not to even mention to hand this over to a less experienced member just when the senior is on holidays (hey, security releases, I’m looking at you).

A better approach? Well, something native to git itself and closer to the way we are used to work daily: branches.

The approach we’ve been taking since a few projects is to create a release branch, say release-v1.0. Once that branch is created, then you can create a tag from that branch. The advantage? Huge. Whenever you need to do a hotfix, you won’t need to over complicate with cherry picking or what else, you simply open in your preferred tool a PR against the release branch, and simply create another release from that branch.

That approach allows you to continue working on develop, keep a version of your prod safe in that release branch, and if the worst happens, you can simply open a PR against it, cut a new release tag, and the release to prod (of course testing first in stage).

I’ll work on some graphs to make this process more clear… if there is any interest on this :-)

What do you think about this approach? Feel free to leave your opinions.
Why Data Science
Published: 2019-11-08 11:52:16


##**Finding what people really want is one important thing I care about.**

I have been a software and mechanical engineer. As an engineer, I tried to make sure the products meet the needs of my users as much as possible. When interviewing users and analyzing their requirements, I got the problem. It seems difficult for people to clearly say what they need and what they really want. There is a big gap between what people said and what they really want. Data science is a powerful tool to discover the real needs of people. 


##**Asking, “Why?” is the key to everything.**

Data science is the study of data. Data analysis is a process with the goal of discovering useful information, informing conclusions and supporting decision-making. Effective analysis requires obtaining relevant facts to answer questions and support a conclusion or opinion. These insights help people to make powerful data driven decisions.
Here is a list of data science deliverables: Prediction, Classification, Recommendations, Pattern detection and grouping, Anomaly detection, Recognition, Actionable insights, Automated processes and decision-making, Optimization, Forecasts.
Whatever questions you may have, data science could provide an objective opinion.


Data science is becoming pervasive across so many industries. Data science can be applied to many different domains. It is widely used in e-commerce industries, banking, health-care, even film industry.


##**In the future**
I would like to apply data science to the mechanical engineering field such as machine monitor, production forecast, failure prevention, improve reliability, and warranty analysis.In automated production, collecting and monitoring data allows us to replace components and maintenance machinery at the proper timing to optimize our productivity.



*Photo by [Vlad Tchompalov](https://unsplash.com/@tchompalov?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText) on [Unsplash](https://unsplash.com/)*
Appsinvo : Top Mobile App Development Company in India and USA
Published: 2019-11-08 11:36:50

Appsinvo, a high rated mobile app development company in India, is well known for building innovative applications.

Appsinvo delivers its services to offshore and onshore countries. Till now Appsinvo has served 12 countries and developed 300 plus apps for many industries, startups, and verticals since 2015.
With our years of experience team in this field, we build a comprehensive, unique and impeccable app by focusing targeted audience.

Yes with the help of our lucrative team of designers and developers we delivered many fascinating applications till now.

Contact Us		
Company  : Appsinvo Pvt. Ltd.
Address	 : B-25, B Block, Sector 2, Noida, Uttar Pradesh 201301
Mobile 	 : +91-9971531430
Email Id : info@appsinvo.com
Website  : https://www.appsinvo.com/
           https://www.appsinvo.com/service.php
           https://www.appsinvo.com/contact.php
           https://www.appsinvo.com/blog/
Canon Printer Not Responding Windows 10
Tags: computer
Published: 2019-11-08 11:16:41

In most cases, the major culprit behind printer not responding error is a lack of communication between your PC and printer. If that is the issue, then below are a few steps that might help you to resolve the issue. <a href="https://www.canonprintersupport247.com/blog/fix-canon-printer-not-responding-error/">Canon Printer Not Responding Windows 10</a>
Testing A Function That Calls Go Routine
Tags: go, testing
Published: 2019-11-08 11:15:02

Okay so I've been trying to test a function that calls a routine and I found no solution that fits my taste. This is fairly simple, although some  won't like it. Imagine you have a function like this.
```golang
package main

import "fmt"

type printer struct{}

func (p printer) HelloWorld() {
  fmt.Println("Hello, world!")
}

type asyncPrinter struct{
  p printer
}

func (ap asyncPrinter) HelloWorld() {
  go ap.p.HelloWorld()
}
```

Now, if you test this the 'usual' way, it won't wait for the go routine. For example:
```go
package main

import "github.com/stretchr/testify/mock"

type printerMock struct {
  mock.Mock
}

func (pm printerMock) HelloWorld() {
  pm.Called()
}

func Test_AsyncHelloWorld(t *testing.T) {
  pm := printerMock{}
  ap := asyncPrinter(pm)

  pm.On("HelloWorld")
  ap.HelloWorld()
  
  pm.AssertExpectations(t)
}
```

This will sometimes fail, the other time will pass. To 'trick' it some will suggest waiting in test. For examples:
```go
package main

import (
  "time"

  "github.com/stretchr/testify/mock"
)

type printerMock struct {
  mock.Mock
}

func (pm printerMock) HelloWorld() {
  pm.Called()
}

func Test_AsyncHelloWorld(t *testing.T) {
  pm := printerMock{}
  ap := asyncPrinter(pm)

  pm.On("HelloWorld")
  ap.HelloWorld()
  
  time.Sleep(1 * time.Second)
  pm.AssertExpectations(t)
}
```
Yes, it works! But we don't know how long we should wait till the go routine finish. The way that I like to do it is to use wait group and help of test variable. Take a look at the code:
```golang
package main

import (
  "fmt"
  "sync"
)

var testMode bool
var wg sync.WaitGroup

type printer struct{}

func (p printer) HelloWorld() {
  fmt.Println("Hello, world!")
}

type asyncPrinter struct{
  p printer
}

func (ap asyncPrinter) HelloWorld() {
  if testMode {
    wg.Add(1)
  }
  go ap.p.HelloWorld()
  if testMode {
    wg.Wait()
  }
}
```
This way, we can now simply write test that calls wg.Done() on method call. For examples:
```go
package main

import (
  "sync"

  "github.com/stretchr/testify/mock"
)

type printerMock struct {
  mock.Mock
}

func (pm printerMock) HelloWorld() {
}

func Test_AsyncHelloWorld(t *testing.T) {
  pm := printerMock{}
  ap := asyncPrinter(pm)

  testMode = true
  pm.On("HelloWorld").Run(func(){
    wg.Done()
  })
  ap.HelloWorld()

  pm.AssertExpectations(t)
}
```

Voila! You don't have to worry about slow test because of time.Sleep()!


DISCLAIMER: I haven't run code written here, you might need a little bit adjustment.
API versioning; how SLOs help teams; & tidying up your code
Tags: todayilearned, programming, beginners
Published: 2019-11-08 11:00:23

*TL;DR style notes from articles I read today.*

### [Introduction to API versioning best practices](http://bit.ly/2WSCdoV)

- Most companies modify path parameters when approaching API versioning. 
- Google prefers a numbered versioning. Twilio uses a timestamp in the URL. Salesforce opts for vXX.X in the middle of the URL. Facebook goes for prepending the version to the endpoint path. Badoo opts for continuous versioning where features are added and endpoints stay the same. 
- Header exchanges are a common alternative to path parameters. 
- Another option is to keep a single unchanging URI with just one set of criteria for consumption. 
- All new API versions should be backward compatible. There should be rich documentation for new versions to enable successful transition too. 

*[Full post here](http://bit.ly/2WSCdoV), 7 mins read*

---

### [SLOs are the API for your engineering team](http://bit.ly/33uW9R5)

- SLOs (service level objectives) help you invest in your team's ability better to meet the agreed-upon goals.
- SLOs help you push back when demands exceed your capacity to deliver.
- SLOs ensure consistent & predictable delivery. 
- SLOs enable better decisions based on real data without wasting time on debating.

*[Full post here](http://bit.ly/33uW9R5), 9 mins read*

---

### [Does this code spark joy? Tidying up your code bit by bit](http://bit.ly/34F8Okt)

- Messy code can result in bugs, prolonged development time, or increased difficulty with onboarding new engineers.
- Tidying means making purely structural changes to a confusing and messy section of code.
- Use helper methods and differentiate between sections of code that are accomplishing different tasks.   
- Ensure your tests pass at all times when making changes.

> “Divide your program into methods that perform one identifiable task. Keep all of the operations in a method at the same level of abstraction.” - Kent Beck

*[Full post here](http://bit.ly/34F8Okt), 5 mins read*

---

*[Get these notes directly to your inbox every weekday by signing up for my newsletter, in.snippets(), here.](https://mailchi.mp/appsmith/insnippets?utm_source=devto&utm_medium=post08&utm_campaign=is)*
#codevember — 5 — Light 💡🔦
Tags: codepen
Published: 2019-11-08 10:52:00

---
title: #codevember — 5 — Light 💡🔦 
published: true
tags: codepen
---

<h1>codevember 2019 day 5 Light from <a href="https://www.youtube.com/watch?v=JQ-jNMUxMas" target="_blank">https://www.youtube.com/watch?v=JQ-jNMUxMas</a></h1>

{% codepen https://codepen.io/trinketmage/pen/vYYjPoJ %}
The real challenges of using Mac Catalyst
Published: 2019-11-08 10:30:30

#Introduction
In our latest project we tried to leverage the abilities brought by Mac Catalyst to make our iOS app Mac-compatible. However simple it was announced, the reality was and still is covered in pitfalls and challenges. In this post we'd like to share key insights and learnings, which we had porting our app. We are still looking for answers and are excited to get more input from this great community.

##Adapt your information design
Working on a desktop app is fundamentally different from working on  mobile devices. The way we interact with our environment, where we look for information and where we use the app have a massive impact on the overall app design and its information structure. We started with mobile-only designs and had to learn, that it's not quite that simple to bring it to macOS. Here are some implications which need to be reflected in the information architecture of your designs:
- You will need an iPad app as a stepping stone from iOS to macOS. There is no way to avoid that step. 
- Desktop navigation happens mostly at upper part of your screen or its window margins. Did you consider putting your commands and actions into the **main menu, a toolbar or sidebar**? Did you design for segments instead of tabs?
- Mobile apps usually hide information until it's needed. Desktop resolution allows for showing more data or hide it in context menus or the menu bar. Did you rethink where the user finds all available information in a desktop-friendly way?

Let's look at the example of the new JIRA macOS app:

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/z27j2z0vqlm5yilmcntf.jpg)

##Make all components and actions Mac-compatible
Apps can make use of various UI elements, such as dialogs, prompts and push notifications. It is crucial to check whether all of these work as expected when being ported by Mac Catalyst.

##Add click capabilities
Most of the native iOS components map touch handlers to click handlers. However, we have designed our own complex components building on a bottom-sheet navigation and touch-optimizing all user inputs in there. For cases like this, it makes sense to double-check all event handlers and test their "clickability". Does the click event handler return the same object and data than the touch event handler?

##Connect menu commands to React code
To follow the Apple-given guidelines for an optimal Mac integration we need to write Swift code. For instance, we do need to put in menu commands which functionality is coded in React Native classes but called in a Swift file in Xcode. Bridging React code and native code is essential. 

___
We will update this article continuously and add new insights and code examples, once we fix some fundamental building issues. We appreciate all help solving a problem, which stops us: [Undefined symbols for architecture x86_64 React Native 0.61.2](https://github.com/facebook/react-native/issues/27166)
That's why your Angular Interceptor may NOT WORK! 😥 [5 seconds fix]
Tags: angular, webdev, javascript
Published: 2019-11-08 09:39:45

---
title: That's why your Angular Interceptor may NOT WORK! 😥 [5 seconds fix]
published: true
description: 
tags: angular, webdev, javascript
---
**EDIT**: This problem does not occur when you import `HttpClientModule` only ONCE in the `AppModule` or `CoreModule` (and import the `CoreModule` into `AppModule`). Huge Kudos to [@joekaiser](https://dev.to/joekaiser) for spotting the issue! 🙏🙏🙏

---

It's time for another **Angular Knowledge Pill**!
It takes just a couple of seconds to learn something new 🔥
Like taking your morning vitamins 😃

**👉 Angular creates a new Dependency Injector for a lazy-loaded module!**

So what!? 🤐 For example, your HttpErrorInterceptor (or TokenInterceptor) may not work as you expect! Let's take a closer look. We have three modules _CoreModule_, _AuthModule_, and _ExpensesModule_. The first two modules are NOT lazy-loaded and register interceptors. The third, ExpensesModule is lazy-loaded and uses HttpClient to execute HTTP requests.

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/4oskz35543ejx1zukoxq.png)
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/ksdpu27v2dqtmlfdnezf.png)
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/xj0m1r9b4ghdga74lqq8.png)

**The solution 👉 @SkipSelf()**

Now, if we have ExpensesModule (lazy-loaded) and if we don't use **@SkipSelf()** when injecting HttpClient into a provider (here ExpenseApi), Angular will create a new instance WITHOUT previously registered HttpInterceptors - Error handling will not work! 🤦‍♂️ Take a look at how to tell Angular not to create a new instance of a provider in the lazy-loaded module!

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/2owowa4ipg381foi02fp.png)

That's it! Problem is fixed! Your Interceptors are working properly 💪.

---

If you would like to receive this kind of knowledge pills directly into your mailbox, subscribe at [angular-academy.com/blog/](https://angular-academy.com/blog). I will be sending them regularly! Remember, it just takes 10 seconds to learn something new! 😃
New deadline for Product Advertising API deprecation
Tags: productadvertisingapi, amazon, api
Published: 2019-11-08 09:18:19

---
title: New deadline for Product Advertising API deprecation
published: true
description: Amazon has made a decision to push back API deprecation deadline, but did it privately... again.
tags: product-advertising-api, amazon, api
canonical_url: https://fbacatalog.com/blog/new-deadline-pa-api-deprecation.html
---
[As I previously announced](https://fbacatalog.com/blog/new-product-adveritising-api.html), Amazon was planning to deprecate PA-API version 4 on 31 October 2019. But that didn't happen and the deadline has been pushed back.

Amazon keeps tradition of secrecy on this API transition. To this date not a single company representative officially commented in support forums and we have seen zero public announcements, besides those details provided in [documentation for new API](https://webservices.amazon.com/paapi5/documentation/).

In a private communication, some of the biggest Amazon partners that rely on PA-API have received a heads up that deprecation will be postponed. But they made them sign NDA, justifying this by the push to get everyone off older API as fast as possible.

PA-API has a huge history of abuse by people that scrape Amazon for data. And last year changes have been mostly aimed to tame all the abusive behavior. This migration to new API is not an exception -- biggest features have been improved security and even further limits to grab big chunks of data at once.

![leaked photo from Amazon Associate event in Munich](https://fbacatalog.com/images/munich-event.jpeg)

We've found leaked photo from Amazon Associate event in Munich (hence the German language) that suggest that **deprecation has been pushed back to 14 January**. There seems to be a typo in the year, but our private sources have confirmed this date.

This push back, makes a lot of sense -- it would not be reasonable to do such huge change during biggest sales season. So let's breathe calmly here, we have some time to migrate our websites and apps.

Thanks to Amazon for that!
How to encrypt a string in Java using RSA and decrypt it in Python
Tags: encryption, java, python, rsa
Published: 2019-11-08 08:59:45

---
title: How to encrypt a string in Java using RSA and decrypt it in Python
published: true
description: Recently at work, I was tasked to write a Java program which would encrypt a sensitive string using the RSA encryption algorithm. The encrypted string would then be passed on to a client over public internet. The client would then use the private key to decrypt the message. But the client is written in Python.
tags: encryption, java, python, rsa
cover_image: https://thepracticaldev.s3.amazonaws.com/i/0ihn2rt59mkb7s8nxp40.jpg
---

Recently at work, I was tasked to write a Java program which would encrypt a sensitive string using the RSA encryption algorithm. The encrypted string would then be passed on to a client over public internet. The client would then use the private key to decrypt the message. But the client is written in Python. So I have to make sure the encryption and decryption wok as expected. And as always, I wrote POCs for both. And here, I’m going to document that.

<b>Creating the key pair</b>

Before we can start the encryption, we need to have a key pair. A key pair will have a public key and a private key. The public key, as the name suggests, is public. You can share it with anybody who wishes to send you an encrypted text. They will encrypt the original text using this public key, and send over the encrypted text to you. You can then use the private key that only you have to decrypt the text. You’ll get the original message back this way.

So to start the process, we need to first generate the key pair. For this, we’ll use the very popular tool, openssh. You’ll need a terminal for this though. So open up your terminal and run the following command:

```openssl genrsa -out privateKey.pem 2048```

The command above will create a private key file – privateKey.pem. You can rename this to whatever you want, or you can change the value of the -out option in the command to create the file with any name you want.

Once you have this private key, we need to create a public key that goes with this. For this, we’ll run another command (given below), which will generate a public key. Again, you can change the value of the option -out to name the file whatever you want.

```openssl rsa -in privateKey.pem -outform PEM -pubout -out public.pem```

That’s it. You now have a key pair which we can use in our code.

Please continue reading this post on <a href="https://blog.contactsunny.com/tech/how-to-encrypt-a-string-in-java-using-rsa-and-decrypt-it-in-python" target="_blank">my personal blog</a>.
How to rapidly update your React Native android project using Code Push without app store upload
Tags: android, reactnative, codepush, javascript
Published: 2019-11-08 08:16:57

These days React Native has become so popular among developers. React Native lets us to develop mobile applications that technically are able to run on Android and IOS platforms. 

When you built your app and everything is ready for publishing it,
you have to submit your app in the app store and wait until they review and publish it for you. There are some cases that you need immediately update your app. For example, there is a critical bug in your release version.

In this case, you should build another version and submit it and wait for the review process. Plus, most users do not update their applications immediately. So these users will face errors and unluckily some of them will write bad reviews for your application. 

Fortunately, Code Push library has solved this problem for our react native developers. While your application support code push, there is a way to update your app without sending any file to the app store and even your users don't need to update your application.

All the instructions for implementing Code Push library into your project have been described in my youtube channel. 

{% youtube Jo7AV5etOsA %}
How to start freelancing as a beginner?
Tags: discuss, webdev, career, beginners
Published: 2019-11-08 08:12:28

Hey there!

I started with WebDev roughly 1 year ago and buy now I would say that I'm familiar enough with React, CSS and HTML to build small websites (blogs, landing pages, newsletter subscription etc.) for small clients.

But how do I start?
How does one price his services? 
What about the hosting? If I host the stuff by my own Netlify (or similar) account, it will eventually increase my own bill rather than the customers. Do I help them configure their own hosting accounts?

I just want to build stuff the people need and sell it to them for a price that satisfies my relatively low needs and is also not to expensive for the clients.
I'm afraid that building stuff and hosting it on my own pushes me into some maintaining role with consistent and monthly billing of service fees or stuff like that.

So, how do you do that?

I would love to hear your experiences!
What are your favorite analogies to explain programming?
Tags: explainlikeimfive, discuss, watercooler, beginners
Published: 2019-11-08 08:03:49

Hello,

I am giving a workshop on Sunday. 
The goal is to try to give complete beginners a less wrong idea of what programming is all about.

Not a small challenge given that for my students, programming looks like something aliens do. 

Heck, even the majority of companies hiring developers don't really understand programming either! See how they make us solve algorithms on a whiteboard, put us in noisy open offices and make sure to kill our focus with unhelpful meetings and constant interruptions on Slack. 

So my question: 

> What are your favorite non-technical analogies to explain programming?

I'm interested in good analogies AND in the popular but really helpful ones - like Hollywood describing us as doing magic on a screen or recruiters thinking we are Ninja Rock Stars.