- login to 'AWS Management Console' (https://aws.amazon.com/console/)
- from 'Services'(in navbar) choose 'EC2'
- from 'Create Instance' section, click on 'Launch Instance'
- then select 'AMI' (Amazon Machine Image), we will be using 'Ubuntu Server 16.04 LTS (HVM)' as example
- select 'Instance Type' as per your requirement
- then click 'Next:Configure Instance Details' to continue
change 'Configure Instance Details' or used as default settings
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a = [1,2,3,4,5] | |
# 2 new arrays | |
left,right = a.each_slice( (a.size/2.0).round ).to_a | |
# left == [1, 2, 3] | |
# right == [4, 5] | |
# make array 2-dimensional | |
a.each_slice( (a.size/2.0).round ).to_a | |
# a == [[1, 2, 3], [4, 5]] |