teleren/devto huggingface dataset:
Changing our Integration with Netsuite
Tags: netsuite, webhooks, restful, suitescript
Published: 2019-02-18 21:03:03

---
title: Changing our Integration with Netsuite
published: true
description: It's easier to integrate with Netsuite from inside Netsuite
tags: #netsuite #webhooks #restful #suitescript
cover_image: https://a57.foxnews.com/a57.foxnews.com/static.foxnews.com/foxnews.com/content/uploads/2018/09/640/320/1862/1048/660_car_keys.jpg?ve=1&tl=1?ve=1&tl=1
---

So Netsuite decided they will be implementing 2FA for logins.  This makes things rather difficult for me as our integration was using basic username/password Authorization header calls.  Essentially, in Netsuite, you can't use username/password for web service calls anymore. 

They have varying methods of authentication they allow for in order to utilize their services.  They have a SOAP service and then they provide a RESTful type of method that allows you to write your own script and assign the callback functions to verbs.  It's actually quite flexible and powerful with the various actions one can do. I recommend looking into RESTlets in Netsuite's documentation if you're unfamiliar.

This brings me to Netsuite's authentication methods.  You can use username and password, Session ID (virtually unusable...but capable) and OAuth 1.0 for integration into their web services platform.

Many of our partners used the username and password authentication due to the simplicity of setup.  Obviously, this can create problems when passwords expire or a client wants to eliminate access but our scheduled jobs continue to try to access Netsuite from inside our platform until you can't.  Netsuite is sunsetting the username/password capability soon.

So with all that said, I have decided I'll work from the inside out.  I am going to rewrite my integration from within Netsuite using a variety of Suitescript events and calling out to our own RESTful API which will accept the data.

This may cause some problems for debugging or troubleshooting any possible errors but we also have an endpoint we will write errors to that will essentially duplicate the execution log of a script.  With the exception of invalid license keys to our API, we should be able to generally troubleshoot most issues.

I will use UserEventScripts to attach actions of records to trigger Map/Reduce scripts to loop through unimported records and throttle the calls on our end using our own governance methods tweaking it based on customer commitments ($$$).  

I will also use a public Suitelet webhook that will do nothing more than wake up, obtaining updated info by retrieving info via our RESTful api and then going back to sleep. Clean.

Using a combination of RESTlets, Suitelets, and javascript, I will beat permission issues related to users who don't have access to needed records, slower data transfer times and clunky popups that call unfamiliar UIs possibly confusing user experience.  Rounding out a good, fast, and usable solution all without needing to use OAuth.
Recursion
Tags: recursion, javascript, codenewbie
Published: 2019-02-18 20:50:39

---
title: Recursion
published: true
description: An introduction to recursion
tags: #recursion, #javascript, #codenewbie
---

**What Is Recursion**

Recursion is a process that calls itself.  With respect to programming, recursion is a function that calls itself. 

**How Does It Work?**
A recursive function calls itself until it reaches the base case.

The base case is where the recursion ends. Without the base case your function would not know when to stop calling itself. Once the base case is reached the function stops calling itself and returns its final value.

**Let's Look At An Example**
Let's look at the following example of recursion:

![Imgur](https://i.imgur.com/DVoorfP.png)

We have a function that counts down from the number given to the function as an argument, until it gets to 1.  

The *base case* instructs the function to return once the number has reached 1 
( <=0 ).

The remainder of the function prints out the current value of the number and then decrements it before the **countdown** function is called again.

This cycle repeats until the number has reached the base case, at which point it prints out *"You've reached the end"* and the returns and exits the function.

Let's execute the function with a number: 

```
countdown(4);

=> 4
=> 3
=> 2
=> 1
=> You've reached the end
```

The above function could have been solved with a simple for loop as well:
```
function countdown(num) {
    for (let i = num; i > 0; i--) {
        console.log(i)
    }
    console.log("You've reached the end")
}

```

As you can see for this simple example the for loop is much easier to use and understand. However, it is important to become familiar with recursion because is is used extensively in programming. Also, recursion comes up frequently in technical job interviews so take the time now to learn it.
What's your new dream dev tool for React?
Tags: inspiration
Published: 2019-02-18 20:49:24

---
title: What's your new dream dev tool for React?
published: true
description: Inspiration 
tags: #inspiration
---

**Hello React JS Community!**

My team and I are looking to make an open source dev tool that would help solve _some_ common problems/issues that developers encounter while working with React.

Our project goal is to help solve _some_ of the these problems and deepen our understanding of React along the way.

We hope that by hearing from the React Community that we will be able to generate some **useful** ideas that will help us build a **meaningful** tool.

But we're still green in our ideation process.

**Any ideas/comments would be very much appreciated!**
faceRecognition
Tags: javascript, neuralnetwork, facerecognition
Published: 2019-02-18 20:41:28

---
title: faceRecognition
published: true
description: Face recognition experiment in JavaScript using neural networks
tags: javascript, neuralnetwork, facerecognition
canonical_url: https://github.com/victorqribeiro/faceRecognition
cover_image: http://img.youtube.com/vi/KzXpdcOYwv0/0.jpg
---

# faceRecognition

A face recognition experiment in JavaScript using my [neural network](https://github.com/victorqribeiro/mlp).

[![groupImg](http://img.youtube.com/vi/KzXpdcOYwv0/0.jpg)](http://www.youtube.com/watch?v=KzXpdcOYwv0)

## Capture Data

captureData.html - Get image data from the webcam.

on the *label* input, entry the label in the one-hot encoded hormat. 
e.g.: [1,0] if something is A - [0,1] if something is B.

### How to use it
c - capture the current frame and add it to the data set.  
s - save the data set (x, y) as x and y .json files.  
u - undo. remove the last entry from the data set.  

## Fit Data

fitData.html - Train the neural network with the data created in captureData.html

## Test Data

testData.html - Test the neural network with new images from the webcam.

## Important Info

The *nn.json* model provided in this repo may not work for you, since it was only trained with 80 images of myself. 
40 images of me in front of the computer, 40 of me not in front of the computer.
The images ware scale to 32x24 pixels before traingin and during test.


You can check out the code [here](https://github.com/victorqribeiro/faceRecognition)
UiPath RPA
Tags: uipath, rpa, chetu
Published: 2019-02-18 20:40:40

---
title: UiPath RPA
published: true
description: UiPath RPA Partners with Chetu
tags: UiPath, RPA, Chetu
---

Chetu & UiPath

Accelerate your Digital Transformation with RPA and Process Mining
 
Building a Powerhouse Requires the Right Tools.

UiPath’s partnership with [Chetu](https://www.chetu.com/solutions/uipath.phputm_source=Dev.to&utm_medium=UiPath&utm_campaign=Partnerships
), the world market leader in custom software development, makes sure you get exactly that, at the touch of a button.

By combining Chetu's software integration with UiPath’s deployable digital workforce, small to large enterprises can simplify their RPA initialization phase by mapping processes to discover the best automation opportunities.
I Took a Vacation and You Should Too
Tags: productivity, mentalhealth, career
Published: 2019-02-18 20:09:33

---
title: I Took a Vacation and You Should Too
published: true
description: 
tags: productivity, mentalhealth, career
---

I wasn't particularly burnt out or _dying_ for a vacation, but I had a short trip scheduled for last week and I came back feeling productive and clear about my work. It's a great feeling.

I feel like I maintain a decent work life balance in general, but I truly don't take a lot of time off. There are a few reasons for this. I like my work and I don't always _love_ vacations in general. The overhead of planning and traveling sometimes seems like a wash for me in terms of what I'd like to be doing with my time. I can't say I don't feel a bit of pressure to push off vacations as the founder of a company with different stakeholders looking for me to be productive. My family, with a single parent, also never took a vacation that I can recall. So in an odd way I don't _know how_ to really take full-on vacations.

Anyway, I spent a few days <kbd>away from keyboard</kbd> and it seems like it was really great for my brain. I came back with a pretty clear idea about important long term decisions, and excited about contributing to [dev.to](/) as a developer and director. Nothing broke when I was gone and the site also got its all-time high in traffic. <sup>_As a function of a general trend, we hit all-time highs most weeks._ 🙃<sup>

I hope you also find some time for a vacation. It will _boost_ your productivity and generally be good for your health. Don't put it off too long.

Happy coding! ❤️
HTML Inputs Element:  The ears and eyes
Published: 2018-11-07 05:07:07

---
title: HTML Inputs Element:  The ears and eyes
published: true
description: 
tags: 
---
#HTML Inputs Element:  The ears and eyes

While working on a project I was thinking about how important the input tag and form element are in the world of development.  Since this is a blog I was trying to find a catchy or charming phrase to describe, the best I could come up with is that input fields are sort of like the ears and eyes that take in details that an end user provides (I guess that would make JavaScript the brain).  

Inputs simply give us a way to allow applications to take in information from the end user to store (POST) and or manipulate (GET, PUT, DELETE).  Input elements are placed inside a form element to collect inputs. Input elements use different attributes to define and create rules for the input.

##Attributes

###Name
You should always add a **name** attribute to inputs. The type is defined inside the input tag using `<input name=” ”>`. The name attribute is used to reference elements in JavaScript.

###Type
The input type is useful because they define the input field and create rules based on the type.  The type is defined inside the input tag using `<input type=” ”>`. Some common used input types are text, submit and checkbox.

The most common input type is **text**, it is the default type if none is assigned and allows a simple text field.  

**Date** input type provides a field that requires date format.  The default value inside the field is “mm/dd/yyyy” to require user to enter correct date format.

The **email** input type provides a field that requires text in email format.

The input type **checkbox** is shown as a square box that is ticked (checked) when activated.  An additional attribute of “checked” or “unchecked” can be assigned to a checkbox to force the box to be checked when the page loads.  The default is unchecked.


The submit input type creates a submit button that is used to submit or send the form info.  The default text inside the submit button is “submit”.

See the following code below of an input form:
```
<form>
    <input type="text" name="name" placeholder="name"/><br>
    <input type ="date" name="birthdate"/><br>
    <input type="email" name="email" placeholder="name@email.com"/><br>
    Sign me up for email updates<input type="checkbox" name="subscribe"  value="Subscriber" checked/><br>
    <input type ="submit" value="Submit">
</form>
```
###Other
Inputs can be further enhanced using other attributes. Attributes can set rules for inputs and assist with user experience.  Common attributes **value** and **placeholder** add default text to the input field.  Placeholder provides the user a hint of the requested input while value stipulates an input value provided.


Below is shows the form on the page:
![alt text](https://thepracticaldev.s3.amazonaws.com/i/4mymz7ypb3961bg36376.png)


Stay tuned for future discussions on how to take in using GET, POST, PUT and DELETE methods....
Laravel Deployment Optimization on Heroku
Tags: optimization, heroku, laravel
Published: 2019-02-21 19:24:01

---
title: Laravel Deployment Optimization on Heroku
published: true
tags: optimization,heroku,laravel
canonical_url: 
---

#### Laravel on Heroku — Tip #4

![](https://cdn-images-1.medium.com/max/1024/0*AmZG-ptxLz776cOl)<figcaption>Photo by <a href="https://unsplash.com/@toddquackenbush?utm_source=medium&amp;utm_medium=referral">Todd Quackenbush</a> on <a href="https://unsplash.com?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption>

Laravel has great [documentation about deployment](https://laravel.com/docs/deployment).

The most important part is optimization, which includes 3 parts:

1. Autoloader Optimization
2. Optimizing Configuration Loading
3. Optimizing Route Loading

On Heroku, we also need these 3 optimizations.

### Autoloader Optimization

We have to optimize Composer’s class autoloader with the following command:

```
composer install --optimize-autoloader --no-dev
```

Heroku already run composer install with this command ([Doc](https://devcenter.heroku.com/articles/php-support#installation-of-dependencies)). Thanks Heroku 👍

### ️Optimizing Configuration Loading and Route Loading

We should run

```
php artisan config:cache

php artisan route:cache
```

for optimizing configuration loading and route.

We will call these 2 artisan commands on boot so we create a new scripts entry in composer.json, e.g. warmup:

```
"scripts": {
 "warmup": [
 "php artisan config:cache",
 "php artisan route:cache"
 ]
}
```

You may then combine invocation of that script together with your existing command in Procfile, for example:

```
web: composer warmup && $(composer config bin-dir)/heroku-php-apache2 web/
```

That's it, our Laravel app on Heroku is optimized! 🚀

### Want more tips like these?

You should follow me on [Twitter](https://twitter.com/AutoIdle)! And if you’re building on Heroku, you should check out [AutoIdle](https://autoidle.com) — the automated way to save money on your staging and review apps.
What Do You Think About Types?
Tags: programming, discuss, javascript, typescript
Published: 2019-02-18 17:15:48

---
title: What Do You Think About Types?
published: true
description: A series of discussions about trending JS patterns. This week's topic is types.
tags: programming, discuss, javascript, typescript
cover_image: https://thepracticaldev.s3.amazonaws.com/i/a1kh2l8bdw5pqsujrel7.jpg
series: What Do You Think?
---

> I accidentally posted this on Sunday for a short time, just after promising to continue as a weekly Monday series. In case you saw that post or commented on it, I'm sorry. This is the final republished version.

A few things are becoming de-facto solutions in JavaScript with a lot of tutorials but without much discussion about the practical benefits and reasons. The goal of this series is to talk about these topics.

The rules:

- Speak about the whys, not the hows. It's okay to include a few favorite libs and patterns but it should not be the main focus of your comment.

- No Googling! I am interested in **Your** opinion, experience, anecdotes, and gut feelings.

- Your comment might get linked or quoted in the weekly summary if you are not asking otherwise. I never quote comments in a negative context.

---

### This week's topic is **Types**

- Do you prefer strongly or weakly typed languages?

- Do you have a favorite language type system wise? What makes it better than the rest?

- Can you mention situations when using types caught early errors for you?

- How does TypeScript relate to group projects? Does it make the barrier of entry and cooperation simpler or more difficult compared to vanilla JS?

- Whatever pops into your mind about types.

*All comments are welcomed, there is no wrong answer!*
Returning type-safe & non-nil failure in Crystal?
Tags: crystal, discuss
Published: 2019-02-18 18:37:07

---
title: Returning type-safe & non-nil failure in Crystal?
published: true
description: 
tags: crystal,discuss
---

I am having design doubts in Crystal and would like to hear how others have implemented similar functionality.

The `User` class has a method to fetch data based on some attribute value and return an instance.

```
class User
  def self.get_by_login(login : String)
    obj = DB.irrelevant_method(login)
    return obj
  end
end
```

_(I am using superfluous return statements to be more illustrative of intent)_

The issue comes in when the database does not find a record to return. I do not want to return a union type such as `(User|Nil)` or `(User|Bool)`. My idea is to return a User instance to satisfy the return type with the specific error added to an existing `errors` array I'm already using for validation on the creation side.

```
class User
  def self.get_by_login(login : String)
    user = User.new
    begin
      user = DB.irrelevant_method(login)
    rescue ex
      user.errors << ex.to_s
    end
    return user
  end
end
```

This leaves it up to the caller to check if the returned object is valid or has any errors before knowing what to do with it.

Any thoughts or concerns about this approach in Crystal or in general? I've used this pattern before in other languages and it does work, but I've never really felt great about it. I'm curious to hear how others have solved this or similar issues in Crystal or other strongly typed languages.
How to structure a security token offering (STO) and its revenue model successfully?
Tags: securitytokens, cryptocurrencies, business, blockchain
Published: 2019-02-18 18:30:34

---
title: How to structure a security token offering (STO) and its revenue model successfully?
published: true
description: As there can’t be any specific structure for STO business ideas even though based on various aspects of STO business structuring & revenue model that get should be based on successful Security token offering launch.
tags: Security tokens, cryptocurrencies, business, blockchain
---
Security token offering remained a burning business idea throughout 2018 and came as a sigh of relief for those looking for alternative methods to raise money. In 2019 things are not the same. STO is now mature and composed, unlike a wildfire; gaining land without efforts and motive.

With a lot more regulations and increased scrutiny in the play, now it requires a proper blend of efforts and professional approach to bring STO. The thing needs to be proved is – It’s not a trap.Now there is a strict need, even stricter than before, to structure STO’s and design a nice revenue model.

Let’s find what all boxes need to be ticked while creating a structure for STO and planning for revenue model of STO business.Read more > https://alwin.io/blog/structure-revenue-model-of-sto-business-application
Is there a way to explain hooks without mentioning class component?
Tags: discuss, react, javascript
Published: 2019-02-18 17:54:56

---
title: Is there a way to explain hooks without mentioning class component?
published: true
tags: discuss, react, javascript
---

Is there a way to explain about hooks without mentioning or comparing it to class components? I find it hard to explain about `useState()` without showing how it's done with `this.state = {}` and `setState()` 😐

I'd like to explain about state using hooks without ever showing how it's done with class component to React newcomers. Even in the [documentation](https://reactjs.org/docs/hooks-state.html) on `useState()` explains by comparing the equivalent class component first

Thanks everyone!
Moving Past Tutorials: a course on problem solving for programmers
Tags: beginners, problemsolving, programming, movingpasttutorials
Published: 2019-02-18 17:52:01

---
title: Moving Past Tutorials: a course on problem solving for programmers
published: true
cover_image: https://thepracticaldev.s3.amazonaws.com/i/y4gvgt64pl0mkglo8da4.png
description: The introductory post to a course on problem solving for programmers.
tags: beginners, problemsolving, programming, movingpasttutorials
series: "moving past tutorials"
---
In my experience working with programmers at beginner and intermediate levels, the most difficult part of programming is putting the pieces of the program together and knowing which pieces to actually use. And, most programming courses don't teach that part. They teach the pieces individually and then expect students to put the pieces together. So, I'm building a multimedia course that will focus entirely on problem solving, how to move past tutorials, and why certain choices should be made when you're programming.

This course will take the format of a DEV series, so it will be totally free and accessible to anyone. I will be releasing a new post each week so that I have time to get any feedback from the previous week's post and incorporate it into the next post, as well as balance creating content and the rest of my work.

I'm a strong believer in making content accessible to people with different learning styles, so this course will be very interactive and use different mediums to reinforce the material. Most of the concepts will be written and diagrammed. Then there will be example problems within the concept for you to solve, finally there will be videos explaining how to solve the practice problems after you attempt them yourself.

This course will be mostly language agnostic, though I will be solving my problems in Python since it's pretty understandable if you know a different programming language. This course won't teach the fundamentals of programming, though. Before starting, I would learn the fundamentals at least at a basic capacity. The fundamentals needed prior to this course are: variables, lists/arrays, hash tables/dictionaries/objects (whatever they're called in your programming language of choice), loops, conditionals, and functions. If you're looking to get started, [here's a list](https://dev.to/aspittel/my-favorite-free-resources-for-new-programmers-bia) of free resources for learning those.

The topics will include breaking down problems both for coding puzzles and for more realistic business problems, debugging, thinking abstractly, pseudocoding, what to think about when optimizing code, refactoring, approaching problems, edge cases, and what to learn outside of code that will help you code.

I'm really excited to work on this project, and would love your ideas and feedback through out. Feel free to comment below!