teleren/devto huggingface dataset:
Solving Over 35 performance Issues in React Native
Published: 2017-11-28 14:12:49

---
title: Solving Over 35 performance Issues in React Native
published: True
description: Learn how you can improve react native app's performance. Understand major issues and app optimization that can be done on react native applications.
tags:  
---

React Native lets you build mobile application with its declarative programming model, and that makes React Native awesome. 

but often people complain a lot of performance issues. Most of the time, these issues can be easily resolved though. 

We did an analysis, and handpicked some common [React Native performance issues](https://www.simform.com/react-native-app-performance/) which you should know before starting with React Native. Like:

- Memory leakage in React Native

It’s a common issues for applications with a lot of unnecessary background process running in the background

- Javascript threads, and heavy CPU usage

React Native applications have multiple threads which are interconnected. The native thread has to be in sync with the Javascript thread. While synchronisation, the large objects creates heavy usage on the CPU.

Learn its impact on your application, and how to reduce the CPU usage and improve the performance.


- Application size

Applications rely on third party libraries, API, and other sources to operate. These resources need to be optimised in order to minimise the size of your application. 


- Issues in Navigation components

Almost 9 out of 10 developers complain about performance issues when they implement navigation components. Learn more about the issue and how to improve it.


- Slow app launch time

There are number of factors which impacts the app launch time, and it’s a continuous cycle to minimizing the dependencies and improving the overall performance.

- Device orientation changes 

Sometimes the application freezes when you change the orientation i.e. from landscape to portrait. See what affects the application and how to solve the issue.

And so many other issues like: 

- Issues while animating the image size for different UI view
- Lack of multithreading support
- Issues with infinite scrolling
- Image caching and optimisation
- Issues with image placeholders
- Issues while using third party libraries
- Map optimisation issues
- API JSON data optimisation
- Frozen UI
- Working with animations
- Slow app response for keyword popups.


I have made an extensive analysis of these issues(over 35) and have put together insights on improving it.

---
You can read a more comprehensive version of this post that goes into extreme details here [React Native Performance issues](https://www.simform.com/react-native-app-performance).


Feel free to share your thoughts and [reach me](mailto:purvak@simform.com) if you have any questions.
RxJava combineLatest quick example by Kotlin
Tags: kotlin, rxjava, android, java
Published: 2017-11-28 11:57:13

---
title: RxJava combineLatest quick example by Kotlin
published: true
description: 
tags: [Kotlin, RxJava, Android, Java]
---

RxJava's `combineLatest` is very convenient but I can use it difficultly because it has many overloads.
So I wrote the code snippet for `combineLatest`.

```kotlin
val name = PublishSubject.create<String>()
val age = PublishSubject.create<Int>()

// Can not omit Type parameters and BiFunction 
Observable.combineLatest<String, Int, String>(
        name, age, BiFunction { n, a -> "$n - age:${a}" })
        .subscribe({
            Log.d("combineLatest", "onNext - ${it}")
        })

// If you introduce RxKotlin then you can use type inference
Observables.combineLatest(name, age) { n, a -> "$n - age:${a}" }
        .subscribe({
            Log.d("combineLatest", "onNext - ${it}")
        })

// Also we can use Observable array for 1st parameter 
// but second parameter to be array, it's not cool.
Observable.combineLatest(arrayOf(name, age), {
    val n = it[0] as String
    val a = it[1] as Int
    "$n - age:${a}" })
        .subscribe({
            Log.d("combineLatest", "onNext - ${it}")
        })


name.onNext("saito")
age.onNext(24)
name.onNext("yoshida")
```

* [ReactiveX/RxJava: RxJava – Reactive Extensions for the JVM – a library for composing asynchronous and event-based programs using observable sequences for the Java VM.](https://github.com/ReactiveX/RxJava)
* [ReactiveX/RxKotlin: RxJava bindings for Kotlin](https://github.com/ReactiveX/RxKotlin)
Why's there so much hype around React.js?
Tags: discuss, javascript, webdev
Published: 2017-11-28 11:24:35

---
title: Why's there so much hype around React.js?
published: true
description: 
tags: discuss, JavaScript, web-development
---

When seeing https://dev.to/itsjzt/why-there-is-so-much-hype-around-doing-things-in-javascript-8ne I as a web developer immediately got another question in mind:

**Why is there so much hype around React.js?**

Yes, typically people argue with Facebook as a big backer and the nowadays tremendous ecosystem. But a big part of this ecosystem for example tries to solve problems that only exist because of React. The way it works seems to be completely contrary to existing web technologies, so that more and more convenience libraries are written to make things work in React, that already would work without it. React is also neither the fastest nor the most convenient way to do componented web applications. It's speedy but also not the fastest in rendering. 

So what's it that draws people to it?
Beginners guide to markdown.
Tags: beginners, webdev, introduction, tutorial
Published: 2017-11-28 10:00:53

---
title: Beginners guide to markdown. 
published: true
description: learn markdown with ease.
tags: beginners, webdev, introduction, tutorial
---

![Hero Image](https://cdn-images-1.medium.com/max/800/1*G0YcQMGtG6jWgq6xIQ1BnQ.png)
if you don't listened about markdown, then markdown is a clean and better way of writing online. You can easily export it to other formats like docx, PDF, HTML, etc.
Markdown is simple text format with some syntax so you don't need any special tool for writing markdown.

**Quick fact**: We use markdown to write posts on [Dev.to](https://dev.to)
**Blog link**: [Beginner Guide to Markdown](https://medium.com/@itsjzt/beginner-guide-to-markdown-229adce30074)
Imposter Syndrome: PHP Edition
Tags: php, impostersyndrome, webdev, career
Published: 2017-11-28 03:33:58

---
title: "Imposter Syndrome: PHP Edition"
published: true
description: 
tags: PHP, Imposter Syndrome, Web Dev, Career
---
![cartoon](https://thepracticaldev.s3.amazonaws.com/i/tvhkb9ezs40obddvnshp.jpg)

Have you seen this cartoon before? The Lisp panel is especially ((((((hilarious)))))).  It is fun to mock each eccentricity of a programming language. Unless you are a PHP developer. Apparently, PHP isn’t uniquely flawed like all programming languages, it is just suicidal.

Programming is an amazingly cliquish community. Every developer has a preferred language with philosophical reasoning or performance rankings to back up the choice. I love the variety we have when picking a technology, it keeps the industry exciting and nimble. However, I hate all of the constant derision that many programmers throw at languages they don’t use. I’m guilty. “I hate JavaScript, callback hell is the worst”, “Ruby is just weird”, “C# is for Microsoft groupies”  are all sentiments we have heard or thought ourselves. These negative thoughts are born from a lack of understanding of the technology or through an insecure need to validate whatever tool the programmer is already using. In particular, PHP has been the constant butt of the joke.

I started using PHP a couple years ago and currently use it in a full time position. PHP definitely has its flaws, like every other programming language, but I still enjoy its simplicity, development speed and open ecosystem. What I didn’t expect to find when starting PHP, is the constant derision of the language from other programmers and even non-technical people. “I’m Andrew, I mostly use PHP” / “Oh wow, I’m sorry” is a common verbal exchange. After enough of these conversations, the negativity starts to affect you.

> **Impostor syndrome** is a concept describing individuals who are marked by an inability to internalize their accomplishments and a persistent fear of being exposed as a "fraud”. ~ Wikipedia

Guess who got imposter syndrome? It is really easy to get imposter syndrome when you constantly feel like you need to learn another programming language. It does not matter if you create a successful app in PHP or your contributions are valued by a company. Your next thought will be “I should have written the app in Java”.

One of the cures for imposter syndrome is accepting your own accomplishments and valuing your own expertise. Therefore, I want to spread the word. **If you have written an app that is valued by a company, is secure and is easy to maintain, then you are successful, no matter the programming language.** If you are a budding PHP developer, don’t be discouraged by all the negativity, just build something great. If you don’t use PHP, I encourage you to look at all the web apps built in the language and give it a chance. Maybe it won’t be so bad after all: [PHP: The Right Way](http://www.phptherightway.com/).
require('./opencv.js') is not enough for using OpenCV.js
Tags: javascript, emscripten, opencv, node
Published: 2017-11-28 03:27:08

---
title: require('./opencv.js') is not enough for using OpenCV.js
published: true
description: javascript,opencv
tags: javascript,emscripten,opencv,node
---

# Begin

I noticed that I can use official OpenCV with JavaScript(WASM).

- https://docs.opencv.org/3.3.1/d4/da1/tutorial_js_setup.html


# The problem

When I wrote code following:

```js
const cv = require('./opencv.js');

let mat = new cv.Mat();
console.log(mat.size());
mat.delete();
```

Unfortunately I've got only error messages like this:

```txt
TypeError: cv.Mat is not a constructor
    at Object.<anonymous> (/Volumes/EXTHDD3/local/opencv/build_wasm/bin/dame.js:3:11)
    at Module._compile (module.js:641:30)
    at Object.Module._extensions..js (module.js:652:10)
    at Module.load (module.js:560:32)
    at tryModuleLoad (module.js:503:12)
    at Function.Module._load (module.js:495:3)
    at Function.Module.runMain (module.js:682:10)
    at startup (bootstrap_node.js:191:16)
    at bootstrap_node.js:613:3
```

# Solution 1

I think I need some wait, and I rewrite the code following:

```js
const cv = require('./opencv.js');

setTimeout(()=>{
        (()=>{
                let mat = new cv.Mat();
                console.log(mat.size());
                mat.delete();
        })();
},10000);
```

This time,there is no error message.

```txt
{ width: 0, height: 0 }
```

# Solution 2

Solution 1 is not goot at looking, and depends on CPU's speed.

I found that Emscipten will call onRuntimeInitialized when it's ready to call main function.


```js
const cv = require("./opencv.js");
cv['onRuntimeInitialized']=()=>{
          let mat = new cv.Mat();
          console.log(mat.size());
          mat.delete();
};
```

```txt
{ width: 0, height: 0 }
```
What NodeJS SQL Query Builder/ORM should I use for my Postgres DB, and why?
Tags: discuss
Published: 2017-11-28 00:29:57

---
title: What NodeJS SQL Query Builder/ORM should I use for my Postgres DB, and why?
published: true
tags: discuss
---

I am migrating a project from Google Cloud Datastore, and since I am mucking with it anyway I decided I want to move to PostgreSQL because my project better fits a relational model. 

The state of Node ORMs seems a bit weak, at least from the last time I had to use Sequelize about a year ago. Documentation was spotty and frustration abounded. The comparisons I can find right now seem to indicate that Sequelize is actually my *best* option. Can anyone suggest alternatives? Are query builders like Knex better-supported?
CLI tool to visually see disk usage in Linux and OSX
Tags: osx, cli, utility
Published: 2017-11-27 20:41:39

---
title: CLI tool to visually see disk usage in Linux and OSX
published: true
description: OSX + brew + ncdu = awesome
tags: osx, cli, utility
---


[murze.be](https://murze.be/view-disk-space-usage-on-ubuntu) just published an article about the `ncdu` utility for linux. It is a cli based disk usage tool. Super handy. So I thought I would see if OSX had it as well. Awesomely it does!

 - `brew install ncdu`
 - `cd ~/{wherever you want to, probably a project root}`
 - `ncdu`
 - Collect bacon!

![](https://thepracticaldev.s3.amazonaws.com/i/j4txwr8erbggr6nadv0q.png)
A Simplified Interpretation of Algorithms
Tags: algorithms, coding, programming, webdev
Published: 2017-11-27 20:00:27

---
title: A Simplified Interpretation of Algorithms
published: true
description: A Blogpost about Algorithms
tags: Algorithms, Coding, Programming, web development
---
As a Software Engineer, the hardest concept for me to understand is Algorithms. Since I do not have a traditional CS background, I have never learned about Algorithms until I started prepping for technical interviews. In fact, very few technical programs/bootcamps focus on teaching students Algorithms.
In order to become comfortable with Algorithms, I googled online, attended meetups, and attended a Girl Develop It workshop called Introduction to Algorithms. This workshop really helped me understand Algorithms more clearly and I want to share with you what I learned.

###What is a Algorithm?

An algorithm is a repeatable process for determining the solution to a problem. An example is show below:

![Alt text of image here](https://thepracticaldev.s3.amazonaws.com/i/077eo0a118adavtpf7ua.png)


###Do we use Algorithms daily?


We actually do. Here are some ways we use Algorithms on a day to day basis:

* Find a cereal in the grocery store.
* Re-organizing your closet to make finding stuff easier.
* Finding something good to watch on TV.


In fact, let’s use watching TV as an example. There are several ways we find something to watch on TV. Here is one approach:


**Finding something to watch on TV: Version 1 (v1)**

1. Turn on TV.
2. Watch what is on.

![Alt text of image here](https://thepracticaldev.s3.amazonaws.com/i/0yn6pio6x7pu8268x30o.png)


Another approach is:


**Finding something to watch on TV: Version 2 (v2)**

1. Turn on TV.
2. Flip through every channel and rate what is on.
3. Find the highest rated channel.
4. Watch

![Alt text of image here](https://thepracticaldev.s3.amazonaws.com/i/8e8x66lpx2glgt5ekv2x.png)


Here is another way as well:


**Finding something to watch on TV: Version 3 (v3)**

1. Turn on TV.
2. Check 5 favorite channels and rate what is on .
3. Find the highest rated channel
4. Watch

![Alt text of image here](https://thepracticaldev.s3.amazonaws.com/i/ttnnklpyd9xhn0kjmqyd.png)


As you can see there are several ways to finding something to watch on TV and the same goes for solving an Algorithm.


So the goal of Algorithms is to solve a problem in a repeatable way. What I touch upon in this blog post is just the tip of the iceberg. There is much more to come. I plan on writing a series of blogposts regarding Algorithms and will go in further detail about Data Structures, Time Complexity, Big O Notation, and various sorting methods.
Data Science Workflows Using Docker Containers
Tags: docker, tutorial, python, datascience
Published: 2017-11-27 18:22:32

---
title: Data Science Workflows Using Docker Containers
description: This talk covers the basics of Docker; discusses how containers fit into Data Science workflows; and provides a quick-start guide that can be used as a template to create a shareable Docker image!
tags: docker, tutorial, python, datascience
canonical_url: https://www.youtube.com/watch?v=oO8n3y23b6M
cover_image: https://thepracticaldev.s3.amazonaws.com/i/f4rmgjxdd6iurstqaai9.png
published: true
---

I gave a talk last month on how to incorporate Docker into Data Science projects.

{% youtube oO8n3y23b6M %}

Slides are available at http://bit.ly/docker-for-data-science
Link to my blog: https://alysivji.github.io
Running Sidekiq On Heroku Free Dyno With Puma
Tags: heroku, sidekiq, puma, ruby
Published: 2017-11-27 17:55:22

---
title: Running Sidekiq On Heroku Free Dyno With Puma
published: true
description: Running Sidekiq On Heroku Free Dyno With Puma
tags: heroku, sidekiq, puma, ruby
canonical_url: https://bilalbudhani.com/running-sidekiq-on-heroku-free-dyno/
---

In my opinion, [Heroku](https://www.heroku.com) is the nearly perfect place to deploy a project. It provides support for a lot of technologies out of the box with minimal or no configuration.

Similarly, [Sidekiq](https://sidekiq.org) is what I strongly prefer whenever there is a need for background job processing. It ships with all the right set of APIs to deal with background processing and more importantly a great monitoring dashboard. 

So, Last weekend I decide to hack on a side-project which has been on my mind forever (I will write about this project in another blog post). I rolled up a new rails project, added Sidekiq with Redis and pieced together a basic functional prototype. When I moved to deployment process I realised - I have to run another dyno to keep the Sidekiq process running. 

Now let me be honest with you here, I have an inch for creating side-projects. Once I get hit by a problem I take some time out to hack on it & later I struggle to find time to work on the project again. That's why I don't go with any paid plan in project's infant days. 

Coming back to our problem at hand, Heroku already provides a free tier of [Redis as an addon](https://elements.heroku.com/addons/heroku-redis) – which does 

```
heroku addons:create heroku-redis:hobby-dev
```

The other half is to figure out how to spawn a Sidekiq process within the same dyno. After some digging I found a great blog post [Sidekiq on Heroku with Redis To Go Nano](http://manuelvanrijn.nl/blog/2012/11/13/sidekiq-on-heroku-with-redistogo-nano/) describing how to achieve the same in Unicorn. From here is just a matter of figuring out how to replicate this behaviour in Puma. 

...some experiments later...

I got the `puma.rb` inside `config` to mimic the same behaviour for me – keeping Heroku Redis' client connection limit in check. Here is the config: 


```ruby
threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }

threads threads_count, threads_count

port        ENV.fetch("PORT") { 3000 }

environment ENV.fetch("RAILS_ENV") { "development" }

workers ENV.fetch("WEB_CONCURRENCY") { 2 }

preload_app!

on_worker_boot do
  @sidekiq_pid ||= spawn('bundle exec sidekiq -c 2 -t 25')
  ActiveRecord::Base.establish_connection if defined?(ActiveRecord)
end

on_restart do
  Sidekiq.redis.shutdown { |conn| conn.close }
end

plugin :tmp_restart
```

Copy this to your Puma config and deploy this with your Heroku app. 

```
git push heroku master
```

Be sure to point `Procfile` to right puma config

```
bundle exec puma -C config/puma.rb
```

__Post was originally published at https://bilalbudhani.com/running-sidekiq-on-heroku-free-dyno/__

P.S: I'm available for consulting projects.
How would you go about providing minimal-latency web experience for a single local event?
Tags: networking, webdev, discuss
Published: 2017-11-27 16:47:48

---
title: How would you go about providing minimal-latency web experience for a single local event?
published: true
description: 
tags: networking, webdev, discuss
---

This is mostly a thought experiment, but it's also something I'd like to do real experiments with if I were to find a practical path forward.

Say you're at a festival or a conference, you and the rest of the crowd are all accessing the same scheduling info through the website, perhaps along with a chat/discussion app, all localized to the event, but every person is getting data coming back and forth from some data center in Utah and everybody's having a really shitty high-latency experience on the crappy network. Even though you're all accessing exactly the same data, you're all independently beaming across the country/world.

How can you overcome this problem, in a practical way? Meaning nobody has to really know anything about the underlying technology, they access the website as usual, but under the hood you treat them differently?

Things that come to mind are some potential peer-to-peer solutions, or perhaps a local server that's plenty powerful to handle all the traffic and keep a warm cache for all the traffic. I have a grip on the way this might be architected, but I'm really not sure where to begin on how this kind of thing might be implemented.

Again, this is more of a personal interest than anything, but if there were a practical implementation, I'd love to try something like this with [dev.to](/) at a conference or something. The site is already built to be serve a lot of widely shared caches served from the our CDN's edge-nodes.

Thoughts?
The 7 Most Popular DEV Posts from the Past Week
Tags: top7
Published: 2017-11-27 16:46:49

---
title: The 7 Most Popular DEV Posts from the Past Week
published: true
description: A round up of the most-read and most-loved contributions from the community this past week.
tags: icymi
cover_image: https://thepracticaldev.s3.amazonaws.com/i/xsr1z6iqv0pd7p3s6ns3.png
---

#1. Noam Chomsky & Regex

What on earth to the two have to do with one another? Find out in Alaina's spellbinding post about the linguistics behind regular expressions.

{% link https://dev.to/alainakafkes/exploring-the-linguistics-behind-regular-expressions-bb4 %}

#2. The truth about learning to code

>"My name is xxxx and after studying with TreeHouse for six weeks, I got a job as a Front-End Developer." 

^^ Does not apply to everyone. In this post, Muna shares the truths she's learned on her coding journey.

{% link https://dev.to/munamohamed94/front-end-web-development-is-not-what-you-think-it-is-1ib %}

#3. Do you know how to GitHub?

Community advice on github and personal use, team use, open source, career advancement, and more, compiled by Kim Arnett. 

{% link https://dev.to/kimberlypilbeam/the-unwritten-rules-for-github-by-devdiscuss-742 %}

#4. The what, why, & how on progressive web apps

Alexandre gives us a quick guide to progressive web apps. 

{% link https://dev.to/pixeline/the-easy-way-to-turn-a-website-into-a-progressive-web-app-77g %}

#5. "It's been hard, but I'm loving it!"

_Overheard at a conference in a huddle of junior developers_. In this post, Steff goes in more depth about these feelings and shares some tips to help junior devs. 

{% link https://dev.to/steff_br/how-does-it-feel-to-be-a-junior-developer-24e %}

#6. No More Outdated API Documentation
 
A walkthrough on using Dredd, a tool for testing APIs using their own documentation.

{% link https://dev.to/albertofdzm/testing-an-api-against-documentation-6cl %}

#7. Technology fads

"An innovation only becomes a technology fad when we start mass-adopting it on any basis other than its own merit!" Jason shares his thoughts on today's fads. 

{% link https://dev.to/codemouse92/all-the-cool-kids-are-doing-it-dm8 %}


_That's it for our weekly wrap up! Keep an eye on dev.to this week for daily content and discussions...and if you miss anything, we'll be sure to recap it next Monday!_
Restore ftp and telnet erased by macOS High Sierra
Tags: macosxhighsierra
Published: 2017-11-27 16:28:51

---
title: Restore ftp and telnet erased by macOS High Sierra
published: true
description: I think that ftp and telnet are still active.
tags: Mac OS X High Sierra
---
# macOS High Sierra can not use ftp and telnet

[https://discussions.apple.com/thread/8093031?start=0&tstart=0](https://discussions.apple.com/thread/8093031?start=0&tstart=0)


I understand the idea of wanting to be secure, but how about erasing basic tools?



# Resurrection spell

    brew install inetutils


# Reference

[https://apple.stackexchange.com/questions/299758/how-to-get-bsd-ftp-and-telnet-back-in-10-13-high-sierra](https://apple.stackexchange.com/questions/299758/how-to-get-bsd-ftp-and-telnet-back-in-10-13-high-sierra)