With the virtual hard drive just created, boot the virtual machine with the android-x86 image in the optical drive.
Once you boot, you can see the grub menu of the Live CD
Choose the Debug Mode Option, then you should see the shell prompt. This is a busybox shell. You can get more shell by swi...
With the virtual hard drive just created, boot the virtual machine with the android-x86 image as the optical drive.
In the booting options of the Live CD choose "Installation - Install Android to hard disk"
Choose the sda1 partition and install android and we'll install grub.
Reboot t...
An example of implementation which give a possibility to detect if user single or double tap on UITableViewCell.
override func viewDidLoad() {
viewDidLoad()
let doubleTapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(handleDoubleTap(sender:)))
double...
An example of implementation UITableView which allows to detect if cell has been tapped single or double time.
override func viewDidLoad() {
viewDidLoad()
let doubleTapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(handleDoubleTap(sender:)))
doubleTa...
multiply-square-matrix-parallel(A, B)
n = A.lines
C = Matrix(n,n) //create a new matrix n*n
parallel for i = 1 to n
parallel for j = 1 to n
C[i][j] = 0
pour k = 1 to n
C[i][j] = C[i][j] + A[i][k]*B[k][j]
return C
matrix-vector(A,x)
n = A.lines
y = Vector(n) //create a new vector of length n
parallel for i = 1 to n
y[i] = 0
parallel for i = 1 to n
for j = 1 to n
y[i] = y[i] + A[i][j]*x[j]
return y
A is an array and p and q indexes of the array such as you gonna sort the sub-array A[p..r]. B is a sub-array which will be populated by the sort.
A call to p-merge-sort(A,p,r,B,s) sorts elements from A[p..r] and put them in B[s..s+r-p].
p-merge-sort(A,p,r,B,s)
n = r-p+1
if n==1
...
Suppose we have a simple class with validation annotations
public class UserDTO {
@NotEmpty
private String name;
@Min(18)
private int age;
//getters/setters
}
A controller to check the UserDTO validity.
@RestController
public class ValidationController {
@Reque...
In following example we will create table movies with AWS Ruby SDK v2.
Here, each Movie as one unique Partition Key as id, and Range Key year. Apart from this we want to be able to query movies with their name, hence we will create a Global Secondary Index (GSI) name-year-index with name as Hash Ke...
Q-learning is a variant of model-free reinforcement learning. In Q-learning we want the agent to estimate how good a (state, action) pair is so that it can choose good actions in each state. This is done by approximating an action-value function (Q) that fits in equation below:
Where s and a are ...
So the good news is that Apple kindly includes a Ruby interpreter. Unfortunately, it tends not to be a recent version:
$ /usr/bin/ruby -v
ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin16]
If you have Homebrew installed, you can get the latest Ruby with:
$ brew install ruby...
Run the following bash script as sudo
#!/bin/bash
# get deps
apt -y install build-essential libncurses5-dev libxml2-dev libsqlite3-dev libssl-dev libsrtp0-dev uuid-dev libjansson-dev
# download
cd /usr/src
wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-14-current.tar.gz...
Ex1:-
let str1 = 'stackoverflow';
let str2 = 'flowerovstack';
These strings are anagrams.
// Create Hash from str1 and increase one count.
hashMap = {
s : 1,
t : 1,
a : 1,
c : 1,
k : 1,
o : 2,
v : 1,
e : 1,
r : 1,
f : 1,
l : 1,
w : 1...
Solves problem of: access denied for user root using password YES
Stop mySQL:
sudo systemctl stop mysql
Restart mySQL, skipping grant tables:
sudo mysqld_safe --skip-grant-tables
Login:
mysql -u root
In SQL shell, look if users exist:
select User, password,plugin FROM mysql.user ;
U...