teleren/devto huggingface dataset:
An update on my Twilio Application
Tags: twiliohackathon, node, typescript
Published: 2020-04-14 13:20:07

## What I'm building
This application is designed to be used primarily in a business context. The app allows sending SMS to people and starting a phone call on the browser. This is useful for a business to target specific users with marketing ads or directly send promo codes. Yes, there are current solutions to this problem. For example, you can use [Intercom](https://www.intercom.com/) to start conversations with your users, the issue here is that you can only contact them when they are logged in to your application.

## Sending the first message
First I created a Twilio trial account by filling their form, then you need to input your phone number so they can send you a verification code. After my account was set up, it was time to start coding!

Sending a simple message was quite easy thanks to their [quickstart guide](https://www.twilio.com/docs/sms/quickstart/node?code-sample=code-send-an-sms-using-twilio-with-nodejs&code-language=Node.js&code-sdk-version=3.x#sign-up-for-twilio-and-get-a-twilio-phone-number).

![code snippet](https://dev-to-uploads.s3.amazonaws.com/i/j4gyqeup53sxf9ajsbl3.PNG)
<center>Snippet for the service function used by a route handler</center>

After I ran the server, opened postman and made a `POST` request with my phone in the payload and the message 'hi', I had a log on the server that the message was sent:
![message sent log](https://dev-to-uploads.s3.amazonaws.com/i/c7cgjpb5fil4gcqd6lk0.PNG)

But I only received the message after some seconds, and when I did I was like wow😮😮 this is so awesome! Although, I did receive more info on the message. It said “Sent from your Twilio trial account - h1” and the subject was "SMS".


## Link to Code
Here is my GitHub repository where I'll continue to develop the app:
{% github BOLT04/client-connector %}

## How I'm building it (what's the stack? did I run into issues or discover something new along the way?)
The tech stack I'm using is React, Javascript and the CSS framework is Semantic UI React. For the server-side I'm using Node.js, Express.js, Typescript and the [Twilio helper library for Node](https://www.twilio.com/docs/libraries/node). This package enables you to do more than sending SMS, so I want to dig deeper. I only saw these [typescript examples](https://github.com/twilio/twilio-node/blob/abf3470d89c68f5efbb6eeb811242404ec59762d/examples/typescript/example.ts) and read a bit of the docs.

One question I had was "what happens if I message back this phone number?". Maybe it's not an issue I should worry about though.

## Next steps
- Add a web form to send the POST request instead of using Postman. The phone input should be validated, might use [Cleave.js](https://nosir.github.io/cleave.js/)
- Add support to start a phone call from the web browser
- Maybe save in local storage the phone numbers to select previous ones
- Validate the given phone number on the API. The solution I'm looking too is to use [Twilio Lookup](https://www.twilio.com/docs/lookup/api).
Secrets of Laravel: Successful in Development

Tags: laravel, webdev, php, design
Published: 2020-04-14 13:11:46

Secrets of Laravel: Successful in Development
There are lot many frameworks for website development in market. As a business owner we often take time to think which framework is best for my requirement. From consumer point of view the website which looks very attractive and creative which makes them engaging while surfing. Now let’s find something very interesting for the website development.

We will see Laravel framework for website development and web applications. Laravel is recently very popular among web developers. Let’s find the reason behind the popularity. We will see distinct features of the Laravel for web development. Why it is chosen frequently?

Firstly, we will see what it is Laravel? Laravel is a free open-source PHP web framework created and intended for the dev elopement of web applications following the model-view-controller (MVC) architectural pattern.

Let’s have a look into the significant features of Laravel

New Directory Structure
Method Injection
Contracts
Route Caching
Authentication
Events Object
Multiple file System

Read in detail here:https://www.rlogical.com/blog/secrets-of-laravel-successful-in-development/
Introduction to PHP and MySQL
Tags: php, tutorial
Published: 2020-04-14 13:08:46

## Introduction to PHP

* Only executed on a server - can’t just be opened in browser like HTML files
* Interacts with database but only through queries
* Like Python, data types (int, string, bool) are optional for function parameters and return values, though omitted from variables in PHP

In the next post, you will learn the syntax of PHP so you can start writing it. It may look familiar if you already know other high level programming languages.

## Introduction to MySQL

* It is a type of Database management software (DBMS) - it manages a database
* A database can contain multiple tables, each containing records
* Tables are created with a data structure detailing what fields will be stored
Daily Challenge #225 - Square'n'Sum
Tags: challenge
Published: 2020-04-14 13:04:39

---
title: Daily Challenge #225 - Square'n'Sum
published: true
series: Daily Challenge
description: Square all numbers in an array, then add them together. 
tags: challenge
---
Implement a function `squareSum` so that it squares any number(s) passed into it and then adds the squares together.

For example, for [1, 2, 2]: it should return 9 because 1^2 + 2^2 + 2^2 = 9.

**Tests**
[1, 2, 3, 4]
[0, 3, 5, 7]
[2, 2, 20]

Good luck!
***
_This [challenge](https://www.codewars.com/kata/515e271a311df0350d00000f) comes from jhoffner on CodeWars. Thank you to [CodeWars](<https://codewars.com/>), who has licensed redistribution of this challenge under the [2-Clause BSD License](<https://opensource.org/licenses/BSD-2-Clause>)!_

_Want to propose a challenge idea for a future post?  Email **yo+challenge@dev.to** with your suggestions!_
Rules to define identifiers in Python:
Published: 2020-04-14 13:02:06

1. The only allowed characters in Python are
 alphabet symbols(either lower case or upper case)
 digits(0 to 9)
 underscore symbol(_)

 By mistake if we are using any other symbol like $ then we will get syntax error.
 cash = 10 Correct
 ca$h = 20 Incorrect
 2. Identifier should not starts with digit
 123total Correct 
 total123 Incorrect

 3. Identifiers are case sensitive. Of course Python language is case sensitive language.

 total=10
 TOTAL=999
 print(total) #10
 print(TOTAL) #999

Identifier:

1. Alphabet Symbols (Either Upper case OR Lower case)

2. If Identifier is start with Underscore (_) then it indicates it is private.

3. Identifier should not start with Digits.

4. Identifiers are case sensitive.

5. We cannot use reserved words as identifiers
 Eg: def=10 

6. There is no length limit for Python identifiers. But not recommended to use too lengthy
identifiers.Identifier:

7. Dollor ($) Symbol is not allowed in Python.
Starting Out In Web Development (again)
Tags: webdev, time, advice
Published: 2020-04-14 12:58:39

# The Question

I am looking for some suggestions on tools or frameworks to look into for a hobby project I wanted to try.  I have always felt that _time_ is quite interesting so I was going to knock something up to present the current time in a lot of formats (All the ISOs I can find, GPS Time, Week Numbers, Mian Calendars, Metric Time, etc).  

# My Background

It has been a while since I did anything much with website related bits.  Long ago I wrote HTML (4 or XHTML I think) out but hand for simple things.  I added a little JavaScript to do a rollover image substitution.  At some point I also did some JavaServerPages (JSP).  

In the non-web world; 
* I am quite good at C & C+
* I am OK with Go, Python, Ruby, BASH
* I can cobble together JavaScript, Java, JSP and a bunch of other things but I will be a bit slow and doing a lot of "online research" to aid me.

-----

Any suggestions are very welcome.  Also if you know of similar existing sites I would be interested to see how others have chosen to present things.
Transformando seu celular android num monitor externo
Published: 2020-04-14 12:57:37

Esses dias, por curiosidade resolvi transformar meu celular numa extensão do meu monitor, pra colocar um ou outro lembrete necessário ao dia-a-dia e também já deixar o celular carregando enquanto o estou utilizando para um fim mais nobre do que ficar apenas parado na mesa esperando alguém ligar.

Aparentemente parece algo trivial, mas eu me enganei e é exatamente por isso que estou escrevendo esse post.

Para transformar o celular ou tablet Android em um monitor segui os seguintes passos:

1) Baixei o aplicativo spacedesk em www.spacedesk.net necessário baixar no celular via play store.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/sz3fr9p4jjecb1vqf9zo.jpg)

Tanto o PC quanto o device android precisam estar na mesma rede.

2) Depois de baixado e configurado, iniciei o app no celular e voilà, ele identificou na rede o meu PC que já estava com o programa rodando.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/y136l0yzp6rhxcbbij1e.jpg)

3) Foi só clicar no IP da minha máquina e o PC reconheceu meu celular como um monitor, com direito a propriedades de vídeo e tudo, tudo funcionando via Wifi.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/myd4zh0ej4kn9zffj8gc.jpg)

Aí começaram os problemas…

O lag pra se utilizar o celular como monitor é imenso devido a tudo trafegar via Wifi, e pra resolver, fui pesquisar como que seria possível usar o mesmo esquema só que usando o cabo, felizmente achei a solução.

1. Conectar o device no PC com o cabo USB.
2. Ligar o roteamento de conexão do celular por USB em configurações.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/ct55npge73uvgasq1srg.jpg)

3. O Android exibe o PC agora com um IP de rede interna cabeada.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/8kocjhgh94av3y6ar2h6.jpg)

4. Basta clicar agora na conexão local e pronto, monitor agora sem lag, só que temos outro problema, agora o PC passa a priorizar a conexão USB para conectar a internet, e meus dados pra onde vão? Próximo passo, mudar as configurações de rede pra que o Windows priorize a minha rede Wifi para internet para isso vamos abrir o powershell em modo administrador.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/txdcbpjlclodwrbuhg6g.jpg)

5. A seguir digite o seguinte comando: Get-NetIPInterface ele trará algo como:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/7umywwfkqyv278j7d4a9.png)

6. A seguir use o comando **Set-NetIPInterface -InterfaceIndex “XX” -InterfaceMetric “100”** onde XX é o número da interface que corresponde ao device Android na lista anterior e 100 é a prioridade, quanto maior o número menor será a prioridade, no nosso caso vamos colocar 100.

7. O Windows volta novamente a priorizar minhas outras interfaces de rede.

É isso ai.

**Post publicado originalmente em 15/05/2018 em https://gardelsouza.wordpress.com/**
PHP Tutorial Series Introduction
Published: 2020-04-14 12:54:52

## Introduction to tutorial

This tutorial will guide you to create an online shopping website using the popular web scripting language, PHP, and excellent database management system, MySQL. Some existing programming knowledge is expected in a language such as Python, although this tutorial will provide step by step instructions for getting started. Extra challenges with example solutions are also given to boost learning. Having HTML and CSS skills will ensure you make the most of this tutorial. To anyone unfamiliar with web development, I recommend this [online tutorial](https://dev.to/ziizium/frontend-development-zero-to-hero-j0j), which covers HTML, CSS, Javascript and general web design tips.

### Examples Context
The examples that will be given are based on a Cardiff based cake bakery called Neat Treats. The examples each deliver a lesson going further in Neat Treats' online cake ordering system. I believe this will give the examples more realism and authenticity. However, you are free to substite Neat Treats for a different project name when you follow the examples. The content is designed to apply to online shops in a wide range of industries.


The code used in the examples will be explained in each step. I have also made sample solutions to the extra steps, which you can view at any time on [my Github](https://github.com/herobank110/PHP-Tutorial).
Beautiful GitHub cards for your portfolio website. 🎉
Tags: showdev, webdev, javascript
Published: 2020-04-14 12:53:40

---
title: Beautiful GitHub cards for your portfolio website. 🎉
cover_image: https://i.ibb.co/kx08h9q/final-product.png
published: true
description: beautiful github card components for your website.
tags: showdev,webdev,javascript
---
Repo: https://github.com/RocktimSaikia/github-card
Live: https://codepen.io/RocktimSaikia/full/jObbBmR

For a couple of days, I've been learning about [web components](https://developer.mozilla.org/en-US/docs/Web/Web_Components). It's a completely new concept for me.I've heard about it before but never actually tried it. So this time I set my mind to build one from complete scratch. 

So I planned to create a GitHub profile card web component that can be embedded on any website. Once the idea was clear I started creating quite a few card designs. Here are some designs I created before settling with the final design.

<img src="https://i.ibb.co/tqPmQJk/brainstorm-compressor.jpg" alt="brainstorm-compressor" border="0">

## Usage
1.Through importing script
```js
<github-card data-user="rocktimsaikia"></github-card>

<script src="https://unpkg.com/@rocktimsaikia/github-card@1.0.0/dist/widget.min.js" type="module"></script>
```
2.Through installing the package
```js
import "@rocktimsaikia/github-card";

<github-card data-user="rocktimsaikia"></github-card>
```

If you want to contribute to this project please do. That would be awesome😊
JavaScript: window, document and screen
Published: 2020-04-14 12:50:46

Window :
The JavaScript window object sits at the top of the JavaScript Object hierarchy and represents the browser window. The window object is supported by all browsers. All global JavaScript objects , functions, and variables automatically become members of the window object. The window is the first thing that gets loaded into the browser . This window object has the majority of the properties like length, innerWidth, innerHeight, name, if it has been closed, its parents, and more.

The window object represents the current browsing context . It holds things like window.location, window.history, window.screen, window.status, or the window.document . Each browser tab has its own top-level window object. Each of these windows gets its own separate global object. window.window always refers to window, but window.parent and window.top might refer to enclosing windows, giving access to other execution contexts. Moreover, the window property of a window object points to the window object itself. 


Document :

The Document interface represents any web page loaded in the browser and serves as an entry point into the web page's content, which is the DOM tree. When an HTML document is loaded into a web browser , it becomes a document object. It is the root node of the HTML document. The document actually gets loaded inside the window object and has properties available to it like title, URL, cookie, etc. HTML documents, served with the "text/html" content type, also implement the HTMLDocument interface, whereas XML and SVG documents implement the XMLDocument interface.
 
Screen:

Screen is a small information object about physical screen dimensions . It can be used to display screen width, height, colorDepth, pixelDepth etc. It is not mandatory to write window prefix with screen object. It can be written without window prefix.
How to use 3D Mouse via RDP
Tags: 3dmouse, remote, network, usb
Published: 2020-04-14 12:46:46

---
title: How to use 3D Mouse via RDP
published: true
description: How to redirect 3D Mouse to Remote Desktop Session? This step-by-step tutorial will help you to redirect your 3d Mouse in RDP
tags: 3d mouse, remote, network, usb
canonical_url: https://www.net-usb.com/usb-over-rdp/3d-mouse-over-rdp/
---
#**How to redirect 3D Mouse to Remote Desktop Session**

##What is a 3D mouse
![3Dconnexion](https://www.net-usb.com/images/upload/UNG/articles/mouse/4.jpg)

A **3D mouse** is a specialized pointing and control device that is designed to be used in virtual 3D environments. It provides this functionality through a variety of methods including accelerometers, multi-axis sensors, and infrared sensors. Used in tandem with a traditional mouse, it allows individuals to employ a two-handed approach to their work.

Computer modelers and designers make use of 3D mice because they increase productivity and are more comfortable to use compared to traditional techniques. They are also considered essential gear for serious gamers who wish to immerse themselves in the world of virtual reality. A 3D mouse offers users the six degrees of freedom required to successfully navigate three-dimensional environments.
An example of 3D mouse that are in great demand: Logitech Space Navigator, Space Mouse Pro, Space Explorer, Space Pilot PRO and etc. 

##**Accessing a 3D mouse in RDP sessions**

It can be challenging to use a 3D mouse from within a Remote Desktop Session. If it uses a USB interface, you need the ability to redirect data transmission to your remote session. One option is to use RemoteFX USB redirection which allows an RDP to access a USB connected 3D mouse.

While this solution does enable access to the mouse, there have been problems reported with inconsistent performance from the device. The issue is that the mouse acts fine until it enters the 3D environment. When used in the 3D space, issues with the mouse driver result in a lack of control over the device’s movements.

##**Redirecting a 3D Mouse to RDP**

[USB for Remote Desktop](https://www.net-usb.com/usb-over-rdp/) is a third-party solution developed to streamline the process of redirecting USB device transmission. Here’s how to use USB Network Gate to redirect a 3D mouse to an RDP session.

1. Download and install USB Network Gate on the machine that is attached to the 3D mouse and the computer that will use RDP to access it.

2. On the computer with the direct connection to the 3D mouse, launch the application and go to **’Devices’**. Locate the mouse in the device list and select **‘Settings’**. Here you can update parameters like the port number or enable encryption. When you are finished updating parameters, click **‘Share’**.

3. The mouse is now available to any network-connected computers that have USB Network Gate installed. Open USB for Remote Desktop app in your RDP session and in **‘Devices’L** click **‘Connect’** to access the shared device.

That’s it! The 3D mouse is now available in your RDP session and ready for use.
DynamoDB geospatial data in python
Tags: aws, python, geo, dynamodb
Published: 2020-04-14 12:44:55

Did you ever wondered how to find the closest data points to a given latitude and longitude pair in DynamoDB without having to scan the full table?

In 2013, DynamoDB service team provided dynamodb-geo Java library that allow customers to insert and query the Geo spatial data efficiently. But since then no official support to that library was provided even with the numerous updates that happened in DynamoDB since then.  



Recently, as a Cloud Support Engineer at AWS I noticed that various customer showed interest in re-inventing that library in python or integrating it in boto3. For that, I gave it a try and build a python unofficial port of dynamodb-geo. You can check it out here : https://github.com/Sigm0oid/dynamodb-geo.py.

Please let me know if any question raises or if you have any suggestions.

Have an AWSome day!
A Python Data Types Chart for the Forgetful
Tags: python, cheatsheet
Published: 2020-04-14 12:35:18

---
title: A Python Data Types Chart for the Forgetful 
published: true
description: A Python Data Types Chart
tags: #python #cheatsheet
---

If you're like me, you forget the nuances of each of [Python's Data Types](https://realpython.com/python-data-types/). I made this chart as a cheatsheet for myself but I figured I would share it! I will update it with anything I personally find useful! Feel free to comment to add / improve!

Here's to hopefully not needing this chart one day!

| Data Type | Mutability | Iterable | Ordered   | Unique Values | Sliceable | Instantiate                           |
|-----------|------------|----------|-----------|---------------|-----------|---------------------------------------|
| string    | immutable  |          |           |               |           | s = ""                                |
| num       | immutable  |          |           |               |           | i = 0                                 |
| list      | mutable    | x        | ordered   | not           | x         | L = [], list()                        |
| tuple     | immutable  | x        | ordered   | not           | x         | t = (1,), tuple([1,2,3])              |
| range     | immutable  | x        | ordered   | unique        | x         | range(0,3)                            |
| dict      | mutable    | x        | unordered | unique        |           | d={'name': "drew"}, dict(name='drew') |
| set       | mutable    | x        | unordered | unique        |           | ms={1,"two"}, set([1,"two",False])    |
| frozenset | immutable  | x        | unordered | unique        |           | frozenset([1,"two",False])            |
| bool      | immutable  |          |           |               |           | True, False, bool([])             |
A beleza dos editores WYSIWYG
Published: 2020-04-14 12:31:27

**Post publicado originalmente em 29/08/2007 em https://monodel.blogspot.com/**

Já pararam pra pensar que falar What You See Is What You Get é mais fácil de falar do que WYSIWYG :D

Em inícios dos meus estudos em asp.net me deparei com a seguinte situação, precisei desenvolver um sistema de notícias, ai começaram meus problemas...

Primeiro, meu conhecimento de desenvolvimento web diga-se de passagem é meio resumido, mais sem falsa modéstia, é muito se comparado ao nível dos profissionais que atuam na minha cidade.

Meus estudos me levaram a necessidade de fazer um sistema de notícias, pra alguém com experiência, uma tarefa relativamente simples, porém pra mim, relativamente complicado, o problema é que eu queria poder incluir notícias com o texto formatado, poder incluir fotos, isso me levou a procurar desesperadamente um editor WYSIWYG, e que fosse free.

Pagos existem alguns, mais a maioria só te permite usar alguns dias, e estava atrás de algo que fosse grátis, felizmente eu achei, tanto como 2 :D.

O primeiro deles achei fantástico é o FreeTextBox é free porém o código é fechado, e ainda o FckEditor, muito legal também porém o primeiro que eu baixei foi o FreeTextBox e me apaixonei e já coloquei no site e não quis saber de testar o outro :D, mais de já eu recomendo muito, use esse componente, da um grau muito legal nas notícias.

Meu próximo desafio é montar uma galeria de fotos, ainda estou atrás de um componente pra facilitar a minha vida, caso não tenha vou ter que desenvolver um.

Caso alguém tenha alguma idéia de um componente de Galeria de imagens manda um recado.

Logo que eu tiver notícias ou novidade eu posto aqui.

Qualquer coisa me add no msn: gardel@gardelsouza.net

Até mais.