Image source: Pixabay
Amazon Web Services (AWS) is currently the most widely adopted cloud service provider. Python is currently ranked in the top three languages being used by developers. It only makes sense that you might want to use the two in tandem. Thankfully, AWS has anticipated this and provided ways to smoothly integrate the two. Here, we’ll look at how Python and AWS can be combined and see an example script used to work with metrics through CloudWatch.
[Read More]
How To Connect To MySQL Running In Docker Container From Localhost
In this tutorial, you’ll learn how to connect to MySQL running in docker container from localhost. You’ll start by pulling in an image of MySQL from Docker hub.
From the command prompt, type in the following command to pull the MySQL docker image.
// Execute in terminal docker pull mysql Once you have the MySQL docker image, you need to run the image to create an instance of MySQL.
// Execute in terminaldocker run -p 3307:3306 --name mysql -e MYSQL_ROOT_PASSWORD=root -d mysql:5.
[Read More]
How To Download File In Express Web App
Providing the ability to download a file from a web application is one of the common use cases of web application development. In this tutorial, you’ll learn about how to download file in express web app. The tutorial assumes the reader to have basic understanding of express web framework and JavaScript.
Getting Started With Express App Let’s get started by creating an express web app. Create a project directory and initialize the node project.
[Read More]
How To Execute JavaScript Promises In Sequence
In this tutorial, you’ll learn how to execute JavaScript promises in sequence. If you are unfamiliar with JavaScript promises, I would recommend getting a basic understanding of how JavaScript promises work.
Creating a JavaScript Promise Let’s start by creating a JavaScript promise. I’ll define a function which will return a promise which gets resolved after a specific time interval.
function createPromise(i) { let timeperiod = 1000; return new Promise((resolve, reject) => { setTimeout(() => { resolve(i) }, timeperiod) }) } As seen in the above code, I have used setTimeout to delay the response from the promise.
[Read More]
How To Insert Element To Front/Beginning Of An Array In JavaScript
In this tutorial, you’ll learn how to insert element to front/beginning of an array in JavaScript.
For adding an element to an array, you use push which inserts the new element to the end of the array.
let array_list = [1, 2, 3] array_list.push(4); console.log(array_list); Output : 1, 2, 3, 4 To insert an element to the front or beginning of an array you can use the unshift method.
let array_list = [1, 2, 3] array_list.
[Read More]
How To Make REST API Calls In Julia
In this tutorial, you’ll learn how to make REST API calls in Julia. Assuming you have Julia installed and running in your system. let’s get started.
Install The HTTP Package For installing and managing packages in Julia, you have a Julia package manager. Assuming you are familiar with installing packages in Julia, from the terminal navigate to the Julia prompt.
ajay@ajay-HP-Notebook:~$ julia__ _ _(_)_ | Documentation: https://docs.julialang.org(_) | (_) (_) |_ _ _| |_ __ _ | Type "?
[Read More]
How To Read And Display JSON using Python
In this tutorial, you’ll learn how to read and display JSON using Python. Let’s use Flask Python web framework and see how to read and display JSON data while reading from an API.
Start by creating a project folder called python-app. Install Flask and Requests using pip. Requests library will be used for making the API call.
pip insall flask pip install requests Create a file called hello.py inside python-app folder and add the following code :
[Read More]
How To Read Arguments From JavaScript Functions
In this tutorial, you’ll learn How to read arguments from JavaScript functions. This question was asked to me during a JavaScript interview. Off course you can read arguments from the parameters to the function. But there is a way to read all function arguments as a single object or array list.
Using Arguments Keyword The keyword arguments gives you all the arguments passed into the JavaScript function.
function foo() { console.
[Read More]
How To Read POST Request Parameters In Express
In the last express tutorial, you learnt how to get query string parameters in express web app. In this tutorial, you’ll learn how to read POST request parameters in express web app.
Getting Started With Express Let’s get started by creating an express web app. Create a project directory and initialize the node project.
mkdir node-app cd node-app npm init Once the project has been initialized, install express framework into the project.
[Read More]
How to Reverse a Number In JavaScript
In this tutorial, you’ll see how to reverse a number in JavaScript. There is no direct method to reverse a number in JavaScript. You’ll convert a number to string, then to array, reverse it and convert it back to number.
function reverseNumber(num){
return Number(String(num).split("").reverse().join(""))
}
console.log(reverseNumber(123))