Skip to content

Instantly share code, notes, and snippets.

var webdriverio = require('webdriverio');
//var webdriverio = require('selenium-webdriver');
var options = {
desiredCapabilities: {
browserName: 'firefox'
}
};
webdriverio
.remote(options)
var webdriverio = require('webdriverio');
//var webdriverio = require('selenium-webdriver');
var Username = "[email protected]";
var Password = "pencil12";
var options = {
desiredCapabilities: {
browserName: 'firefox'
}
};
|-Raw--------------------------------------------------------------------|
|-00------|-01-----|-02---|-03---|-04---|-05----|-06-------|-07---|-08---|
|Cardboard|Concrete|Magnet|Metal |Paint |Plastic|Rare Metal|Rubber|Wire |
|b:0.24 |b:4.19 |b:5.68|b:3.40|b:2.26|b:0.60 |b:7.81 |b:1.10|b:1.71|
|s:0.18 |s:3.14 |s:4.26|s:2.55|s:1.70|s:0.45 |s:5.86 |s:0.83|s:1.28|
|---------|--------|------|------|------|-------|----------|------|------|
|-Products---------------------------------------------------------|
|-09-------------|-10-----------|-11--------------|-12----------|-13------------|-14----------|-15-----------|-16----------|-17-----------|-18------------|-19------------|-20-------------|-21------------|-22----------|
|Adv Concrete |Belt |Box |Cable |Circuit |Gear |Hose |Metal Wheel |Motor |Plastic wheel |Pump |Garden Gnome |Speakers |Toaster |air gun
/*
## EXPECTED OUTPUT
PC IR A B C
1 0x00 0 0 0
4 0x01 0 5 0
7 0x01 0 5 1
10 0x02 1 5 1
13 0x05 1 5 1
memArray = new ArrayBuffer((2*65536)); //10k words at 16 bit each, ArrayBuffer(N), where N is bytes, hence 2 multiplier
MEM = new Int16Array(memArray); //view arraybuffer, seperate into 16 bits per index.
//end initmem
//init registers
regArray = new ArrayBuffer((2*16)); //8 registers, 2 bytes each
registers = new Int16Array(regArray);
register = {
A:registers[0x00],//'A'
B:registers[0x01],//'B'
C:registers[0x02],//'C'
//--INIT
h2b = {a:['0' ,'1' ,'2' ,'3' ,'4' ,'5' ,'6' ,'7' ,'8' ,'9' ,'a' ,'b' ,'c' ,'d' ,'e' ,'f'],
b:['0000','0001','0010','0011','0100','0101','0110','0111','1000','1001','1010','1011','1100','1101','1110','1111']};
b64Arr= ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z',
'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z',
'0','1','2','3','4','5','6','7','8','9','+','/'];
hexa = '1c0111001f010100061a024b53535009181c';
hexb = '686974207468652062756c6c277320657965';
bin = '';
//--INIT
h2b = {a:['0' ,'1' ,'2' ,'3' ,'4' ,'5' ,'6' ,'7' ,'8' ,'9' ,'a' ,'b' ,'c' ,'d' ,'e' ,'f'],
b:['0000','0001','0010','0011','0100','0101','0110','0111','1000','1001','1010','1011','1100','1101','1110','1111']};
hexa = '1c0111001f010100061a024b53535009181c';
hexb = '686974207468652062756c6c277320657965';
hexc = '';
for (var i = 0; i <= hexa.length-1; i++) {
parta = parseInt(hexa.slice(i,i+1),16);
partb = parseInt(hexb.slice(i,i+1),16);
/*
###--- test-anything #2 ---###
# Tell me what's wrong
Write a passing assertion for the function isCoolNumber, that will assure that
it returns true when passing 42 in it.
The path of the module exporting the function will be provided through
process.argv[2].
*/
var assert = require('assert');
// take directory as arg1 take exetension filter #2,
//output files that match the exetension
// must use async readdir and a callback function
var fs = require('fs');
var path = require('path');
var dir = process.argv[2];
var exe = '.'+process.argv[3];

MAKE IT MODULAR (Exercise 6 of 13)

This problem is the same as the previous but introduces the concept of modules. You will need to create two files to solve this.

Create a program that prints a list of files in a given directory, filtered by the extension of the files. The first argument is the directory name and the second argument is the extension filter. Print the list of files (one file per line) to the console. You must use asynchronous I/O.