Skip to content

Instantly share code, notes, and snippets.

View mohnoor94's full-sized avatar
๐Ÿ“˜
Always Learning...

Mohammad Noor Abu Khleif mohnoor94

๐Ÿ“˜
Always Learning...
View GitHub Profile
@mohnoor94
mohnoor94 / grid-node.json
Created October 24, 2017 08:02
Simple Configurations for a Selenium Node
{
"capabilities":
[
{
"browserName": "firefox",
"maxInstances": 10
}
],
"port":5555,
"hubPort":4444,
@mohnoor94
mohnoor94 / selenium
Created October 23, 2017 14:30 — forked from adeubank/selenium
Set up selenium on Ubuntu 16.04 as a service
#!/bin/bash
case "${1:-''}" in
'start')
if test -f /tmp/selenium.pid
then
echo "Selenium is already running."
else
export DISPLAY=localhost:99.0
java -Dwebdriver.gecko.driver="/usr/lib/geckodriver/geckodriver" -jar /usr/lib/selenium/selenium-server-standalone.jar -port 4444 > /var/log/selenium/output.log 2> /var/log/selenium/error.log & echo $! > /tmp/selenium.pid
@mohnoor94
mohnoor94 / multiplyAndDivideFull.cpp
Last active August 20, 2017 21:27
A full C++ program contains a function that takes 2 integer variables x and y, returns the multiplication of x and y in variable mul, and the division of x and y in variable div.
// www.abukhleif.com
#include <iostream>
using namespace std;
void multiplyAndDivide (int x, int y, int& mul, double& div) {
mul = x * y;
div = (x * 1.0) / y;
}
int main() {
int n1, n2, m;
double d;
@mohnoor94
mohnoor94 / multiplyAndDivideFunction.cpp
Created August 20, 2017 21:21
A function that takes 2 integer variables x and y, returns the multiplication of x and y in variable mul, and the division of x and y in variable div.
// www.abukhleif.com
void multiplyAndDivide (int x, int y, int& mul, double& div) {
mul = x * y;
div = (x * 1.0) / y;
}
@mohnoor94
mohnoor94 / isVowelFull.cpp
Created August 20, 2017 21:03
A full C++ program that contains a function isVowel returns the value true if a given character is a vowel and otherwise returns false
// www.abukhleif.com
#include <iostream>
using namespace std;
bool isVowel (char x) {
char y = toupper(x);
return (y=='A' || y=='E' || y=='I'|| y=='O'|| y=='U');
}
int main() {
cout<< isVowel('a');
return 0;
@mohnoor94
mohnoor94 / isVowelFunction2.cpp
Last active August 20, 2017 21:07
A function isVowel that returns the value true if a given character is a vowel and otherwise returns false
// www.abukhleif.com
bool isVowel (char x) {
return (x == 'A' || x == 'a' ||
x == 'E' || x == 'e' ||
x == 'I' || x == 'i' ||
x == 'O' || x == 'o' ||
x == 'U' || x == 'u');
}
@mohnoor94
mohnoor94 / isVowelFunction1.cpp
Last active August 20, 2017 21:04
A function isVowel that returns the value true if a given character is a vowel and otherwise returns false
// www.abukhleif.com
bool isVowel (char x) {
char y = toupper(x);
return (y=='A' || y=='E' || y=='I'|| y=='O'|| y=='U');
}
@mohnoor94
mohnoor94 / ArrayQueueJava.java
Created August 19, 2017 22:17
Simple Java Implementation of Queue
// www.abukhleif.com
class ArrayQueue {
private final int[] queue;
private int first = 0;
private int last = 0;
int size = 0;
public ArrayQueue(int size) {
queue = new int[size];
}
@mohnoor94
mohnoor94 / ArrayStackJava.java
Created August 19, 2017 22:15
Simple Java Implementation of Stack
// www.abukhleif.com
class ArrayStack {
private final int[] stack;
private final int size;
private int top;
public ArrayStack(int size) {
this.size = size;
stack = new int[size];
}
@mohnoor94
mohnoor94 / EvenOddFunction.cpp
Last active August 20, 2017 21:12
A C++ function that takes as a parameter an integer, and returns the number of odd and even digits.
// www.abukhleif.com
void EvenOdd (int num, int& evens, int& odds) {
evens = odds = 0;
while (num != 0) {
if (num % 2 == 0)
evens++;
else
odds++;
num /= 10;
}